Can I update the wxOgre page?

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
grizzley90
Gnome
Posts: 318
Joined: Wed Jan 18, 2006 7:22 pm
Location: Montreal, Canada

Can I update the wxOgre page?

Post by grizzley90 »

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.
REiNDEeR
Greenskin
Posts: 149
Joined: Sat Apr 14, 2007 1:27 pm

Post by REiNDEeR »

I dont see why not, the wiki has a history system. So if someone wants to take a peek at an older version they can.
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 »

Yeah, go ahead. As long as articles target the current stable version it's fine.
grizzley90
Gnome
Posts: 318
Joined: Wed Jan 18, 2006 7:22 pm
Location: Montreal, Canada

Post by grizzley90 »

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 .
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

Thanks for doing this, but why on Earth is it on a separate page? :o

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. :wink:
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
grizzley90
Gnome
Posts: 318
Joined: Wed Jan 18, 2006 7:22 pm
Location: Montreal, Canada

Post by grizzley90 »

That was my question on the first post... just nobody answered it. Everybody simply said I can do it :D. So I continued with the existing pattern... a new page for each release. Sorry about that.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

No problems! :D
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

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).
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
JorenJoestar7
Gnoblar
Posts: 5
Joined: Tue Dec 12, 2006 12:25 pm

Post by JorenJoestar7 »

What about covering multiple renderwindow under wxWidgets? It will be VERY appreciated by all of us... :D
PadrinatoR
Gnoblar
Posts: 5
Joined: Wed Aug 29, 2007 5:32 pm

Post by PadrinatoR »

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:

Code: Select all

mRenderWindow = Ogre::Root::getSingleton().initialise(false);
in void wxOgre::createOgreRenderWindow() which is called in wxOgre constructor. The debugger brings me to this function in window.cpp file:

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
}
and in the last line it says *somethink like* this:
Uncaught exception at 0x00000000 in TestwxOgre.exe: 0xC0000005: Memory access violation reading at 0x00000000.
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_T

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!
User avatar
Harvest
Halfling
Posts: 42
Joined: Sat Sep 16, 2006 5:24 pm

Post by Harvest »

did you set the compiler flags? In my #defines, I had to add these:
__GNUWIN32__
__WXMSW__
WXUSINGDLL

or I would get exactly your kind of error - maybe this helps ..
User avatar
pumpkin_zch2u
Gnoblar
Posts: 18
Joined: Thu May 17, 2007 3:01 am
Location: Harbin, China

Post by pumpkin_zch2u »

OGRE, it's wonderful!
idhan
Halfling
Posts: 83
Joined: Mon Dec 10, 2007 2:51 pm

Compilation errors using wxogre with wxframe

Post by idhan »

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!!!
pengus
Gnoblar
Posts: 4
Joined: Sun Jan 20, 2008 4:34 pm
Location: Italy

Any possibility of a Mac version of wxOgre ?

Post by pengus »

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 :)
pengus
Gnoblar
Posts: 4
Joined: Sun Jan 20, 2008 4:34 pm
Location: Italy

Post by pengus »

seems like posting on ogre forums brings in some luck :D

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 :D

if anyone has had this kind of problems and managed to solve it pls pls pls help me :)
User avatar
Kencho
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4011
Joined: Fri Sep 19, 2003 6:28 pm
Location: Burgos, Spain
x 2
Contact:

Post by Kencho »

I had a similar problem at first, but was due to the sizers and how I was structuring everything. Does it work fine if you use, say, a button instead of an wxOgre widget?
Image
pengus
Gnoblar
Posts: 4
Joined: Sun Jan 20, 2008 4:34 pm
Location: Italy

Post by pengus »

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:

Code: Select all

wxRect rect = this->GetClientRect();
wxRect orect = wxOgre->GetRect();
sizer->SetDimension(rect.x, rect.y - orect.height, orect.width, orect.height);
In this way the ogre window is shown, but when resizing is stuck on bottom/left of the sizer... but am almost there :D

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

How did you solve it ? :D

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 :)
User avatar
Kencho
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4011
Joined: Fri Sep 19, 2003 6:28 pm
Location: Burgos, Spain
x 2
Contact:

Post by Kencho »

Uhh... can't remember :cry: But seems it's not the same problem. Try adding an extra button and see if it overlaps the render window. I remember I had a very bad time trying to figure why they were overlapping, and the problem was there.
Image
pengus
Gnoblar
Posts: 4
Joined: Sun Jan 20, 2008 4:34 pm
Location: Italy

Post by pengus »

ok i got it "almost" working ... meaning the ogre window shows correctly in the wxFrame now !

Code: Select all

sizer = new wxBoxSizer(wxHORIZONTAL);
sizer->Add(wxOgre, 1, wxALIGN_BOTTOM | wxALIGN_LEFT, 1, NULL);
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 ? :)
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 »

So long as you're not losing any information, go ahead and edit that page.
nile
Gnoblar
Posts: 1
Joined: Sat Jan 26, 2008 1:53 am

Post by nile »

pengus wrote:ok i got it "almost" working ... meaning the ogre window shows correctly in the wxFrame now !

Code: Select all

sizer = new wxBoxSizer(wxHORIZONTAL);
sizer->Add(wxOgre, 1, wxALIGN_BOTTOM | wxALIGN_LEFT, 1, NULL);
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 ? :)
Great job and please update the wiki page -- then it would provide support for all three major operating systems.

thanks,

Nile
dbrock
Kobold
Posts: 30
Joined: Sat Oct 20, 2007 4:49 am

Post by dbrock »

I'm getting huge amounts of link errors here.

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)
It says in the wiki to link against wxCore/base/aui. So I did by using the following:

Code: Select all

OgreMain_d.lib
wxbase28.lib
wxmsw28_core.lib
wxmsw28_aui.lib
Am I missing anything here?

EDIT: fixed by adding

Code: Select all

#define __GNUWIN32__
#define __WXMSW__
#define WXUSINGDLL
BEFORE the call to include "wx/wx.h".

But now the application won't startup, and provides the following error:
Image
azmeuk
Kobold
Posts: 32
Joined: Mon Jan 01, 2007 6:30 pm
Location: France
Contact:

Troubles using wxOgre and Ubuntu 7.10

Post by azmeuk »

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)
I used the code shown here but I've got those compilation errors:

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$ 
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
sprint84
Gnoblar
Posts: 5
Joined: Mon Oct 20, 2008 9:53 pm

Access to Mouse and Keyboard

Post by sprint84 »

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:

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 ));
		
	}
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:

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);
}
Do you know what I am doing wrong?
Is this the way the code snippet was supposed to be used?

thanks in advance
sprint84
Gnoblar
Posts: 5
Joined: Mon Oct 20, 2008 9:53 pm

Managed to fix it

Post by sprint84 »

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:

Code: Select all

	renderWindow->getCustomAttribute("WINDOW", &windowHnd);
	windowHndStr << windowHnd;
	pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str())); 
I was passing the renderwindow to the OIS.
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()));
where parent is your main frame.

see you
Post Reply