Quick question on SDL_PushEvent()

This function takes a pointer to an SDL_Event. Does it push this
pointer onto the event queue, or a copy of the object it points to? Is
it safe to pass it a pointer to an automatic variable in a function
belonging to secondary thread?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello let me start off by saying that I am a begineer to SDL, and game
programming in general. Well here is my problem whenever I blit a “Sprite” (
png format ) to the screen and attempt to move it from its original position
it will leave a copy of it self at its last coordinates Is there a proper way
to accomplish image movement without it having a trace of itself at the last
coordinates? I have searched google, and some other peoples source code but I
cant for the life in me figure this out yet, if anyone can shed any light on
this subject I would be greatful.

Thanks in Advance,


Juan D. Espinoza
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (FreeBSD)

iD8DBQE+mD2kt76GF50GSsgRAjSGAKDI/SRFTwwkAz5o/WacbS0ZAEJqKQCeIFCL
WG93UMEd7Jvi16vKrW5sNLc=
=sD9o
-----END PGP SIGNATURE-----

Hi there,

Hello let me start off by saying that I am a begineer to SDL, and
game programming in general. Well here is my problem whenever I blit
a “Sprite” ( png format ) to the screen and attempt to move it from
its original position it will leave a copy of it self at its last
coordinates Is there a proper way to accomplish image movement
without it having a trace of itself at the last coordinates? I have
searched google, and some other peoples source code but I cant for
the life in me figure this out yet, if anyone can shed any light on
this subject I would be greatful.

About your problem, well i just redraw first on the old position the
orginal background and then i will draw the new position of my player.

This code fragment should help you … if not look at the source of my
bomberclone game… there in the game.c file in the function game_loop
() you will see how i did it.

i hope i could help you …
bye bye
Steffen

------------ sample code
game_start ();

while (!done) {
sprite_restore (); /* delete sprites from the screen
this shoudl only draw the background
or the gamefield… - whatever you write
for a game*/

sprite_move ();	     /* calculate new position */
sprite_draw ();      /* draw sprites again */

screen_update ();    /* flip only the part of the screen you really

*/ need}

game_end ();–

Steffen Pohle (@Steffen_Pohle)| _ x
http://stpohle.bei.t-online.de | /#/ BomberClone - The Clone of
JabberID: stpohle at amessage.de ||###| DynaBlaster and Bomberman
ICQ: 370965 Yahoo: stpohle | #/ http://www.bomberclone.de
MSN: stpohle at hotmail.com |

This function takes a pointer to an SDL_Event. Does it push this
pointer onto the event queue, or a copy of the object it points to? Is
it safe to pass it a pointer to an automatic variable in a function
belonging to secondary thread?

Yes. It copies the object passed in.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment