Tricky color cursors

Emil Brink d94-ebr at nada.kth.se
Fri Apr 24 01:17:10 PDT 1998



On Fri, 24 Apr 1998, Sam Lantinga wrote:

>> For the category of applications that rebuild their display from sratch 
>> every frame (like mine:), SDL can't possibly manage the cursor more
>> efficiently than the application programmer. Basically, the cursor is
>> just another blit, then.
> 
> True.  And if you call SDL_UpdateRect(0,0,0,0) once per frame, then the
> cursor will be blitted at the end of the update.  How more efficient can
> you get? :)  The blit also takes advantage of any hardware acceleration
> available.  .. this isn't tested yet as the DirectX layer still has to
> be brought up to speed.

Seems like DirectX is causing you a great deal of trouble. Is it just
bad luck, or was there more evil in there than you'd expected?

> Then again, if you want to handle the cursor yourself, go for it! :)
> Don't forget that if you set a mouse motion callback for smooth cursor
> position updates that it will run in a separate thread, and you'll have
> to deal with the gnarly locking and coordination that SDL takes care of.

Hm... That's a good reason to think twice about handling the mouse
myself. :) I still haven't gotten around to thinking that dealing
with the down side of concurrency is much fun... :( But, hey, I could
just poll the mouse position every frame, right? Perhaps not so
smooth, but simpler.

/Emil





More information about the SDL mailing list