Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / The CEGUI_GDK Project.

Author
Message
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 28th Mar 2011 23:03 Edited at: 2nd Apr 2011 18:54
CEGUI



CEGUI(Crazy Eddies GUI) is a multi-platform GUI system designed for use in games.

You can download it from the link above, or you can try the version attached, it is compiled with DirectX(August 2007) which is the same as DarkGDK. This does not make much difference but might make things easier when you release anything using CEGUI.

I have also included a small class(CEGUI_GDK.h, CEGUI_GDK.cpp) with an example(Main.cpp). This will setup CEGUI for you with just a few commands.


I am thinking about expanding the CEGUI_GDK class to perhaps wrap more of CEGUI, this is why I call it the CEGUI_GDK Project. Although this is not needed for you to create your GUI's it may speed the process up and perhaps provide an easier interface for other users.

So if you wish to add to this class then feel free and post what you have added here.
The main thing that needs doing is a function to poll the keyboard, I will do it when I get around to it unless someone else would like to do it first.

Here is a screenie of a basic button, CEGUI will do almost any widgets you desire for your next big game/app with GDK.



Thanks to Crazy Eddie

Attachments

Login to view attachments
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 29th Mar 2011 12:46 Edited at: 7th Apr 2011 16:10
CEGUI_GDK


The top post in this thread is just to help people get started and then go their own way with CEGUI.

This second post is where you will find updated version of the CEGUI_GDK class. It is still very light and even if you do not want to use it, it will contain some examples of how you create different widgets.

You can contribute to this class by just posting functions you want adding, I will then update the attachment here with the new functionality.

You may also discuss exactly what ths class should/should not do, what are its boundaries etc. Because for everything put in to make CEGUI easier to use, you probably take away a little control.

I have started by adding more schemes and trying to make it so you can change your scheme at the top of your code and the whole look will change automatically. I'm not sure now if this is a good idea or not, seems some schemes have more widgets than others.

Some more widgets made easier with example code, thanks to FERSIS.



Latest example code:





This is the OGRE look.



Code using CEGUI_GDK class:


Attachments

Login to view attachments
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 29th Mar 2011 18:59
Looks awesome, however I've not been able to properly set up a project, I've got some linking errors:



I've created a new project for the main.cpp example file, and I've set the project properties as suggested, as well as added the CEGUI 'lib' and 'include' paths to the VS2008 options, but I haven't been able to run the example, any ideas

Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 29th Mar 2011 19:07 Edited at: 19th Jun 2012 03:06
Looks like you have not added the CEGUI_GDK.cpp and CEGUI_GDK.h files to your project.

I have made a couple of minor alterations to these files, I am about to upload it again now to the top post.

EDIT: Done.

Mr Bigglesworth
16
Years of Service
User Offline
Joined: 4th Mar 2008
Location:
Posted: 29th Mar 2011 19:28
This will be very useful for me, thank you.

I will post later when I try it out, I have to to go to work now
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 30th Mar 2011 01:41
Cool, hope it helps some people, I'm sure it will over time.


Regarding the CEGUI_GDK class, I am planning on adding the following functionality:

A custom file selector - this will list all files in a particular directory and allow you to select one or cancel. I need this to load in models for a obj-dbo converter I wrote a while back.

I will also add the ability to just show the files you are interested in, using the file extensions to filter through the ones you want.

You will be able to add file types to show(.jpg, .obj, .x etc) or show all files.

Red Eye
15
Years of Service
User Offline
Joined: 15th Oct 2008
Location:
Posted: 30th Mar 2011 12:12
Looks nice! What is the fps?

FERSIS
17
Years of Service
User Offline
Joined: 17th May 2006
Location:
Posted: 30th Mar 2011 19:32
Quote: "
Looks nice! What is the fps?
"

CEGUI is pretty fast, this version uses the same DX Device as GDK so there shouldnt be any issue.

I used CEGUI in my last job. (OpenGL renderer though)
Great job Matty.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 30th Mar 2011 19:48
Thanks FERSIS.

Red Eye, if you go to the CEGUI page(link in top post) you will see some demos with fps displayed.

There would no point getting an fps from the example I wrote above as there is not much going on, I never even subscibed events to most of the widgets.

I would presume, like FERSIS said, that this will be pretty well optimised as its been developed over a number of years now.

