Sign in to follow this  
  • entries
    56
  • comments
    80
  • views
    41681

Easy Usage

Sign in to follow this  

265 views

So with the little time I have to code, I've managed to get a little bit done on the engine.

One thing that's always bugged me when creating game/render windows is picking the 'right' resolution by default for the user. To combat this issue I wrote a window creation function that does just that.

int OpenQuickWindow(bool fullscreen) is the prototype for it.

Basically, when the method is called it grabs a list of available video modes and removes the video modes with the lowest RGB bit values. If true is passed to it then we assume the user wants the highest resolution video-mode available from the list for full-screen, otherwise we pick a lower resolution mode (but not the lowest) that way windowed mode isn't taking up his/her entire screen.

It's probably not the best routine but it works. My only concern is when you're dealing with weird aspect ratios, like mine for example (16:9) which has 1366 x 768 AND 1365 x 768. Right now it's picking 800x600 for windowed mode on my system which is perfect, I need to test it on other systems before I get too excited.
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now