Skip to main content
GameDev.net gamedev.net
🔒 Locked

glTexImage2D and multithreading

Started by Lutz Jun 4, 2004 at 10:31 AM 1 replies 2.8k views
Original Post
Lutz
Lutz
Hey! I''ve loaded a texture and passed it to VRam with glTexImage2D while my engine is running. This way I noticed ugly slowdowns. So I''d like to do it in a separate thread. Because I''m quite new to multithreading, I''d like to know two things: 1) Will this solve the slowdowns or at least speed it up a bit? I don''t need the texture at once, so the separate thread may run for a few frames, I don''t care. 2) How will the graphics hardware react to multithreading? If my main thread happens to draw some triangles while the separate thread calls glTexImage2D, will it crash or will it work?
Brother Bob
Brother Bob
The rendering context can only be active in a single thread at a time, so using multithreading for that is not possible.
MENTAL
MENTAL
that''s why games have "loading" screens

1. render some text saying "loading"

2. load all models and the world

3. load all the textures that are needed for these models

4. begin to render the screen

the loading screen will remain on screen until step 4 (because nothing else is rendering), and will go away when you render the world.

Topic Locked

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

Sign in to reply to this topic.