hello all,
i’m new in SDL…
currently i try to learn Sprite Animation and stuffs…
when I blit the sprite to the surface with SDL_BlitSurface… its
worked… but only for the small sprite…
and i found out that… the CPU works is too heavy…
Are you converting and possibly even reloading the sprites for every
blit? (That stuff should be outside the main loop. The only time you
reload stuff is when DirectX tells you it lost your surfaces.)
and my aps
crashed after performed the animation for a few minutes…
Not really related to sprite size - though if you have a surface leak,
as seems to be the case, the crash (out of memory) will come quicker
with larger surfaces…
i realized that i need to free some memory after i draw the sprite
for every loops…
You shouldn’t have to… (In fact, you should avoid allocating or
freeing any memory in the main loop, as memory management is one of
the big problems in real time applications.)
What exactly are you doing? Can you post some code?
i tried SDL_FreeSurface(Sprite) but it the SDL is crashed… (SDL
DEPLOY PARACHUTE Stuffs etc…)
Yeah, that would kill the sprite surface, so you end up passing an
invalid pointer (ie garbage) to SDL_BlitSurface() the next time
around.
//David Olofson - Programmer, Composer, Open Source Advocate
.- Audiality -----------------------------------------------.
| Free/Open Source audio engine for games and multimedia. |
| MIDI, modular synthesis, real time effects, scripting,… |
`-----------------------------------> http://audiality.org -’
— http://olofson.net — http://www.reologica.se —On Sunday 28 March 2004 14.58, Renaldy wrote: