SDL 0.6k prepatch

Okay folks, this is a work in progress, but since it fixes many things
on the X11 side, and adds some candy, I thought I’d release an SDL 0.6k


What’s broken:
Win32, BeOS support.

What’s New:
Addition of the ‘stars’ demo
Addition of TrueType rendering using the FreeType 1.0 library
The event loop has been moved into the main thread
X11 no longer uses semaphores at all, unless you make the screen
thread-safe by passing the SDL_THREADSAFE flag to SDL_SetVideoMode()

API changes:

    The video surface is no longer thread-safe by default, except on BeOS.

    The separate event handler thread has been removed -- now all event
    handling occurs in the main thread when the event polling functions
    are called.  (The event filter may still run in a separate thread)

    SDL_QuitRequested() has been removed

    SDL_PushEvent(), SDL_PullEvent() and SDL_NumEvents() have been replaced
    with SDL_PollEvent() and SDL_WaitEvent()

    A window event must arrive for SIGINT to be processed in SDL_WaitEvent()

    Event callback functions have been removed.

    SDL_Init() takes a new flags parameter, telling it what subsystems
    to initialize.  The flags are documented in SDL.h

    There's a new test program 'testtimer' to determine the resolution
    of the SDL timer on your system.

    Removed SDL_sleep.h, replaced with SDL_Delay(Uint32 ms) in SDL_timer.h

    Removed SDL_StartTicks(), replaced with SDL_InitTimer()

    Added new timer function SDL_SetAlarm() -- sets a callback to
    be run a specified number of milliseconds away.  This callback
    is passed the alarm interval and returns the next interval.
    If both the passed and returned interval is the same, the alarm
    automatically runs on the next interval (a periodic timer), otherwise
    the periodic alarm is canceled, and a new alarm is scheduled for that

    Surfaces that are converted to display format do not automatically
    get the SDL_THREADSAFE flag anymore (and associated safeties.) The
    surfaces with this flag already set will have it set on the converted

    If SDL_SetVideoMode() is passed 0 bpp, it uses the current screen
    bpp, or the "best" bpp if no mode is set.  This allows you to do:
            SDL_SetVideoMode(640, 480, 0, 0);
    instead of:
            SDL_PixelFormat fmt;

            SDL_SetVideoMode(640, 480, fmt.BitsPerPixel, 0);

Enjoy! :slight_smile:
-Sam Lantinga (slouken at

Author of Simple DirectMedia Layer -