SDL Tutorials

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

User avatar
sirtom93
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 49
Joined: Sun Dec 09, 2007 9:34 am
Location: England.
Contact:

Post by sirtom93 »

So how would you load images in such a way and blit images and stuff like that before it came out.

I got the pants thing to work. Pretty cool, gunna get a book and read it all like I did with c++ for dummys; anyone know any good books?
User avatar
Arce
Jealous Self-Righteous Prick
Jealous Self-Righteous Prick
Posts: 2153
Joined: Mon Jul 10, 2006 9:29 pm

Post by Arce »

Focus On SDL

^ great book. That tutorial shown above was heavily influenced by and a result of it.
<qpHalcy0n> decided to paint the office, now i'm high and my hands hurt
User avatar
sirtom93
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 49
Joined: Sun Dec 09, 2007 9:34 am
Location: England.
Contact:

Post by sirtom93 »

Arce wrote:Focus On SDL

^ great book. That tutorial shown above was heavily influenced by and a result of it.
Awesome, ill look out for it.
User avatar
MarauderIIC
Respected Programmer
Respected Programmer
Posts: 3406
Joined: Sat Jul 10, 2004 3:05 pm
Location: Maryland, USA

Re: SDL Tutorials

Post by MarauderIIC »

Hey Arce, I changed the post name since that old acct of yours had been deleted, out of curiosity: can you edit it?
Of course if youre a moderator then you can probably edit anything...
I realized the moment I fell into the fissure that the book would not be destroyed as I had planned.
User avatar
cloudncali
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 13
Joined: Sun Jan 18, 2009 8:36 pm
Current Project: Random stuff
Favorite Gaming Platforms: PC
Programming Language of Choice: C++
Contact:

Re: SDL Tutorials

Post by cloudncali »

wow a post dedicated to SDL tutorials with out this:
http://lazyfoo.net/SDL_tutorials/index.php

this IMO is THE best SDL tutorial, he makes it so easy to understand, and yet you can do so much with it. hell i still use his timer class for simple projects.
User avatar
Ginto8
ES Beta Backer
ES Beta Backer
Posts: 1064
Joined: Tue Jan 06, 2009 4:12 pm
Programming Language of Choice: C/C++, Java

Re: SDL Tutorials

Post by Ginto8 »

cloudncali wrote:wow a post dedicated to SDL tutorials with out this:
http://lazyfoo.net/SDL_tutorials/index.php

this IMO is THE best SDL tutorial, he makes it so easy to understand, and yet you can do so much with it. hell i still use his timer class for simple projects.
I agree. I learned SDL from Lazyfoo, and he is insanely good at making easy-to-understand tutorials (compared to other programming tutorials).
Quit procrastinating and make something awesome.
Ducky wrote:Give a man some wood, he'll be warm for the night. Put him on fire and he'll be warm for the rest of his life.
jumboorange
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 3
Joined: Tue Jan 20, 2009 9:58 pm

Re: SDL Tutorials

Post by jumboorange »

I looked for Focus on SDL at a few stores and couldn't find it so I googled it to see if I could find it somewhere, and guess what i found:
http://books.google.ca/books?id=Lp_py9c ... E#PPP11,M1
The entire book, for free, thanks to Google.
[edit] I just looked at it again and its not the whole book... Back to my search i guess [/edit]
Anyone know if this book is any good? http://www.amazon.ca/exec/obidos/ASIN/1592000746/gam-20
User avatar
programmerinprogress
Chaos Rift Devotee
Chaos Rift Devotee
Posts: 632
Joined: Wed Oct 29, 2008 7:31 am
Current Project: some crazy stuff, i'll tell soon :-)
Favorite Gaming Platforms: PC
Programming Language of Choice: C++!
Location: The UK
Contact:

Re: SDL Tutorials

Post by programmerinprogress »

I also learnt from Lazyfoo, but I believe once you've got your head around the pointers, the SDL DocWiki is probably the most invaluable source you'll find.
---------------------------------------------------------------------------------------
I think I can program pretty well, it's my compiler that needs convincing!
---------------------------------------------------------------------------------------
And now a joke to lighten to mood :D

I wander what programming language anakin skywalker used to program C3-PO's AI back on tatooine? my guess is Jawa :P
Daxtorax
ES Beta Backer
ES Beta Backer
Posts: 26
Joined: Sun Mar 15, 2009 1:34 pm
Favorite Gaming Platforms: Dreamcast, N64, Xbox 360
Programming Language of Choice: C++

Re: SDL Tutorials

Post by Daxtorax »

I've tried to follow lazyfoo's tutorials, but I come up with one of two errors depending on how I change the include heading.
When the include is, #include "SDL.h" I get the following error:
fatal error C1083: Cannot open include file: 'SDL.h': No such file or directory
I get this error even after I add the SDL.dll to my project folder. I then saw on there that you can instead change the include to #include "SDL.h", I try this, but then I get the error:
fatal error C1189: #error : You should copy include/SDL_config.h.default to include/SDL_config.h
I looked in the include folder in SDL and found the SDL_config.h but don't understand how to add the default to the SDL_config.h?
I'm sorry if I'm asking a newbish question, I just don't know how to solve it, I've tried searching google, any help is greatly appreciated.
Ewan
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 62
Joined: Mon Mar 23, 2009 11:46 am

Re: SDL Tutorials

Post by Ewan »

jumboorange wrote:I looked for Focus on SDL at a few stores and couldn't find it so I googled it to see if I could find it somewhere, and guess what i found:
http://books.google.ca/books?id=Lp_py9c ... E#PPP11,M1
The entire book, for free, thanks to Google.
[edit] I just looked at it again and its not the whole book... Back to my search i guess [/edit]
Anyone know if this book is any good? http://www.amazon.ca/exec/obidos/ASIN/1592000746/gam-20
Focus on SDL is on Amazon: http://www.amazon.com/Focus-Premier-Pre ... 1592000304 ;)

I think I'll buy it...I'm trying to build up a collection of C++ and Game Development books. Should help in the long run, even if I can't understand half the stuff in them at the moment :mrgreen:

BTW, thanks for the tutorial Arce.

It doesn't work for VC++ 2008 though :(
They pull out the truncheon, that's when the trouble starts.

'Cause when you've got a badge, the laws don't apply.
herby490
Chaos Rift Regular
Chaos Rift Regular
Posts: 122
Joined: Thu Feb 12, 2009 5:59 pm

Re: SDL Tutorials

Post by herby490 »

Ewan wrote:[
It doesn't work for VC++ 2008 though :(
Yes it does. Here is a tutorial on how to set it up in VC++ 2008 . There is also one in Focus on SDL.

EDIT: Forgot the link so here it is http://lazyfoo.net/SDL_tutorials/lesson ... /index.php
Last edited by herby490 on Tue Mar 31, 2009 7:58 pm, edited 1 time in total.
User avatar
MarauderIIC
Respected Programmer
Respected Programmer
Posts: 3406
Joined: Sat Jul 10, 2004 3:05 pm
Location: Maryland, USA

Re: SDL Tutorials

Post by MarauderIIC »

You forgot the link?
I realized the moment I fell into the fissure that the book would not be destroyed as I had planned.
xmjhsx
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 16
Joined: Tue Mar 24, 2009 3:54 pm

Re: SDL Tutorials

Post by xmjhsx »

What all do I need to know before I start trying to learn SDL?
Ewan
Chaos Rift Cool Newbie
Chaos Rift Cool Newbie
Posts: 62
Joined: Mon Mar 23, 2009 11:46 am

Re: SDL Tutorials

Post by Ewan »

herby490 wrote:
Ewan wrote:[
It doesn't work for VC++ 2008 though :(
Yes it does. Here is a tutorial on how to set it up in VC++ 2008 . There is also one in Focus on SDL.
I meant this tutorial ;)

Some of the stuff is in different places in the 2008 version, I couldn't figure out how to set it up. But I'm using Dev-C++ now so it's good :)
They pull out the truncheon, that's when the trouble starts.

'Cause when you've got a badge, the laws don't apply.
User avatar
programmerinprogress
Chaos Rift Devotee
Chaos Rift Devotee
Posts: 632
Joined: Wed Oct 29, 2008 7:31 am
Current Project: some crazy stuff, i'll tell soon :-)
Favorite Gaming Platforms: PC
Programming Language of Choice: C++!
Location: The UK
Contact:

Re: SDL Tutorials

Post by programmerinprogress »

xmjhsx wrote:What all do I need to know before I start trying to learn SDL?
You should have at least a basic understanding of how to program, and you should be proficient with your language (most likely C or C++ if we're talking SDL)

The bare minimum you need to know (in my opinion) are:
- variables and constants (if you don't know how to use these, you can't program)
- control flow statements (conditional statements such as if...else, and iteration statements such as the for statement or Do...While)
- Pointers (the first thing you need to set up an SDL window, involves using pointers, understanding these are essential)
if you intend to write solutions in C++
- then a basic knowledge of OOP is essential, you don't have to be an OO zealot, but if you're going to be make games using objects, then a knowledge of how classes work, how they are wirtten, and their benefits is a definate must.
- It might also help to become acquanted with inheritance aswell.

Overall, you need to make sure you have a grip on the fundamentals of programming, at the end of the day, you have to ask yourself "can I program proficiently WITHOUT SDL", if yes, then proceed to instaling SDL :)
---------------------------------------------------------------------------------------
I think I can program pretty well, it's my compiler that needs convincing!
---------------------------------------------------------------------------------------
And now a joke to lighten to mood :D

I wander what programming language anakin skywalker used to program C3-PO's AI back on tatooine? my guess is Jawa :P
Post Reply