FERSIS
17
Years of Service
User Offline
Joined: 17th May 2006
Location:
Posted: 30th Mar 2011 21:26 Edited at: 30th Mar 2011 21:28
Added:
- Checkbox
- Combobox //Only works with Taharez
- Listbox //Only works with Taharez, the other schemes are missing images
- Multicolumnlist //Weird crash

(Add this bits on each file)
CEGUI_GDK.h


CEGUI_GDK.cpp


Main.cpp


When i try to add a second text item to the multicolumn list it crashes.
Some of the schemes are missing images, Taharez is the 'official' one i think.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 30th Mar 2011 22:13
Thats awesome FERSIS, great work.

You are in a good position to help out with this class as you know the SDK, I am just starting to learn it so let me know if you think this class should work differently.

The one thing that's giving me headaches right now is the schemes and how they name their images differently or have images missing.
The idea was to be able to change the scheme at any time but that does not seem possible now, well, not without extra work.

The other advantage is that the our class would hide all the image selection stuff from the user, making it slightly easier to setup widgets, although with a little less control.

I would still like to hold on to this feature of the CEGUI_GDK class, there are options I will look at, like having a default scheme/image for each widget which will definitely work if the user selected one fails.

If I can't find a good system then this feature will have to be dropped

Anyway, great work, I almost have a basic file selector set up, looks great with windows scheme, ok with OGRE and just does not work with the other two lol.

Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 30th Mar 2011 23:25
The error was here, you give them both an ID of 0.


If you have any problems, check the log file in the 'bin' folder, this is how I found out what was wrong.

I also notice that we allocate memory for the listbox item:


Not sure whether we should have a command to release these items or inform the user what memory they will have to release themselves?

A few decisions to make I think.

FERSIS
17
Years of Service
User Offline
Joined: 17th May 2006
Location:
Posted: 31st Mar 2011 01:45 Edited at: 31st Mar 2011 01:47
Quote: "
The error was here, you give them both an ID of 0.
"

Yup that was my copy/paste fail.

Quote: "
I also notice that we allocate memory for the listbox item:
"

The function returns the pointer to the textItem so it can be freed later.
Dunno its your project good man. But if you need help just tell me.

For your sanity's sake i would recommend not to wrap the entire CEGUI.
Just the basic stuff with makeElements(...) just like you did.
I choose the ListBoxes because everyone need those!

EDIT: Sorry for my english.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 31st Mar 2011 19:22
Quote: "For your sanity's sake i would recommend not to wrap the entire CEGUI."


I'm not going to, I almost have everything I need for now, I will spend some time soon trying to get all the schemes working with the widgets we have so far.

If anyone needs anything adding then they can add to it and over time the class should become more and more useful

FERSIS
17
Years of Service
User Offline
Joined: 17th May 2006
Location:
Posted: 1st Apr 2011 19:13 Edited at: 1st Apr 2011 19:16
Added basic char injection and editbox

keyCodetable.h


CEGUI_GDK.h


CEGUI_GDK.cpp


Main.cpp


It translates 0-9 and A-Z DarkGDK scancodes to Unicode for CEGUI.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 1st Apr 2011 23:24
This is an amazing contribution FERSIS, thanks alot. I will take a better look tomorrow and add it to the download.

I'm pretty busy until the middle of next week, I will then take a look at the 'scheme' issues. What I need to do is take a good look at the XML files and see how they are put together, I should then have a good idea of what needs doing to fix this issue.

Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 2nd Apr 2011 19:00
Updated second post with new editbox and basic key input, I added basic latency to the key polling, its still not perfect though.

Thanks again FERSIS

Mr Bigglesworth
16
Years of Service
User Offline
Joined: 4th Mar 2008
Location:
Posted: 2nd Apr 2011 23:21 Edited at: 2nd Apr 2011 23:22
I can compile your example, but when I start the application it instantly crashes, I can't make sense of the log, so any help would be appreciated.

Here is the log:
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 2nd Apr 2011 23:41
Here is my log when I run the latest CEGUI_GDK example.



Seems the problem may be on that bottom line:

As my one has an extra step after that.

Have you tried running the simpler example you get in the main download in the top post?

Are you using the version I supplied in the top post?

Are you running on VC++ 2008?

Are you using DirectX 2007(August, the GDK one)?

To be honest I am just starting out with this library, if we can't solve it here you my be better trying the CEGUI forums. First though, if you can't get this working you may want to try the pre-compiled version they supply over on the CEGUI forum, just in case its something I have done wrong when compiling.

