speeding up ifsoGUI?

BlitzMax Forums/BlitzMax Programming/speeding up ifsoGUI?

jhans0n(Posted 2010) [#1]
I asked this on the ifsoGUI forum, but then noticed that nobody has posted there since August. So I'll try here:

Are there any tips for making ifsoGUI run faster? I am working on a game, and without ifsoGUI running it is currently about 400 fps. As soon as I put an ifsoGUI panel on my screen with three buttons and two progress bars, it drops to about 230 fps. In the grand scheme of things, this probably doesn't sound that bad, but I have a lot more buttons that I want to add. If I go up to 9 buttons it gets down to 160-ish fps. I haven't tested past that point

It seems like the bulk of the fps hit is coming from the DrawBox routine. Digging through what it's doing in there, it seems that it's doing a lot of calculations to determine how to stretch/tile the images that are used to make up the controls. I'm considering making a "simple button" type where I pre-render the button as an image of the size I want and skip DrawBox altogether, but am hoping there's a better way.


Thareh(Posted 2010) [#2]
Write your own gui :D It's a lot of fun! :D


jhans0n(Posted 2010) [#3]
I've done it before, and disagree on the "lot of fun" part. I just wanted something that I can drop in so I can concentrate on the parts that are more fun for me (the game itself). Plus this one is better than mine.


TaskMaster(Posted 2010) [#4]
I helped jhans0n with this and his program is running quicker now.

I am also rewriting the drawing portion of ifsoGUI to do less texture swapping, which should speed things up considerably. It isn't the drawing calculations that is slow, it is the method being used to draw the resizable gadgets.

Last edited 2010


jhans0n(Posted 2010) [#5]
Yup, TaskMaster is quick on support! Thanks again :)


Corum(Posted 2010) [#6]
@Taskmaster: Any chance to include some titlebar's buttons into the window gadget? ^_^


TaskMaster(Posted 2010) [#7]
Do you want it to be a just a graphic? Or an ifsoGUI button of some sort? If you just want to put some small pics on the titlebar, that is simple.

I would think that you could easily extend the window gadget to draw a couple graphics onto the titlebar during the draw function.


Corum(Posted 2010) [#8]
I'd like to have a feature, by which I can add an arbitrary button on the title bar, placing it as I would, and managing its own event as it was a generic button.
I think you'll agree with me, when I say that a window without fold/close buttons is not so different from a "simple" drag-around frame. :)

Last edited 2010

Last edited 2010


TaskMaster(Posted 2010) [#9]
Very easy to do. One way to do it would be to just extend the window gadget. Call the original draw function, then draw your button.

Or you could create a window_button gadget that is a slave to the window gadget. Have it draw itself on the window gadget and it could check for its own mouse clicks and whatnot. This might be the easiest method, because then you could add any number of buttons to the window. You wouldn't be limited to a set number.


TaskMaster(Posted 2010) [#10]
A little testing...

I have converted the label gadget to drawing with the new method I came up with. I put 51 labels on the screen and it draws at 310 fps with the old method and 440 fps with the new method. So, this should help some.

Now I just need to go through all of the gadgets and make them use the new method.


jhans0n(Posted 2010) [#11]
Sounds awesome! I can't wait to see it. :)


TaskMaster(Posted 2010) [#12]
v1.15 is now available on my website to owners of ifsoGUI.

The new drawing method cuts down on the amount of texture switching happening when drawing the gadgets. In my test apps, it has improved the drawing as much as %25. 10% is fairly common.

The amount it does improve is obviously going to be determined by the amount of gadgets being drawn.


jhans0n(Posted 2010) [#13]
1.15 definitely speeds things up a lot! I got a solid 30-40 fps back on my screen with a panel, 3 image buttons, and 2 progress bars.