Ogre Toolbox (Editor)

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
Mr. Turner
Halfling
Posts: 88
Joined: Sun Sep 05, 2004 7:01 pm
Location: Belgium

Ogre Toolbox (Editor)

Post by Mr. Turner » Wed Jan 26, 2005 1:26 pm

Hi,

I'm trying to setup an ogre scene editor package: Ogre Toolbox. I have a basic framework up and running, rendering is ok, but I have difficulties converting between Strings.

I'm using wxWidgets for the GUI. How do I convert between wxString and Ogre::String ?

Or should I just go with CEGui?

[Edit]For the current version check: http://www.ogre3d.org/phpBB2/viewtopic.php?t=8122[/edit]
Last edited by Mr. Turner on Sun Feb 20, 2005 5:34 pm, edited 2 times in total.
0 x

User avatar
Kanma
Halfling
Posts: 61
Joined: Sun Feb 22, 2004 3:41 pm
Location: Martigny, Switzerland
Contact:

Post by Kanma » Wed Jan 26, 2005 1:46 pm

You can convert your Ogre::String (which is in fact a std::string) to a standard null terminated C-string by doing:

Code: Select all

ogreString.c_str();
(and it looks like it is the same for a wxString, according to the documentation of wxWidget)

Both classes are able to use standard null terminated C-strings (as parameters for a lot of their methods, including constructors and assignement operator).
0 x

User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19261
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
Contact:

Post by sinbad » Wed Jan 26, 2005 2:43 pm

Ogre::String is just a std::string - I don't know what wxWidgets uses but I'd be surprised if they didn't have a way to assign between them since std::string is very common.
0 x

ibrown
Gremlin
Posts: 164
Joined: Wed Aug 18, 2004 6:41 pm
Location: London
Contact:

Re: Ogre Toolbox (Editor)

Post by ibrown » Wed Jan 26, 2005 4:21 pm

Mr. Turner wrote:.

I'm using wxWidgets for the GUI. How do I convert between wxString and Ogre::String ?

Or should I just go with CEGui?
wxString can be derived from std::string, but you cannot rely on it being so. It depends on how you configure the wxWidgets build. Still, converting between the two types of string is pretty trivial:

wxString wx_string(ogre_string.c_str());

or

wx_string = ogre_string.c_str();

where ogre_string is an Ogre::String object.

For what you are doing, wxWidgets is a far better choice than CEGUI. CEGUI is great - but it's application is in-game stuff rather than for full blown design tools.

Ian
0 x

Mr. Turner
Halfling
Posts: 88
Joined: Sun Sep 05, 2004 7:01 pm
Location: Belgium

Post by Mr. Turner » Thu Jan 27, 2005 3:33 pm

Thanks. That worked.

I'll post here if I have an alfa version (with scene loading) done.
0 x

Mr. Turner
Halfling
Posts: 88
Joined: Sun Sep 05, 2004 7:01 pm
Location: Belgium

Post by Mr. Turner » Sat Jan 29, 2005 12:33 pm

I've updated the screenshot. Now selection of objects is in place and I've also implanted the option viewing grid.

Could anyone send me some larger scene files with lights, scenenodes,...?

I just want to test my scene loading a bit further and add more commonly used options to it.

Thanks
0 x

Mr. Turner
Halfling
Posts: 88
Joined: Sun Sep 05, 2004 7:01 pm
Location: Belgium

move to 1.0

Post by Mr. Turner » Sun Feb 06, 2005 1:58 pm

Hi,


I'm making the move to Ogre 1.0 CVS-HEAD, but I'm having trouble converting this Code:

Code: Select all

      mRoot->showConfigDialog();

		// Render system + external handle.
		mRSys = mRoot->getRenderSystem();
		D3D9RenderSystem *rsys = (D3D9RenderSystem *)mRSys;
      rsys->SetExternalWindowHandle(handle);
        
		// Root and Scene.
      mWnd = mRoot->initialise(true);
      mScene = mRoot->getSceneManager(ST_GENERIC);
handle is a HWND that I got from a wxWidget. This code works in Ogre 0.15.2, but not in 1.0 CVS-HEAD.

It crashes at the setexternalwindowhandle. No error in the ogre.log .
If I comment it out, it does everything except now it's in its own window instead of in the wxWidget.

I've read that the setexternalwindowhandle has been changed into a parameter-like system, but I always get errors.

Mr. Turner
0 x

User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19261
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
Contact:

Post by sinbad » Sun Feb 06, 2005 5:22 pm

Please read the Azathoth porting notes on the wiki, there is a specific mention about SetExternalWindowHandle.
0 x

Post Reply