Advertisement

HELP! with fullscreen mode.

Started by December 26, 2000 01:13 AM
0 comments, last by Galileo430 24 years, 1 month ago
I am posting this question here cause I think I put it in the wrong forum. So I posted this here and deleted the other one... Ok, So i am writeing this engine. I have most of the stuff I need working in windowed mode so I decided to add my fullscreen option (been putting it off). So I modfy my code and added
  
memset( &dmScreenSettings, 0, sizeof dmScreenSettings));
dmScreenSettings.dmSize = sizeof(dmScreenSettings); dmScreenSettings.dmPelsWidth = width; dmScreenSettings.dmPelsHeight = height; dmScreenSettings.dmBitsPerPel = bpp;
dmScreenSettings.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;

if ( fullscreen == 1)
{    
     if ( ChangeDisplaySettings( &dmScreenSettings, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL )    
     {	
           DebugOut("Error Switching To FullScreen Going To Windowed Backup"); // This Would Be In the below text if there was a error	

           fullscreen = 0;	
           mainwindow.fullscreen = 0;     
      }
}  
 
  
Load it up.. runs but does not return my display to normal, so I add the line of code I missed. ChangeDisplaySettings(NULL,0); Load it up.. CRASH!!! KERNEL32.DLL, Program will close!. Not when I change the display mode TO the setting but somewhere between me ordering the exit to the program and it hiting WinMain''s return 0. I guessed it was with the ChangeDisplaySettings(NULL,0); but even with that removed it still crashes. I can seem to avoid the crash if I remove CDS_FULLSCREEN and the change back BUT that is fixing the problem by removeing the new code. << UPDATE: IT DONE NOT CRASH IF MY SETTINGS ARE IDENTICAL TO THE ONES I ASK THE COMPUTER TO SWITCH TO >> Here is my debug.txt file. It''s output by my engine as it runs. NOTE: The arrows where added by me as a form of comment. <--------------------Debug.Txt---------------------------> Comment Line In Config File <--Ignore Comment Line In Config File <--Ignore Set Command <-- Config Stuff Ignore Set ResX To 800 <-- Config Stuff Ignore Set Command <-- Config Stuff Ignore Set ResY To 600 <-- Config Stuff Ignore Set Command <-- Config Stuff Ignore Set Color Depth To 16 <-- Config Stuff Ignore Set Command <-- Config Stuff Ignore Fullscreen Mode <--Says My cfg wants fullScreen, This is correct Bad GL Call <--- This is NOT the cause of error. It''s Normal <-- Here is where the display change is called.. Switched To Menu GL <-- Loaded 2D OpenGL Called Menu GL <--- Window Resized, Resize GL parameters. Created Window at 800W, 600H, 16D. <-- Confirmation of a Successful window creation. Started Menu Loop without Switching GL <--- Crash, Error Kernel32.dll Any ideas? Bad Flags or some stuff like that?
------------------------------------------------------------I wrote the best video game ever, then I woke up...
maybe this can help

http://www.gamedev.net/reference/articles/article1009.asp

This topic is closed to new replies.

Advertisement