• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Discussion Screen Resolution set before Game Renders

XanthorXIII

Member
Is there anyway we can get a change to GameMaker that involves changing the way Resolution handling is done? I feel that letting the first room dictate the screen resolution is out of date. I’m currently using PixelatedPope’s method of screen resolution handling which is good, it still bugs the crap out of me when I see the window appear for the first room and it’s garbled before it switches to the second room and is correct. Why can GameMaker not have something that sets up the screen resolution before anything is rendered so we can get away from this confusing mess once and for all. I see a game like Hyperlight Drifter and it seems like they are using a different method but I could be wrong.
 

Mike

nobody important
GMC Elder
Yes, it's pretty simple in fact. Inside the create event of a controller object (or any object), you can set the window size and the size of the application surface. After that, everything would scale to fit this size.

Code:
window_set_size( w, h );
surface_resize(application_surface, w, h);
Even though the app surface isn't created (it's created on the first draw event), you can resize it and we remember that for when we do create it.
 

XanthorXIII

Member
So tonight I worked on an example of what I am seeing so I can pass that along and something interesting. I'm building an app in a resolution of 432x768, for Mobile at the moment but I'm also thinking about bringing it to PC as well. This is somewhat based on what PixelatedPope does in his tutorial for this but isn't the whole thing as I wanted to show what I am talking about. When you start the App the Application Surface for whatever reason starts off squished horizontally but then fills out the window. It doesn't matter if you place in a different event, be it the create event or the Room Start Event it does this. Now something interesting, if you comment out the surface_resize, it starts out looking normal for a second and then squishes vertically. And on top of that, if you go as far as disabling the application surface, it doesn't do any of that and draws the window correctly without that split second of the frame not quite drawing correctly.

Here's the test I came up with.
https://1drv.ms/u/s!Akqb-kGKzRE4pH7v5ajffFL6C_hH
 

nesrocks

Member
I agree with you, it should have a setting somewhere. But, it doesn't, and the workaround is to simply start on an empty black room, and change rooms afterwards.
 

Mike

nobody important
GMC Elder
If you have an empty room at the start - which is why I tend to do, especially to initialise global's and setup the game; why wouldn't you just set it to the size you wanted? This is actually a genuine question. Why would you want a dialog where you specify widths and heights etc, rather than just make the 1st room the size you want? What's the benefit? Especially when you can use that room for game related stuff most of the time.

I tend to not resize the window unless it's to fill the screen, I only ever really change the application_surface size so that I'm not rendering too much - if it's a low-res game, reducing it down helps a lot.
 
Last edited:

XanthorXIII

Member
I’ll have to test on a device but my main concern was how this looks when someone starts up a game. Are they going to see that split-sec frame where it is adjusting the application surface to match the aspect ratio of their device?
 

XanthorXIII

Member
So yeah I did some testing on my Kindle Fire and it doesn't do that stretchy thing at the start of the game and this is with Application Surface enabled. Not sure why it does that on Windows when using Window mode, especially when I can test with the Application Surface turned off and it doesn't do that stretchy/squishy split sec thing. I was more concerned with that than the First Room being used in the game itself. I'm fine with using it to do my setup. I just didn't want someone to load the game and see that squishy nonsense and say, oh that's not professional, more like amateurish....
 
Top