About Store Forum Documentation Contact



Post Reply 
Gui library
Author Message
Seba Offline
Member

Post: #1
Gui library
Hi, I look for cross platform gui library. Any advice what library use? I found wxWidgets, any one use it?
04-25-2011 04:14 PM
Find all posts by this user Quote this message in a reply
siwykon Offline
Member

Post: #2
RE: Gui library
Use MyGUI: http://mygui.info/
04-26-2011 04:01 AM
Find all posts by this user Quote this message in a reply
rndbit Offline
Member

Post: #3
RE: Gui library
For desktop applications i could not find anything better than http://qt.nokia.com
For our game we use http://berkelium.org/
(This post was last modified: 04-26-2011 11:57 AM by rndbit.)
04-26-2011 11:57 AM
Find all posts by this user Quote this message in a reply
zetto Offline
Member

Post: #4
RE: Gui library
Id recommend libRocket.

http://librocket.com/
04-29-2011 02:30 AM
Find all posts by this user Quote this message in a reply
Morto Offline
Member

Post: #5
RE: Gui library
zetto,

have you successfully integrated librocket in esenthel ?? if so can you enlighten us(me at least) ?

thank you.
04-30-2011 02:08 AM
Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #6
RE: Gui library
Just thought I'd mention Awesomium. It is the GUI library being used in Overgrowth. Seems pretty awesome (hence the name).
05-19-2011 08:16 AM
Find all posts by this user Quote this message in a reply
Morto Offline
Member

Post: #7
RE: Gui library
as Anyone been able to integrate a gui lib ? if so can you please provide some code sample ?

Thank you.
05-20-2011 12:58 PM
Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #8
RE: Gui library
I would try to integrate with Awesomium, but I downloaded last night and it doesn't work with VS2010, only 2005 or 2008. I use 2010, so I can't.
05-20-2011 08:38 PM
Find all posts by this user Quote this message in a reply
Morto Offline
Member

Post: #9
RE: Gui library
(05-20-2011 08:38 PM)Driklyn Wrote:  I would try to integrate with Awesomium, but I downloaded last night and it doesn't work with VS2010, only 2005 or 2008. I use 2010, so I can't.

you can try the last post in here http://support.awesomium.com/discussions...tudio-2010


just trying to help grin
05-21-2011 01:16 PM
Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #10
RE: Gui library
Thanks, I'll look into it and try to get it to work...
05-21-2011 08:08 PM
Find all posts by this user Quote this message in a reply
rndbit Offline
Member

Post: #11
RE: Gui library
awesomium is commercial now. try berkelium - works the same way except license is much more friendly.
05-21-2011 09:58 PM
Find all posts by this user Quote this message in a reply
Zervox Offline
Member

Post: #12
RE: Gui library
(05-21-2011 09:58 PM)rndbit Wrote:  awesomium is commercial now. try berkelium - works the same way except license is much more friendly.
Awesomium is free until you earn 100k USD a year there is no problem with that as most indie devs never earns that much money a year on their "companies". and if they do I tend to think they would either A) Move to another professional GUI library or B they upgrade their Awesomium license.

Berkelium enforces copyright notice no matter what, which for some people are a problem, but again it's a choice for whatever needs 'a developer/developers' has/have.
05-21-2011 10:18 PM
Find all posts by this user Quote this message in a reply
Barthap Offline
Member

Post: #13
RE: Gui library
What the berkelium is? Its website is poor, no screenshot, i cant find out what i can do with that. There aren't any screens so why should we use it?
05-22-2011 01:10 PM
Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #14
RE: Gui library
(05-22-2011 01:10 PM)Barthap Wrote:  What the berkelium is? Its website is poor, no screenshot, i cant find out what i can do with that. There aren't any screens so why should we use it?

Exactly. Awesomium is much more appealing since the website is designed much better and actually showcases what it can do. You can tell what it's for in the first few seconds of loading their website, not so with Berkelium, which takes a significant more amount of research to figure out.

