OpenGL Linux SDL or Allegro?

Started by
1 comment, last by Dospro 16 years, 9 months ago
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?
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
Johnny was a chemist's son by Johnny is no more, for what Johnny thought was H2O was HO4
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

This topic is closed to new replies.

Advertisement