Compiling:
To make SDL+GL code compile under Dev-C++, use the following project options:
Compiler Options:
Linker Options:
If the code is advertised as "SDL/Linux" then it wont compile, it will bring up some weird error. You can either #include "windows.h" *before* including the GL headers, or you can do it how OpenSceneGraph does it, I'll attach the GL header to this post, you should be able to include this instead of "GL/GL.h" and it will do all the vodoo required to have GL.h included and working on all platforms
Note also that under Linux, a SDL app will compile with a main defined as either
int main(void) or int main(int argc, char **argv)
However, under windows, main MUST be
int main(int argc, char **argv)
Tutorials:
The two best resources are the NeHe OpenGL tutorials at www.gamdev.net and the OpenGL tutorials at www.gametutorials.com
NeHe
Gametutorials
Note that you WILL get compile errors for the SDL code for these tutorials, however 95% of the time the only required modifications will be the two things I pointed out above.
To make SDL+GL code compile under Dev-C++, use the following project options:
Compiler Options:
Code:
-I"\SDL" -Dmain=SDL_main
Code:
-lmingw32 -lSDLmain -lSDL -liberty -lopengl32 -lglu32

Note also that under Linux, a SDL app will compile with a main defined as either
int main(void) or int main(int argc, char **argv)
However, under windows, main MUST be
int main(int argc, char **argv)
Tutorials:
The two best resources are the NeHe OpenGL tutorials at www.gamdev.net and the OpenGL tutorials at www.gametutorials.com
NeHe
Gametutorials
Note that you WILL get compile errors for the SDL code for these tutorials, however 95% of the time the only required modifications will be the two things I pointed out above.
Comment