Jump to content

CEGUI alternatives?


TexelOne
 Share

Recommended Posts

Hi,

 

I've been trying to get CEGUI to work with LE for the past couple of weeks without results. I've carefully followed Laurens' CEGUI tutorial and the turorials on CEGUI's website but it always crashes when loading the scheme:

 

CEGUI::SchemeManager::getSingleton().create("TaharezLook.scheme");

Here's the code:

#include "engine.h"
#include "GL/gl.h"
#include "CEGUI.h"
#include "RendererModules\OpenGL\CEGUIOpenGLRenderer.h"

//SHOW MENU FUNCTION
void showMenu (short int &gState) {
//Create World:
TWorld mnuWorld = CreateWorld();

//Create camera:
TEntity mnuCam = CreateCamera();
MoveEntity(mnuCam, Vec3(0, 0, -10));

//Center and show mouse pointer:
MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2);
ShowMouse();

//Setup CEGUI:
CEGUI::OpenGLRenderer &ceguiRenderer = CEGUI::OpenGLRenderer::create();
CEGUI::System::create(ceguiRenderer); 

ceguiRenderer.enableExtraStateSettings(true); 

CEGUI::DefaultResourceProvider *rp = static_cast<CEGUI::DefaultResourceProvider*>(CEGUI::System::getSingleton().getResourceProvider());

rp->setResourceGroupDirectory("schemes", "Data/GUI/Schemes/");   
rp->setResourceGroupDirectory("imagesets", "Data/GUI/Imagesets/"); 
rp->setResourceGroupDirectory("fonts", "Data/GUI/Fonts/"); 
rp->setResourceGroupDirectory("layouts", "Data/GUI/Layouts/"); 
rp->setResourceGroupDirectory("looknfeels", "Data/GUI/LookNFeel/"); 

CEGUI::Imageset::setDefaultResourceGroup("imagesets"); 
CEGUI::Font::setDefaultResourceGroup("fonts");
CEGUI::Scheme::setDefaultResourceGroup("schemes"); 
CEGUI::WidgetLookManager::setDefaultResourceGroup("looknfeels"); 
CEGUI::WindowManager::setDefaultResourceGroup("layouts"); 

CEGUI::SchemeManager::getSingleton().create("TaharezLook.scheme"); //<---- CRASHES HERE!
CEGUI::FontManager::getSingleton().create( "DejaVuSans-10.font" ); 
CEGUI::System::getSingleton().setDefaultFont("DejaVuSans-10"); 

CEGUI::WindowManager &wm = CEGUI::WindowManager::getSingleton(); 
CEGUI::Window *root = wm.loadWindowLayout("test.layout"); 
CEGUI::System::getSingleton().setGUISheet(root);

//Loop:
while(!KeyHit(KEY_ESCAPE)) 
{
	//Update world:
	UpdateWorld();

	//Render world:
	RenderWorld();

	//Render GUI:
	glPixelStoref(0x806E, 0); 
	glPixelStoref(GL_PACK_ROW_LENGTH, 0); 
	glPixelStoref(GL_UNPACK_ROW_LENGTH, 0); 
		CEGUI::System::getSingleton().renderGUI();

	//Flip buffers:
	Flip();
}

//Cleanup:
FreeEntity(mnuCam);
FreeWorld(mnuWorld);

//Return value:
gState = 0; //Game State value to exit app
return;	
}

Note: I'm using VC++ 2010, LE 2.4 and CEGUI 0.7.2 (precompiled VC++ 2010).

 

 

I've checked and redone everything a zillion times but it's always the same, so I'm thinking about moving on to another GUI.

 

Looking for alternatives to CEGUI, I saw Roland's GUI for his CELL game and the links to download the code and docs here. It seems like a great GUI, but does anyone have an example on how to integrate it with LE in VC++?

 

Thanks!

Press any key to continue...

Link to comment
Share on other sites

CEGUI has really nothing to do with a GUI. It's mostly a renderer as it loads also fonts and renders them, that's something a GUI should NOT do, but a GUI should only tell an existing renderer to draw something with OpenGL commands.

 

It's pretty easy to make a GUI like in Crysis from scratch with LE. You want to keep things simple for the user, so the easier the GUI is, the better.

I've used my own GUI in 2 games so far, so I think it's soon ready to be universal enough to go open source.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

