[…]
while not done do
begin
SDL_GetMouseState(x, y);
This is a potential bug, I think; make sure not to mix old and new
position and button data this way, or you’ll get bugs of the kind “But
that’s not where I clicked!” on slow systems. 
while (SDL_PollEvent(@event) = 1) do
begin
case event.type_ of
[…]
SDL_MOUSEBUTTONDOWN:
begin
[…]
// Update just the part of the display that we've changed
SDL_UpdateRect(screen_, x, y, 1, 1);
end;
Don’t! You should generally not touch the screen (or do anything else
that might be time consuming) until you’ve processed all events in the
queue, to avoid lag.
end;
end; //(SDL_PollEvent(@event) = 1)
keys := PKeyStateArr(SDL_GetKeyState(nil));
if keys[SDLK_ESCAPE] = SDL_PRESSED then
done := True;
Not a big issue, but this is not a particularly nice way of doing it.
Pressing the escape key to exit an application would normally be expected
to be an “event style” input, as opposed to a “state style” input.
In many cases you won’t know the difference, but you will know the
difference if the program stalls long enough that you manage to press
and release the button between two successive passages through this
code. (In short; key presses seem to be ignored.)
//David Olofson — Programmer, Reologica Instruments AB
.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |
--------------------------------------> david at linuxdj.com -'On Sunday 09 September 2001 23:31, Dominique Louis wrote: