View Full Version : Rendering Context in CBuilder5
06-18-2002, 10:38 PM
Can anyone pls explain, why i must change the rendering context even if i want only to define a texture?
06-19-2002, 06:01 AM
Are you talking about the SetPixelFormat stuff?
I'm not sure why you have to, but you have to have a window initialized to use OpenGL before you use ANY gl* function. I'm not sure exactly why it's like that, but it is. http://www.opengl.org/discussion_boards/ubb/smile.gif
06-20-2002, 03:26 AM
I have set the OpenGL window already. I have also the rendering context(hrc) and I can load the texture only if I change the context using wglMakeCurrent(Canvas->Handle,hrc). When hrc is not set as the current context, the texture will not load. And this made me a whole lot of troubles, figuring out why the hell is not the texture functioning. Eventually I solved this, but I wonder why is it this way.
06-20-2002, 05:17 AM
Ok, maybe I wasn't clear above. You need to have a window with a GL context (set with wglMakeCurrent) in order to use gl* functions. In order for a window to get a GL context, it needs to be initialized to use GL by using SetPixelFormat.
That's just the way it is. Now that you know, you shouldn't have to spend hours figuring out problems like this next time. http://www.opengl.org/discussion_boards/ubb/smile.gif
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.