More keyboard in OSX

Hullo,

Instead of

if(SDL_PollEvent(e)) {…}

I tried

while (SDL_PollEvent(e)) {…}

  • But same difference. My event e is declared as a pointer, so no problems
    there. Since the PollEvent removes events from a queue, the if(…) should be
    somewhat equivalent to while(…), except that I only process the first event
    in the queue with if(…), instead of all of them in turn.
    The code I posted first worked excellently on Linux, so I’m guessing something
    is wrong with the SDL-lib, or my OSX-setup?

Still baffled :slight_smile:

  • Andreas

— buding at daimi.au.dk wrote:

while (SDL_PollEvent(e)) {…}

My event e is declared as a pointer

The code I posted first worked excellently on Linux,
so I’m guessing something
is wrong with the SDL-lib, or my OSX-setup?

Are you initializing e to anything? If it’s just
pointing out into space somewhere, then on one system,
it may be pointing to some seemingly harmless memory,
and storing the event data there, while on another
system, that data may be put somewhere volatile.

My apologies if I didn’t help, I didn’t get a chance
to read any earlier emails in this thread since I
deleted them earlier whenever I didn’t have time to
read, and had too many email (damn yahoo email.)__________________________________
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.