[Hugo Ferreira][Positronic Dreams][Colibri 3D Engine][Entropy HL2 MOD][Yann L.][Enginuity]
The most irrefutable evidence that there is intelligent life in the Universe is that they haven''t contacted us!
🔒 Locked
Loosing Drawing Context
Advertisement
Original Post
Hi all,
i''m using OpenGL under Windows XP, coding under VStudio C++.
How do I detect that my window has lost its Drawing Context?
This sometimes happens, right? Probably a message is sent to the window, and then we reaquire the drawing context right?
Thanks for any tips on this...
Get a DC per frame? DDraw is faster in 2D?
what?
dont drink and post please...
what?
dont drink and post please...
[Hugo Ferreira][Positronic Dreams][Colibri 3D Engine][Entropy HL2 MOD][Yann L.][Enginuity]
The most irrefutable evidence that there is intelligent life in the Universe is that they haven''t contacted us!
Are you talking about the fact that when you perform an "ALT-TAB" an you come back with another alt tab to you app your scene is not displayed anymore ?
If so you could take a look to the NEHE tutorials for example.
Car Physics Sample Engine
If so you could take a look to the NEHE tutorials for example.
Car Physics Sample Engine
ya, NEHE explains that when we exit full screen mode, we lose our DC.
I''m looking for examples where that happens in windowed mode. Sometimes we do lose our DC in windowed mode, and there must be ways for our window to become aware of such an event... i presume.
I''m looking for examples where that happens in windowed mode. Sometimes we do lose our DC in windowed mode, and there must be ways for our window to become aware of such an event... i presume.
[Hugo Ferreira][Positronic Dreams][Colibri 3D Engine][Entropy HL2 MOD][Yann L.][Enginuity]
The most irrefutable evidence that there is intelligent life in the Universe is that they haven''t contacted us!
Do you mean DC as in Device Context? Which you get by calling GetDC at the start of the program, after you create the window? Because if it is, then I''m pretty sure that if you''re using Win32, and you specify CS_OWNDC in the style attribute of the window class, your window will never lose the DC associated with it (because the DC is unique to your window). I tried switching to fullscreen mode and back again with my OpenGL engine, and I didn''t lose the hDC.
Can you give an example of when you might lose the hDC in windowed mode? The only time I can think of this happening is when the window is destroyed and recreated to set different style parameters like WS_POPUP or WS_OVERLAPPEDWINDOW. Then it''s pretty obvious that you''d lose it, as the hWnd you got it from would have been destroyed. I just handle this in my window creation/destruction code...
Windows 95 - 32 bit extensions and a graphical shell for a 16 bit patch
to an 8 bit operating system originally coded for a 4 bit microprocessor,
written by a 2 bit company that can''t stand 1 bit of competition.
Can you give an example of when you might lose the hDC in windowed mode? The only time I can think of this happening is when the window is destroyed and recreated to set different style parameters like WS_POPUP or WS_OVERLAPPEDWINDOW. Then it''s pretty obvious that you''d lose it, as the hWnd you got it from would have been destroyed. I just handle this in my window creation/destruction code...
Windows 95 - 32 bit extensions and a graphical shell for a 16 bit patch
to an 8 bit operating system originally coded for a 4 bit microprocessor,
written by a 2 bit company that can''t stand 1 bit of competition.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement