Performance
Tips
-
Nesting: Since a changed widget triggers a redraw of itself and all it's parents, often changed
widgets like a drawable panel
shouldn't be nested too deep. The most performing way is to use an EM_COMPONENT_SCENE
and add it directly on the scene.
However this is only necessary for often changed widgets because all widgets are only redrawn if they are changed.
-
Scene type: In your game scene, use an EM_COMPONENT_SCENE and add your
main game component (or widget) directly on the scene. This enables an independent update of the game component.
When no performance is needed or changes are less often - like in the main menu or the credits scene - an EM_WIDGET_SCENE
can be used and has the advantage of having a background
.
-
Transparency: Use of transparent widgets (with set_transparent) with enabled transparency refresh
can be slow, since all transparent widgets (and their parents) will be refreshed every frame.
-
OpenGL: When OpenGL is enabled, often chaning widgets like drawable panels
shouldn't be used. Since every time a widget changes a new OpenGL texture has
to be created, this can slow down the application. Static widgets like labels or seldom changed widgets like buttons are
not a problem.