Looking for ingame gui lib

Blitz3D Forums/Blitz3D Userlibs/Looking for ingame gui lib

Ferret(Posted 2010) [#1]
Hi,

Wich is the fastest free gui lib?
I want to use it for ingame menus.


Ferret(Posted 2010) [#2]
I just tryed NGUI, its a nice lib but slow.

Mi framerate drops from 1800 to 300 with 3 windows open and nothing else renderd.


Yasha(Posted 2010) [#3]
This depends enormously on whether your app uses 3D graphics or is purely 2D. 2D drawing over 3D is extremely slow, so if you're using a 3D scene, for maximum performance you'll need a GUI lib that uses 2D-in-3D (i.e. quad meshes) rather than 2D drawing. (If you're new to the concept of 2D-in-3D, it may seem counterintuitive but it really is many times faster than the pixel-based alternative.)

NGUI uses 2D drawing, so if you're trying to integrate it with a 3D scene this is probably not the fastest solution.

Offhand the only 2D-in-3D solution I can think of is Escape 3D (at the bottom of the page - the one at the top is pure 2D). There may be a couple of other good ones in the toolbox. If your needs are very simple, you could also try building only the components you need out of a generic 2D-in-3D drawing library such as Draw3D.


Ferret(Posted 2010) [#4]
I just tested DevilGui and its much faster.

Escape 3D looks promising but when i click the download link i go to an empty page.

Thx for the info


Pinete(Posted 2010) [#5]
Maybe I can recommend the GUI libs of Spritecandy.. Very customizable, fast and complete enough.. take a look..


Rroff(Posted 2010) [#6]
For 2D rendering of GUIs (with some slight issues mainly to do with input) you can massively speed them up by only updating the UI say 30 times a second instead of every frame and rendering the output to an image buffer and drawing that buffer every frame.

I use BCF like this in my projects (heavily modified) for a 25x speed up over the stock source code.


Ferret(Posted 2010) [#7]
All good libs, i decided to buy BCF.
I did notice a slowdown when using inputboxes.

Now, how do i render the output to an image buffer?

25x speed up sounds good :), anything else you did to achieve this?


Yasha(Posted 2010) [#8]
...

Local drawBCFThisFrame, BCFBuffer=CreateImage(GraphicsWidth(),GraphicsHeight())

While ...
    ...
    
    If drawBCFThisFrame
        Cls
        BCF_RenderBCF
        CopyRect 0,0,GraphicsWidth(),GraphicsHeight(),0,0,BackBuffer(),ImageBuffer(BCFBuffer)
    EndIf
    drawBCFThisFrame = Not drawBCFThisFrame

    ... 3D Graphics afterwards ...

    DrawImage BCFBuffer,0,0
    Flip

    ...
Wend

...


...untested, but maybe? The idea of rendering BCF before the game scene being to take advantage of the background as an image mask colour.


Rroff(Posted 2010) [#9]
The main speed up comes from doing something very similiar to what yasha posted... unfortunatly this does leave an issue with input (key presses, etc. can leave the buffer between UI updates and never be actioned in the UI and so on) which require a bit of special case handling - as a hack you can force a UI update every time a keyboard or mouse input is detected but depending on situation this could make your game choppy.

The rest of the speed up comes from porting some functions to using features of fastext especially image resizing and rewriting some of the bottlenecks like where its walking long arrays of objects to find one bit of data with more optimal methods such as linked lists.


Ferret(Posted 2010) [#10]
Thank you!

I'm using BCF and Draw3D.
Also playing with Fastext, looks like a winner :)


Leon Drake(Posted 2010) [#11]
I personally like GUIw512, but the help docs are in Russian, thank you google translate.