Firstly, I don't usually take requests to ICQ people - and in your case, I'm not going to make an exception

(Just a little joke - don't take it personaly or seriously, I used to be on ICQ a lot more, but got bogged down by everyone who thought I was their own personal code monkey

As such, I'm generally not on ICQ that much any more

).
I can't personally integrate the system with your project (see above), since if I started doing this, I'd spend most of my limited free time working on other peoples projects instead of my own
As far as getting the system working with your project... Okay, you have the 0.300 version, so you don't have to deal with the Renderer object (and you don't get alpha blending with this version because of it). Anyway...
Job number one is to compile the system. Add the gui system include folder to your VC++ includes directories list in the main VC++ options dialog (Menu: Tools>Options... Then select: Projects>VC++ Directories).
Since you have one of the supported compilers, all you have to do now is load the solution and hit the build button.
Once that's done, in your own project you'll need add the base system libs directory either to your project (via the project properties) or add them to the library directories lists as you did for the includes above. You'll also need to add the crayzedguibase_d.lib (for debug build) & crayzedguibase.lib (for release build) files to your project via the linker options.
Now you need to add all the Taharez widget files to your project. Just right-click on the project in solution explorer and select add->existing item, select all the .cpp and .h files in Source/TaharezLookDemo/Widgets
I assume that you already have your project running with Direct3D. So now you're ready to roll.
The main include you'll need is the Utils one (at least until you stat adding windows).
Code: Select all
#include "CrayZEdGUIBase/GUILib/Utils.h"
At some stage after you have initialised Direct3D, you need to tell the GUI system which D3DDevice it's supposed to be using, so...
Code: Select all
CEGUI::Utils::setD3DDevice(your3DDevice);
you'll also need to set some render states that the GUI relies on, like this:
Code: Select all
your3DDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_TRUE);
your3DDevice->SetRenderState(D3DRS_ALPHATESTENABLE, true);
your3DDevice->SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_GREATER);
your3DDevice->SetRenderState(D3DRS_ALPHAREF, 0x7F);
Now the rendering side of the system is ready to roll. In order to actually get the syetm to render, you need to add the following between your BeginScene and EndScene calls, typically the GUI is the last thing on screen, so make the call just before EndScene:
Code: Select all
CEGUI::Utils::instance()->renderFullGUI();
Now, since you're using Taharez images, these are loaded as the default by the system. Though you will need to set-up a default font:
Code: Select all
CEGUI::Utils::instance()->getDefaultFont()->createFromOSFont("Arial", 8, 0);
You also need a function to change the cursor for you, the one out of the demos is jus what you need, which is this:
Code: Select all
bool cursorChanger(CEGUI::Utils::Cursor cursor)
{
switch(cursor) {
case Utils::Cursor::SIZING_LEFTRIGHT:
SetCursor(LoadCursor(NULL, IDC_SIZEWE));
break;
case Utils::Cursor::SIZING_UPDOWN:
SetCursor(LoadCursor(NULL, IDC_SIZENS));
break;
case Utils::Cursor::SIZING_NESW:
SetCursor(LoadCursor(NULL, IDC_SIZENESW));
break;
case Utils::Cursor::SIZING_NWSE:
SetCursor(LoadCursor(NULL, IDC_SIZENWSE));
break;
case Utils::Cursor::NORMAL:
SetCursor(LoadCursor(NULL, IDC_ARROW));
break;
case Utils::Cursor::MOVING:
SetCursor(LoadCursor(NULL, IDC_SIZEALL));
break;
case Utils::Cursor::TEXT_BEAM:
SetCursor(LoadCursor(NULL, IDC_IBEAM));
break;
default:
return false;
}
return true;
}
Then you need to tell the GUI system to use this function for changing cursors:
Code: Select all
CEGUI::Utils::instance()->setCursorChangeHandler(cursorChanger);
Now you have to get the root window and 'show' it so that the GUI becomes visible:
Code: Select all
CEGUI::Window* rootWnd = CEGUI::Utils::instance()->getRootWindow();
rootWnd->show();
Then you just add the widgets you need, position them, set their size and what have you.
So, to add a button (for that menu of yours), you'd do this...
add the include:
Code: Select all
CEGUI::MyButton* button = new CEGUI::MyButton;
button->initialise();
CEGUI::Utils::instance()->getRootWindow()->addChildWindow(*button);
button->setPosition(250,100);
button->setSize(300, 24);
button->setText("Start New Game");
button->show();
This adds a new push button, with size 300 x 24 at position 250,100 - with the label 'Start New Game'.
The system also needs to know about inputs. If you're using Win32 messages, the best bet is to use the code out of the demo application as an example. If you're using DirectInput, then the approach is similar, all you're doing is taking the inputs and pumping them into the GUI via the 'CEGUI::Utils:: on<whatever>' methods. So for mouse movements:
Code: Select all
CEGUI::Utils::instance()->onMouseMove(xDelta, yDelta, sysKeys);
'sysKeys' is a flags value that tells the system which of the system keys (like control and shift) were pressed.
This should get you started, by being able to add some widgets to the display. Getting events back out of the system is even more fun

You have to create a command object class derived from CEGUI::Command. This class has a virtual function 'execute' which should be overridden to perform whatever action you want. Then you have to attach this command object to the widget, so for our button example, if you had a command object called 'StartGameHandler' you could do this:
Code: Select all
StartGameHandler* sgh = new StartGameHandler;
button->setClickedCommand(sgh);
This will invoke sgh->execute() whenever the button is clicked.
I have intentionally skipped over some required management you must do - that is, keeping track of all the windows you create, and the command objects. Since when your application shuts down, or whenever you need to clean-up the GUI, you'll need to delete these objects to prevent resource leakage.
This is a big overview of what you need to integrate the system. It seems a lot of stuff you have to do, and some areas are fairly complex. But with this article, the example applications, and some time & patience, you should have all the information needed to get you started.
Hope this helps.
CE.