Jump to content
  • Advertisement
Sign in to follow this  
Dospro

OpenGL OpenGL Linux SDL or Allegro?

This topic is 4052 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

Well, i am linux user. A long time ago i used to make some games using Direct X, but won't do it on Linux. Right now i use SDL and Allegro for graphics, sound and input programming, but none of them support hardware accelerated 3D graphics. So i decided to learn OpenGL. I read that the implementation of OpenGL in linux is called Mesa3D. I don't understand this, but a t least i know i have to use mesa3D to do 3d stuff on linux as if i were using opengl. I hope i am right. Anyway. I started looking under google and here in gamedev for any good tutorial for learning opengl. But i found that most of the tutorials have MFC code, Windows code or GLUT code. I want to learn plain OpenGL so i can use it with Allegro or with SDL. I found one but it is terribly old and has some glut code. Do you any good tutorial that explains plain OpenGL or at least SDL+OpenGL? Or is it REALLY necessary to by an expensive book?

Share this post


Link to post
Share on other sites
Advertisement
Well, if you already know SDL, then its quite simple. The only real change is that you need to add SDL_OPENGL to your SDL_SetVideoMode

for example:

SDL_SetVideoMode(1024,768,24,SDL_HWSURFACE|SDL_OPENGL);

And instead of SDL_Flip(), you use SDL_GL_SwapBuffers();

Everything else is your standard OpenGL stuff.

Also, SDL also makes loading textures easy, since you just need to load your images (textures) into SDL surfaces and give OpenGL the data with the standard OpenGL functions.


I learned OpenGL from the NeHe tutorials, which wasn't too hard, you just need to ignore the windows-specific stuff, then I purchased a copy of the OpenGL Red Book (OpenGL Programming Guide) which has been a great experience for me.

Here's some sample SDL + OpenGL code:
http://wiki.vislab.usyd.edu.au/moinwiki/SDL_and_OpenGL

Share this post


Link to post
Share on other sites
Thank you very much.
I succeded to compile the example of the link you gave me. It works quite well.
Now let's just learn pure OpenGL, let's try the nehe tutorials again.

Thanks

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!