What graphic library should I use?

Started by
8 comments, last by Attanar 15 years, 1 month ago
Hi there. I'm totally newbie to game programming. Yet, I have been reading a lot about it and I would like to start my own project soon. I have studied computing, and know OOP with C++. Yet, I have never used it with any graphics library, so there's my main doubt. The thing is, I want to make a 2D game, probably tile-based. I know OpenGL is the most compatible API since it can be used over many OSes, but it's a 3D library. Would it be better to use DirectX or OpenGL for this? What do you think? Thanks in advance for your help.
Advertisement
There more than dx and opengl out there ;). but the best thing you can do is try the api's and find the one you like to use the most.
Personally I'd recommend SFML or SDL rather than either of those. You could also consider using an engine such as Haaf's game engine depending on what features you require and whether or not you're more interested in the learning experience of doing more of the work yourself or just want to get a game working.

- Jason Astle-Adams

I'm interested in both, creating the game, and learning things that may be useful in creating more complete games in the future.

I would like to have as much freedom as possible too, so I would prefer not using an engine, but programming my own.

I've been reading here (http://gpwiki.org/index.php/Libraries#Graphics) about it, but the problem is I don't see the advantages or disadvantages of picking one or another. I've read the wiki documentation about them and taken a look at their websites but that doesn't seem to make it clear.

Could you please tell me what are the main advantages/disadvantages of in from your experience?

Obviously the best would be to try them all and then chose, but I think it would take a lot of time to leanr and try them deep enough to see their strong points or weakneses.

Thanks.
Well to answer your question Jbadams really answered it well SDL or the other one he stated for speed. But if you want better control you simply need to pick one that is to your liking and go with (open gl or DX). SDL is fairly nice only because you can quickly turn the DX into something playable fast. But if you want better control like you stated early then your just going to have to struggle and drudge through the lower end of DX coding.
Quote:Original post by Attanar
The thing is, I want to make a 2D game, probably tile-based. I know OpenGL is the most compatible API since it can be used over many OSes, but it's a 3D library.

Not really. Yes, you can do 3D with it, but also 2D. It all depends on how do you use it in the end.
Don't pay much attention to "the hedgehog" in my nick, it's just because "Sik" was already taken =/ By the way, Sik is pronounced like seek, not like sick.
Quote:Original post by Sik_the_hedgehog
Quote:Original post by Attanar
The thing is, I want to make a 2D game, probably tile-based. I know OpenGL is the most compatible API since it can be used over many OSes, but it's a 3D library.

Not really. Yes, you can do 3D with it, but also 2D. It all depends on how do you use it in the end.


Yes but as far as I know (and that's not much xD) OpenGL is mainly thought for 3D, isn't that right? I've read there are some ways to make 2D but that's not its main purpose, maybe I'm completely wrong.
OpenGL and Direct3D are both hardware-accelerated 3d libraries. They're also the most performant way to do 2D.

Also lemme throw in a vote for OpenGL+GLFW(+FTGL) if you want to do it yourself. HGE if you don't.
Anthony Umfer
The problem you may have with using a 3D API to do 2D work is that it's a 3D API, and if you are not familiar with the concepts of 3D graphics already, you may find things to be a little more painful (on the order of "why are my triangles not rendering?") than using an API dedicated to 2D graphics would be.

The ideal situation would be to use a 2D graphics API that is sitting on top of a 3D API like D3D or OpenGL, which will allow you to get the hardware-accelerated performance boost but still work in the semantics of 2D.
OK thank you all very much for your answers, I think I've got quite a better idea about this now.

I'll check those APIs you suggested and will look for more information about them.

PS: I've been taking a look at the different options and I think SDL over OpenGL is just what I need.

Thanks very much again.

[Edited by - Attanar on March 13, 2009 11:39:51 AM]

This topic is closed to new replies.

Advertisement