Jump to content
  • Advertisement

Archived

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

Marduk Kurios

SDL loading DDS textures in another thread

This topic is 5227 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 making a game and i''m trying to load dds textures in other thead using SDL+opengl under Linux. The dds loader is complete and it works fine, but if i try to load a new texture once the previous texture is loadead and applied the game crash. Of course the dds loader loads the textures in different textures, ie. TEXTURES[numtexturefree]. I think that it''s possible that opengl crash if two different texture operation are done simultaneously, only an idea. The function i''m using for launch the new thread is : SDL_CreateThread it is ok? And the sdl has been inited like this: SDL_Init (SDL_INIT_VIDEO|SDL_INIT_TIMER)

Share this post


Link to post
Share on other sites
Advertisement
i dont know anything about threads, but i think its not possible to load SDL surfaces in anything other then the main thread... think i saw something about this in the SDL mailing list...dont take my word for it though.. check out the mailing list yourself www.libsdl.org and click newsgroups

[edited by - graveyard filla on June 3, 2004 3:23:16 PM]

Share this post


Link to post
Share on other sites
The SDL manual says:
quote:
Don''t call SDL video/event functions from separate threads


So... Depending on how you define a "video" function, you can or can''t create surfaces from other threads. (I''m pretty sure you can, as you can load surfaces without init''ing SDL at all)

It''s probably the uploading of the texture data that''s breaking it though.
Maybe you could just load the surfaces, store them in an array, then let the main thread upload them (to OpenGL) later?

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!