
http://www.ogre3d.org/wiki/index.php/Wx ... _OGRE_v1.2
Yes it will be useful.
It's in the begining of the article under requirementspjcast wrote:Looks really good.. Though, What lib's should you link against to make this work? Sorry if I missed that part.
OGRE 1.2 [Dagon]
wxWidgets
It is because you need to get the window handler somehow and every OS has a different type of handlers. There is an #ifdef in the code, it just has to be written by someone who really knows what he's doing in linux/macnihilocrat wrote:I find this sort of odd, seeing as how wxWidgets is cross-platform.WxOgre Wiki wrote: Supports Windows OS only (if somebody was able to get this to work on Linux or MacOS please add your code)
Perhaps bits of the h file need to be rewritten with #ifdef's and such(?)
That is a wxWidgets specific question, there are quite a few libraries to include and code to add. So please refer to their website for tutorials on the matter.pjcast wrote:Well, I have discovered the libs (I think), but still get unresolved externals :/
It builds exactly the same as using wxWidgets normally.pjcast wrote:If there is a wiki article on something, well, it is nice if it tells you how to build the item in question. And, I have looked around at the website, which has ton's of out of date/dead links. So, sorry if I was asking a question you are not able to answer.
Code: Select all
// Create a new parameters list according to compiled OS
Ogre::NameValuePairList params;
String handle;
#ifdef __WXMSW__
handle = Ogre::StringConverter::toString((size_t)((HWND)GetHandle()));
#elif defined(__WXGTK__)
// TODO: Someone test this, you might to use "parentWindowHandle" if this
// does not work. Ogre 1.2 + Linux + GLX platform wants a string of the
// format display:screen:window, which has variable types ulong:uint:ulong.
GdkWindow * window = GetHandle()->window
handle = Ogre::StringConverter::toString((ulong)GDK_WINDOW_XDISPLAY(window));
handle += ":0:";
handle += Ogre::StringConverter::toString((uint)GDK_WINDOW_XID(window));
#else
#error Not supported on this platform.
#endif
params["externalWindowHandle"] = handle;
Heh, I've seen that issue before. The way they solved it was to disable rendering when any modal dialogues were up.Rodif wrote:Btw, i have something very similar to this code. But there is an issue using a timer to render the scene and using modal dialogs. If your scene takes longer to render than the timer takes to fire off, it will make it so modal dialogs never leave their eventloop. I posted something to the wxwindows forums. They basically said 'dont use a timer to do something longer than the timer takes to fire'.
One soultion that im working on now, is to fire off a timer a couple milliseconds after renderoneframe() is called. This allows the modal dialogs eventloop time to shut down after renderoneframe() is callled.
Code: Select all
#include <gdk/gdkx.h>
Code: Select all
GdkWindow * window = GetHandle()->window
handle = Ogre::StringConverter::toString((ulong)GDK_WINDOW_XDISPLAY(window));
handle += ":0:";
handle += Ogre::StringConverter::toString((uint)GDK_WINDOW_XID(window));
Code: Select all
GtkWidget *widget = GetHandle();
gtk_widget_realize(widget);
GdkWindow * window = GetHandle()->window;
handle = Ogre::StringConverter::toString((ulong)GDK_WINDOW_XDISPLAY(window));
handle += ":0:";
handle += Ogre::StringConverter::toString((uint)GDK_WINDOW_XID(window));
Code: Select all
ogre = new wxOgre(this);
wxBoxSizer *sizer = new wxBoxSizer(wxHORIZONTAL);
sizer->Add
( ogre
, 1
, wxEXPAND | wxALL
, 10
)
;
SetSizer(sizer);
sizer->SetSizeHints(this);
ogre->update();
By "ogre" do you mean the Ogre library or the wxOgre widget. Thanks for correcting me on the gtk issue, I don't really have any GTK programming experience. The only way to know about the realize issue it check the wxControl/wxWindow source code to if they do realize the widget.Rekk2 wrote:Now i can manualy set window to any size i wish, but it just dosn't resize. I can see in ogres output he is registering resize events, but it has the same size on the screen.