• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
GautamSingh

For being good game programmer ,good to use SDL?

16 posts in this topic

Hi All,

I just started developing games, i found that we can use SDL to develop games, but using such API's is really a good option?
or we should avoid such things to improve our skills? I want to be a good game programmer, so i think it will be good if i do many
of the things in my own?
Also game studios recruitment clearly shows the need to have good grip over c++ , OpenGl.
Using the SDL ,Can i still improve my these required skills?

Please suggest !!

Thanks&Regards
0

Share this post


Link to post
Share on other sites
The purpose of SDL is to give you a cross-platform way of performing common tasks, like creating a GUI Window and accessing keyboard and mouse. If you only plan on creating a game for one platform and one only, then you might think of it as a convenience. If you ever plan to deploy it on multiple platforms (eg. Windows, OS X, Linux, iPhone, Android) then it is an absolute must that you use something like SDL.

Most people will tell you to use SFML instead of SDL, if you are planning on programming in C++.
0

Share this post


Link to post
Share on other sites
Programming a game is such a vast task, you can use SDL and still find lots of things to practice your skills (and as said by others, more interesting things than what SDL does).

And if you ever feel limited, in possibilities or in "skill challenge", you can replace SDL with something of your own later.
0

Share this post


Link to post
Share on other sites
When I first started working in 3D, I also used SDL. Eventually when I was comfortable enough with SDL, I ended up replacing it with Win32 API calls to have more control over my games. SDL was a great stepping stone for me because it let me get up and running quickly and what you learn there, carries forward to other platforms as well.
0

Share this post


Link to post
Share on other sites
To answer part of your question a little more directly: YES -- using SDL will still let you practice your C++ and (if you choose to use it) OpenGL, and more importantly it will allow you to exercise your [i]problem solving[/i] skills and create programs without having to worry about basic functionality like creating a window.

If you look at the [url="http://en.wikipedia.org/wiki/List_of_games_using_SDL"]List of games using SDL on Wikipedia[/url] you'll find that there are a lot of quality games, and that even some very big commercial titles have used it for Linux ports; working with SDL will not be a waste of your time.
0

Share this post


Link to post
Share on other sites
I've never seen much of a point for using SDL for a few reasons:

