Ack, quick question? Started getting SDL set up for GCC/Mingw using Dev-C++ (Windows XP), did everything I was meant to- copied the SDL.dll and the libSDLmain.a (er... that's a linker-script right?) into the \lib subdirectory of the Dev-Cpp root (C:\Dev-Cpp in my case- the default of the installer), and all the header files into an \SDL subdirectory of the \include directory (so C:\Dev-Cpp\include\SDL in my case)
then I wrote in the following code, which is basically just some code from a tutorial at a Wiki, which initialises a basic SDL project, setting Fullscreen and double buffering flags on, and just initialising the video mode.
Code:
#include <stdlib.h> // For some useful functions such as atexit :)
#include "SDL\SDL.h" // main SDL header
#define SCREEN_WIDTH 640
#define SCREEN_HEIGHT 480
SDL_Surface *screen; //This pointer will reference the backbuffer
int InitVideo(Uint32 flags = SDL_DOUBLEBUF | SDL_FULLSCREEN) {
// Load SDL
if (SDL_Init(SDL_INIT_VIDEO) != 0) {
fprintf(stderr, "Unable to initialize SDL: %s\n", SDL_GetError());
return false;
}
atexit(SDL_Quit); // Clean it up nicely :)
// fullscreen can be toggled at run time :) any you might want to change the flags with params?
//set the main screen to SCREEN_WIDTHxSCREEN_HEIGHT with a colour depth of 16:
screen = SDL_SetVideoMode(SCREEN_WIDTH, SCREEN_HEIGHT, 16, flags);
if (screen == NULL) {
fprintf(stderr, "Unable to set video mode: %s\n", SDL_GetError());
return false;
}
return true;
}
Anyway, when I come to compile I get a rather strange error:
Code:
10 C:\Dev-Cpp\Projects\SDL test\main.c syntax error before '=' token
help please? This is really annoying.