grt-talk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [grt-talk] SDL Rendering window


From: Nikodemus Siivola
Subject: Re: [grt-talk] SDL Rendering window
Date: Tue, 8 Apr 2003 01:34:23 +0300 (EEST)

On Mon, 7 Apr 2003, Jason Dagit wrote:

> I like this idea too.  Sdl has timer events that you can receive I
> think, but I don't know if we can interrupt and resume execution if we
> use them...

Why not just get some time-measurement from lisp?

> Do you think we could use uffi to interface with posix threads?  Then
> we would be ``portable'' in some sense and still have threads.  It's a
> bummer that so many of the cool things are not portable.

Maybe we could create an extension to cl-sdl on the C-side. Something like:

void SimpleWindowHandler( Window * window )
{
    SDL_Thread *thread;

    thread = SDL_CreateThread(BasicEventLoop, window);
    if ( thread == NULL ) {
        fprintf(stderr, "Unable to create thread: %s\n",
        SDL_GetError());
        return;
    }
}

The Window struct would hold all the relevant stuff -- whichever that may
be. The BasicEventLoop function would just provide a simple event
loop that waits for the window to be closed.

Something tells me it might be productive ask about the feasibility on the
cl-sdl lists...

But maybe a better short-term solution is to create a system that uses a
compatibility layer to handle lisp threads if they are present, and makes
do without threads if they are not available.

Jason: I just commited a minur cleanup to the sdl-code, one that sets the
masks only once (when loading the code). Seems to work, but can you check
that I did not misundrestand the original intention.

  -- Nikodemus





reply via email to

[Prev in Thread] Current Thread [Next in Thread]