LWJGL Forum

Programming => OpenGL => Topic started by: luke1337 on February 23, 2015, 09:37:39

Title: Is it possible to create a custom OpenGL context for LWJGL?
Post by: luke1337 on February 23, 2015, 09:37:39
Is it possible to create a custom OpenGL context for LWJGL, with least modification of lwjgl native library?
Title: Re: Is it possible to create a custom OpenGL context for LWJGL?
Post by: SHC on February 23, 2015, 09:52:33
What do you mean by custom OpenGL context? Do you want to select the OpenGL version? If that is what you want, then there is no need to modify LWJGL binaries.
Title: Re: Is it possible to create a custom OpenGL context for LWJGL?
Post by: Kai on February 23, 2015, 10:55:34
Or perhaps you want to have the OpenGL context created externally by some other native framework/library and then have LWJGL pick up on it?
That is possible with LWJGL 3 (http://www.lwjgl.org/download) very easily via GLContext.createFromCurrent() (http://javadoc.lwjgl.org/org/lwjgl/opengl/GLContext.html#createFromCurrent()), provided the externally created GL context is current in the calling thread.
Title: Re: Is it possible to create a custom OpenGL context for LWJGL?
Post by: spasi on February 23, 2015, 16:25:39
LWJGL 3 also has bindings to WGL, GLX and CGL, so yes, you can create custom OpenGL contexts.
Title: Re: Is it possible to create a custom OpenGL context for LWJGL?
Post by: luke1337 on March 09, 2015, 07:13:42
Thanks to you all! :)
Title: Re: Is it possible to create a custom OpenGL context for LWJGL?
Post by: asyx on March 15, 2015, 03:21:38
I don't understand the question. Both LWJGL2 and LWJGL 3 allow you to create the context in whatever way other libraries for any language allow you to do it. Version, profile, debugging and so on. LWJGL 2's Display can take an object context and LWJGL 3 uses straight up GLFW and even returns you a pointer in form of a long to the actual GLFW window (which is basically the context).