[list][*]It probably has the wrong open source license (its unusable as-is on platforms that don't have dll support), and for the platform's you would need the commercial license won't come with code to run on that platform (PS3, XBOX, etc) anyway, which more or less makes me wonder why the commercial license of SDL costs money.[*]You still have to deal with shaders (GLSL, Cg, HLSL), which arguably is where a huge portion of the code is going to live. Supporting more than one flavor is a huge amount of work, which can be mitigated with a language neutral shader generator (editor etc), which is also a huge amount of work to create.[*] Graphics API's in the grand scheme of things aren't all that complicated since the hardware does all of the work, using the APIs raw or even making a basic wrapper for one is a pretty trivial thing to do.[*]For C++ the real time consuming things end up being things like serialization, proper localization support and string handling, and memory management (multiple heaps, streaming textures etc)[/list]
-1

Share this post


Link to post
Share on other sites
[quote name='Zoner' timestamp='1307054509' post='4818883']It probably has the wrong open source license (its unusable as-is on platforms that don't have dll support), and for the platform's you would need the commercial license won't come with code to run on that platform (PS3, XBOX, etc) anyway, which more or less makes me wonder why the commercial license of SDL costs money.[/quote]
It's not quite so simple. SDL 1.3 is now zlib (or some similarly permissive license). However, 1.3 is still a WIP (last I checked, at least), and so may not be suitable in some cases. 1.2.x is relatively stable, but is still LGPL (IINM). Whether that's a problem depends on the circumstances, of course.

Naturally, if a library doesn't support the platforms you're interested in or if the licensing terms or cost don't meet your requirements, then it probably won't be of much use to you. That goes for any library though, more or less (SDL isn't unique in this regard).

[quote]Graphics API's in the grand scheme of things aren't all that complicated since the hardware does all of the work, using the APIs raw or even making a basic wrapper for one is a pretty trivial thing to do.[/quote]
Although SDL 1.3 does provide a wrapper over the underlying graphics API for hardware-accelerated 2-d graphics, many people just use SDL to handle windowing and events, and do all the low-level graphics stuff themselves. As such, SDL is still useful even if you want to write all the low-level graphics code yourself.

[quote]For C++ the real time consuming things end up being things like serialization, proper localization support and string handling, and memory management (multiple heaps, streaming textures etc)[/quote]
If you're talking about development time, I'd say it's probably easy to underestimate what goes into a cross-platform library like SDL unless you've actually tried to implement such a framework yourself (that is, a library that supports at least Windows, OS X, and Linux, and offers support for windowing, events, basic audio, and so forth). It can be surprising how much is involved (IMX, at least).

Note that I'm not specifically advocating for the use of SDL here; I'm just responding to the points you raised.
1

Share this post


Link to post
Share on other sites
Many open-source games use SDL, so if you are interesting in contributing to them, learning SDL would not be so bad. (There are also many using OpenGl.) It can only be a positive thing if you mention SDL on your CV, though OpenGl might have a higher status. With those API things though I think that when you have learned to use one it will be easy to learn the others.
0

Share this post


Link to post
Share on other sites
SDL is really the only decent low level game programming API; this is compared to an API like the Windows 32 API.

SDL is also compatible with the much more powerful OpenGL. SDL has many tutorials on the web, Lazy Foo being the best I have found so far, though I no longer have a need for tutorials and only really use them as a reference. OpenGL, when used with SDL can give it a bigger punch. SDL should be learnt first then OpenGL (walk before running).

[list][*]I would avoid SFML as there are very little tutorials and I don't really know a lot of support.[*]Allego (Don't make me laugh).[*]Win32 API is great, lots of control but without learning an API before, you will find it very difficult and probably get frustrated.[/list]It is important to start with an API that is technical enough, yet simple enough for you to use; there is no point in abandoning games half through because you don't know how to solve the programming specifics. It will also help to build up your problem solving skills, which you will use across all APIs that you learn.
0

Share this post


Link to post
Share on other sites
[quote name='Ryan Konky' timestamp='1307537241' post='4820913']
[list][*]I would avoid SFML as there are very little tutorials and I don't really know a lot of support.[/list][/quote]
The tutorials on the SFML homepage explain pretty much anything that one needs to know, also I found that thanks to the very structured oop approach of SFML I have to study documentation and tutorials way less.
0

Share this post


Link to post
Share on other sites
[quote name='japro' timestamp='1307615680' post='4821261']
[quote name='Ryan Konky' timestamp='1307537241' post='4820913']
[list][*]I would avoid SFML as there are very little tutorials and I don't really know a lot of support.[/list][/quote]
The tutorials on the SFML homepage explain pretty much anything that one needs to know, also I found that thanks to the very structured oop approach of SFML I have to study documentation and tutorials way less.
[/quote]

I'm talking of what I know from about a year ago, so it may have well changed since then. I would still choose over SDL over SFML. It was the first API that I learnt to use and helped me learn more complex APIs like WIn32 API and OpenGL.
0

Share this post


Link to post
Share on other sites
I used to use SDL but I switched to SFML shortly after. I mostly use it for windowing/events but I have used the graphics library that's included for my first few test projects. If you do choose SFML then I recommend you download the version 2.0 snapshot instead of the current version(1.6). Laurent, the creator, even claims that the newer "unreleased" version is more stable than 1.6 and he only has a few more major things to implement before officially releasing it. The only thing that will change drastically should be the graphics library.

Good luck!

EDIT: That reminds me, while SFML is actively being worked on, SDL hasn't been updated in years. It does have a strong community built up though.
0

Share this post


Link to post
Share on other sites
[quote name='B O N E S' timestamp='1307667162' post='4821548']
SDL hasn't been updated in years.[/quote]
SDL 1.2.x is relatively stable, and indeed hasn't had any major updates in some time. However, active development has continued on SDL 1.3. (It's still a WIP, but to say that SDL hasn't been updated in years is inaccurate.)
0

Share this post


Link to post
Share on other sites
What's all the fuss with the Win32 API? That's what I started with, given some good tutorials on creating Windows and using the message loop. I used NeHe's openGL tutorial to get started rather quickly. Technically, you don't even need to know the ins and outs of creating a Window. Just go through the first ten or so tuts and experiment a bunch. Do realize that I have never even used SDL, so I don't know the advantages... I just know that I don't need it. Also, you don't have to use openGL, and if you want to skip the nitty gritty stuff, you could just start with an open source game engine.


[url="http://nehe.gamedev.net/lesson.asp?index=01"]http://nehe.gamedev.net/lesson.asp?index=01[/url]

0

Share this post


Link to post
Share on other sites
[quote name='swilkewitz' timestamp='1307676613' post='4821580']
Do realize that I have never even used SDL, so I don't know the advantages... I just know that I don't need it.[/quote]
The primary advantage of an API such as SDL or SFML is (arguably) portability. If you're only targeting Windows, then that may not matter for you, in which case using WinAPI directly may be perfectly suitable. But if you were to try to replicate that functionality for Linux and OS X and perhaps other platforms as well, you might start to see how a cross-platform library such as SDL can be useful.
0

Share this post


Link to post
Share on other sites
Leaving aside portability, even creating a simple window/input loop in Win32 requires a lot of (frankly ugly) boilerplate. With SDL, you can get the same result with a tiny amount of (very readable) code.

Here is a simple SDL program that draws a sine wave.
[code]
#include <cmath>
#include <cstdlib>
#include <iostream>

#include "SDL.h"

void drawSineWave(SDL_Surface *screen)
{
int h = screen->h / 2;
float time = (SDL_GetTicks() % 1000) / 1000.0f;
for(int x = 0 ; x < screen->w ; ++x)
{
float f = (x / static_cast<float>(screen->w)) + time;
int y = h + static_cast<int>(h * std::sin(360.0f * f * (M_PI / 180.0f)));
SDL_Rect r = {x, y, 1, 1};
SDL_FillRect(screen, &r, SDL_MapRGB(screen->format, 0xff, 0, 0));
}
}

int main(int, char **)
{
if(SDL_Init(SDL_INIT_VIDEO) < 0)
{
std::cerr << "Failed to init SDL " << SDL_GetError() << '\n';
return 1;
}
std::atexit(&SDL_Quit);

SDL_Surface *screen = SDL_SetVideoMode(800, 600, 0, SDL_DOUBLEBUF);
if(!screen)
{
std::cerr << "Failed to set video mode: " << SDL_GetError() << '\n';
return 2;
}

bool running = true;
while(running)
{
SDL_Event event;
while(SDL_PollEvent(&event))
{
if(event.type == SDL_QUIT)
{
running = false;
}
}

SDL_FillRect(screen, 0, 0);
drawSineWave(screen);
SDL_Flip(screen);
}

return 0;
}
[/code]
Ain't it pretty!
0

Share this post


Link to post
Share on other sites

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  
Followers 0