FERSIS
17
Years of Service
User Offline
Joined: 17th May 2006
Location:
Posted: 3rd Apr 2011 00:25 Edited at: 3rd Apr 2011 00:57
@Mr Bigglesworth:

Could you post the call stack?

BTW, the lists are correctly working with the Windows Look Scheme ... BUT the background and font color are the same white tone.
Easy fix: Change the background color in WindowsLook.tga.
Real fix:
Mr Bigglesworth
16
Years of Service
User Offline
Joined: 4th Mar 2008
Location:
Posted: 3rd Apr 2011 00:57
I figured out why it was crashing. I am using the DirectX 2010 SDK, as soon as I switched backed to the August 2007 version it worked perfectly fine.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 3rd Apr 2011 01:04 Edited at: 3rd Apr 2011 01:06
Thanks for the tip FERSIS.

@Mr Bigglesworth - if you want to use another DX version then you can download one of the many versions they have compiled over at CEGUI. You can still use the CEGUI_GDK class and examples, they should still work fine. Glad you found the issue.

EDIT: I was thinking about the input latency I added, I think it would work alot better if each key had its own 'lastInput_' value. I will try that when I get some time.

Para _Charlie
17
Years of Service
User Offline
Joined: 31st May 2006
Location: Wisconsin
Posted: 3rd Apr 2011 02:50
Was wondering if we can make buttons that are actually images. Something like setButtonImage(). Where we could paste an image to a button. Reason why I ask is because I've been messing around with an inventory and equipment ui for an rpg and I have been thinking about ways to move images around to button slots within a window, and most windows only work with mouseing over the parent itself without being able to mouse over a child of the parent window. So if the button was the child of the parent window and it was an image then I could retrieve the information of the slot(button) itself and remove/paste a new image to the button and retrieve information of the image in the button to make a information popup in a new window.
Make sense? Lol... confusing I know. Rpgs make my head explode.

Like 30 different TGC products. Cause I get bored easy.
Asus P5Q MB, P3.0 dual core, 8gigs ram, SATA HD, GTX 260
Win 7.
FERSIS
17
Years of Service
User Offline
Joined: 17th May 2006
Location:
Posted: 3rd Apr 2011 03:05 Edited at: 3rd Apr 2011 03:08
@Para_Charlie
You can totally do it.
You can do it from the looknfeel file ,from the layout file and by code.

@Matty
I may be wrong but i think that the second post has the old version of the CEGUI_GDK files.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 3rd Apr 2011 11:59 Edited at: 3rd Apr 2011 11:59
@Para_Charlie - Cant help you much with images as I have not looked into it although here is a link to someone making an RPG with CEGUI:
Summoning Wars

@FERSIS - You were right, sorry about that everyone, the second post should be up to date now.

TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 3rd Apr 2011 19:56
Wow matty, look like you have you hands full with Library Ports for DGDK. I have my reasons for not porting CEGUI to DGDK, but you've done an excellent job.

Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 3rd Apr 2011 20:25
Quote: "look like you have you hands full with Library Ports for DGDK"


Yeah, I'm not going all out on this like the Physics, and I'm not going to the extra trouble of creating a basic interface.

Its got a pretty easy interface anyway, unlike the physics which takes a little math/matrix knowledge as well as some knowledge of the Dark Basic library internals.

We have not really done much, just a few basics to get it setup with some input working.

FERSIS
17
Years of Service
User Offline
Joined: 17th May 2006
Location:
Posted: 4th Apr 2011 00:48 Edited at: 4th Apr 2011 00:53
So it seems we have to inject keys besides characters to get functionality like backspace,delete,etc.
We also have to feed CEGUI with key downs and key ups.

First step:
Added a basic CEGUI Keys table to Keycode_Table.h (Also added the space key lol)


Speaking of interfaces CEGUI's is pretty 'public' and easy to follow.
I think that we only need to do is the key input (Timer,keydown,keyup,etc) and some common stuff like open,save dialogues.
What do you think matty?
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 4th Apr 2011 02:02 Edited at: 4th Apr 2011 15:31
Good stuff FERSIS, I will add this tomorrow, its late here now.

Quote: "I think that we only need to do is the key input (Timer,keydown,keyup,etc) and some common stuff like open,save dialogues."


Completely agree.

