Sign in to follow this  

Starting SDL... need some heads up? :)

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

So I've been learning and playing with C++ for the past 2 years. I believe I've got it down pretty well. My overall goal was to make a very small game, just to get a grip on graphics. So SDL seemed like the good choice. I've been going through the tutorials on lazyfoo.net, which is what my friend advised me to do.

So, going through it, it explains itself quite well... but... how the hell am I supposed to memorize all that? Am I even supposed to memorize it? Or should I just reference/copy and paste forever, until I get it down. And who knows how long that will take. My friends son has got this down, and he's only 15. Im not expecting this to be a walk in the park but... this is something I didn't see coming. How did you guys deal with it. Were you as confused in the beginning as I am? How am I supposed to deal with it?

I don't mean to sound bitchy about it, Im just a little confused and, shocked? All help is appreciated. Thanks in advance :)

Share this post


Link to post
Share on other sites
Quote:
Original post by Soap360
So I've been learning and playing with C++ for the past 2 years. I believe I've got it down pretty well. My overall goal was to make a very small game, just to get a grip on graphics. So SDL seemed like the good choice. I've been going through the tutorials on lazyfoo.net, which is what my friend advised me to do.

So, going through it, it explains itself quite well... but... how the hell am I supposed to memorize all that? Am I even supposed to memorize it? Or should I just reference/copy and paste forever, until I get it down. And who knows how long that will take. My friends son has got this down, and he's only 15. Im not expecting this to be a walk in the park but... this is something I didn't see coming. How did you guys deal with it. Were you as confused in the beginning as I am? How am I supposed to deal with it?

I don't mean to sound bitchy about it, Im just a little confused and, shocked? All help is appreciated. Thanks in advance :)
No, you don't have to memorize anything in particular. Copy-and-paste isn't really the way to go either, but you absolutely can and should refer to available references (tutorials, API documentation, etc.) whenever necessary. (That's how most of us do it. The more you work with a given API, the more likely it is that you'll commit certain things to memory, but the documentation is always there if you need it.)

Share this post


Link to post
Share on other sites
Quote:
Original post by Soap360
One other thing, how long did it take you to reach the end of the tutorial, or learning the basics of SDL in general?
I wouldn't worry too much about stuff like that. What really matters (IMO) is whether you're learning what you want to learn and (ultimately) accomplishing what you want to accomplish. (If you find you're not happy with the progress you're making, you can always look at alternative approaches.)

Share this post


Link to post
Share on other sites
The idea is that you learn the api so you know more or less how things work. Then when you need the specifics you flip through the reference docs from SDL's site. I wouldn't bother working through all of the tutorials just enough so that you can learn the general flow of things. Then head out on what you want to do. Then if you feel a little lost come back and look over a tutorial to refresh your memory. The thing to remember about tutorials is that they are trying to teach one thing. Any code not related to that one thing may or may not be good code. Any code related to the main topic is more than likely simplified for teaching purposes. As such copy paste probably isn't the best approach for using what you learned.

Share this post


Link to post
Share on other sites
I see. It's kind of weird though... like Im not really learning anything. My main concern is if I don't really know 100% what's going on in the code, and there's an error, I'll be stumped. Whatever, I'll see where the wind takes me. Thanks a lot guys!

Share this post


Link to post
Share on other sites
Quote:
Original post by Soap360Am I even supposed to memorize it? Or should I just reference/copy and paste forever, until I get it down.


You'll naturally memorize the pieces you use frequently, for the rest of it, referencing should be perfectly fine. Also, while I would discourage copy and pasting things as a matter of course, it can be useful to copy a piece of working example code and then tweak it to suit your purposes.

Share this post


Link to post
Share on other sites
Quote:
Original post by Soap360
My main concern is if I don't really know 100% what's going on in the code, and there's an error, I'll be stumped.


Hey, that's the way of the ninja. Go for it!. IMHO, you learn by doing (trial and error). Of course, you got the books and the tutorials out there; but they don't cover what you specifically want to develop.

There's nothing wrong with being stumped. Writing new code is easy, but you learn better when debugging and getting things done.

Quote:
Original post by kuroioranda
You'll naturally memorize the pieces you use frequently


I agree. Again, you get the hang of it by doing. And you probably know it already, we usually create functions/procedures when we're seeing some patterns in our code. But It's important to start getting things done to see them (IMHO).

Finally, every good coder will agree that copy-pasting code for the sake of it will not take you to the place you want to be.

Quote:
Original post by kuroioranda
I would discourage copy and pasting things as a matter of course


Quote:
Original post by jyk
Copy-and-paste isn't really the way to go



The best of luck for 2011 :D

Share this post


Link to post
Share on other sites
Confucius said something along these lines: "I see and I am aware. I hear and I know. I do and I understand."

You may be able to remember the basic steps to setting up an SDL program from tutorials; but you're not going to learn how to really use SDL until you actually HAVE USED SDL.

SDL may be simple to use, but it's also a low-level C library at the same time. So for someone who has probably been learning C++ with STL (anything in the std:: namespace that's not in a header with a "c" prefix) or boost, it might be harder to understand and even unwelcoming at first. But that's fine; it will ultimately make you more aware of things that boost and STL do under the hood and make you a better programmer and ESPECIALLY a better Computer Scientist for it. :)

Also; I recommend using SDL 1.3 for anything serious. Lazyfoo's SDL tutorials will still train you under the fundamental concepts of an SDL (and really; any GUI) application.
Then once you've got that down, applying the same theory (the API is different!) to SDL 1.3 will still work the same.

Share this post


Link to post
Share on other sites
I'm currently learning though the same way (from lazyfoo) and I'm not achieving much yet. I have managed to do the tutorials up to tutorial 10 so far, and I have made it so the user can move a sprite around.
Been at it for a few days and I can understand how it all works, however I still need to memorize how to set things up and keywords.

The manual has also helped me alot since I'm trying to do things on my own as much as possible.

And yes I was confused at first and a lot of things have been cleared up by following the lazyfoo tutorials, just keep at it. ;)

Share this post


Link to post
Share on other sites
I've recently started going through the LazyFoo tutorials myself. One thing that I've found helpful is to go through the tutorial itself (not the source code attached to the articles) and type everything in yourself. Even if you're transcribing it word for word, you're at least sort of "doing" it yourself and committing it to memory a little bit more.

Also, after I finish each tutorial I like to mess around and change things up a little bit, adding to the functionality each time.

Share this post


Link to post
Share on other sites

This topic is 2508 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this