Phil
Phil

Reputation: 627

How to stretch OpenGL fullscreen app with Win32 API's DEVMODE?

I am trying to stretch an 800x600 screen to the dimensions of a full screen. I am currently getting black borders around the 800x600 portion. I'm using the Win32 API with OpenGL.

This is being called when entering full screen:

    DEVMODE dmScreenSettings;

    memset(&dmScreenSettings, 0, sizeof(dmScreenSettings));
    dmScreenSettings.dmSize = sizeof(dmScreenSettings);
    dmScreenSettings.dmPelsWidth = win->width;
    dmScreenSettings.dmPelsHeight = win->height;
    dmScreenSettings.dmBitsPerPel = SCREEN_BPP; 
    dmScreenSettings.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;

Is there a way to stretch with DEVMODE?

Note: there is a .dmScale member, but I had no luck with it.

Upvotes: 0

Views: 408

Answers (1)

datenwolf
datenwolf

Reputation: 162367

Please don't change the display device mode. Doing that alters the physical signal going to the screen and may mess up the user Desktop's icon arrangement. User's don't like that, don't offend the users.

If all you want is to stretch the display, resize your window to cover the full screen and use glViewport and appropriate values for the projection matrix. I could give you more advice if you'd post your drawing functions source code.

Upvotes: 1

Related Questions