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

texture loading

Started by Crispy Aug 1, 2002 at 2:37 PM 1 replies 300+ views
Original Post
Crispy
Crispy
I''m just wondering - why do you have to reload all of the textures every time you create a new window in an OpenGL application? Example:
  
main()
{
Window1 = CreateOpenGLWindow();
LoadTextures();

CreateOpenGLWindow(CHILD_OF_Window1)
LoadTextures(); //<- here

}
  
or...
  
main()
{
CreateOpenGLWindow();
LoadTextures();
//do stuff

if(Something_Failed)
 {
 DestroyOpenGLWindow();
 CreateOpenGLWindow()
 LoadTextures(); //<- here

 }
}
  
I''m storing the textures in a totally independent vector of any window creation/destuction routines. Does it have to do with the fact that every time I make a HGLRC current, I have to load its share of textures (into the video memory), and thus, if I delete it, and create a new one, I have to reload the textures? It seems like an awful waste of cpu power... Crispy
"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared
PM
PM
I think, you shold link both HDCs to the same HGLRC (Rendering context).
Then, it should not be a problem to use the textures in both windows.

PM
PM Times change... Excuse my poor english!
Crispy
Crispy
Hmm - seems like the RC has got nothing to do with the loading of textures. I tried binding all of the windows to one global RC, but I still need to load textures for each one of them separately. Strange....

Crispy
"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared

Topic Locked

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

Sign in to reply to this topic.