Pages: 1
  Print  
Author Topic: Need some advice on fullscreen + views  (Read 1500 times)
Offline (Unknown gender) sorlok_reaves
Posted on: September 10, 2014, 10:20:50 PM
Contributor
Joined: Dec 2013
Posts: 261

View Profile
Hello all,

I've got a pretty simple question: what's the "correct" (from a GM point of view) way of saying "make the game fullscreen, and stretch all views to fit"?

Basically, I know that window_set_fullscreen(true) works fine when views are off, but if views are in use then the game screen will never expand to fill the entire window. Is there some magic number for views/ports that causes the views to behave this way, or do I have to resize every view's port to fit the new window size when I trigger fullscreen?

Would appreciate any advice on this.
Logged
Offline (Male) Goombert
Reply #1 Posted on: September 10, 2014, 10:27:35 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3108

View Profile
I think you may be thinking of the scaling options, in Unity3D they just fullscreen the application and let the display handle black bars and aspect ratio. In GM they render everything to a surface allegedly which is scaled when it is finally drawn allowing you to emulate and have more control over the behavior of a display. This is a little more tricky though because in ENIGMA someone got the bright idea of making Win32 create two window in order to accomplish this, the embedded window is scaled with the scaling options and the parent window has the black bars. We do not do this on Mac or Linux and currently the scaling options do not work on these platforms. I made an attempt at emulating the scaling through viewports but that doesn't work out so well because there is no way to clip clearing the background color.

This is actually a major issue which needs sorted out so we have the same consistent cross-platform behavior. As I stated before I was more in favor of just fullscreening the application and letting the user do the scaling themselves, but that wouldn't be GM compatible.
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Male) Josh @ Dreamland
Reply #2 Posted on: September 10, 2014, 10:52:51 PM

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2956

View Profile Email
I'm actually annoyed by the ill-defined, uncustomizable behavior of the engine when the screen size changes. There's no reason to force rendering on a fixed-size canvas to up- or down-scale. I believe GM allowed options to scale or render at (0, 0), which is stupid; why can't we center it? Why can't we allow users to let the card scale the textures and draw the lines as normal? Why can't we offer threshold scaling, eg, take the largest fitting of .5x, 1x, 2x, 3x..., then render it centered? Why not just let the user define the render logic around the drawing size? There are a lot of modes that make sense.

Handling view boundaries for users complicates this, because we logically need to be in charge of that until the user manually assigns to the view variables, which we don't facilitate. So we have the classic UI problem of "how do we scale these widgets?" (here, views). Once we've scaled to get accurate view coordinates, we then have the problem of how we want to project the world onto this space. GM's answer is surfaces; ENIGMA originally let the user handle that, but now, as I understand, also uses surfaces. It's annoying.

Anyway, that concludes my rant. The short version is, I don't have an answer for you because the current answer is ill-specified and generally lousy. Sorry.
Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Unknown gender) sorlok_reaves
Reply #3 Posted on: September 10, 2014, 11:33:04 PM
Contributor
Joined: Dec 2013
Posts: 261

View Profile
Thanks for the comments; seems that full-screen is a lot more complicated than it should be. I can see how views+ports complicates things, and it seems that the new "application_surface" variable in GM just adds to the complexity.

I noticed that the window-within-a-window approach on Win32 breaks down when window_set_region_scale() is used in conjunction with window_set_fullscreen() ---or perhaps it's just my graphics card. Anyway, I think for now I'll just manually resize all the views+ports in Iji when fullscreen mode is activated, since there seems to be no easy answer.
Logged
Offline (Male) Goombert
Reply #4 Posted on: September 11, 2014, 10:06:01 AM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3108

View Profile
Sorlok, I believe Josh is basically saying that the way Unity3D does it is best by just using the native scaling with the default frame buffer, and letting you manually scale with surfaces or stuff yourself. This I think honestly should just be the behavior of ENIGMA/GM in my opinion too because there is no one size fits all. For 3D games you really shouldn't be doing any scaling anyway they should in fact just be handled by the display.
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Unknown gender) sorlok_reaves
Reply #5 Posted on: September 11, 2014, 10:51:49 AM
Contributor
Joined: Dec 2013
Posts: 261

View Profile
Yeah, that seems reasonable. Regardless, I'll probably just fake it with Views for Iji.
Logged
Pages: 1
  Print