Using glSDL with Microsoft Visual C++ 6

by Florian Hufsky

First of all; please excuse my english, as i'm a student with lots of other things on my mind beside correct spelling / grammar. If you find any mistakes in this document feel free to contact me.

Everything described in this document was tested with Microsoft Visual C++ 6, but it should work with Microsoft Visual C++ 5 as well. If not drop me a line.

About glSDL

Currently glSDL is a proof-of-concept hack for SDL. In the future it will become a real backend, but till then you have to use it as is.

It is being developed by David Olofson in his free time. You can take a look at his other projects at his homepage: olofson.net.

Using glSDL in your programms

Add glSDL.c and glSDL.h to your project.

Uncomment line 16 - #define HAVE_OPENGL - in glSDL.h.

Add opengl32.lib to your project by adding "opengl32.lib " to the beginning of the line in Project | Settings | Linker tab | Object-/Library-modules.

Add SDL_GLSDL to the flags of SDL_SetVideoMode().

Now: compile! - that's all.

Using the examples

To use the two examples you have to extract VisualC.zip to your glSDL folder.

Assure that your folder structure looks like this:

your glSDL folder\
     VisualC\
          paralax4c\
          testsprite\

Now copy SDL.lib SDLmain.lib and SDL_Image.lib to your glSDL folder.

Or you can open up the projects, delete SDL.lib, SDLmain.lib and SDL_Image.lib from the project and add yours to the projects.

...Compile, take a look at the code and learn :).

That's it!

I hope this brief introduction to glSDL helped you getting started with glSDL.

Thanks to David Olofson for glSDL and Lion Kimbro for the original SDL VisualC.html.

This document is based on VisualC.html, originally written by Lion Kimbro as update of VisualC.txt by Sam Lantinga.