Crash Using Ogre GUI Renderer and CEGUI

Problems building or running the engine, queries about how to use features etc.
Post Reply
jchmack
Goblin
Posts: 267
Joined: Tue Feb 28, 2006 12:30 pm

Crash Using Ogre GUI Renderer and CEGUI

Post by jchmack »

i am trying to rebuild my engine from the ground up. Before i had Cegui as part of my main game class, this time i am trying to separate it into its own GUI class. Before i had this code which worked fine:

Code: Select all


void game4::InitializeCEGUI()
{
	//create CEGUI
	mGUIRenderer = new CEGUI::OgreCEGUIRenderer(mWindow, Ogre::RENDER_QUEUE_OVERLAY, false, 3000, mSceneMgr);
	mGUISystem = new CEGUI::System(mGUIRenderer);
..........
now i try this very similar code in my new app i get a crash:

Code: Select all


//create CEGUI
	mGUIRenderer = new CEGUI::OgreCEGUIRenderer(mWindow, Ogre::RENDER_QUEUE_OVERLAY, false, 3000, mSceneMgr);
	//if(mGUIRenderer == NULL)
	mGUISystem = new CEGUI::System(mGUIRenderer);

and the crash:

Unhandled exception at 0x7c812a5b in game5.exe: Microsoft C++ exception: CEGUI::GenericException at memory location 0x0013ed28..





if i uncomment the if(mGUIRenderer == NULL) i don't get a crash but of course the system isn't created....... so for some reason "new CEGUI::OgreCEGUIRenderer(mWindow, Ogre::RENDER_QUEUE_OVERLAY, false, 3000, mSceneMgr);" Is returning NULL.

Any ideas?

edit:

im using: 17:34:01: *-*-* Version 1.4.0RC2 (Eihort)
I dont believe a version update will help because i was using the same version of ogre with my older engine and it worked fine.

my new class is very simple:

Code: Select all

#ifndef GUIManager_H
#define GUIManager_H

#include <CEGUI/CEGUIImageset.h>
#include <CEGUI/CEGUISystem.h>
#include <CEGUI/CEGUILogger.h>
#include <CEGUI/CEGUISchemeManager.h>
#include <CEGUI/CEGUIWindowManager.h>
#include <CEGUI/CEGUIWindow.h>
#include <CEGUI/CEGUIPropertyHelper.h>
#include <CEGUI/elements/CEGUICombobox.h>
#include <CEGUI/elements/CEGUIListbox.h>
#include <CEGUI/elements/CEGUIListboxTextItem.h>
#include <CEGUI/elements/CEGUIPushButton.h>
#include <CEGUI/elements/CEGUIScrollbar.h>
#include "OgreCEGUIRenderer.h"
#include "OgreCEGUIResourceProvider.h"

#include "Ogre.h"

class GUIManager
{
public:

	GUIManager();

	void CreateGUIManager(Ogre::RenderWindow* mWindow,Ogre::SceneManager* mSceneMgr,std::map<Ogre::String, Ogre::String> settings);

	CEGUI::OgreCEGUIRenderer*	mGUIRenderer;
	CEGUI::System*				mGUISystem;
	CEGUI::Window*				mEditorGuiSheet;
};

#endif

Code: Select all

#ifndef GUIManager_CPP
#define GUIManager_CPP

#include "GUIManager.h"

GUIManager::GUIManager()
{
	mGUIRenderer = NULL;
	mGUISystem = NULL;
}

void GUIManager::CreateGUIManager(Ogre::RenderWindow* mWindow, Ogre::SceneManager* mSceneMgr,std::map<Ogre::String, Ogre::String> settings)
{
	//create CEGUI
	mGUIRenderer = new CEGUI::OgreCEGUIRenderer(mWindow, Ogre::RENDER_QUEUE_OVERLAY, false, 3000, mSceneMgr);
	mGUISystem = new CEGUI::System(mGUIRenderer);
}
i dont really see a reason for this crash....... its an overly simple class could someone please try and app with this class and see if you can run CreateGUIManager without a crash?

thx in advance to anyone who helps =)[/code]
Last edited by jchmack on Mon Sep 03, 2007 1:23 am, edited 2 times in total.
jchmack
Goblin
Posts: 267
Joined: Tue Feb 28, 2006 12:30 pm

Post by jchmack »

i believe this guy might be having a similar problem:

http://www.cegui.org.uk/phpBB2/viewtopi ... 2594#12594

I am PRETTY SURE that i am initializing mWindow and mSceneMGR fine:

Code: Select all

mWindow = mRoot->initialise(true, WindowName);
mSceneMgr = mRoot->createSceneManager(ST_GENERIC, "NxOgre");

if(mWindow ==	NULL)
	cout << "BAH WINDOW" << endl;
if(mSceneMgr==NULL)
	cout << "BAH Manager" << endl;
i use window and scene manager in many places in my app and it seems to work fine there.
murderv
Greenskin
Posts: 105
Joined: Tue Jun 26, 2007 12:20 pm

Post by murderv »

ive had problems like that. make sure you have all dll's in the same folder. that was my problem =)
jchmack
Goblin
Posts: 267
Joined: Tue Feb 28, 2006 12:30 pm

Post by jchmack »

murderv wrote:ive had problems like that. make sure you have all dll's in the same folder. that was my problem =)
I will double check but i am almost certain i have all the correct dlls including the debug ones for debug mode. Usually when i am missing a DLL I get a crash asking for a Specific one though.
jchmack
Goblin
Posts: 267
Joined: Tue Feb 28, 2006 12:30 pm

Post by jchmack »

sigh i got it..... it was the DLL issue. Thank you tons murderv for the recommendation. I didn't know that if you were missing a DLL it wouldn't always ask for that DLL in specific. I don't know if this is an ogre problem or a CEGUI one but it would be nice if you got an assert saying that your missing the DLL. Well Thx to all who helped =)
Post Reply