Archived

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

mrrolf810p

Texture disappearing

Recommended Posts

I''ve got a simple particle engine based on the NeHe basecode. It''s Object Oriented. Each instance of a particle system loads it''s own texture in it''s constructor. The problem is when I switch between fullscreen and windowed, the textures disappear (they are white blocks). I suppose this happens when KillGLWindow() is called when switching. Is there anyway to keep the texture data between switchs like that? It just seems that deleting and reloading the textures is complicated and not efficent. Robbie

Share this post


Link to post
Share on other sites
Actually - I might''ve misled you in my first post regarding the "releasing" part. I''m not sure about it. I came up with the excact same question a couple of months ago and after a while I just let it go - it may be possible to release the RC, destroy your window (but not the RC!), create a new one and reattach the RC. I tried doing it this way, but my window class grew over my head and I drowned in code, so I let it go (haven''t had time to deal with it ever since). If you''re going to try this out and succeed, please be kind enough to let me (and everyone else here know) if it can be done. Other than that - take a look at commercial games: run the game (for example, Unreal) and change the resolution - the textures are reloaded and the level rehashed, so my guess is that this can be an inevitability...

Cheers,
Crispy

Share this post


Link to post
Share on other sites
Don''t load textures in contructors. Just make a Load() function and call it when switching from windowd mode to FS.
And a bit off toppic : each particle having it''s own texture is NOT a good idea at all as texture bind will totaly kill your performance.

You should never let your fears become the boundaries of your dreams.

Share this post


Link to post
Share on other sites