Legacy GM [SOLVED]A question about how GMS 1.4 handles graphics

I have noticed something that I don't understand in GMS 1.4 when it comes to the graphics. If I turn off "draw background colour" in the room properties, it becomes apparent that old frames are not being wiped.
echo.png
This doesn't seem like it should be the case, at least from the perspective of someone not well versed in these things. If I turn that feature back on, then you won't see this happening.

1) Does that function actually wipe these "echoes", or is it just hiding that they exist?

2) I'm assuming this redrawing of old frames is not a good thing, so (if that is correct) how do I stop it? I've witnessed it regardless of whether it's me manually drawing something (the above image is textured primitives in the draw end event of an object) or a sprite assigned to an instance i.e Gamemaker drawing it

I thought it might be draw_texture_flush, but it didn't change this happening. So is it something to do with the application surface? And, if so, why doesn't the image get cleared regardless of whether its me or GMS handling it? I can understand the former happening as I'm perhaps unaware of having to clear the surface, but not the latter (given that it still occurs when GMS is drawing)
 
What, precisely, do you expect to be drawn over the old frames when there's no background?
I'd expect there to be nothing.....?

Maybe I didn't communicate well enough that I don't know, but I would have thought it would be cleared every step and that it would just be empty.
 

ophelius

Member
GM doesn't clear the BG, you need at least 1 BG layer which draws over the last frame. Just set one to the color black.

Edit: I suppose it doesn't need to be a BG layer specifically, you can have a tile layer be the base layer, as long as there's no transparent holes after all your layers have been drawn, you won't have that trailing effect
 

TsukaYuriko

☄️
Forum Staff
Moderator
I'd expect there to be nothing.....?

Maybe I didn't communicate well enough that I don't know, but I would have thought it would be cleared every step and that it would just be empty.
There indeed is exactly nothing... at least there is nothing that will overwrite what's already there. :)

This behavior is expected and absolutely intended. The process of drawing a background is what clears it.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
You can actually use this to create some really interesting effects too... Like, if you draw a black rectangle that covers the whole screen with an alpha of say 0.05 every step, then you'll get a trippy "trail" effect that fades out over time. I used it on my One Script Game of Asteroids to create not just trail effects, but a really cool transition effect:



(you can get the game for free here, btw: https://marketplace.yoyogames.com/assets/4454/osg-asteroids )
 
@TsukaYuriko @Nocturne @ophelius
Thanks for the constructive input, and useful tip :)

@Sybok
That would be assuming I understood how drawing the background is making the application surface be "empty", or more precisely, "cleared". I did not know that it does that purpose, or that with it turned off one must presumably clear the application surface somehow. As the manual doesn't address this specifically when talking about the application surface. I guess I need to clear it like any other surface:

surface_set_target(application_surface);
draw_clear_alpha(c_black, 0);

before doing the drawing?

EDIT: Now I understand, and have "fixed" it
 
Top