Jump to content
  • Advertisement
Sign in to follow this  
Yourself

2D game : witch API?

This topic is 3829 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi, I want to develop a 2D game engine in c++ , for the windows platform I only got stuck witch graphical API i'm gonna use.. I mean : - GDI( or GDI+) - DirectX - OpenGL my first idea was to use GDI+ c'se it's quite powerfull and c'se I know it quite good and it's not that hard to use... then I realized that GDI( and GDI+) aren't hardware accelerated, where DirectX and OpenGl are... But those 2 aren't very easy (and I should learn them)... What should you people suggest ussing ?

Share this post


Link to post
Share on other sites
Advertisement
I'd personally go with the happy trio of SDL, SDL_image and OpenGL.

- SDL provides initialization of a window, as well as mouse/keyboard and even joystick input handling
- SDL_image provides image loading
- OpenGL provides hardware accelerated rendering
- Documentation, examples and forum help are plentiful

Good luck!

Share this post


Link to post
Share on other sites
Not only that, but it makes your game portable; you could deploy it on multiple operating systems instead of just sticking to Windows.

Share this post


Link to post
Share on other sites
The engine must be windows only (not my call... )

I just looked at SDL , but In windows, I know how to code a lot of the functions that they offer meself... so that's not really an option, but thx anyway for suggesting :)

I only need the graphical API, but I don't know witch to use :

- GDI : easy but not advanced
- GDI+ : easy, advanced but slow as it's not hardware accelerated
- DirectX and OpenGl : difficult, advanced, hardware accelerated but not made for 2D ...
-... other API ?

thx

Share this post


Link to post
Share on other sites
Quote:
Original post by Yourself
The engine must be windows only (not my call... )
Is this homework? Part of your job? I ask because I'm wondering why one would require that an engine be Windows-only. (I can imagine a project having the parameter that the engine can be Windows-only, but why would you require it to be so? If using a cross-platform library such as SDL serves the project well, why not do so?)
Quote:
- GDI : easy but not advanced
- GDI+ : easy, advanced but slow as it's not hardware accelerated
- DirectX and OpenGl : difficult, advanced, hardware accelerated but not made for 2D ...
-... other API ?
DirectX and OpenGL are both fine for 2D. As for which to use, if this 'Windows only' thing is really important, you might as well use DirectX. If on the other hand you choose to use OpenGL, it would be kind of silly not to make the rest of the engine cross-platform as well.

Personally, I'd recommend SDL + OpenGL. Or, better yet, if your goal is to make a game, use a game engine that already exists rather than creating a new one from scratch.

Share this post


Link to post
Share on other sites
Well I would go with the combination of OpenGL, GLFW, and GLPng. And if you want sound, then I would choose OpenAL. You can't go wrong with that combination.

And OpenGL is totally built for 2D if you just use an ortho matrix. With an ortho matrix you have a great advantage of other 2D engines in the fact that the depth is real and hardware-acclerated, not faked with software depth sorting.

Share this post


Link to post
Share on other sites
Quote:
Original post by jyk
Is this homework? Part of your job? I ask because I'm wondering why one would require that an engine be Windows-only. (I can imagine a project having the parameter that the engine can be Windows-only, but why would you require it to be so? If using a cross-platform library such as SDL serves the project well, why not do so?)[


it 's an engine that I will give to students (I'm a prof) and they are using windows ;) they use the engine to learn the basics of c++...

it looks like DirectX is the best option for now ...

I know that DirectX can handle 2D graphics but can it also handle stuff like collision detection ?

Share this post


Link to post
Share on other sites
I haven't actually played with GDI+, but I'm developing a 2D game entirely in OpenGL. The editor that's evolving alongside it is a mix of GDI and OpenGL. I think if you could do a serious 2D game in GDI (with Dibs, I'd presume), then you'd be proficient enough to do one in OpenGL.

and writing shaders in GLSL is going to be way better for heavy effects, provided you're aiming at a decent class of hardware

Quote:
Original post by Yourself
I know that DirectX can handle 2D graphics but can it also handle stuff like collision detection ?


No. But you can get something like Box2D and tie it in

Share this post


Link to post
Share on other sites
Quote:
Original post by Yourself
Quote:
Original post by jyk
Is this homework? Part of your job? I ask because I'm wondering why one would require that an engine be Windows-only. (I can imagine a project having the parameter that the engine can be Windows-only, but why would you require it to be so? If using a cross-platform library such as SDL serves the project well, why not do so?)[


it 's an engine that I will give to students (I'm a prof) and they are using windows ;) they use the engine to learn the basics of c++...

it looks like DirectX is the best option for now ...

I know that DirectX can handle 2D graphics but can it also handle stuff like collision detection ?


Just curious, but what kind of professor are you. If you are on a tight schedule, and looking for an easy 2D OpenGL rendering engine to modify, then I recommend that you check out: http://www.googlecode.com/p/phoenixgl. It is under the GPL license which means you are free to modify it, and release it as you like. If you need any help, then just contact me by email.

Share this post


Link to post
Share on other sites
at this moment I give math and vb.net but in 2 yr (2009-2010) I start teaching C++ (STD lib's) in an bachelor gamedev.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!