-
C++ game programming
As the title suggests, I'm interested in game programming. I've looked at openGL, but turned away when i found it was only for 3d projects. I looked at allegro, but was discouraged when i found that text isn't really it's forte(imagine the accent over that 'e' for me, if you would...). Could there be one library to cover 2d graphics and text output, or should I use allegro in conjunction with some other library for text? I guess the real question is, does anyone know a solid set of libraries to use to get into game programming in C++? I don't really care if anyone else can play the games, I just want to make them...
-
OpenGL *can* be used for 2D projects as can DirectX. You may want to look at SDL though.
-
SDL can be really nice. It may be just what you're looking for!
http://www.libsdl.org/
-
looks good, i'll give it a shot.
thanks.
-
Note that if you want truetype text output, I recommend SDL_ttf, an additional library for the SDL that lets you load and display text with standard text files, like COUR.TTF (Courier) and FreeSans.ttf (a Linux font).
Or you can use sfont or SDL_gfx for bitmap fonts. Bitmap fonts are pretty easy to implement and use -- I have a simple implementation if you want to look at it -- but they don't look very nice.
Once you have a bit of experience, you can check out SDL_image, which lets you load images besides BMP ones. (PNG, JPEG, basically every format you can think of.) SDL_gfx or SGE are essential as well if you want to rotate or scale images.
I highly recommend the SDL. It's very portable and quite easy to use. You'll probably need extra libraries to do more advanced stuff, however, like the ones I mentioned.
You can download libraries from the SDL website by searching for them by name here: http://libsdl.org/libraries.php
Finally, you absolutely must check out these tutorials. http://lazyfoo.net/SDL_tutorials/index.php
They're fantastic. And no, I didn't write them. ;)