Can I update the wxOgre page?
-
- Gnome
- Posts: 318
- Joined: Wed Jan 18, 2006 7:22 pm
- Location: Montreal, Canada
Can I update the wxOgre page?
Hey, I want to update the wxOgre page.
I know I might sound lame asking for permission to update a wiki page. But I am unsure how I should do it because in one of the threads, the guy updating the tutorials was criticized for leaving older code on the same page. AND AS THERE CURRENTLY ARE 2 wxOgre pages, one for Ogre v1.0 and one for Ogre v1.2, I am wondering about how I can do this? Should I create a new page for Ogre v1.4 and wxWidgets 2.8? Or should I update the v1.2 page?
Also, I fixed a couple of bugs in the v1.2 page. There is no need for manager.h(it was probably came from somebodies engine), wx/aui/aui.h wasn't included, wxFrameManager ----> wxAuiManager.
I know I might sound lame asking for permission to update a wiki page. But I am unsure how I should do it because in one of the threads, the guy updating the tutorials was criticized for leaving older code on the same page. AND AS THERE CURRENTLY ARE 2 wxOgre pages, one for Ogre v1.0 and one for Ogre v1.2, I am wondering about how I can do this? Should I create a new page for Ogre v1.4 and wxWidgets 2.8? Or should I update the v1.2 page?
Also, I fixed a couple of bugs in the v1.2 page. There is no need for manager.h(it was probably came from somebodies engine), wx/aui/aui.h wasn't included, wxFrameManager ----> wxAuiManager.
- sinbad
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
- Contact:
-
- Gnome
- Posts: 318
- Joined: Wed Jan 18, 2006 7:22 pm
- Location: Montreal, Canada
Its all done!
http://www.ogre3d.org/wiki/index.php/Wx ... _OGRE_v1.4
Its on a seperate page, I also added a couple of notes for making it work OIS .
http://www.ogre3d.org/wiki/index.php/Wx ... _OGRE_v1.4
Its on a seperate page, I also added a couple of notes for making it work OIS .
- jacmoe
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
Thanks for doing this, but why on Earth is it on a separate page? 
The wiki should only deal with the current stable Ogre. Which currently means 1.4.
That also means that old Dagon code should be removed everywhere it's to be found.
You can use the history function if you need it.
I will probably delete the page after moving the contents over.

The wiki should only deal with the current stable Ogre. Which currently means 1.4.
That also means that old Dagon code should be removed everywhere it's to be found.
You can use the history function if you need it.
I will probably delete the page after moving the contents over.

/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
-
- Gnome
- Posts: 318
- Joined: Wed Jan 18, 2006 7:22 pm
- Location: Montreal, Canada
- jacmoe
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
No problems! 

/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
- jacmoe
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
Blast!
Now we have tree different wxogre pages..
Grizzley90, I assume your page can be just pasted right on top of the main wxOgre page?
I will then get rid of the other two. (1.2 and 1.4 specific versions).
Now we have tree different wxogre pages..
Grizzley90, I assume your page can be just pasted right on top of the main wxOgre page?
I will then get rid of the other two. (1.2 and 1.4 specific versions).
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
-
- Gnoblar
- Posts: 5
- Joined: Tue Dec 12, 2006 12:25 pm
-
- Gnoblar
- Posts: 5
- Joined: Wed Aug 29, 2007 5:32 pm
Hi!
I'm trying to embed Ogre 1.4.4 in wxWidgets 2.8.5 using this wxOgre and it compiles well but I get an error when it executes the following line:
in void wxOgre::createOgreRenderWindow() which is called in wxOgre constructor. The debugger brings me to this function in window.cpp file:
and in the last line it says *somethink like* this:
I've used the example showed in the wiki with no changes. I'm using:
Windows XP SP2
Visual Studio 2005 Professional Edition with SP1
Ogre 1.4.4
wxWidgets 2.8.5
Can anyone help me, please?
Thank you in advance.
Bye!
I'm trying to embed Ogre 1.4.4 in wxWidgets 2.8.5 using this wxOgre and it compiles well but I get an error when it executes the following line:
Code: Select all
mRenderWindow = Ogre::Root::getSingleton().initialise(false);
Code: Select all
bool wxWindowMSW::HandleActivate(int state,
bool WXUNUSED(minimized),
WXHWND WXUNUSED(activate))
{
wxActivateEvent event(wxEVT_ACTIVATE,
(state == WA_ACTIVE) || (state == WA_CLICKACTIVE),
m_windowId);
event.SetEventObject(this);
return GetEventHandler()->ProcessEvent(event); //THIS LINE FAILS
}
I said 'something like that' because my Visual Studio is in Spanish and I've translated the message as well as I could, so I'm sorry if you don't understand it T_TUncaught exception at 0x00000000 in TestwxOgre.exe: 0xC0000005: Memory access violation reading at 0x00000000.
I've used the example showed in the wiki with no changes. I'm using:
Windows XP SP2
Visual Studio 2005 Professional Edition with SP1
Ogre 1.4.4
wxWidgets 2.8.5
Can anyone help me, please?
Thank you in advance.
Bye!
- pumpkin_zch2u
- Gnoblar
- Posts: 18
- Joined: Thu May 17, 2007 3:01 am
- Location: Harbin, China
-
- Halfling
- Posts: 83
- Joined: Mon Dec 10, 2007 2:51 pm
Compilation errors using wxogre with wxframe
Hi,
I am using wxOgre 1.4 with VS2008, wx2.8.7 and the last sdk-ogre aviable, so far wxOgre compile just with warnings (always the same : warning C4245: 'initializing' : conversion from 'int' to 'const Ogre::UTFString::size_type', signed/unsigned mismatch), but when I combine wxOgre with wxFrame (as child) I get the follow errors:
1>c:\ogresdk\include\ogreutfstring.h(180) : warning C4245: 'initializing' : conversion from 'int' to 'const Ogre::UTFString::size_type', signed/unsigned mismatch
1>c:\wxwidgets\include\wx\app.h(230) : warning C4002: too many actual parameters for macro 'Yield'
1>c:\wxwidgets\include\wx\app.h(230) : error C2059: syntax error : '{'
1>c:\wxwidgets\include\wx\app.h(230) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>c:\wxwidgets\include\wx\app.h(406) : warning C4002: too many actual parameters for macro 'Yield'
1>c:\wxwidgets\include\wx\app.h(406) : error C2059: syntax error : '='
1>c:\wxwidgets\include\wx\app.h(406) : error C2238: unexpected token(s) preceding ';'
1>c:\wxwidgets\include\wx\msw\app.h(38) : warning C4002: too many actual parameters for macro 'Yield'
1>c:\wxwidgets\include\wx\msw\app.h(38) : error C2208: 'bool' : no members defined using this type
I really need to make run wxOgre, so any advice is welcome!!!
I am using wxOgre 1.4 with VS2008, wx2.8.7 and the last sdk-ogre aviable, so far wxOgre compile just with warnings (always the same : warning C4245: 'initializing' : conversion from 'int' to 'const Ogre::UTFString::size_type', signed/unsigned mismatch), but when I combine wxOgre with wxFrame (as child) I get the follow errors:
1>c:\ogresdk\include\ogreutfstring.h(180) : warning C4245: 'initializing' : conversion from 'int' to 'const Ogre::UTFString::size_type', signed/unsigned mismatch
1>c:\wxwidgets\include\wx\app.h(230) : warning C4002: too many actual parameters for macro 'Yield'
1>c:\wxwidgets\include\wx\app.h(230) : error C2059: syntax error : '{'
1>c:\wxwidgets\include\wx\app.h(230) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>c:\wxwidgets\include\wx\app.h(406) : warning C4002: too many actual parameters for macro 'Yield'
1>c:\wxwidgets\include\wx\app.h(406) : error C2059: syntax error : '='
1>c:\wxwidgets\include\wx\app.h(406) : error C2238: unexpected token(s) preceding ';'
1>c:\wxwidgets\include\wx\msw\app.h(38) : warning C4002: too many actual parameters for macro 'Yield'
1>c:\wxwidgets\include\wx\msw\app.h(38) : error C2208: 'bool' : no members defined using this type
I really need to make run wxOgre, so any advice is welcome!!!
-
- Gnoblar
- Posts: 4
- Joined: Sun Jan 20, 2008 4:34 pm
- Location: Italy
Any possibility of a Mac version of wxOgre ?
Hi everyone, i've been trying hard to get wxMac and Ogre working together... and failed
Anyone around managed to get a RenderWindow embedded in a Carbon wxWindow ?
Seems like GetHandle() returns some weird values and the rendering appears on the window titlebar, while MacGetTopLevelWindowRef obviously returns the container ref, not the control one...
am totally stuck now after a week of trial and error... any advice is totally welcome

Anyone around managed to get a RenderWindow embedded in a Carbon wxWindow ?
Seems like GetHandle() returns some weird values and the rendering appears on the window titlebar, while MacGetTopLevelWindowRef obviously returns the container ref, not the control one...
am totally stuck now after a week of trial and error... any advice is totally welcome

-
- Gnoblar
- Posts: 4
- Joined: Sun Jan 20, 2008 4:34 pm
- Location: Italy
seems like posting on ogre forums brings in some luck 
i managed to have some sort of ogre window embedded in wxMac, but it's badly offsetted on top and only resizing the wxWindow a lot it's possible to see something... almost there
if anyone has had this kind of problems and managed to solve it pls pls pls help me

i managed to have some sort of ogre window embedded in wxMac, but it's badly offsetted on top and only resizing the wxWindow a lot it's possible to see something... almost there

if anyone has had this kind of problems and managed to solve it pls pls pls help me

- Kencho
- OGRE Retired Moderator
- Posts: 4011
- Joined: Fri Sep 19, 2003 6:28 pm
- Location: Burgos, Spain
- x 2
- Contact:
-
- Gnoblar
- Posts: 4
- Joined: Sun Jan 20, 2008 4:34 pm
- Location: Italy
Kinda fixed, but now the renderwindow is stuck on bottom/left corner of the main widget and the sizer doesn't automatically resize... apparently ogre renderwindow gets positioned with bottom/left corner at top/left corner of the client region, so i had to shift down the sizer by content height:
In this way the ogre window is shown, but when resizing is stuck on bottom/left of the sizer... but am almost there 
And yes, with buttons and stuff is all fine. Only the renderwindow is misplaced by no reasons apparently
How did you solve it ?
EDIT: removed that awful code and still trying to lock the top/left corner of the renderwindow to the top/left corner of the wxframe... coffee and cigarettes and ready for a all nigher. When i clean the code i add the mac parts to the wiki
Code: Select all
wxRect rect = this->GetClientRect();
wxRect orect = wxOgre->GetRect();
sizer->SetDimension(rect.x, rect.y - orect.height, orect.width, orect.height);

And yes, with buttons and stuff is all fine. Only the renderwindow is misplaced by no reasons apparently

How did you solve it ?

EDIT: removed that awful code and still trying to lock the top/left corner of the renderwindow to the top/left corner of the wxframe... coffee and cigarettes and ready for a all nigher. When i clean the code i add the mac parts to the wiki

- Kencho
- OGRE Retired Moderator
- Posts: 4011
- Joined: Fri Sep 19, 2003 6:28 pm
- Location: Burgos, Spain
- x 2
- Contact:
-
- Gnoblar
- Posts: 4
- Joined: Sun Jan 20, 2008 4:34 pm
- Location: Italy
ok i got it "almost" working ... meaning the ogre window shows correctly in the wxFrame now !
This did the trick, but now each time the window is resized and the OnSize event is called i need to call Layout() to fit the sizer, but as soon as that happens the renderwindow warps on top, again aligned on TOP/LEFT and going up (overwriting the window titlebar)... gah...
EDIT: !!!!!! WORKS !!!! Got Ogre embedded in wx on mac finally ! Now let me clean the code then... can i update the wiki, or should i make a new page for it ?
Code: Select all
sizer = new wxBoxSizer(wxHORIZONTAL);
sizer->Add(wxOgre, 1, wxALIGN_BOTTOM | wxALIGN_LEFT, 1, NULL);
EDIT: !!!!!! WORKS !!!! Got Ogre embedded in wx on mac finally ! Now let me clean the code then... can i update the wiki, or should i make a new page for it ?

- sinbad
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
- Contact:
-
- Gnoblar
- Posts: 1
- Joined: Sat Jan 26, 2008 1:53 am
Great job and please update the wiki page -- then it would provide support for all three major operating systems.pengus wrote:ok i got it "almost" working ... meaning the ogre window shows correctly in the wxFrame now !
This did the trick, but now each time the window is resized and the OnSize event is called i need to call Layout() to fit the sizer, but as soon as that happens the renderwindow warps on top, again aligned on TOP/LEFT and going up (overwriting the window titlebar)... gah...Code: Select all
sizer = new wxBoxSizer(wxHORIZONTAL); sizer->Add(wxOgre, 1, wxALIGN_BOTTOM | wxALIGN_LEFT, 1, NULL);
EDIT: !!!!!! WORKS !!!! Got Ogre embedded in wx on mac finally ! Now let me clean the code then... can i update the wiki, or should i make a new page for it ?
thanks,
Nile
-
- Kobold
- Posts: 30
- Joined: Sat Oct 20, 2007 4:49 am
I'm getting huge amounts of link errors here.
It says in the wiki to link against wxCore/base/aui. So I did by using the following:
Am I missing anything here?
EDIT: fixed by adding BEFORE the call to include "wx/wx.h".
But now the application won't startup, and provides the following error:

Code: Select all
1>------ Build started: Project: StuntzEditor, Configuration: Debug Win32 ------
1>Compiling...
1>main.cpp
1>WxOgre.cpp
1>Generating Code...
1>Linking...
1>wxbase28.lib(wxbase28_vc_custom.dll) : error LNK2005: "public: __thiscall wxString::~wxString(void)" (??1wxString@@QAE@XZ) already defined in WxOgre.obj
1>wxmsw28_core.lib(wxmsw28_core_vc_custom.dll) : error LNK2005: "public: __thiscall wxSize::wxSize(int,int)" (??0wxSize@@QAE@HH@Z) already defined in WxOgre.obj
1>wxbase28ud.lib(wxbase28ud_vc_custom.dll) : error LNK2005: "public: __thiscall wxString::wxString(wchar_t const *)" (c??0wxString@@QAE@PB_W@Z) already defined in WxOgre.obj
1>WxOgre.obj : error LNK2001: unresolved external symbol "protected: static struct wxEventTable const wxWindow::sm_eventTable" (?sm_eventTable@wxWindow@@1UwxEventTable@@B)
1>WxOgre.obj : error LNK2001: unresolved external symbol "class wxPoint const wxDefaultPosition" (?wxDefaultPosition@@3VwxPoint@@B)
1>WxOgre.obj : error LNK2001: unresolved external symbol "class wxSize const wxDefaultSize" (?wxDefaultSize@@3VwxSize@@B)
1>WxOgre.obj : error LNK2001: unresolved external symbol "class wxValidator const wxDefaultValidator" (?wxDefaultValidator@@3VwxValidator@@B)
1>WxOgre.obj : error LNK2001: unresolved external symbol "wchar_t const * const wxControlNameStr" (?wxControlNameStr@@3QB_WB)
1>WxOgre.obj : error LNK2001: unresolved external symbol "public: static unsigned int const wxStringBase::npos" (?npos@wxStringBase@@2IB)
1>WxOgre.obj : error LNK2001: unresolved external symbol "wchar_t const * const wxEmptyString" (?wxEmptyString@@3PB_WB)
1>WxOgre.obj : error LNK2001: unresolved external symbol "private: static int wxWindowBase::ms_lastControlId" (?ms_lastControlId@wxWindowBase@@0HA)
1>WxOgre.obj : error LNK2001: unresolved external symbol "public: static class wxClassInfo wxControl::ms_classInfo" (?ms_classInfo@wxControl@@2VwxClassInfo@@A)
1>WxOgre.obj : error LNK2001: unresolved external symbol "public: static class wxClassInfo * wxClassInfo::sm_first" (?sm_first@wxClassInfo@@2PAV1@A)
1>WxOgre.obj : error LNK2001: unresolved external symbol "int const wxEVT_NULL" (?wxEVT_NULL@@3HB)
1>WxOgre.obj : error LNK2001: unresolved external symbol "int const wxEVT_TIMER" (?wxEVT_TIMER@@3HB)
1>WxOgre.obj : error LNK2001: unresolved external symbol "int const wxEVT_ERASE_BACKGROUND" (?wxEVT_ERASE_BACKGROUND@@3HB)
1>WxOgre.obj : error LNK2001: unresolved external symbol "int const wxEVT_SIZE" (?wxEVT_SIZE@@3HB)
Code: Select all
OgreMain_d.lib
wxbase28.lib
wxmsw28_core.lib
wxmsw28_aui.lib
EDIT: fixed by adding
Code: Select all
#define __GNUWIN32__
#define __WXMSW__
#define WXUSINGDLL
But now the application won't startup, and provides the following error:

-
- Kobold
- Posts: 32
- Joined: Mon Jan 01, 2007 6:30 pm
- Location: France
- Contact:
Troubles using wxOgre and Ubuntu 7.10
edit: now I can compile but it doesn't work more. See here
Hello world
I've got troubles with wxOgre for OGRE v1.4, I'm running Ubuntu 7.10.
Here is my Makefile
I used the code shown here but I've got those compilation errors:
Gtk seems to be the source of the problem... Any idea ?
Thanks for your help.
edit: now I can compile but it doesn't work more. See here
Hello world
I've got troubles with wxOgre for OGRE v1.4, I'm running Ubuntu 7.10.
Here is my Makefile
Code: Select all
## Compiler and linker settings
DEFINES =
LIBS = OGRE gtk+-2.0
CXX = g++
CXXFLAGS = $(shell pkg-config --cflags $(LIBS)) $(shell wx-config --cppflags) $(DEFINES)
LD = g++
LDFLAGS = $(shell pkg-config --libs $(LIBS)) $(shell wx-config --libs)
EXEC = SampleApp
## Compilation and linking occurs here
all: $(EXEC)
SampleApp: wxOgre.o MainFrame.o
$(CXX) -o $@ $^ $(LDFLAGS)
MainFrame.o: wxOgre.h
%.o: %.cpp
$(CXX) -o $@ -c $< $(CXXFLAGS)
## Clean up
clean:
rm -f *.o $(EXEC)
Code: Select all
g++ -o wxOgre.o -c wxOgre.cpp -DOGRE_GUI_gtk -DOGRE_CONFIG_LITTLE_ENDIAN -DPNG_NO_MMX_CODE -I/usr/local/include -I/usr/local/include/OGRE -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__
wxOgre.cpp: In member function «void wxOgre::createOgreRenderWindow(Ogre::RenderSystem*)":
wxOgre.cpp:102: erreur: «GTK_PIZZA" was not declared in this scope
wxOgre.cpp:121: erreur: «GLX_RGBA" was not declared in this scope
wxOgre.cpp:121: erreur: «GLX_DOUBLEBUFFER" was not declared in this scope
wxOgre.cpp:121: erreur: «GLX_DEPTH_SIZE" was not declared in this scope
wxOgre.cpp:121: erreur: «GLX_STENCIL_SIZE" was not declared in this scope
wxOgre.cpp:122: erreur: «glXChooseVisual" was not declared in this scope
make: *** [wxOgre.o] Erreur 1
azmeuk@bulbi:~/Dev/C++/wxogre$
Thanks for your help.
edit: now I can compile but it doesn't work more. See here
-
- Gnoblar
- Posts: 5
- Joined: Mon Oct 20, 2008 9:53 pm
Access to Mouse and Keyboard
I'm trying to implement a FrameListener where the user can interact with wxOgre Frame with the mouse or keyboard, similarly to Ogre's ExampleFrameListener.
Following the wiki page I added the pairs to OIS:
However, the program exits when it tries to create the Keyboard Input Object (last line).
It breaks in the last line of the following code from wx/window:
Do you know what I am doing wrong?
Is this the way the code snippet was supposed to be used?
thanks in advance
Following the wiki page I added the pairs to OIS:
Code: Select all
wxFrameListener( RenderWindow *renderWindow, Camera *camera, SceneNode* object )
: mObject(object), mInputManager(0), mMouse(0), mKeyboard(0)
{
OIS::ParamList pl;
size_t windowHnd = 0;
std::ostringstream windowHndStr;
renderWindow->getCustomAttribute("WINDOW", &windowHnd);
windowHndStr << windowHnd;
pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
pl.insert(std::make_pair(std::string("w32_mouse"), std::string("DISCL_NONEXCLUSIVE")));
pl.insert(std::make_pair(std::string("w32_mouse"), std::string("DISCL_FOREGROUND")));
pl.insert(std::make_pair(std::string("w32_keyboard"), std::string("DISCL_NONEXCLUSIVE")));
pl.insert(std::make_pair(std::string("w32_keyboard"), std::string("DISCL_FOREGROUND")));
mInputManager = OIS::InputManager::createInputSystem( pl );
mKeyboard = static_cast<OIS::Keyboard*>(mInputManager->createInputObject( OIS::OISKeyboard, false ));
}
It breaks in the last line of the following code from wx/window:
Code: Select all
bool wxWindowMSW::HandleActivate(int state,
bool WXUNUSED(minimized),
WXHWND WXUNUSED(activate))
{
wxActivateEvent event(wxEVT_ACTIVATE,
(state == WA_ACTIVE) || (state == WA_CLICKACTIVE),
m_windowId);
event.SetEventObject(this);
return GetEventHandler()->ProcessEvent(event);
}
Is this the way the code snippet was supposed to be used?
thanks in advance
-
- Gnoblar
- Posts: 5
- Joined: Mon Oct 20, 2008 9:53 pm
Managed to fix it
By the way,
I managed to fix the problem.
It seems that the wiki information is a little bit simplistic, so one can easily pass by some details...
In this part:
I was passing the renderwindow to the OIS.
However it is necessary to pass the wxFrame, like this:
where parent is your main frame.
see you
I managed to fix the problem.
It seems that the wiki information is a little bit simplistic, so one can easily pass by some details...
In this part:
Code: Select all
renderWindow->getCustomAttribute("WINDOW", &windowHnd);
windowHndStr << windowHnd;
pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
However it is necessary to pass the wxFrame, like this:
Code: Select all
size_t handle = (size_t)(parent->GetHandle());
windowHndStr << handle;
pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
see you