Thread: sprites in SDL

  1. #1
    Registered User
    Join Date
    May 2003
    Posts
    26

    sprites in SDL

    So someone showed me this link.
    http://cone3d.gamedev.net/cgi-bin/in...s/gfxsdl/index
    I do tutorials 1 and 2. Then I get ready for tutorial number 3
    http://cone3d.gamedev.net/cgi-bin/in...ls/gfxsdl/tut3
    I notice in the description 'Note: make sure you know c++ classes'.

    Well.. I learned c first and was planning on doing c++ at some point in the future. Do I have to know c++ to know how to do sprites ? I was really hoping that I can start messing around to make games.

  2. #2
    Pursuing knowledge confuted's Avatar
    Join Date
    Jun 2002
    Posts
    1,916
    You don't need to know how to do classes to make a sprite, but you will need to learn classes sometime in the future, and the basics of them aren't too hard, so you might want to just read up on it now.
    Away.

  3. #3
    Registered User
    Join Date
    May 2003
    Posts
    26
    What will I need to know them for? I was really planning on learning them eventually, but I just got so excited that I finally got to do graphics. I really dont want to do c++ right now =P

  4. #4
    Registered User
    Join Date
    May 2003
    Posts
    26
    also does anyone have a link to some open source that uses sprites with just

  5. #5
    WEll the sprites are just normal SDL_images but they use transparencies and animation. To use transparencies just look up SDL_SetColorKey(), and for animations you just draw an image on the screen and then delete it then draw another and keep doing that. It is actually pretty simple, but the guy at cone3D likes to show you a very good way of doing it.

    There was an awsome site that I liked when doing sdl but sadly their servers were attacked by some crackers or script kiddies but they had had some great tutorials, IMO better than Cone3D. I would also throw you in the Direction of ZEngine a free SDL/addons wrapper that makes everything extremely simple to use SDL and the addons, but the site is temporarily down but if you ever see cozman online PM him or get his AIM SN from his profile.

    BTW, there is a book on SDL if you geel you need one: Focus on SDL

    Hope this helps, if yo uhave any questions e-mail or pm me.

    --Sean

  6. #6
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361
    SDL in C: http://www.overcode.net/~overcode/wr...ing-update.pdf
    It's called "Programming Linux Games", but you can use this book if you're programming for windows, too.

  7. #7
    Registered User Ace Bowers's Avatar
    Join Date
    Jul 2003
    Posts
    23

    WAH!!!

    I did the same thing the guy (or girl) at the top did and when I got to tut 3 I went ahead. I have some idea of classes structures and inheritance but I followed exactly what the tut said and it wouldn't work. It gave me:

    'CSpriteBase' is used as a type, but is not defined as
    'CSpriteBase' is used as a type, but is not defined as
    'CSprite' is used as a type, but is not defined as

    Et cetera... If anyone has had this problem and/or knows how to fix it
    please tell me. I use Dev-C++ and I did do the linker thing and got the header files right, I think. I included:

    <iostream>
    <string>
    <stdio.h>
    <stdlib.h>
    <SDL/SDL.h>

    Anyway thanks in advance.
    "I have read about a hill in a book, so the hill must exist." -a Christian quote
    "I have not seen this hill, so it must not exist." -an Athiest quote
    "Well, I've heard of this hill, so lets bomb it." -a George Bush quote

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problems compiling this SDL app
    By Rider in forum C++ Programming
    Replies: 3
    Last Post: 03-27-2007, 12:22 PM
  2. SDL or Allegro
    By fungus_mungus in forum Game Programming
    Replies: 7
    Last Post: 04-02-2005, 01:18 PM
  3. SDL and MinGW Studio
    By Vicious in forum Tech Board
    Replies: 0
    Last Post: 07-30-2004, 09:59 PM
  4. SDL and Windows
    By nickname_changed in forum Windows Programming
    Replies: 14
    Last Post: 10-24-2003, 12:19 AM
  5. sdl in c++
    By Klinerr1 in forum C++ Programming
    Replies: 8
    Last Post: 07-07-2002, 07:46 AM