View Full Version : GL scope question
02-04-2004, 09:42 AM
I was working on a tga loader class for this windows project I'm working on. I use the loader in WinMain and load the textures before I draw anything and it works fine. My question is if I take the loader and put it into another class to load textures will GL be able to use them in the display function in WinMain (assuming i know the texture IDs to bind them)?
I guess I don't get the problem. Besides the fact this depends from the kind of your implementation, once you've created texture objects (and initialized them) correctly it does not matter where they came from.
So my natural question would be "sure it will be able to" but... maybe I'm missing something.
02-06-2004, 11:04 AM
Ok sorry, I see how it could be misleading its just the only samples of creating textures in OpenGL have all been made in the main/driver cpp. I just wanted to make sure that if I created the textures elsewhere that I could still use the textures somewhere else in the program. Does that make sense?
Originally posted by Mighty:
Does that make sense?Yes, most of the time this will work just fine. Consider something like a global namespace.
In fact, you could have different contexts for the same program and this could invalidate my own sentence but I'll explain this in the future. I don't think you need to care right now. (yes, I am lazy http://www.opengl.org/discussion_boards/ubb/smile.gif
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.