• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM [SOLVED] Draw to surface in STEP event or DRAW event?

Greetings,

Is it best to draw to a surface in the step event, and then draw that surface to the screen in the draw event?
or
Is it better to draw to a surface in the draw event, and then draw that surface to the screen in the draw event?

Cheers,
Nathan
 

Simon Gust

Member
I tested it drawing 2048 x 2048 draw_points on a surface

step event:
799ms
807ms
805ms

draw event:
801ms
800ms
795ms

code used:
Code:
//FUNCTIONS START 
    surface_set_target(surf);
    draw_clear_alpha(0, 0);
    for (var i = 0; i < 2048; i++)
    {
        for (var j = 0; j < 2048; j++)
        {
            draw_point(i, j);
        }
    }
    surface_reset_target();
   
//FUNCTIONS END
 
Thanks everyone. Simon, love your tests! As you said, it seems there is only a very minor difference. Perhaps depending on the kind of drawing taking place though, even larger differences might become apparent.
 
Top