Archived

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

Building my own Window Class

This topic is 5246 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 , I''ve posted this msg over the begginer''s forum without luck.Maybe it''s better in this forum. ====== I''m just loosing my time trying to build a very simple, but powerfull enough Window Class for Windows . (It will include full OpenGL support soon). But I''ve found a little problem when programming the part of the class that switches Window->FullScreen and viceversa. Here you have some part of the declaration code:
class CWindow{
public:		
CWindow			();
void	WSetMainSettings(int w, int h, bool fs);
bool	WRegister	();
HWND	WCreate		();
void	WChangeToFullScreen();
bool	WReturnFullScreen();
void	WKillPartial	();
void	WKillAbsolute();
I have implemented the switch (only for test) at the WM_KEYDOWN -> VK_TAB. I have included an if like that : if (!Window.WReturnFullScreen()) WReturnFullScreen returns true if Window is in FullScreen mode, and false if it''s in Windowed mode. Then I Kill partially the window (Without unregister), set new settings and create. The problem appears when setting from fullscreen to window, and the result is a bit hard of explain. When I hit TAB it creates the window, in the windowed mode, perfecly but (There''s always an but) appears a white screen behind, and it is not possible to see the desktop!!! I hope that my explanations are clearly enough. Always, thanks for reading :D. Jacob. PS: This is how I delete the window: wglMakeCurrent(NULL, NULL); wglDeleteContext(g_hRC); ReleaseDC(g_hWnd, g_hDC); if(mFullScreen){ ChangeDisplaySettings(NULL,0); } UnregisterClass("CWindow",g_hInstance);

Share this post


Link to post
Share on other sites
i dont know much about opengl but shouldn''t u release the 3d device and restart it ? iam a newb myself so i could be completly wrong :/

Share this post


Link to post
Share on other sites
Hang on, so is the problem when switching to fullscreen or from fullscreen? It sounds like you''re switching to fullscreen, in which case it makes sense you can''t see the desktop (although it highly depends on your card & driver combo).

Or do you mean you''re creating the GL window in windowed mode and you''re losing your desktop? (that could be card/driver related)

If it''s the second one, try posting your window/GL setup code.

Share this post


Link to post
Share on other sites