I am trying to figure out how to set up openGL on Linux based operating systems (Ubuntu 12.10) without using any *GLUT libraries. I don't have much experience with developing on Linux distributions.
To be more precise I'm trying to make a statically linked library that compiles on the three major OS flavours (using some preprocessor macros to figure out the os its being compiled on and switch up renderer code, window creation code etc).
On windows I have successfully created a openGL 4.0 rendering context using wglCreateContextAttribsARB
and the GL/gl.h
provided by mingw.
On Ubuntu I have managed to create a openGL 2.2 rendering context using glXCreateContextAttribsARB
and the GL/gl.h
provided by mesa3d. This was however in a VMware Ubuntu VM and so mesa(9.0.2 I believe) would only manage to go that far with a virtual graphics card.
So I decided to go ahead and install Ubuntu on a external HDD to take advantage of the graphics card only to later find out that mesa(9.1) can only go up to openGL 3.1. After a little bit of research I figured out that the AMD and Nvidia drivers have support for openGL 4.3. So I installed the AMD 13.1 drivers (I have a Sapphire 7970 vapor-x 6GB) but then the openGL header files that come with it are really strange, GL/glATI.h
tries to include windows.h
, it doesn't define APIENTRY
etc.
The question is whats the proper way of setting up openGL (with 4.3 support) for Linux? And even if the GL/glATI.h
files were proper, wouldn't they fail if ran on a Nvidia card?
I'm manually creating the window with XCreateWindow
and then I'm loading the extensions with glXGetProcAddressARB
so I'm not going to use GLUT or any GLUT-like library.