Public Group

# I want to learn SDL and OpenGL

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

## Recommended Posts

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).

##### Share on other sites
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).

##### Share on other sites
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?

##### Share on other sites
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.

##### Share on other sites
Don't forget the ever-so-important SDL reference!
Clicky

##### Share on other sites
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.

##### Share on other sites
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).

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 11
• 15
• 21
• 26
• 11