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 »

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.
User avatar
Kanma
Halfling
Posts: 61
Joined: Sun Feb 22, 2004 3:41 pm
Location: Martigny, Switzerland
Contact:

Post by Kanma »

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).
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

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.
ibrown
Gremlin
Posts: 164
Joined: Wed Aug 18, 2004 6:41 pm
Location: London
Contact:

Re: Ogre Toolbox (Editor)

Post by ibrown »

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
Mr. Turner
Halfling
Posts: 88
Joined: Sun Sep 05, 2004 7:01 pm
Location: Belgium

Post by Mr. Turner »

Thanks. That worked.

I'll post here if I have an alfa version (with scene loading) done.
Mr. Turner
Halfling
Posts: 88
Joined: Sun Sep 05, 2004 7:01 pm
Location: Belgium

Post by Mr. Turner »

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
Mr. Turner
Halfling
Posts: 88
Joined: Sun Sep 05, 2004 7:01 pm
Location: Belgium

move to 1.0

Post by Mr. Turner »

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
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

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