PDA

View Full Version : using dglOpenGL on linux



laggyluk
14-07-2013, 04:57 AM
I wanted to check if my game will start up on linux but looks like opengl rendering context is set/used in different way than on windows. dglOpenGL page and forum is in german so maybe someone has simple tut/example that sets the context on linux?

User137
14-07-2013, 08:36 AM
That is another reason why i use TOpenGLControl with dglOpenGL, for easy cross-platformity.

Sascha Willems
14-07-2013, 08:41 AM
The context creation functions in our headers for windows are just helper functions, and the header can be used as long as you have a render context, no matter how you created. If you're using lazarus I'd suggest using the TOpenGLControl. It abstracts creating the render context.

With the OpenGLControl it's pretty straightforward using our headers :

InitOpenGL;
GLControl.MakeCurrent;
ReadImplementationProperties;
ReadExtensions;

If you don't want to use it you'll have to create your render context with the OS-specific functions like glXCreateContext on linux and aglCreateContext on Mac OSX. Maybe I'll put some helper functions for abstracting that into our headers, but right now you either have to use the TOpenGLControl or call the aforementioned functions to create a valid rendercontext yourself.

laggyluk
14-07-2013, 02:45 PM
I tried that, doesn't crash but TOpenGLControl is all white

Sascha Willems
14-07-2013, 04:50 PM
That's only the initialization stuff. How do you draw? And does GLControl.MakeCurrent return true (which means you've got a valid render context)? I'm using it for the linux port of my game and it works fine as long as you've setup OpenGL on linux to work.