Thread: Going to fullscreen with DEVMODE

  1. #1
    Politics&Cpp geek Da-Nuka's Avatar
    Join Date
    Oct 2004
    Posts
    104

    Going to fullscreen with DEVMODE

    Hi.
    Im using the following functions, with a DEVMODE struct to go to fullscreen:

    -ChangeDisplaySettings()
    and
    -AdjustWindowRectEx()



    It works, but when it goes to fullscreen, the programs hangs for maybe a second, with my original window(but in black) on the screen, before finaly getting into fullscreen.

    I guess this is, simply because it takes some time for those functions to actually change the displaysettings, so unless you guys have anything which can speed up the process, im looking for a faster,better,shorter way to get to fullscreen

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    "fullscreen" - What exactly do you mean?

    Is this for a Windows GUI application or a console application?

    gg

  3. #3
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    >>"fullscreen" - What exactly do you mean?<<

    My guess would be switching the display mode to an opengl rendering context or directx surface (or whatever it's called) with a window client covering the desktop and having no borders etc (WS_POPUP style).

    If that's the case then AdjustWindowRectEx is only useful for obtaining a fixed client size based on whether the window has borders, caption, a menu etc.; there's no point in using that function to calculate screen dimensions for a 'fullscreen' window that probably only has WS_POPUP as its window style. Just use GetSystemMetrics to get the screen dimensions and use those for your 'fullscreen' height and width.

    As for the window 'residue', either destroy it with DestroyWindow and recreate a new 'fullscreen' window or hide it with ShowWindow prior to making the switch. It might not eliminate the delay in switching (which may well just be due to your hardware) but it should eliminate any graphical artifacts during the switch.

    If that's not helpful then you should provide a better description of what you are trying to do and a simple example (code) that replicates the problem.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. 6 measly errors
    By beene in forum Game Programming
    Replies: 11
    Last Post: 11-14-2006, 11:06 AM
  2. Linking OpenGL in Dev-C++
    By linkofazeroth in forum Game Programming
    Replies: 4
    Last Post: 09-13-2005, 10:17 AM
  3. Pong is completed!!!
    By Shamino in forum Game Programming
    Replies: 11
    Last Post: 05-26-2005, 10:50 AM
  4. problem with open gl engine.
    By gell10 in forum Game Programming
    Replies: 1
    Last Post: 08-21-2003, 04:10 AM
  5. opengl code not working
    By Unregistered in forum Windows Programming
    Replies: 4
    Last Post: 02-14-2002, 10:01 PM