Screen fills with lines of garbage after execution

Started by
3 comments, last by AfterShock 20 years, 1 month ago
I''m reasonably experienced with OpenGL, but I am having a recurring problem that I can''t seem to fix. While running, my latest OpenGL program works without any problems. Unfortunately, if I leave my computer unattended for a while afterwards, my monitor will go into power-saving mode. When I proceed to wake it up, the screen is filled with horizontal lines of garbage. These lines have a color scheme similar to that of the program, but no recognizable image is formed. Except for the screen, my computer is otherwise stable. If I left my IDE running, a few keystrokes start the program again and temporarily fix the problem, since the garbage goes away once the program runs. I can also use Ctrl-Esc, Up, Enter, R, Enter to restart my computer. Other actions cause the screen to change noticably, but not in a helpful fashion. It appears that I am not properly cleaning up something at the end of execution, but I''m not sure what is missing. I''m using Bloodshed Dev-C++ 4.9.8.7 under Windows98SE with a GeForce3 card, and my source includes a modified version of the NeHe basecode. Any help would be greatly appreciated.
Advertisement
just a guess

Are you sure the program actually exits? What might happen is that the window is destroyed but the program is still running.

Well, I checked (after exiting the program) to see if it was still running, but it wasn''t. Looking through the code, I found that I was returning 0 from WinMain instead of msg.wParam as the NeHe demos do. It would appear that returing 0 indicates something abnormal about the termination, but I don''t see why it would cause my problem. As far as I can tell, however, the problem is gone. Does anyone know why this would be?
I used to get a similar problem when I closed America''s Army with anti-aliasing enabled in the nVidia control panel.
[ PGD - The Home of Pascal Game Development! ] [ Help GameDev.net fight cancer ]
I was getting the exact same thing with a C# program I was working on. Whenever I released my device context it would totally hose the screen. As long as I didn''t release the DC on exit it wouldn''t have a problem. I don''t know if this is remotely related, but definitely the same result.

This topic is closed to new replies.

Advertisement