CEGUI has really nothing to do with a GUI. It's mostly a renderer as it loads also fonts and renders them, that's something a GUI should NOT do, but a GUI should only tell an existing renderer to draw something with OpenGL commands.

 

It's pretty easy to make a GUI like in Crysis from scratch with LE. You want to keep things simple for the user, so the easier the GUI is, the better.

I've used my own GUI in 2 games so far, so I think it's soon ready to be universal enough to go open source.

 

Way to not answer a question :)

 

On topic: I wouldn't know about Rolands GUI but if you have not completely given up CEGUI yet, may I please take a look at your CEGUI log file (the entire file, not just the part that is surrounded by "This is important")? May be some clue there as to why the scheme won't load.

 

One thing I can come up with right now is that your working directory is not set correctly in the project settings. It should be set to the same location as where your exe is written to unless you are changing the working directory in code (you're not doing so in the code you posted here).

 

Also note that registering an abstract path does not effect CEGUI. It does its own loading.

 

Cheers!

Link to comment
Share on other sites

Thanks for you replies!

 

@Lumooja:

A simple GUI would suffice, I just need to be able to display buttons, sliders, text boxes and images.

Being able to have a GUI similar to Crysis' (see attachment) would be more than fine!

 

@Laurens:

Here's the full CEGUI Log:

13/09/2010 14:48:29 (Std) 	+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
13/09/2010 14:48:29 (Std) 	+                     Crazy Eddie's GUI System - Event log                    +
13/09/2010 14:48:29 (Std) 	+                          (http://www.cegui.org.uk/)                         +
13/09/2010 14:48:29 (Std) 	+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

13/09/2010 14:48:29 (Std) 	CEGUI::Logger singleton created. (008DF0C0)
13/09/2010 14:48:29 (Std) 	
13/09/2010 14:48:29 (Std) 	********************************************************************************
13/09/2010 14:48:29 (Std) 	* Important:                                                                   *
13/09/2010 14:48:29 (Std) 	*     To get support at the CEGUI forums, you must post _at least_ the section *
13/09/2010 14:48:29 (Std) 	*     of this log file indicated below.  Failure to do this will result in no  *
13/09/2010 14:48:29 (Std) 	*     support being given; please do not waste our time.                       *
13/09/2010 14:48:29 (Std) 	********************************************************************************
13/09/2010 14:48:29 (Std) 	********************************************************************************
13/09/2010 14:48:29 (Std) 	* -------- START OF ESSENTIAL SECTION TO BE POSTED ON THE FORUM       -------- *
13/09/2010 14:48:29 (Std) 	********************************************************************************
13/09/2010 14:48:29 (Std) 	---- Version 0.7.2 (Build: Aug 28 2010 Microsoft Windows MSVC++ 10.0 32 bit) ----
13/09/2010 14:48:29 (Std) 	---- Renderer module is: CEGUI::OpenGLRenderer - Official OpenGL based 2nd generation renderer module.  TextureTarget support enabled via FBO extension. ----
13/09/2010 14:48:29 (Std) 	---- XML Parser module is: CEGUI::ExpatParser - Official expat based parser module for CEGUI ----
13/09/2010 14:48:29 (Std) 	---- Image Codec module is: SILLYImageCodec - Official SILLY based image codec ----
13/09/2010 14:48:29 (Std) 	---- Scripting module is: None ----
13/09/2010 14:48:29 (Std) 	********************************************************************************
13/09/2010 14:48:29 (Std) 	* -------- END OF ESSENTIAL SECTION TO BE POSTED ON THE FORUM         -------- *
13/09/2010 14:48:29 (Std) 	********************************************************************************
13/09/2010 14:48:29 (Std) 	
13/09/2010 14:48:29 (Std) 	---- Begining CEGUI System initialisation ----
13/09/2010 14:48:29 (Std) 	CEGUI::ImagesetManager singleton created (008DF588)
13/09/2010 14:48:29 (Std) 	CEGUI::FontManager singleton created. (008DF738)
13/09/2010 14:48:29 (Std) 	CEGUI::WindowFactoryManager singleton created
13/09/2010 14:48:29 (Std) 	CEGUI::WindowManager singleton created (004C9478)
13/09/2010 14:48:29 (Std) 	CEGUI::SchemeManager singleton created. (008E0668)
13/09/2010 14:48:29 (Std) 	CEGUI::MouseCursor singleton created. (008D5128)
13/09/2010 14:48:29 (Std) 	CEGUI::GlobalEventSet singleton created. (008D5C00)
13/09/2010 14:48:29 (Std) 	CEGUI::AnimationManager singleton created (008D4E18)
13/09/2010 14:48:29 (Std) 	CEGUI::WidgetLookManager singleton created. (004CE3C0)
13/09/2010 14:48:29 (Std) 	CEGUI::WindowRendererManager singleton created (008D8600)
13/09/2010 14:48:29 (Std) 	CEGUI::RenderEffectManager singleton created (004C7988)
13/09/2010 14:48:29 (Std) 	Created WindowFactory for 'DefaultWindow' windows.
13/09/2010 14:48:29 (Std) 	WindowFactory for 'DefaultWindow' windows added. (008D8290)
13/09/2010 14:48:29 (Std) 	Created WindowFactory for 'DragContainer' windows.
13/09/2010 14:48:29 (Std) 	WindowFactory for 'DragContainer' windows added. (008E0830)
13/09/2010 14:48:29 (Std) 	Created WindowFactory for 'ScrolledContainer' windows.
13/09/2010 14:48:29 (Std) 	WindowFactory for 'ScrolledContainer' windows added. (008E4B10)
13/09/2010 14:48:29 (Std) 	Created WindowFactory for 'ClippedContainer' windows.
13/09/2010 14:48:29 (Std) 	WindowFactory for 'ClippedContainer' windows added. (008E4BB8)
13/09/2010 14:48:29 (Std) 	Created WindowFactory for 'CEGUI/Checkbox' windows.
13/09/2010 14:48:29 (Std) 	WindowFactory for 'CEGUI/Checkbox' windows added. (008E6C60)
13/09/2010 14:48:29 (Std) 	Created WindowFactory for 'CEGUI/PushButton' windows.
13/09/2010 14:48:29 (Std) 	WindowFactory for 'CEGUI/PushButton' windows added. (008E6D08)
13/09/2010 14:48:29 (Std) 	Created WindowFactory for 'CEGUI/RadioButton' windows.
13/09/2010 14:48:29 (Std) 	WindowFactory for 'CEGUI/RadioButton' windows added. (008E6DB0)
13/09/2010 14:48:29 (Std) 	Created WindowFactory for 'CEGUI/Combobox' windows.
13/09/2010 14:48:29 (Std) 	WindowFactory for 'CEGUI/Combobox' windows added. (008E6E58)
13/09/2010 14:48:29 (Std) 	Created WindowFactory for 'CEGUI/ComboDropList' windows.
13/09/2010 14:48:29 (Std) 	WindowFactory for 'CEGUI/ComboDropList' windows added. (008E6F00)
13/09/2010 14:48:29 (Std) 	Created WindowFactory for 'CEGUI/Editbox' windows.
13/09/2010 14:48:29 (Std) 	WindowFactory for 'CEGUI/Editbox' windows added. (008E6FA8)
13/09/2010 14:48:29 (Std) 	Created WindowFactory for 'CEGUI/FrameWindow' windows.
13/09/2010 14:48:29 (Std) 	WindowFactory for 'CEGUI/FrameWindow' windows added. (008E7050)
13/09/2010 14:48:29 (Std) 	Created WindowFactory for 'CEGUI/ItemEntry' windows.
13/09/2010 14:48:29 (Std) 	WindowFactory for 'CEGUI/ItemEntry' windows added. (008E70F8)
13/09/2010 14:48:29 (Std) 	Created WindowFactory for 'CEGUI/Listbox' windows.
13/09/2010 14:48:29 (Std) 	WindowFactory for 'CEGUI/Listbox' windows added. (008E71A0)
13/09/2010 14:48:29 (Std) 	Created WindowFactory for 'CEGUI/ListHeader' windows.
13/09/2010 14:48:29 (Std) 	WindowFactory for 'CEGUI/ListHeader' windows added. (008E7248)
13/09/2010 14:48:29 (Std) 	Created WindowFactory for 'CEGUI/ListHeaderSegment' windows.
13/09/2010 14:48:29 (Std) 	WindowFactory for 'CEGUI/ListHeaderSegment' windows added. (008E8378)
13/09/2010 14:48:29 (Std) 	Created WindowFactory for 'CEGUI/Menubar' windows.
13/09/2010 14:48:29 (Std) 	WindowFactory for 'CEGUI/Menubar' windows added. (008E8420)
13/09/2010 14:48:29 (Std) 	Created WindowFactory for 'CEGUI/PopupMenu' windows.
13/09/2010 14:48:29 (Std) 	WindowFactory for 'CEGUI/PopupMenu' windows added. (008E84C8)
13/09/2010 14:48:29 (Std) 	Created WindowFactory for 'CEGUI/MenuItem' windows.
13/09/2010 14:48:29 (Std) 	WindowFactory for 'CEGUI/MenuItem' windows added. (008E8570)
13/09/2010 14:48:29 (Std) 	Created WindowFactory for 'CEGUI/MultiColumnList' windows.
13/09/2010 14:48:29 (Std) 	WindowFactory for 'CEGUI/MultiColumnList' windows added. (008E8618)
13/09/2010 14:48:29 (Std) 	Created WindowFactory for 'CEGUI/MultiLineEditbox' windows.
13/09/2010 14:48:29 (Std) 	WindowFactory for 'CEGUI/MultiLineEditbox' windows added. (008E86C0)
13/09/2010 14:48:29 (Std) 	Created WindowFactory for 'CEGUI/ProgressBar' windows.
13/09/2010 14:48:29 (Std) 	WindowFactory for 'CEGUI/ProgressBar' windows added. (008E8768)
13/09/2010 14:48:29 (Std) 	Created WindowFactory for 'CEGUI/ScrollablePane' windows.
13/09/2010 14:48:29 (Std) 	WindowFactory for 'CEGUI/ScrollablePane' windows added. (008E8810)
13/09/2010 14:48:29 (Std) 	Created WindowFactory for 'CEGUI/Scrollbar' windows.
13/09/2010 14:48:29 (Std) 	WindowFactory for 'CEGUI/Scrollbar' windows added. (008E88B8)
13/09/2010 14:48:29 (Std) 	Created WindowFactory for 'CEGUI/Slider' windows.
13/09/2010 14:48:29 (Std) 	WindowFactory for 'CEGUI/Slider' windows added. (008E8960)
13/09/2010 14:48:29 (Std) 	Created WindowFactory for 'CEGUI/Spinner' windows.
13/09/2010 14:48:29 (Std) 	WindowFactory for 'CEGUI/Spinner' windows added. (008E8A08)
13/09/2010 14:48:29 (Std) 	Created WindowFactory for 'CEGUI/TabButton' windows.
13/09/2010 14:48:29 (Std) 	WindowFactory for 'CEGUI/TabButton' windows added. (008E8AB0)
13/09/2010 14:48:29 (Std) 	Created WindowFactory for 'CEGUI/TabControl' windows.
13/09/2010 14:48:29 (Std) 	WindowFactory for 'CEGUI/TabControl' windows added. (008E8B58)
13/09/2010 14:48:29 (Std) 	Created WindowFactory for 'CEGUI/Thumb' windows.
13/09/2010 14:48:29 (Std) 	WindowFactory for 'CEGUI/Thumb' windows added. (008E8C00)
13/09/2010 14:48:29 (Std) 	Created WindowFactory for 'CEGUI/Titlebar' windows.
13/09/2010 14:48:29 (Std) 	WindowFactory for 'CEGUI/Titlebar' windows added. (008E8CA8)
13/09/2010 14:48:29 (Std) 	Created WindowFactory for 'CEGUI/Tooltip' windows.
13/09/2010 14:48:29 (Std) 	WindowFactory for 'CEGUI/Tooltip' windows added. (008E8D50)
13/09/2010 14:48:29 (Std) 	Created WindowFactory for 'CEGUI/ItemListbox' windows.
13/09/2010 14:48:29 (Std) 	WindowFactory for 'CEGUI/ItemListbox' windows added. (008E8DF8)
13/09/2010 14:48:29 (Std) 	Created WindowFactory for 'CEGUI/GroupBox' windows.
13/09/2010 14:48:29 (Std) 	WindowFactory for 'CEGUI/GroupBox' windows added. (008E8EA0)
13/09/2010 14:48:29 (Std) 	Created WindowFactory for 'CEGUI/Tree' windows.
13/09/2010 14:48:29 (Std) 	WindowFactory for 'CEGUI/Tree' windows added. (008E8F48)
13/09/2010 14:48:29 (Std) 	Created WindowFactory for 'HorizontalLayoutContainer' windows.
13/09/2010 14:48:29 (Std) 	WindowFactory for 'HorizontalLayoutContainer' windows added. (008E8FF0)
13/09/2010 14:48:29 (Std) 	Created WindowFactory for 'VerticalLayoutContainer' windows.
13/09/2010 14:48:29 (Std) 	WindowFactory for 'VerticalLayoutContainer' windows added. (008E9098)
13/09/2010 14:48:29 (Std) 	Created WindowFactory for 'GridLayoutContainer' windows.
13/09/2010 14:48:29 (Std) 	WindowFactory for 'GridLayoutContainer' windows added. (008E9140)
13/09/2010 14:48:29 (Std) 	Window type alias named 'DefaultGUISheet' added for window type 'DefaultWindow'.
13/09/2010 14:48:29 (Std) 	CEGUI::System singleton created. (008DEEE8)
13/09/2010 14:48:29 (Std) 	---- CEGUI System initialisation completed ----
13/09/2010 14:48:29 (Std) 	
13/09/2010 14:48:29 (Std) 	Started creation of Scheme from XML specification:
13/09/2010 14:48:29 (Std) 	---- CEGUI GUIScheme name: TaharezLook
13/09/2010 14:48:29 (Std) 	Started creation of Imageset from XML specification:
13/09/2010 14:48:29 (Std) 	---- CEGUI Imageset name: TaharezLook
13/09/2010 14:48:29 (Std) 	---- Source texture file: TaharezLook.tga in resource group: (Default)

Hope this helps...

 

Thanks again!

post-986-065172900 1284414937_thumb.jpg

Press any key to continue...

Link to comment
Share on other sites

On second thought, the naming should not be a problem. I wondered why it would run flawlessly on my computer in the past using "looknfeels" instead of "looknfeel" but I think I understand now. Consider the following code:

 

rp->setResourceGroupDirectory("looknfeels", "GUI/LookNFeels/"); 

 

This simply maps the string "looknfeels" to a directory path.

 

CEGUI::WidgetLookManager::setDefaultResourceGroup("looknfeels");

 

Sets path where the WidgetLookManager should looks for resources to the path mapped to "looknfeels".

 

Of course these are assumptions but fact remains that I have set the paths to "looknfeels" and CEGUI runs just fine.

 

I am a little to busy at college right now but I will try your code later this week and find out if it crashes on me too.

Link to comment
Share on other sites

Hi Texel,

 

I just ran your code (modified it a little bit to initialize LE and so on) and am afraid to say it crashes on me too but not on the same line. My display driver stops responding on:

 

CEGUI::Window *root = wm.loadWindowLayout("test.layout"); 

 

I then opened up an old sample project I wrote for Shard a while back, copy/pasted your code in and it ran fine. Only difference being it used an slightly older version (0.7.1 for VS2008) of CEGUI and version 2.32R5 of LE.

 

I am afraid that without source access to LE I cannot safely say whether this is a problem caused by the engine or by CEGUI. On the one hand you would say that it is a call to a CEGUI system and as such has nothing to do with LE but on the other hand, the CEGUI user base is so wide, one could reasonably expect loading a predefined layout to work fine or people would have complained already.

 

You can try running the old, 0.7.1 VS2008 binary version of CEGUI I used back when I wrote the tutorial and see if that helps. You can compile your application with the VS2008 binaries if you have VS2008 installed alongside VS2010. You can modify your VS2010 project settings to compile your project using VS2008. I can understand if you do not wish to go through all this trouble but if you do manage to get this working, I would dearly like to know what fixed it.

 

Cheers!

Link to comment
Share on other sites

OK, here are the test results using the code above and LE 2.4:

 

VC++ 2008:

CEGUI 0.7.1 (vc9 precompiled SDK) - Works fine!

CEGUI 0.7.2 (vc9 precompiled SDK) - Works fine! ;)

 

VC++ 2010 (EDIT: updated!):

CEGUI 0.7.2 (vc10 precompiled SDK) - Not working EDIT: Now, for a strange and unknown reason, its also working!!

 

So I'll just switch back to VC++ 2008 (continue using VC++ 2010) and use CEGUI 0.7.2 from now on.

@Laurens: Its not even crashing while loading the layout, as it happened during your test. :)

 

 

Thanks again for your help and comments!

Press any key to continue...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...