[SDL] Perl binding for SDL?

Jared slake.geo at yahoo.com
Wed Apr 12 17:00:21 PDT 2000


>The problem is that sleep(0) isn't as predictable/portable as we might
>hope... If I remember correctly from FileNET, something like this works
>reasonably well on WinNT, but I wouldn't trust it on Linux.

Oh, c'mon... like any code is going to be totally crossplatform anyways. No matter what sort of code you're dealing with, be it 
audio/video/timer/networking, it'll never be crossplatform without a certain amount of tweaking, so why even bother? Let's just 
treat each platform as a separate kettle of fish and be done with it.  

Crossplatform compatibility is not a natural occurence, this is why SDL exists. (Besides, if code was inherantly more 
crossplatform, you'd be out of a job!) So expect it to be full of various  wierd hackies.... 

Something else which I seem to be blenderizing is what this is actually about - timing (in terms of operations per second) or 
timers (in terms of hooking and repeating action)... I got slipped up and therefore started yabbering on about hardware timers. 
Whee. I wouldn't mind seeing timing functions, something like this:

SDL_StartTiming(1);
while (!done)
{
/* shit happens */
SDL_GL_SwapBuffers(); // or your preferred flip command
SDL_IncrementTimingFrames(1);
}
SDL_EndTiming(1);
SDL_ReportTiming(1);

Which would wrap hardware timing functions etc. as necessary.

Anybody else think that this'd be cool? Granted that you can do it with the current timing apparatus... I tried it and my assistant 
programmer on Kosmos Online went up in arms and started muttering about death threats because it was low resolution. What I'm 
suggesting is very hi-res, and we could use hardware timing dinguses.

>Regards,
>
>-Loren

Good to see you on the ML by the way.  I still remember that amazing looking sandwich ;-)

Cheers,

Nich



More information about the SDL mailing list