As I mentioned earlier, it would be great to have a system were you can change the scheme with no effort, thats the only reason I put in the helper functions to create gadgets(widgets), if I can't get that working then we would not really need those functions.

I have an 'open' dialogue almost complete, its not complicated, I just have had no time to work on this. I will finish it soon.

Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 4th Apr 2011 15:42
Updated second post with new additional code from FERSIS.

FERSIS
17
Years of Service
User Offline
Joined: 17th May 2006
Location:
Posted: 6th Apr 2011 17:43 Edited at: 7th Apr 2011 03:52
I did a quick hack here:
-It injects key up and down events for the last key pressed
-Added some characters ./
-Added keys Cursor Left,Cursor Right,Delete,Backspace
(Everything useful for the EditBox widget)
-Added layout loading (makeRootWindowFromLayout).
The layout file its a xml parsed by CEGUI.

Its possible to check for all keys up and downs, but we have to check the entire key map in each frame.
Thats your call Matty.

Its not the best code solution of the world but i needed a quick hack to use the EditBox widget.
(Im using a modified version in which it injects characters only in the first key down event)


Keycode_Table.h


CEGUI_GDK.h
(Just add this as members)


CEGUI_GDK.cpp
(Only pollKeyboard was changed)
Alex_Peres
AGK Master
14
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 6th Apr 2011 18:39
How to setup this project?

Please explain for dummies.
FERSIS
17
Years of Service
User Offline
Joined: 17th May 2006
Location:
Posted: 6th Apr 2011 22:26
@Alex_Peres Heres the main.cpp comments by Matty:

//-- The CEGUI_GDK object will just setup CEGUI for you with some common
//-- default behavior, it will also handle basic input for you so you
//-- can get started quickly, you may want to re-write alot of this yourself
//-- if you decide to use CEGUI for a game/app.

//-- After setup you will access CEGUI through the CEGUI namespace just as
//-- you would without the CEGUI_GDK wrapper.

//-- For any project you use with CEGUI_GDK you will need to change the
//-- following compiler settings:
//-- Project->(project name)Properties->C/C++->Code Generation->Runtime Library
//-- Change to Multi-threaded(/MT).
//-- Project->(project name)Properties->Debugging->Working Directory
//-- Change to the 'bin' folder containing your dll's.
//-- The 'bin' and 'datafiles' folders should be in the same directory.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 7th Apr 2011 16:20
Second post download is now up to date, includes improved keyboard polling, thanks to FERSIS.

Quote: "Its possible to check for all keys up and downs, but we have to check the entire key map in each frame.
Thats your call Matty."


Whatever works best for now, things can be improved if needed at a later date. I would presume you would only check 'key ups' for keys that are down, maybe a system of keeping track of those keys?

I have not really put any thought into the input as of yet so whatever people add is fine by me. If anyone replaces something which may have negative impacts as well as positive then just add it as an overload leaving the user a choice, perhaps?

Quote: "How to setup this project?"


I will try to put something detailed together if I get time. For now, just tell us how far you have got and what the problem/error is. Even if you don't know where to put everything, just ask, its easier if you have a specific question.

Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 16th Jun 2011 22:55 Edited at: 16th Jun 2011 22:55
I am currently changing a few things to make this a little more organised.

If you have added any widgets or improved anything in any way then let me know so I can put it in before the next update, thanks.

Mireben
15
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 18th Jun 2011 14:50
Hi Matty, it's nice that you work on this project again. Just recently I've been thinking about trying CEGUI but didn't know where to start... I think I'm going to wait for your next version but will certainly try this during the summer.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 18th Jun 2011 15:37
@Mireben - Cool, I should have update in a week or two, I have recently been creating simpler examples so if people want to make a slider they just look at the slider example rather than searching through lots of code, which is the way it is now.

WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 19th Jun 2011 00:23
I was looking at this one some time ago and wondered what had happened. I've not done much lately to require a gui so I didn't have to faff about with WinApi again. Hopefully this will be up and running soon Matty...

Warning! May contain Nuts!
Oster200
13
Years of Service
User Offline
Joined: 21st Jan 2011
Location:
Posted: 19th Jun 2011 19:33 Edited at: 19th Jun 2011 19:34
i dont know if im doing this wrong but i downloaded what u said and since it is a read only i copied it all over to a diffrent all four files and i got this error
i got that code twice and im lost in this whole thing could some one give me instructions how to setup everything please?
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 19th Jun 2011 22:16 Edited at: 19th Jun 2011 22:17
@Oster200 - Not sure what you mean by read only, have you unzipped the file? As far as I know there is nothing read only.

