Thread: Switching from Windows to Fullscreen

  1. #1
    Unregistered
    Guest

    Switching from Windows to Fullscreen

    In my dx8 engine, im trying to switch between windowed and fullscreen mode by resetting the device. The code base for the windowed<>fullscreen is from the directx8 sdk, but it wont work! Any other ideas? The switching must be made with the device resetting.
    Oh, when I clal ToggleFullscreen, the device stops rendering. (Im not using the DXTimer MS uses.)

    Please help, this is very important!!

  2. #2
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,263
    are you reinitializing the renderer when you recreate the window?
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

  3. #3
    Registered User Coder's Avatar
    Join Date
    Aug 2001
    Location
    Cairo, Egypt
    Posts
    128
    When you switch between full-screen and windowed mode, you simply do through a call to IDirect3DDevice8::Reset() supplying - typically - the presentation parameters used in creating the device in the 1st time, only with the Windowed flag changed ( unless one or more of the display mode properties aren't supported in the other operation mode [ fullscreen - windowed] )

    When you do reset the device, you have to take care of your resources. If you have any D3DPOOL_DEFAULT resources, make sure you release them BEFORE you reset the device, and then restore them AFTER you reset the device.

    About the "The device stops rendering" :
    What was the device rendering in the 1st place, and how does it look after it stopped rendering ( i.e. is the screen cleared with the color you specified or not ).

    Finally, make sure you add error checking to your rendering code. Errors happen often, believe me. We're humans , and that means perfect code is rarely written in the 1st time.

    DirectX provides robust error detection & handling functions & macros, use them wisely.

    The debug run-time is your friend, and the Debugger is evev a closer friend. Enable the former & max the Direct3D warning setting ( from the control panel applet ) , and run your sample in the debugger and Direct3D will tell you why your rendering fails in a very sweet detailed error message.
    Muhammad Haggag

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Network Programming in C for Windows
    By m.mixon in forum C Programming
    Replies: 7
    Last Post: 06-19-2006, 08:27 PM
  2. LoadFromFile() causes Windows 98 to freeze?
    By MidnightlyCoder in forum Windows Programming
    Replies: 8
    Last Post: 03-17-2006, 02:23 PM
  3. Program works on Windows XP and 2000, not on 98 or ME
    By MidnightlyCoder in forum C++ Programming
    Replies: 7
    Last Post: 03-10-2006, 03:36 PM
  4. Question..
    By pode in forum Windows Programming
    Replies: 12
    Last Post: 12-19-2004, 07:05 PM
  5. Manipulating the Windows Clipboard
    By Johno in forum Windows Programming
    Replies: 2
    Last Post: 10-01-2002, 09:37 AM