Thanks for all the answers. That link was very useful manasij.
I managed to install SDL and have been able to comile and run a few "very" basic examples. However I am running into compiler errors whenever I use SDL_SetVideoMode(). It's fourth argument is a flag and these flags are not being understood by the compiler (at least thats my best guess). Take this code for example:
Im getting an error at line 16.
/* Includes */#include <SDL2/SDL.h>
/* Globals */
/* Main */
int main(int argn,char **argv)
/* Initialize SDL */
if(SDL_Init(SDL_INIT_VIDEO) != 0)
fprintf(stderr,"Could not initialize SDL: %s\n",SDL_GetError());
/* Open main window */
demo_screen = SDL_SetVideoMode(320,240,0,SDL_HWSURFACE|SDL_DOUBLEBUF);
fprintf(stderr,"Could not set video mode: %s\n",SDL_GetError());
/* Main loop */
active = 1;
/* Handle events */
if(ev.type == SDL_QUIT)
active = 0; /* End */
/* Exit */
Everything else works except for "all" the flags for SDL_SetVideoMode(). What could be the cause of this? All SDL programs that do not use this function seems to be working perfectly.
Trying_SDL.c: In function ‘main’:
Trying_SDL.c:16: error: ‘SDL_HWSURFACE’ undeclared (first use in this function)
Trying_SDL.c:16: error: (Each undeclared identifier is reported only once
Trying_SDL.c:16: error: for each function it appears in.)
Trying_SDL.c:16: error: ‘SDL_DOUBLEBUF’ undeclared (first use in this function)
Edit: Im compiling with gcc, with -lSDL2
Any help appreciated.