Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (TipmyPip, AndrewAMD), 911 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
CEGUI Implementation WIP #409216
10/13/12 20:48
10/13/12 20:48
Joined: Jul 2010
Posts: 283
Germany
J
jenGs Offline OP
Member
jenGs  Offline OP
Member
J

Joined: Jul 2010
Posts: 283
Germany
Hi,
Why projects?
- Because it is work in progress.

Why is it not the holy grail of GUI systems?
- Because, at least the d3d9 system of CEGUI is not very fast. For example, lists with many entries, let's say 50, are slow as hell.
- Skinning is annoying
- The editors are a joke, they lack a lot of features and crashes if you look at them too long.

Here is the link to the binaries only:
CEGUI Zip

How to use it:

First step:
You have to copy the DLLs and the datafiles folder in your GS project folder.
Important: You need the datafiles folder - datafiles folder must be in the mainproject folder
Of course you have to copy the headerfiles into your project folder, too.

Second step:
Include the "LCEGUI.h" in your header
Note: you should include it after acknex standart header

Third step:
Call: "void CEGUI_Start(int keyboardLayout, BOOL mouse_visible)"
- KeyboardLayout: 1 = USA; 2 = German
- mouse_visible - is mouse visible at start? It can be changed later
Important - CEGUI_Start does following:
- It inits the cegui system
- It binds the rendering routine to the render_layer function of Lite-C
- It sets the visibility of the CEGUI intern mouse cursor
- It bind's the on_scanmessage function to CEGUI for keyboard input - because directInput is totaly different to CEGUI utf32 codes - I try to fix that
- It bind's on_d3d_lost and on_d3d_reset to the CEGUI system - that prevent's crashing due to resolution changes

Fourth Step:
Now you have to load content from the datafiles folder.
Example:
CEGUI_LoadFont( "DejaVuSans-10.font" ); //loads a font definition from the font folder - you should edit the existig xml files to deactivate automatic font-scaling (it is terrible - not my fault)
CEGUI_LoadLooknFeel( "WindowsLook.scheme" ); //Obvious it loads a Scheme file for the so called look and feel - this example load's a xp-look into the memory - I am working on a nice look at the moment, which I will contribute
CEGUI_SetDefaultMouseMap( "WindowsLoook", "MouseArrow"); // Set's up the default mouse arrow
CEGUI_LoadImageset("icons.imageset"); // Load an imageset into the memory for customized icons, for example. It is not recomended to load images directly.


Mini Tutorial:

Code:
... // start CEGUI

void *rootWindow; //You need void* pointers - but if you look into my header, you recognize that you can just create the windows and change them by using their names it is not recomended
void *tools;

void CEGUI_Event(void *data) //needs the void pointer, because c++ classes are passed
{
    CEGUI_FillWindowEventArgs(data, &windowEventArgs); //Important: lookup which event class is passed in the CEGUI Event-reference
    //the windowEventArgs is pre creaded struct, to help you get your information. Of course you can use your own - look into the "LCEGUI_events" header for more information
}

void createGui()
{
    rootWindow = CEGUI_CreateRootWindow(); //It fills the whole screen_area
    tools = CEGUI_CreateElement(rootWindow, "WindowsLook/FrameWindow", "tools", 0, 0, 0, 0, 0, 138, 0, 192); //please look into the CEGUI reference for infos about positioning x1 - realtive x2 - absolute (if x1 and x2 are set x2 is the offset) y1 - relatice y2 - absolute w1 - realtice w2 - absolute
    //Realitce coordiantes are normalized to 0 - 1. Example: a w1 = 1 mean's the panel is stretched about the whole screen.

    //Events
    CEGUI_BindEvent(tools, "MouseEnter", CEGUI_Event); //Please look into the CEGUI event reference to look up the event names
    
    //properties
    CEGUI_SetProperty(tools, "Alpha", "0.5"); //You can change properties by name, but I created a lot of helper functions to change general properties.
}


Last edited by jenGs; 10/13/12 21:06.
Re: CEGUI Implementation WIP [Re: jenGs] #409292
10/15/12 08:01
10/15/12 08:01
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
This can get quite helpful, I normally hate GUI creation. I only have got 2 suggestions: You could have linked to CEGUI, I didn't know that it existed or what it was, and you could have included one or two examples (and maybe a screenshot wink ).


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: CEGUI Implementation WIP [Re: Superku] #409297
10/15/12 09:38
10/15/12 09:38
Joined: Jul 2010
Posts: 283
Germany
J
jenGs Offline OP
Member
jenGs  Offline OP
Member
J

Joined: Jul 2010
Posts: 283
Germany
I am working on it. The problem is, that Gamestudio is hobby only and during the day I do something totally different.
I will post some examples and the most important links this afternoon.

I will write at least a documentation for every function ....


Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1