Okay, I'm having the same problem again. When rendering in windowed mode, the window works just fine in all circumstances, EXCEPT when it's covered by another window, or the window is resized so the display surface is no longer visible. It was fixed for a while when I upgraded to DirectX 9.0b, but now it's gone back to doing the same thing again.

Could anyone else check this file and see if it will work right on their system? It's supposed to just display a rotating icosahedron with a light orbiting it. Also, I'm including the source code, in case anyone can spot what I'm doing wrong.

Here is the code, and here is the executable.
Posted on 2003-08-15 11:58:18 by Tatterdemalian
It works fine on mine. P4 WinXP
Posted on 2003-08-15 13:26:52 by drhowarddrfine
Try covering the entire app window with another window, and see if it still runs. On my system (Athlon 1.2Ghz Win XP) the entire computer comes to a halt every few seconds when the window is covered, or if the window height is reduced to 0.
Posted on 2003-08-15 15:14:20 by Tatterdemalian
Yes, I see what you mean now. If I have time I'll look at your code.
Posted on 2003-08-15 20:20:00 by drhowarddrfine
Hmm... on looking back, the original source code is pretty poorly commented.

Here's the updated source, and here's the updated exec. I also updated the viewport calculation code to handle window sizing better, but it still halts the system if the window is completely occluded.
Posted on 2003-08-16 08:49:38 by Tatterdemalian

Hmm... on looking back, the original source code is pretty poorly commented.

Here's the updated source, and here's the updated exec. I also updated the viewport calculation code to handle window sizing better, but it still halts the system if the window is completely occluded.


I see what you mean as well, (Athlon 900MHz, Win2K SP4, Radeon 9100 ) perhaps you should halt rendering and sleep whenever the window has lost focus. (Don't falme me if u already do, cuz I didnt look at ur source yet ) :grin:
Posted on 2003-08-24 10:59:59 by x86asm



I see what you mean as well, (Athlon 900MHz, Win2K SP4, Radeon 9100 ) perhaps you should halt rendering and sleep whenever the window has lost focus. (Don't falme me if u already do, cuz I didnt look at ur source yet ) :grin:


Yes, in your rendering loop, keep testing a flag, and if the flag is set (or not set ur choice) do not render but instead pass control of the CPU back to Windows by executing the "Sleep" API with a "0" parameter (with this parameter Windows will give the rest of ur time slice to another app). That way you wont be using the CPU.
Posted on 2003-08-24 11:03:34 by x86asm