That being said, however, Awesomium and Berkelium essentially do the same exact thing: allow you to insert webpages into your game, which you can then use to create a fully functional GUI system. I'm sure there are some differences in terms of what features they support (i.e. JavaScript, Flash, Silverlight), but the core functionality is the same - as far as I can tell.

----------

@rndbit: Since you already have it working, perhaps you would be willing to post a sample of integrating Berkelium within Esenthel?
(This post was last modified: 05-23-2011 04:56 AM by Driklyn.)
05-23-2011 04:53 AM
Find all posts by this user Quote this message in a reply
rndbit Offline
Member

Post: #15
RE: Gui library
hmmm last time i checked awesomium it didnt have free option, or it was very well hidden. this type of licensing move i really like.

regarding website design - well judging from that is just plain wrong, but i admit, adding berkelium to esenthel took quite a bit of research, however i dont know if awesomium makes it easier. i suspect it draws to buffer and programmer has to render that buffer himself - thats what berkelium does. well berkelium has a native support for flash and javascript, since latest stable version uses chromium 8 engine. it may not look too appealing since you have to put chromium runtime to your game folder. good thing is that berkelium can be extended to handle custom uri, letting access of stuff directly from pak. also i had some glitches with input, but all that could be perfectly worked around.

so yeah, overall i agree that awesomium might be better, but for ones who like opensource and compiling their libs themselves - i guess there aint better alternative than berkelium.

@Driklyn:
code isnt of best quality and certainly not of plug&play type. main issues are drawing berkelium buffers on texture (Image) and keyboard input forwarding. Also i use customized berkelium version and code depends on customizations.

keyboard code:
Code:
u32 berkTxtBtns[][3] = {
    { KB_ENTER, 13, 0 },
    { KB_ESC, 27, 0 },
    { KB_DEL, 0x2E, 0 },
    { KB_NPENTER, 13, 0 },
    { KB_BACK, (u32)'\b', 0 }
};

