Hey, with Resonance, I don't do a whole lot of drawingsurface stuff. I can only think of two places I am using that kind of stuff. But Infinity Bit is pretty much entirely built around it. I knew AGS wasn't really intended for that kind of use, but hell, it's just for fun.
But I'm finding my framerate taking a much bigger hit than I expected. I'm trying to figure out how much of it is due to AGS and how much is due to my approach (I programmed a large portion of the game before I had decided how the game was going to work

)
Basically, I'm drawing onto the backgrounds of 10 different GUIs. Not every loop. Most loops, I'm only drawing one GUI: the one the player is on.
But to do that, I need to take an existing dynamic sprite or create a new one, create a drawing surface from it, draw on the surface, release the surface, and set the background of the GUI to the surface's graphic. Is there some way of doing this better than by doing all of this each loop?
Basically my code looks like this and is run through rep_ex_always (pseudocode):
[code]
function drawFrame(int i){
sprite = DynamicSprite.Create(w, h, false);
DrawingSurface *surface = sprite.GetDrawingSurface();
drawEverything(surface, i); //pass surface on to get all the drawings on it
surface.Release();
gui
.BackgroundGraphic = sprite.Graphic;
}
[/code]
sprite is declared elsewhere so I can manage its memory.
I've tried keeping the sprites and just clearing the drawing surface each loop, but it doesn't provide any noticeable change in framerate.
How do I do this better?