Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Linuxer

OpenGL Linux + Opengl

This topic is 5661 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
> That''s required on all linux distro''s if you wanna use SDL

prefer `sdl-config --libs`

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!