SDL loading DDS textures in another thread

Started by
1 comment, last by Marduk Kurios 19 years, 10 months ago
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)
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]
FTA, my 2D futuristic action MMORPG
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?

This topic is closed to new replies.

Advertisement