Updating screen

I have a doubt about what happnes when sdl updates the screen. I draw
some text with sdl_ttf and blit the resulting surface to the same
location several times, but have noticed that old images are not erased,
producing a mix among new and previous text outputs.
I thought that when sdl updates the screen, any previous image is replaced
by the new one, even if there is nothing (just black color) in that
location. Do I need to erase the place before blitting new surfaces?–
Roger D. Vargas
ICQ: 117641572
Linux User: 180787

  • Much to learn you still have *
    Master Yoda, AOTC


Este mensaje ha sido analizado por MailScanner
en busca de virus y otros contenidos peligrosos,
y se considera que est? limpio.

Unless you use alpha blending or colorkeying, blits will completely
replace everything in the rectangular blit area.

//David Olofson - Programmer, Composer, Open Source Advocate

.- The Return of Audiality! --------------------------------.
| Free/Open Source Audio Engine for use in Games or Studio. |
| RT and off-line synth. Scripting. Sample accurate timing. |
`-----------------------------------> http://audiality.org -’
http://olofson.nethttp://www.reologica.se —On Sunday 06 July 2003 00.17, Roger D. Vargas wrote:

I have a doubt about what happnes when sdl updates the screen. I
draw some text with sdl_ttf and blit the resulting surface to the
same location several times, but have noticed that old images are
not erased, producing a mix among new and previous text outputs.
I thought that when sdl updates the screen, any previous image is
replaced by the new one, even if there is nothing (just black
color) in that location. Do I need to erase the place before
blitting new surfaces?

Unless you use alpha blending or colorkeying, blits will completely
replace everything in the rectangular blit area.
Strange, then Im doing something wrong…On Sun, 6 Jul 2003, David Olofson wrote:


Roger D. Vargas
ICQ: 117641572
Linux User: 180787

  • Much to learn you still have *
    Master Yoda, AOTC


Este mensaje ha sido analizado por MailScanner
en busca de virus y otros contenidos peligrosos,
y se considera que est? limpio.

I have a doubt about what happnes when sdl updates the screen. I draw
some text with sdl_ttf and blit the resulting surface to the same
location several times, but have noticed that old images are not erased,
producing a mix among new and previous text outputs.

I think SDL_ttf produces a colorkey surface by default. I’d have to check
to make sure…

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

I have a doubt about what happnes when sdl updates the screen. I draw
some text with sdl_ttf and blit the resulting surface to the same
location several times, but have noticed that old images are not erased,
producing a mix among new and previous text outputs.

I think SDL_ttf produces a colorkey surface by default. I’d have to check
to make sure…
Is that really needed?On Sat, 5 Jul 2003, Sam Lantinga wrote:


Roger D. Vargas
ICQ: 117641572
Linux User: 180787

  • Much to learn you still have *
    Master Yoda, AOTC


Este mensaje ha sido analizado por MailScanner
en busca de virus y otros contenidos peligrosos,
y se considera que est? limpio.

I have a doubt about what happnes when sdl updates the screen. I draw
some text with sdl_ttf and blit the resulting surface to the same
location several times, but have noticed that old images are not erased,
producing a mix among new and previous text outputs.

I think SDL_ttf produces a colorkey surface by default. I’d have to check
to make sure…
Is that really needed?

Yep. Take a look at SDL_ttf.h, it describes the varying flavors of text
rendering available. All of them are used in different contexts.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment> On Sat, 5 Jul 2003, Sam Lantinga wrote: