http://www.ogre3d.org/wiki/index.php/Wx ... _OGRE_v1.2
Announcing new wxOgre Wiki page
-
Yaniv
- Halfling
- Posts: 65
- Joined: Thu Mar 02, 2006 1:28 am
- Location: Israel
Announcing new wxOgre Wiki page
LowPolyCoop - Join the freedom!
-
jomunoz
- Goblin
- Posts: 228
- Joined: Wed Apr 13, 2005 5:07 pm
- Location: Medellin - Colombia
Re: Announcing new wxOgre Wiki page
Yes it will be useful.
Thanks Yaniv.
-
pxL
- Gremlin
- Posts: 158
- Joined: Fri Oct 07, 2005 11:48 am
- Location: Hilversum, The Netherlands
-
pjcast
- OGRE Retired Team Member

- Posts: 2543
- Joined: Fri Oct 24, 2003 2:53 am
- Location: San Diego, Ca
- x 2
Looks really good.. Though, What lib's should you link against to make this work? Sorry if I missed that part.
Have a question about Input? Video? WGE? Come on over... http://www.wreckedgames.com/forum/
-
Yaniv
- Halfling
- Posts: 65
- Joined: Thu Mar 02, 2006 1:28 am
- Location: Israel
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
LowPolyCoop - Join the freedom!
-
pjcast
- OGRE Retired Team Member

- Posts: 2543
- Joined: Fri Oct 24, 2003 2:53 am
- Location: San Diego, Ca
- x 2
I understand that you list it as a requirement, but what lib's for wxWidget to link to? As, just syaing Ogre, means OgreMain.lib, but I do not know wxWidgets, and I was just looking to get this working under linux (and, there is no wxWidget lib anywhere).
Have a question about Input? Video? WGE? Come on over... http://www.wreckedgames.com/forum/
-
nihilocrat
- Gnoblar
- Posts: 20
- Joined: Thu May 11, 2006 8:18 pm
- Location: Greensboro, NC, USA
-
pjcast
- OGRE Retired Team Member

- Posts: 2543
- Joined: Fri Oct 24, 2003 2:53 am
- Location: San Diego, Ca
- x 2
Well, I have discovered the libs (I think), but still get unresolved externals :/
Have a question about Input? Video? WGE? Come on over... http://www.wreckedgames.com/forum/
-
Yaniv
- Halfling
- Posts: 65
- Joined: Thu Mar 02, 2006 1:28 am
- Location: Israel
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 :/
LowPolyCoop - Join the freedom!
-
pjcast
- OGRE Retired Team Member

- Posts: 2543
- Joined: Fri Oct 24, 2003 2:53 am
- Location: San Diego, Ca
- x 2
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.
Have a question about Input? Video? WGE? Come on over... http://www.wreckedgames.com/forum/
-
Yaniv
- Halfling
- Posts: 65
- Joined: Thu Mar 02, 2006 1:28 am
- Location: Israel
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.
Sorry if it sounds like I'm being lazy, but there are far better tutorials on building wxWidgets than anything I could possibly write here in a few sentences. I don't have time to write a comprehensive tutorial on the matter, plus I don't see a reason to reinvent the wheel here.
If I learnt how to do it from their site, I don't see why anyone else can't.
Have you tries the wiki?
http://www.wxwidgets.org/wiki/index.php ... f_Contents
LowPolyCoop - Join the freedom!
-
Game_Ender
- Ogre Magi
- Posts: 1269
- Joined: Wed May 25, 2005 2:31 am
- Location: Rockville, MD, USA
Linux Update
I have scoured the forums, source code, and web have come up with how to Ogre what it wants out of the GetHandle() function. I must give plenty of credit to this wxWidgets forum thread for showing me how to get the needed information out of the wxWidgets handle. The source plus thisforum thread had the format ogre wanted.
I have updated the wiki but here is the code that does the work:
I don't have the time to test this right now, so I would love to know if it works.
I have updated the wiki but here is the code that does the work:
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;
-
Rodif
- Halfling
- Posts: 46
- Joined: Wed Nov 30, 2005 6:40 pm
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.
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.
-
Tyger
- Gnoblar
- Posts: 22
- Joined: Sun Jun 04, 2006 6:26 pm
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.
I am trying to do something with wxOgre as well, and I will probably be modifying it to run a separate thread for Ogre. Of course, that will have a severe impact on the architecture because Ogre is not thread safe, so any UI interactions will need to be indirect as a message to the Ogre thread to change something.
-
pjcast
- OGRE Retired Team Member

- Posts: 2543
- Joined: Fri Oct 24, 2003 2:53 am
- Location: San Diego, Ca
- x 2
In my little editor (using c#). I have the ogre rendernig done in a seperate thread for continous rendering. However, I use c#'s lock keyword to lock the conatiner class that holds all Ogre structures (root, scenemanager's, etc). And, I leave it up to the plugins (my app has ogre in the main app, the rest of the features are implemented in plugins) to be reponsible for using the lock keywod on the structure whenever they access/modify ogre. Of course, a misbehaving plugin could not use lock, and cause problems.. But, that is just the stance I took.
Of course, for c++, you could replace the lock keyword with mutex's/sephomores/etc depending on need. Messages is one way to do it, but is not the only way
Of course, for c++, you could replace the lock keyword with mutex's/sephomores/etc depending on need. Messages is one way to do it, but is not the only way
Have a question about Input? Video? WGE? Come on over... http://www.wreckedgames.com/forum/
-
Rekk2
- Gnoblar
- Posts: 7
- Joined: Tue Jul 11, 2006 1:43 pm
Hi, my first post here. I compiled ogre 1.2.1 on ubuntu 6.06 amd64 and tried code from wiki for wxwidgets, well it didn't work but it was a nice start.
Did some minor changes to it.
At begining of wxOgre.cpp I added:
and changed:
to:
No when it is created it opens another window for ogre control, but funny thing is that when i resize my wxFrame i see that ogre is picking up his events, like resize..
I create it from my wxFrame with:
Any ideas how to fix this?
Tnx
Did some minor changes to it.
At begining of wxOgre.cpp I added:
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));
I create it from my wxFrame with:
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();
Tnx
-
Yaniv
- Halfling
- Posts: 65
- Joined: Thu Mar 02, 2006 1:28 am
- Location: Israel
I don't know anything about linux window programming... So I wonder if one of the linux gurus will be able to aid you 
LowPolyCoop - Join the freedom!
-
Rekk2
- Gnoblar
- Posts: 7
- Joined: Tue Jul 11, 2006 1:43 pm
-
Game_Ender
- Ogre Magi
- Posts: 1269
- Joined: Wed May 25, 2005 2:31 am
- Location: Rockville, MD, USA
Glad to see someone is getting use out of the code I posted. Am I to understand the code I posted does not work without the "gtk_widget_realize" line? After looking up that function I don't think using it is a good idea. It looks like its supposed to create the GdkWidget for the GtkWidget if it hasn't been created, but wxWidgets is already supposed to do this. So calling this twice might cause problems. Have you tried the original code I posted?
-
Rekk2
- Gnoblar
- Posts: 7
- Joined: Tue Jul 11, 2006 1:43 pm
I added it becouse you can't get XID of widget until it is realized, gtk will not create it until then, with out it i just get segmentation faults, what was excepted.
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.
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.
-
Rekk2
- Gnoblar
- Posts: 7
- Joined: Tue Jul 11, 2006 1:43 pm
-
Game_Ender
- Ogre Magi
- Posts: 1269
- Joined: Wed May 25, 2005 2:31 am
- Location: Rockville, MD, USA
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.
-
Rekk2
- Gnoblar
- Posts: 7
- Joined: Tue Jul 11, 2006 1:43 pm
-
Rekk2
- Gnoblar
- Posts: 7
- Joined: Tue Jul 11, 2006 1:43 pm
It seams that rendering was not done on wxOgre control at all, instead on parent wxFrame. wxControl widget is set to GtkScrolledWindow, and he has no asociated x resource. Now i placed aditional GtkPanel inside it and rendering is done on it.
My problem with resizing is still there, and I'm out of ideas. Help
My problem with resizing is still there, and I'm out of ideas. Help
-
Ceacy
- Halfling
- Posts: 81
- Joined: Sat Jan 29, 2005 5:47 pm
- Location: Paris, France.