Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API.
WARNING: None of the video drivers have been updated for the new API yet! The API is still under design and very fluid.
The code is now run through a consistent indent format:
indent -i4 -nut -nsc -br -ce
The headers are being converted to automatically generate doxygen documentation.
2 /* Simple test of the SDL threading code and error handling */
9 #include "SDL_thread.h"
13 /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
22 ThreadFunc (void *data)
24 /* Set the child thread error string */
25 SDL_SetError ("Thread %s (%d) had a problem: %s",
26 (char *) data, SDL_ThreadID (), "nevermind");
28 printf ("Thread '%s' is alive!\n", (char *) data);
31 printf ("Child thread error string: %s\n", SDL_GetError ());
36 main (int argc, char *argv[])
40 /* Load the SDL library */
41 if (SDL_Init (0) < 0) {
42 fprintf (stderr, "Couldn't initialize SDL: %s\n", SDL_GetError ());
46 /* Set the error value for the main thread */
47 SDL_SetError ("No worries");
50 thread = SDL_CreateThread (ThreadFunc, "#1");
52 fprintf (stderr, "Couldn't create thread: %s\n", SDL_GetError ());
56 printf ("Waiting for thread #1\n");
58 SDL_WaitThread (thread, NULL);
60 printf ("Main thread error string: %s\n", SDL_GetError ());