wxWidgets OSX, Cocoa with Ogre3D

44 views
Skip to first unread message

Nathan Hold

unread,
Jun 19, 2013, 8:29:20 PM6/19/13
to wx-u...@googlegroups.com
Hey all,

So I have been working on integrating Ogre3D with wxWidgets and I have come across a problem. It's a weird program and because it uses both wxWidgets and Ogre3D I have cross-posted this to both Ogre3D and wxWidgets.

First of all I use an advanced ui manager.

Basically if my Ogre3DWindow gets added to an auimanager and that auimanager then updates while the window is docked all the windows disappear.

So the first issue that I think would break it, is that to create an OgreRenderWindow within wxWidgets I must give it the window handle (On OSX, Cocoa) that is an NSView*.

Now, this is the technique I use to do that:

std::string handle;
unsigned long long pointer = (unsigned long long) ((NSView*)GetHandle()); // because 64 bit program
handle = std::to_string(pointer);

Is this correct? (Ogre requires a string and this works with Windows just fine, the only thing that confuses me is I don't think I have a proper definition of an NSView...)

So that gets passed to Ogre with:

#ifdef __WXOSX__
    params["macAPI"] = "cocoa"
    params["macAPICocoaUseNSView"] = "true" // Without this the program crashes without warning
#endif

    params["externalWindowHandle"] = GetOgreHandle();



Here is where I based my wxWidgets class off of.

So with all of that if I just leave it (As on Windows) all of the windows disappear, however if I change it so that after I add the window to the auimanager I float the pane then update then dock it it works fine (Until I do something else that updates the auimaanger)

I have 0 clue where to go from here. The screenshots show it working fine, then what happens if I do anything that updates the auimanager (and then click show all windows)




Screen Shot 2013-06-20 at 10.26.16 AM.png
Screen Shot 2013-06-20 at 10.26.39 AM.png

Nathan Hold

unread,
Jun 25, 2013, 2:41:13 AM6/25/13
to wx-u...@googlegroups.com
I have fixed the bug and edited the Ogre3D wiki to be up to date.


Cheers, for checking this thread out.
Reply all
Reply to author
Forward
0 new messages