Jump to content
  • Advertisement
Sign in to follow this  
biscuitz

I want to learn SDL and OpenGL

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

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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).

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!