case WM_SYSKEYDOWN:
switch(wParam){
case 13: //Alt + Enter
OpenGL.KillWindow();
if(!OpenGL.NewWindow("GL Test",640,480,16,16,!OpenGL.GetFullScreenFlag())){
exit(1);
}
OpenGL.Init();
break;
}
return(0);
(email me if you want the complete code... it''s kinda long)
The problem is that after switching back-and-forth a couple times it just dies... (It''s unable to activate the Rendering Context).
Have you guys ever dealt with a problem like this before? I''m kinda new to win32 programming, so i suspect i''ve done something funny...
Switching between Windowed & Fullscreen modes...
I''ve been having a bit of trouble switching between windowed mode & fullscreen mode...
I can manage to switch using Alt+Enter using something like this:
I''ve had something like this happen before, but it was during my multithreading test. Anyway, I had to split up my window creation and device context creation into two different threads.
What was happening was that the window didn''t have enough time to create itself again. I didn''t have a message box for that error (window handle invalid...shouldn''t happen, since the thread is created on the WM_CREATE from the window itself), so it took me a while to track it down. What I did to fix it is put the thread to sleep for about 5 seconds and then check the window handle again. It hasn''t failed yet.
That may not be the RIGHT solution, but it worked for me.
What was happening was that the window didn''t have enough time to create itself again. I didn''t have a message box for that error (window handle invalid...shouldn''t happen, since the thread is created on the WM_CREATE from the window itself), so it took me a while to track it down. What I did to fix it is put the thread to sleep for about 5 seconds and then check the window handle again. It hasn''t failed yet.
That may not be the RIGHT solution, but it worked for me.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement