Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

davidsporn

My prog does not switch to full screen

This topic is 5600 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi there, Recently I am rewriting my code from scratch (better design, better style, better code, it''s a new year, etc...) My main problem until now was having a black screen, but now I have a wonderful triangle I updated my driver and checked the order in wich I make the initialisation against previous code that actually work (it includes Nehe base code and tutorials) Now the only problem is that my app don''t switch to full screen, and I cannot see why. Apparently my call to ChangeDisplaySettings() is succesfull but in fact nothings happen. I''m quite sure that I checked carefully my code, but as I said all previous code work, so there must be some crap somewhere Here I recap the process of switching to fullscreen I did : - I Fill the DEVMODE structure :
  
VideoMode_.dmPelsWidth
	= i->dmPelsWidth ;
VideoMode_.dmPelsHeight		  
	= i->dmPelsHeight ;
VideoMode_.dmBitsPerPel		  
	= i->dmBitsPerPel ;
VideoMode_.dmDisplayFrequency 
	= i->dmDisplayFrequency ;
VideoMode_.dmFields 
	= (DM_PELSWIDTH|DM_PELSHEIGHT|DM_BITSPERPEL|DM_DISPLAYFREQUENCY) ;
  
Note that I also tried with just 640*480*32bpp@60hz - Then I call a function that use ChangeDisplaySettings()
  
bool SwitchToFullScreen(DEVMODE* mode)
{
    if (0 != mode)
    {
	std::cout << "Switch to full screen : " ;
        if (DISP_CHANGE_SUCCESSFUL !=
            ChangeDisplaySettings(mode, CDS_TEST))
        {
			std::cout << "Test of ChangeDisplaySettings() failed." << std::endl ;
            return false ;
        }
        if (DISP_CHANGE_SUCCESSFUL !=
            ChangeDisplaySettings(mode, CDS_FULLSCREEN))
        {
			std::cout << "ChangeDisplaySettings() failed." << std::endl ;
            return false ;
        }
		std::cout 
			<< mode->dmPelsWidth << "x"
			<< mode->dmPelsHeight << "x"
			<< mode->dmBitsPerPel << "@"
			<< mode->dmDisplayFrequency << "Hz"
			<< std::endl ;
        return true ;
    } // if (true == fsFlag)

    else
    {
		std::cout << "Switch back to full screen." << std::endl ;
        return (DISP_CHANGE_SUCCESSFUL == ChangeDisplaySettings(0, 0)) ;
    } // if (true == fsFlag)

}

  
finally, here is the log file I get :
  
____________________ Start of Log ____________________
Creating fullScreen window...
39 full screen modes.
Switch to full screen : 1280x960x32@120Hz
SwitchToFullScreen() succeeded.
CreateWindowEx() succedeed.
Initialize OpenGL.
OpenGL initialized.
Resizes window : 1280 x 960...
Resizes viewport : 1280 x 960...
Resizes completed
Sporniket OpenGL Framework - 16.7984 FPS
Sporniket OpenGL Framework - 15.6709 FPS
Sporniket OpenGL Framework - 15.8259 FPS
Uninitialize OpenGL.
ReleaseDC() failed.
OpenGL uninitialized.
Switch back from full screen.
^^^^^^^^^^^^^^^^^^^^^ End of Log ^^^^^^^^^^^^^^^^^^^^^
  
I will go to the office now, so I will have to wait this evening before trying your ideas. Many thanks in advance. ---- David Sporn AKA Sporniket

Share this post


Link to post
Share on other sites
Advertisement
Aaaaaah !!!

I guess I forgot to fill the dmSize field of the DEVMODE structure !!!

I''ll try that this evening...


----
David Sporn AKA Sporniket

Share this post


Link to post
Share on other sites
quote:
Original post by davidsporn
David Sporn AKA Sporniket


Forgive me my ignorance, but I always thought it was David''s Porn - damn me and my lack of education...

Share this post


Link to post
Share on other sites
Yes, it was this damn dmSize field !!!

quote:
Original post by Crispy
Forgive me my ignorance, but I always thought it was David''s Porn - damn me and my lack of education...


Don''t worry, you are not the only one.



----
David Sporn AKA Sporniket

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!