If you find any mistakes in this document feel free to contact me.
Everything described in this document was tested with Borland's C++ Builder 6 and the Free Command Line Compiler and should work with earlier and later versions of Borland's Win32 compilers assuming you have SDL setup correctly and should be easily portable to Borland's C++ compiler for Linux called Kylix. If not drop me a line.
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.
Add glSDL.c and glSDL.h to your project.
Uncomment line 16 - #define HAVE_OPENGL
- in glSDL.h.
Add "$(BCB)\lib\psdk"
to your project by adding "$(BCB)\lib\psdk"
to your Project | Options | Directories/Conditional tab | Library Path.
Add SDL_GLSDL to the flags of SDL_SetVideoMode().
Now: compile! - that's all.
To use the two examples you have to extract Borland.zip to your glSDL folder.
Assure that your folder structure looks like this:
your glSDL folder\
Borland\
bcb6\
paralax4c\
testsprite\
freebcc\
paralax4c\
testsprite\
These projects have the paths to the SDL include and lib files hard coded
into them, so you will need to ammend these locations to the ones appropriate
for you machine.
In the freebcc directory I have included rebuildall.bat file assuming your
command line compiler is setup correctly and is accessible via the Windows
PATH.
...Compile, take a look at the code and learn :).
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 and Florian Hufsky for his glSDL document.
This document is based on VisualC.html
, originally
written by Lion Kimbro as update
of VisualC.txt
by Sam
Lantinga.