Good c++ game library?

I want to install a game library to my c++ visual studio 2012 express. I have found a couple of libraries but none of them were either easy .exe installs or pre installed in the program. I want something that is a good start and that is not hard to install. I am mostly interested in just 2d stuff for now, but 3d capabilities doesn't hurt :P
Last edited on
Try SFML or
Try SDL if you are quite hardcore.

But I don't think there is any easy exe install or such for C++ Libraries for as long as I've been learning ( I've only been learning for 2 years now ).

Just put the header file inside include folders
and setup the link to the linker file
Installing libraries are really frustrating -.- I have looked on google and youtube but nothing good to find... How do I install SDL on visual studio without having to type in the terminal and mess too much with directories?
Wait, you are using windows right ?

So long as I know there 2 thing to do
Copy the header files to the include folder ( so you can #include them )
and link to the linker file so that exe can connect to the dll

Well, for visual studio it's quite complecated ( for me )
I use code::blocks

You really want SDL ???
Well, I prefer SFML but if you want SDL then it's your choice

Just follow these instructions on Lesson 1
http://lazyfoo.net/SDL_tutorials/index.php
Last edited on
I found a youtube tutorial that showed how to set everything up. It all works :) The only negative thing is that I have to do it every time I make a new project -.- And I like to make many small projects rather than few but big ones.
You can either make a template project that you'd copy and paste for each new project, or you can install the libraries in a way other than what the YouTube video showed you.

I'm assuming that the video had you go into the project properties and add the relevant folders to the list of linked resources. Either that, or they have you copy and paste the files to the location of the project code. Instead, if you go through C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC you'll find an include and lib folder. Put your lib and header files in the appropriate folders, and they can be accessed from all projects. That's how I normally install my libraries.
Last edited on
Personally, I like Allegro as it has more features than SFML and SDL, cross-platform, and generally integrates well with 3D graphics engines like Ogre or Crystal Space, so if you're looking for 2D and wanted to get started on 3D later on or something, you could get Allegro and add in a 3d graphics engine when you're ready to use it. I think it comes with one, not sure. So I guess I'd recommend Allegro 5 or SDL.

It's not hard to install, but I don't know of any libraries that use .exe installs. Also, it's not fairly difficult to find guides on it, but it's rare you find a good/useful one. The library is easy to understand, for both Allegro and SDL, but SDL has more info available than Allegro, and is much more in wide usage.

Still, Allegro feels natural, the API is easy to understand and makes sense, and like I said, SDL is pretty powerful and although not as easy as Allegro, still has tons of documentation so it is easy to learn. I guess at the end of the day, since you mainly want a 2D library, use SDL. It's mainly for 2D graphics, whereas Allegro is a mix of 2D and 3D features.
I tried to install allegro, I followed the instruction, but it didn't work. (got lots of errors) I'll try to solve my SDL problem since that is working better.
I use visual studio 2012:

I have installed SDL in a way I think should work, and I can show basic images. The program I have made works when I remove this line,
Uint32 colorkey = SDL_MapRGB( image->format, 255, 250, 250 );
When I compile the program, the program opens up with no image, but when I run the program from its location it opens properly. (that is without the line above that makes everything fail) So I guess it has somethig to do with the way I compile???!!! HELP!!
Memory errors come when use this code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include "SDL.h"
#include <iostream>
int main(int argc, char * args[])
{
	using namespace std;
	bool running = true;
	//Init SDL
	if(SDL_Init(SDL_INIT_EVERYTHING) == -1)
	{
		running = false;
	}
	SDL_Surface *screen;

	screen = SDL_SetVideoMode(800, 600, 24, SDL_HWSURFACE);

	if(screen == NULL)
	{
		running = false;
	}


	SDL_Event occur;

	SDL_Surface *image;

	image = SDL_LoadBMP("Test.bmp");

	if(!image)
	{
	cout << "Problem loading image" << endl;
	}
	
        Uint32 colorkey = SDL_MapRGB( image->format, 255, 250, 250 );

	while(running == true)
	{
		if(!image)
	
		{
			cout << "Problem loading image" << endl;
			break;
		}
		SDL_PollEvent(&occur);

		if(occur.type == SDL_QUIT)
		{
			running = false;
		}
		SDL_FillRect(screen, NULL, 0);

		SDL_BlitSurface(image, NULL, screen, NULL);

		SDL_Flip(screen);
	}
	//Quit SDL
	SDL_Quit();
	return 0;
}
Last edited on
I'd vote for SFML. Installation is relatively easy and the forums are active.

Furthermore, it provides excellent OpenGL integration, so you can use it for both 2D and 3D ventures.

With regards to libraries, yeah, they're a pain to set up at first. The more you use them, the more you get used to them, though.
I agree with iHutch, especially since you don't need to compile the libs yourself. Just set up the paths and include the headers and you should be fine.
Thank you guys so much for replies, I think I'll stick with SDL for a little while now because I got it set up :) As for the program above I managed to fix it after hours of testing and changing code and stuff I finally found out that I could compile the code without running it with F7 instead of using F5 wich compiles and runs. Can someone explain directX? Is it a good library for making games? Is it a library at all?
closed account (S6k9GNh0)
I use SDL2 as well with a custom wrapper. I really wish they would officially release it though...
Filiprei wrote:
Can someone explain directX? Is it a good library for making games? Is it a library at all?

DirectX is a collection of APIs use for multimedia programming. Direct3D is the one you're probably most interested in, which is used for 3D programming for things such as video games.

You can download the DirectX SDK from Microsoft's site*.

DirectX is proprietary to Microsoft so anything you make with it is bound to their platforms; Windows and Xbox 360.

If you want a cross-platform alternative, OpenGL is the way to go.

*If you have Windows 8, the DirectX SDK is part of the Windows SDK.
Last edited on
Ok, I guess I'll stick to opengl, I really don't care that much about 3d. I know I can't make anything worth playing yet anyway, but in 2d everything is fun :)
Topic archived. No new replies allowed.