Sign in to follow this  
Terminalkillah

Which to choose

Recommended Posts

Hi all, Im in bit of a pickle at the moment beacause im trying to decide which to use between SDL, DirectX and OpenGL i have tried using all 3 and found that i still coudnt decide on which to use. I know there must be a million other threads like this but i just want to know what the pro's and con's of each one are then using this information i can then decide on which to use Cheers

Share this post


Link to post
Share on other sites
Personal preference and most importantly, target audience.

If you're working on a simple 2D game for yourself and your friend, SDL would probably be the best route because it is the easiest. If you want 3D graphics with portability then OpenGL. If you're not concerned with portability then probably DirectX. OpenGL is easier to get up and running with that Direct3D, but becoming comfortable with the Direct3D API will get you working with a common API for sound, networking, etc whereas with OpenGL you have to find other means.

Beyond that, just use what strikes your fancy. Both OpenGL and Direct3D are industry standards.

Share this post


Link to post
Share on other sites
If you are pretty new to programming, I would suggest starting with SDL. It's designed to be very easy to use (the 'S' stands for simple!) and it comes with everything you need (ie, you don't need Win32).

Also, once you get the hang of it, it can be used as a great framework for OpenGL (and event Direct3D).

Also don't listen to those who tell you "DirectX is better because once you learn Direct3D, DirectSound and DirectInput etc. will be easier." I don't care if you know what "lpUnkown" means or not, SDL or FMOD is way easier than any DX API!

Good Luck!

Share this post


Link to post
Share on other sites
Before I started using the Irrlicht Engine, I was using OpenGL for graphics and DX for sound and input. I liked OpenGL because it was easier to work with. But since it doesn't do anything but graphics, I learned DX for that and input, since it is free to use. FMOD, BASS etc... as far as I know cost money for a commercial project, but fro non-commercial are free. Since I wanted to get into more complex development of games, I was going to have to either make my own engine or use one, so I went with Irrlicht. I hadn't heard of SDL when I was API hunting so I can't appropriately comment, but I have seen many compliments for it. Plus you should be able to use SDL for input and window initialization and connect the window to OpenGL to get hardware accelerated 3d graphics.

Share this post


Link to post
Share on other sites
If you are just starting out I would say go with SDL. It will give you an idea on how to setup the library with your compiler and then include files and such. If you want to do something with 3D graphics then go for DX or OpenGL. I know that there are a lot of good OpenGL & DX tutorials around but you might want to pick up a book to have as a reference. So I'd say for 2D and small games go with SDL. Graphics demos and 3D go with DX or OpenGL.

Share this post


Link to post
Share on other sites
Cheers guys a lot of good points about the three. I think i will go with SDL beacause i am a complete begginer to game design and programming but i have basic knowlege in C++. But i am also doing a night school course in games design and programming using visual basic which is getting my feet wet in designing games but i want to do this as a career im going to have to advance to c++ and directx and such...

Cheers for all the help you guys its much appreciated

Terminalkillah

Share this post


Link to post
Share on other sites
I enjoy using SDL. It has alot of power and can really help you out, especially as a beginner. Later on when(if) you move into OpenGL, you can still use SDL to do input, sound, networking, and pretty much anything else that you'd need.

SDL has a good amount of tutorials out there and excellent documentation. However, it can't compeat with OpenGL and DirectX with tutorials.

Unless you need blazingly fast performance, go with SDL.

Share this post


Link to post
Share on other sites
Quote:
Original post by Ezbez
I enjoy using SDL. It has alot of power and can really help you out, especially as a beginner. Later on when(if) you move into OpenGL, you can still use SDL to do input, sound, networking, and pretty much anything else that you'd need.

SDL has a good amount of tutorials out there and excellent documentation. However, it can't compeat with OpenGL and DirectX with tutorials.

Unless you need blazingly fast performance, go with SDL.


SDL can be used with both OpenGL and Direct3D(if you REALLY wanted to).

Share this post


Link to post
Share on other sites
Quote:
Original post by Ezbez
I enjoy using SDL. It has alot of power and can really help you out, especially as a beginner. Later on when(if) you move into OpenGL, you can still use SDL to do input, sound, networking, and pretty much anything else that you'd need.

SDL has a good amount of tutorials out there and excellent documentation. However, it can't compeat with OpenGL and DirectX with tutorials.

Unless you need blazingly fast performance, go with SDL.


Depending on what you are doing, SDL will give you blazingly fast performance on modern CPU's. If you stick to pure pixel pushing at moderate resolutions and low bpp, SDL is very fast. However, one of the things that does annoy me is not being able to synchronize with the monitor's vertical retrace.

And for the documentation, SDL is certainly on competing terms. For tutorials, SDL may even win. MS does put out some great documentation for Direct3D and there are many tutorials for that too. I have found OpenGL documentation post version 1.1 to be lacking.

Share this post


Link to post
Share on other sites
Quote:
Original post by Terminalkillah
Cheers guys a lot of good points about the three. I think i will go with SDL beacause i am a complete begginer to game design and programming but i have basic knowlege in C++. But i am also doing a night school course in games design and programming using visual basic which is getting my feet wet in designing games but i want to do this as a career im going to have to advance to c++ and directx and such...

Cheers for all the help you guys its much appreciated

Terminalkillah


[edit ... pretty much a longer version of zer0wolf's post]

First of all let me begin this by saying I love 2d games and I am still lost when it comes to 3d games although I am learning :) I personally use SDL and OpenGL even though my post is going to leave me asking myself why.

If you want to do 3d games, it won't hurt to learn SDL but there is nothing stopping you from jumping into 3d right away. You won't be missing much by jumping into the 3d realm right off the bat and by the time you need a HUD or 2d stuff in your game it will seem so easy compared to the other stuff you won't bat an eyelash at it.

If you want to do 2d then the trend seems to be using a 3d API to do 2d. While yes it is easier to use SDL or Allegro you won't see hardware acceleration for scaling, per pixel alpha, or rotation anytime in the near future. While this generally isn't an issue for retro style games, more complex games use this stuff like water and from experience, SDL alone can be a real dog. So you can be ahead of the game by using a 3d API right from the word go for your graphics.

As for choosing an API, it is mostly preference but also your target.

If you don't care about portability and Windows users are your target audience then I would suggest Direct3D. You get an all in one package (sound,input,networking) with DirectX and Microsoft is constantly updating the API with new features. If portability becomes an issue once the game is made, it is always easier to find an equivilent way of doing something than actually creating it for the first time.

If portability is an issue from the start then OpenGL is probably the better choice since DirectX just isn't cross platform. This is only a graphics API however and you will need to use 3rd party libraries for sound, input, and networking.

There are also alternatives such as Irrlicht, Torque and more which offer complete packages that are more high level. While my experience with these is limited there are numerous posts similar to yours here on Gamedev.net that explain the pro's and cons much better than I ever could. Try your favorite search engine and read a little bit on what you find with what people have mentioned so far. I am sure you can make a good decision based on your needs and wants.

First, make the game work... Then, make it work better. As a popular saying here goes, "premature optimization is the root of all evil".

Share this post


Link to post
Share on other sites
Cheers guys a lot of info there. I think i will start of using SDL just to learn the basics and get the proper techinques of OO progamming then i think i will go on to directx when i have a good understaning of how graphics work, also im not really bothered about portability issues beacause im using a windows system and i intend my games to be played on a windows machine (no offense to linux and mac users i just dont see any profit i making games for these platforms)

Thanks Everyone, once i have a game up and running (still in design charts ect...) i will post a link on here to see what you guys think

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