Advertisement Jump to content


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


Strange problem

This topic is 6052 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m using OpenGL and SDL in Linux. I have a text file that lists the images that need to be loaded and used as textures. They''re a mixture of bitmaps and .tga''s. Some of the textures show up as just white boxes! But I know they''re being loaded correctly! But the wierd thing is I can change around the images that are being loaded, and other textures suddenly work and others suddenly stop working! But its not the ones I change! I may change something down at the bottom of the list, and it makes a texture at the top of the list either show up or not show up! If I put some gibberish where an image should be, it gives me the proper "cannont find image" thing and doesn''t put anything where the texture should be (no white box). What is goin on here?!

Share this post

Link to post
Share on other sites
Sounds like an issue I had recently regarding resources being lost. If you do anything which invalidates your opengl rendering context with SDL (for me, it was resizing) then you will need to generate new texture objects, and then reload your textures into it. You will have to re-initialize your sdl display with opengl before this.

Also, if you are reloading your resources... and have some class which gens textures on construction and deletes them on destruction, make sure those destructors are being called *before* your context is invalidated, otherwise while generating new ones, you may also be deleting those from the last context (which really aren''t valid) and confusing opengl.

Once you have a new display initialized, reload your textures.

As an example of confusing opengl:
You might generate "1" from your first reloaded texture.
While destroying your second old texture, you may delete "1", and then generate another texture "1".

This can cause your objects to use the wrong textures, or use an invalid texture (blank white).

"Don''t be afraid to dream, for out of such fragile things come miracles."

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!