SDL_WaitEvent() and event doubts

Hi there.

I am new to SDL (4 days – I am using it on linux,
with C++).
I am using in my main loop

while(SDL_WaitEvent() > 0) {
.
.
.
}

for case SDL_QUIT: SDL_Quit(); it is working fine …
but, when I try to handle mouse and keyboard, (I used
printf for debugging events processing), it only
prints after the program quits … should I use
another way to
process events?

thanks in advance for any info,

J. In?cio. W.

Mit sch?nen Gr??en von Yahoo! Mail - http://mail.yahoo.de

Hi,

Do you have \n at end in printf ?> ----- Original Message -----

From: sdl-admin@libsdl.org [mailto:sdl-admin at libsdl.org] On Behalf Of
Dark Kernel (InacioW-)
Sent: Monday, March 01, 2004 1:28 PM
To: sdl at libsdl.org
Subject: [SDL] SDL_WaitEvent() and event doubts

Hi there.

I am new to SDL (4 days – I am using it on linux,
with C++).
I am using in my main loop

while(SDL_WaitEvent() > 0) {
.
.
.
}

for case SDL_QUIT: SDL_Quit(); it is working fine …
but, when I try to handle mouse and keyboard, (I used
printf for debugging events processing), it only
prints after the program quits … should I use
another way to
process events?

thanks in advance for any info,

J. In?cio. W.

Mit sch?nen Gr??en von Yahoo! Mail - http://mail.yahoo.de


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Try adding
fflush(stdout);
after each printf.

JPOn Monday 01 March 2004 04:28 am, Dark Kernel (InacioW-) wrote:

for case SDL_QUIT: SDL_Quit(); it is working fine …
but, when I try to handle mouse and keyboard, (I used
printf for debugging events processing), it only
prints after the program quits …

Use ‘spritnf(stderr, “”, vars);’ instead.On Mon, 2004-03-01 at 13:28 +0100, Dark Kernel (InacioW-) wrote:

Hi there.

I am new to SDL (4 days – I am using it on linux,
with C++).
I am using in my main loop

while(SDL_WaitEvent() > 0) {
.
.
.
}

for case SDL_QUIT: SDL_Quit(); it is working fine …
but, when I try to handle mouse and keyboard, (I used
printf for debugging events processing), it only
prints after the program quits … should I use
another way to
process events?

thanks in advance for any info,

J. In?cio. W.

Mit sch?nen Gr??en von Yahoo! Mail - http://mail.yahoo.de


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

you mean fprintf.On Monday 01 March 2004 19:36, Jimmy Karlsson wrote:

Use ‘spritnf(stderr, “”, vars);’ instead.

No, but that works to ;)On Mon, 2004-03-01 at 20:10 +0200, Sami N??t?nen wrote:

On Monday 01 March 2004 19:36, Jimmy Karlsson wrote:

Use ‘spritnf(stderr, “”, vars);’ instead.

you mean fprintf.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

you can sprintf to stdout? is it a char *??

if so thats pretty cool, i thought it was a FILE * though…> ----- Original Message -----

From: jimmy.karlsson@nempo.net (Jimmy Karlsson)
To:
Sent: Monday, March 01, 2004 2:24 PM
Subject: Re: [SDL] SDL_WaitEvent() and event doubts

No, but that works to :wink:

On Mon, 2004-03-01 at 20:10 +0200, Sami N??t?nen wrote:

On Monday 01 March 2004 19:36, Jimmy Karlsson wrote:

Use ‘spritnf(stderr, “”, vars);’ instead.

you mean fprintf.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Well sprintf doesn’t output anything it just modifies memory. So I doubt
you meant that or did you really mean spriTNF like you wrote. :)On Tuesday 02 March 2004 00:24, Jimmy Karlsson wrote:

On Mon, 2004-03-01 at 20:10 +0200, Sami N??t?nen wrote:

On Monday 01 March 2004 19:36, Jimmy Karlsson wrote:

Use ‘spritnf(stderr, “”, vars);’ instead.

you mean fprintf.

No, but that works to :wink:

hmm.


/me looks at log code

WOPS, my bad >.<

Just looked at my log code and noticed that I was using fprintf, boy, do
I feel stupid now. ;0On Mon, 2004-03-01 at 15:01 -0800, Alan Wolfe wrote:

you can sprintf to stdout? is it a char *??

if so thats pretty cool, i thought it was a FILE * though…

----- Original Message -----
From: “Jimmy Karlsson” <@Jimmy_Karlsson>
To:
Sent: Monday, March 01, 2004 2:24 PM
Subject: Re: [SDL] SDL_WaitEvent() and event doubts

No, but that works to :wink:

On Mon, 2004-03-01 at 20:10 +0200, Sami N??t?nen wrote:

On Monday 01 March 2004 19:36, Jimmy Karlsson wrote:

Use ‘spritnf(stderr, “”, vars);’ instead.

you mean fprintf.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl