I want to learn SDL and OpenGL
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).
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).
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?
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.
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.
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.
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).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement