Advertisement

NeHe Base Code problems

Started by October 24, 2001 09:35 PM
6 comments, last by Viscous-Flow 23 years, 4 months ago
Hello, Has anyone ever had these problems with NeHe''s base code pertaining to: 1) Textures appearing as white quads when switching to and from full screen mode 2) The program not stopping when the WaitMessage() is called, and the program continues as if it was active even though it is not. Any help would be greatly appreciated
Has anyone ever had this problem?

I essentially based my code off of the NeheGL Basecode II.

I notice that on the original base code problem #2 in my statement above is solved, yet I have failed to find a reason since my code looks rather comparable to that.

And also, in some of the semi-intermediate tutorials (i.e. Lesson 11 (The flag effect)) the problem with textures appearing as white quads is solved, but once again, my code looks rather comparable to that but fails to work properly.

I have been stuck on this problem and another one pertaining to RLE TGA texture loading for about a week and half. I sure would like to move on to more advanced things.

Well, anyways enough about me; I hope you all are having a good day ! Thank you all once again.

PS If you need more information/help I would be humbly obliged to assist you.

Edited by - Viscous-Flow on October 25, 2001 5:53:53 PM
Advertisement
Does anyone have any suggestions to point me in the right direction; all this spinning is making me dizzy .

I will stop posting after this post if no one answers. Thanks anyways.
You may need to double check where you are loading your textures. When the window mode is toggled, the window is actually closed and then re-opened. When the window closes, it releases the device and rendering contexts from the original window, and recreates them when it reopens. Which also means that anything that was related to OpenGL, such as textures, glEnable()/glDisable(), etc, are all released and reset as well. I don''t use the NeHe code, so I can''t guarantee that this is it, but I know he closes and reopens the window, which was something I learned about on my own once.

Good luck,
jason
Your right about that, I have my texture code in another function that doesn''t get called. Is there anyway around having to close your window to switch modes i.e. Can you switch to fullscreen and modify your window''s characteristics on the fly without deleting the rendering contexts, I''ll search around on MSDN.

Or better yet, do you think that just not deleting the rendering or device context will work, I''ll try that out.

Any suggestions?
Anyone have any suggestions or had similar problems?
Advertisement
I had the same problem... I don''t remember what I did to get rid of it. I think I updated the drivers on my monitor ...anyhoo now it doesn''t happen... but it used to - only when I went into fullscreen mode. I have an ATI sound card on win 2k.

-jay
I don''t think it is possible due to the video mode switch. You''ll find the same in DirectX.

You should structure your code such that it doesn''t assume to much and you can reload your textures at any time.

As for WaitMessage() - you really shouldn''t be calling that. You should be calling PeekMessage and continuing with game logic if there isn''t any message (maybe I''m confusing Wait with Get though - can''t remember this late

If you want to switch applications, catch the switch/minimise message and set a flag to pause you application. But continue listening in the background until you get a restore message. Windows takes care of the task priorities while you are in the background.

~~~
Cheers!
Brett Porter
PortaLib3D : A portable 3D game/demo libary for OpenGL
Community Service Announcement: Read How to ask questions the smart way before posting!
~~~Cheers!Brett PorterPortaLib3D : A portable 3D game/demo libary for OpenGLCommunity Service Announcement: Read How to ask questions the smart way before posting!

This topic is closed to new replies.

Advertisement