Skip to main content
gamedev.net
🔒 Locked

Multithreaded texture loading

Started by Xces 0 replies 1.4k views
Original Post
Xces
Xces
Hello, Because i need to load textures @ runtime, i don''t want my application to stop "drawing" frames. Therefore i want to load my textures in a different thread. Has anybody allready done this?
pieman
pieman
Since OpenGL is single-threaded you''ll need to do your texture loading in 2 stages. Your main thread should be rendering as normal, while your secondary thread is loading the texture data into memory (but not making and calls to GL - only the main thread can do that). Once a texture has been loaded from disk you need to signal your main thread so that it can make the necessary calls to OpenGl to create the texture, set params, etc.



Iain Hutchison
Programmer, Silicon Dreams
The views expressed here are my own, not those of my employer.
Iain HutchisonProgrammer, Silicon DreamsThe views expressed here are my own, not those of my employer.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.