u32 berkSpecBtns[][3] = {
    { KB_TAB, (u32)'\t', 0 }
};

        int mods = Wugi::GetBerkeliuMods();

        static u32 kbRepeatTimeout = 300;
        while(const c8 c = Kb.c())
        {
            kbRepeatTimeout = 300;
            if (c == ' ' || c == 127 || c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z')
                recv->keyEvent(true, mods, c, 0);
            c16 outchars[2] = { c, 0 };
            recv->textEvent(outchars, 1);
            Kb.nextBufferedChar();
        }

        for (u32 i = 0; i < SIZEOF_ARRAY(berkTxtBtns); i++)
        {
            bool bp = Kb.bp((KB_BUTTON)berkTxtBtns[i][0]);
            u32 timeDiff = GetTickCount() - berkTxtBtns[i][2];
            if(bp || (Kb.b((KB_BUTTON)berkTxtBtns[i][0]) && timeDiff > kbRepeatTimeout))
            {
                if(!bp || timeDiff < 100)
                    kbRepeatTimeout = 30;
                else
                    kbRepeatTimeout = 300;

                recv->keyEvent(true, mods, berkTxtBtns[i][1], 0);
                c16 outchars[2] = { berkTxtBtns[i][1], 0 };
                recv->textEvent(outchars, 1);
                berkTxtBtns[i][2] = GetTickCount();
            }
        }

        for (u32 i = 0; i < SIZEOF_ARRAY(berkSpecBtns); i++)
        {
            bool bp = Kb.bp((KB_BUTTON)berkSpecBtns[i][0]);
            u32 timeDiff = GetTickCount() - berkSpecBtns[i][2];
            if(bp || (Kb.b((KB_BUTTON)berkSpecBtns[i][0]) && timeDiff > kbRepeatTimeout))
            {
                if(!bp || timeDiff < 100)
                    kbRepeatTimeout = 30;
                else
                    kbRepeatTimeout = 300;
                recv->keyEvent(true, mods, berkSpecBtns[i][1], 0);
            }
        }
        Kb.eat();

texture painting code:
Code:
void HTMLRenderer::onWidgetPaint( Berkelium::Window *wnd, Berkelium::Widget *wgt, const u8* src, const Berkelium::Rect &srcRect, size_t numCopyRects, const Berkelium::Rect *copyRects, int dx, int dy, const Berkelium::Rect &scrollRect )
{
    WidgetRenderers::iterator i = _widgets.find(wgt);
    if(i != _widgets.end())
    {
        paintOnTexture(((HTMLRenderer::WidgetRenderer*)i->second)->texture, src, srcRect, numCopyRects, copyRects, dx, dy, scrollRect);
    }
}

void HTMLRenderer::onPaint( Berkelium::Window *win, const unsigned char *sourceBuffer, const Berkelium::Rect &sourceBufferRect, size_t numCopyRects, const Berkelium::Rect *copyRects, int dx, int dy, const Berkelium::Rect &scrollRect )
{
    paintOnTexture(_texture, sourceBuffer, sourceBufferRect, numCopyRects, copyRects, dx, dy, scrollRect);
}

void HTMLRenderer::paintOnTexture( Texture* tex, const u8* src, const Berkelium::Rect &srcRect, size_t numCopyRects, const Berkelium::Rect *copyRects, int dx, int dy, const Berkelium::Rect &scrollRect )
{
    u8* texd = tex->buffer;
    u32 tw = tex->width;
    
    // scrolling
    {
        s32 wid = scrollRect.width();
        s32 hig = scrollRect.height();
        s32 top = scrollRect.top();
        s32 left = scrollRect.left();


        if(dy < 0)    // scroll down
        {
            for (int y = -dy; y < hig; y++)
            {
                u32 tb = ((top + y) * tw + left) * 4;
                u32 tb2 = tb + dy * tw * 4;
                memcpy(&texd[tb2], &texd[tb], wid * 4);
            }
        }
        else if(dy > 0)    // scroll up
        {
            for (int y = hig - dy; y > -1; y--)
            {
                u32 tb = ((top + y) * tw + left) * 4;
                u32 tb2 = tb + dy * tw * 4;
                memcpy(&texd[tb2], &texd[tb], wid * 4);
            }
        }

        if(dx != 0)    // scroll
        {
            int subx = dx > 0 ? 0 : -dx;
            for (int y = 0; y < hig; y++)
            {
                u32 tb = ((top + y) * tw + left) * 4;
                u32 tb2 = tb - dx * 4;
                memcpy(&texd[tb], &texd[tb2], wid * 4 - subx);
            }
        }
    }

    // copy new rects
    for(u32 i = 0; i < numCopyRects; i++)
    {
        Berkelium::Rect cr = copyRects[i];
        s32 wid = cr.width();
        s32 hig = cr.height();
        s32 top = cr.top() - srcRect.top();
        s32 left = cr.left() - srcRect.left();

        for(int y = 0; y < hig; y++)
        {
            u32 tb = ((cr.top() + y) * tw + cr.left()) * 4;
            memcpy(&texd[tb], &src[(left + (y + top) * srcRect.width()) * 4], wid * 4);
        }
    }
}

void HTMLRenderer::paintOnTexture(Texture* dest, Texture* src, Berkelium::Rect& srcRect)
{
    for (u32 j = 0; j < srcRect.height() && dest->height > (srcRect.mTop + j); j++)
        memcpy(&dest->buffer[(srcRect.mLeft + (srcRect.mTop + j) * dest->width) * 4], &src->buffer[j * srcRect.mWidth * 4], srcRect.mWidth * 4);
}
05-23-2011 02:26 PM
Find all posts by this user Quote this message in a reply
Post Reply