🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

OpenGL and ubuntu

Started by
3 comments, last by Kasya 14 years, 2 months ago
I am confused about what packages I need to write applications with OpenGL without using GLUT or SDL. I want to get full hardware acceleration. I think I have to work with GLX. But where do I get the OpenGL headers and libraries from? Which packages do I need? Which Version of OpenGL should I use? The applications I want to write should run on video card of the DirectX 9 generation and all newer ones. Up to now I worked with DirectX 9, so I have some 3D-API experience, but I am new to OpenGL and new to graphics-programming with Linux.
Advertisement
Using the package manager, install libgl1-mesa-dev. To get hardware acceleration you will also need to install appropriate driver. The easiest way is to use System->Administration->Hardware Drivers, the utility will download and install the driver automatically.
The Direct3D 9 equivalent is OpenGL 2.
The header files under /usr/include/GL/ are put there by mesa-common-dev.
GLX itself is installed by your graphic card driver, ie fglrx-glx or nvidia-glx. For nvidia, you also need nvidia-glx-dev, that replaces some of the mesa stuff.

You'd need libx11-dev if you are using xlib directly to create the window, but that's up to you.

As for the version, you can use anything up to 4.0 (at least on ati, not sure if nvidia is there yet), but that really depends on what features you are going to use and what taget audience you have.
:wq!
I am using an 8800 GTS 512 MB with the nvidia driver (185). So I will install 'nvidia-glx-185-dev'. The package 'libx11-dev' is already installed.

What about libgl1-mesa-dev and mesa-common-dev?
I thought MESA is a software implementation of OpenGL. I dont see why I need these packages. To install 'nvidia-glx-185-dev' apt-get removes those packages from my system.

My video card should support OpenGL 3.x so I think i will use 3.3. Does this mean I have to write different code to support OpenGL 2.x video cards or do these cards also run 3.x applications just without the features introduced with 3.x?
If you are writing for OpenGL 3.x this can work in OpenGL 2.x (if you are not going to use features that are only for OpenGL 3.x (like GLSL 3.3) )

This topic is closed to new replies.

Advertisement