Did you download the files from the first post, second post or both? I think I have it setup so you need to download both. 'CEGUI.h' the main header file for CEGUI, CEGUI_GDK builds on this, be sure your compiler can find all the relevant header files.

Oster200
13
Years of Service
User Offline
Joined: 21st Jan 2011
Location:
Posted: 20th Jun 2011 06:22 Edited at: 20th Jun 2011 06:24
okay so this is what i did in order
1. downloaded the first post u did.
2. i saved it in the visual studio 2008 folder
3. i clicked on CEGUI_GDK.zip.
4. it said extract the files i did then it showed
- CEGUI_GDK.cpp
- CEGUI_GDK.h
- Keycode_Table.h
- Main.cpp
5. i clicked on one and it shows a lock by the .h or .cpp tab. and at the top it says [Read Only]
6. i clicked on all of the files i said above and then since it is a read only i cant click the start button. so i cant really do any thing

all the demos work that is in that zip so i dont know what is wrong

7. downloaded the second post still nothing
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 20th Jun 2011 21:18
I will take a look at this very soon, you might be best waiting for the update as I will provide more information on the setup.

All I can suggest for now is re-downloading and trying again.

Oster200
13
Years of Service
User Offline
Joined: 21st Jan 2011
Location:
Posted: 20th Jun 2011 23:40 Edited at: 20th Jun 2011 23:42
i dont know if this will help or not but under CEGUI_GDK.h when i right click on #include "CEGUI.h" and then click 'Open document "CEGUI.h" it say it cant find it

where on Eddies website did you download it maby i should try from the website.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 21st Jun 2011 01:14 Edited at: 21st Jun 2011 01:14
'CEGUI.h' and the lib files should have all been in the first download in the first post, you will need to tell the compiler where to find these files.

You can get CEGUI from the forum:
http://www.cegui.org.uk/phpBB2/viewtopic.php?f=6&t=5280

Oster200
13
Years of Service
User Offline
Joined: 21st Jan 2011
Location:
Posted: 21st Jun 2011 01:30 Edited at: 21st Jun 2011 04:24
Where do i tell the compiler to find these folders?

and on that website which one did you download there are so many.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 22nd Jun 2011 17:18 Edited at: 22nd Jun 2011 17:20
I think I downloaded:
Crazy Eddie's GUI System 0.7.5 precompiled SDK for MSVC++ 2008 (with SP1) (.zip file)
And then I downloaded the source code and compiled it myself with the same directX version DarkGDK uses.

You tell the compiler where to find stuff here:
Tool->Options->Projects and Solutions->VC++ Directories
You can then tell it where your header files and library files are.

Sorry I took so long getting back to you, been busy with Imposters update

Oster200
13
Years of Service
User Offline
Joined: 21st Jan 2011
Location:
Posted: 22nd Jun 2011 22:46
This is safe right theres no viruses on that file Crazy Eddie's GUI System 0.7.5 precompiled SDK for MSVC++ 2008 (with SP1) (.zip file)Just want to make sure
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 23rd Jun 2011 02:30
I would say its pretty safe.

I must mention though that I think I ran into problems because of the compiler settings that DarkGDK was compiled with, I can't exactly remember what the issue was but CEGUI did not work properly. If you wantt to know more I will try to find the post I made for help on their forums?

I would recommend using what I supplied in the top post, quite a few people on here have got it working.

Oster200
13
Years of Service
User Offline
Joined: 21st Jan 2011
Location:
Posted: 23rd Jun 2011 03:41 Edited at: 23rd Jun 2011 08:07
Alright would the top post be the source code that you compiled


then i will just download the thing from website and then download the source code.

Edit: Dosent Work i just downloaded it from website and it still dosent work ill prob. just delete every thing so you dont have to worry about it any more thanks any way for all the time you put in trying to get this to work for me
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 23rd Jun 2011 19:14
@Oster200 - I am in the middle of changing this around a bit to make it a little easier to get going, although I have a few things on at the moment so I can't say when I will finish.

Maybe check back in a while if you still need it

Login to post a reply

Server time is: 2024-05-04 09:21:45
Your offset time is: 2024-05-04 09:21:45