Skip to main content
GameDev.net gamedev.net
🔒 Locked

Linux + Opengl

Started by Linuxer Dec 23, 2002 at 9:08 PM 3 replies 550+ views
Original Post
Linuxer
Linuxer
How can I use opengl programing in gcc (linux)??? In my slackware 8.1 has a directory " /usr/include/GL " that has some headers, but I don''t know how to use it. I know a little about glut, but it''s not the same in linux, I think.
zedzeek
zedzeek
personally i use sdl instead of glut (www.libsdl.org)

*first see if u have your graphics card setup correctly type glxinfo in at the console + u should see various info
eg gl version glx version openglextenmsion list, list of supported pixelformats etc.
*if everything looks ok then its onto the next step (prolly nehe is a good bet to look at when youre starting off, i think thery have sdl tutorials there)


http://uk.geocities.com/sloppyturds/kea/kea.html
http://uk.geocities.com/sloppyturds/gotterdammerung.html
grady
grady
you should pass an option to gcc like so: "-I /usr/include/GL". This will tell the compiler to look in the directory /usr/include/GL for include files. You should also have some files in a directory called /usr/lib called libGL.so and libGLU.so. If you have glut then you should also have libglut.so. Pass these options to link to the GL, GLU and glut libraries: "-lGL -lGLU -lglut". This should be all the extra stuff you need to compile opengl programs. If you have SDL, they include files are probably in /usr/include/SDL and you have to link to libSDL.so and on Redhat 8.0 at least you have to pass another option to the linker: "-lpthread"
an example:

g++ -I /usr/include/GL -I /usr/include/SDL -lGL -lGLU -lSDL -lpthread main.cpp -o game
----------------------------www.physicsforums.comwww.opengl.org
George2
George2
quote:
Original post by grady
... Redhat 8.0 at least you have to pass another option to the linker: "-lpthread"



That''s required on all linux distro''s if you wanna use SDL

"THE INFORMATION CONTAINED IN THIS REPORT IS CLASSIFIED; DO NOT GO TO FOX NEWS TO READ OR OBTAIN A COPY." , the pentagon
jmg
jmg
> That''s required on all linux distro''s if you wanna use SDL

prefer sdl-config --libs

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.