→ update!
Rigel pointed out to me that the original example code was not portable. For portable code using opengl, SDL_opengl.h should be included instead of GL/GL.h and friends.
However, that would mean a few less bytes for sourcecode. So, to make it easier for all of you. I will allow you to include a header which i provide, which includes a few commonly used header files.
→ basic rules
The rules are mostly the same as last year,
- Your source code should be less than (or equal to) 4096 bytes.
- Only ANSI C and C++ are allowed.
- You have to use SDL
- No other API calls allowed.
- No external data files, just code.
- Sound is allowed.
- ESC quits.
- You can use the g.h or s.h files provided on the example page.
→ detailed rules
Some of these rules may seem a bit harsh, but please keep in mind this is an open source compo. Most of these rules deal with getting your code to be portable - the voters would like to be able to run your entry on Win32, GNU/Linux, Mac OSX, etc..
- The size limit for all the source code in the project is 4096
bytes, this does not include makefiles/projects or whatever you use
to build it. Whitespace (space/tab/newlines) is not counted for the
size limit, however the `real' size of your source files should not
grow beyond 8192 bytes.
The real size of your source files is the size you see with dir or ls -l (this should be <= 8192 bytes).
You can use something like this to calculate the size without counting whitespace (should be <= 4096 bytes):cat source.c | perl -pe 's/\s//g' | wc -c
Using compiler switches to add source code at compile time is strictly prohibited (that means no funky -D tricks in the Makefile guys).
- You are not allowed to use compiler extensions, only ANSI C (or ANSI C99) and C++ is allowed.
- You have to use LibSDL to
get a video buffer to play with :). This cuts down on overhead for
the window init and msg loop and it is portable too.
note: only stock SDL is allowed - do NOT use any of the additional libraries). - You cannot use any OS specific libraries or API calls - i.e. No Direct3D or other Windows API calls (and no X11 either). OpenGL (gl and glu, but not glut) is allowed to access 3D hardware.
- No data files are allowed.
- Sound is allowed with SDL audio (do not use /dev/dsp or something like that directly).
- Pressing escape should quit the intro.
- You can use g.h or s.h from the example page to avoid having to include a bunch of headers yourself.