I want to learn SDL and OpenGL

Started by
5 comments, last by CodeMunkie 18 years, 8 months ago
I want to make a 3d modeller with SDL in OpenGL. Where can I learn the stuff to do that? I tried looking at the tutorials (like on this site) but they're confusing because I don't understand what they're doing. I used to program with Allegro but I want to switch over to SDL. Experience: I've made a basic 2d editor before (using Allegro).
Advertisement
You can get started with SDL at my site (look under 2D Game Tutorials). When you want to move on to using OpenGL with SDL, either check out Cone3D or go to NeHe's Tutotials and download the tutorial .zips that use SDL (they're usually specified as SDL/Linux).
-------------------------------See my tutorial site: Click here
Thanks your site helped me a lot with keyboard input.
But NeHe's tutorial is one of the one's that confuses me. Some of the numbers have an (f) at the end (like 0.0f). What is the (f) for?
f means float. OpenGL doesn't use C++, it uses C, so it can't overload methods to take different types of parameters. Instead, it has to put the parameter type in the name of the method.

There are a bunch of sites with tutorials for OpenGL. You might want to google around and pick the one you like the most. You can also try Beginning OpenGL Game Programming if you can afford a book.

You should also think of what skill level you're at. I have no idea, so I won't jump to conclusions, but if you consider yourself a beginner, you might want to try some (read a lot) of 2D games first.
-------------------------------See my tutorial site: Click here
Don't forget the ever-so-important SDL reference!
Clicky
----------------------------------------------------------------------------------------------------------------------"Ask not what humanity can do for you, ask what you can do for humanity." - By: Richard D. Colbert Jr.
Is the (f) at the end required? Like in:
glTranslatef(-1.5f,0.0f,-6.0f);
Are the f's in that required?

I got the SDL reference. I use Dev-C++.

I understand the NeHe tutorial now. I thought I could just jump to Tutorial #2 but Tutorial #1 makes it make sense.
Quote:Is the (f) at the end required? Like in:
glTranslatef(-1.5f,0.0f,-6.0f);
Are the f's in that required?


f is just a shorthand way to cast a double to a float. If you don't do the cast, the number is treated as a double. If you try to use a double when a float is expected, the compiler will either generate an error or perform the cast for you with a warning (depending on which compiler you use and how it is set up).
"When you die, if you get a choice between going to regular heaven or pie heaven, choose pie heaven. It might be a trick, but if it's not, mmmmmmm, boy."
How to Ask Questions the Smart Way.

This topic is closed to new replies.

Advertisement