Hello,
I've added the following code to the osgViewerWX example (with cow.osg),
in order to split the window vertically:
...
attributes[5] = 8;
wxSplitterWindow *m_splitter = new wxSplitterWindow(frame,
wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_LIVE_UPDATE);
wxTextCtrl *m_textctrl = new wxTextCtrl(m_splitter, wxID_ANY,
wxT("Some text"), wxDefaultPosition, wxDefaultSize);
GraphicsWindowWX* gw = new GraphicsWindowWX(m_splitter, wxID_ANY,
wxDefaultPosition, wxSize(width, height), wxSUNKEN_BORDER,
wxT("osgviewerWX"), attributes);
m_splitter->SplitVertically(m_textctrl, gw, 200);
osgViewer::Viewer *viewer = new osgViewer::Viewer;
...
When the window is split is the following way, the blue background
(clearColor?) is shown but not the cow:
* m_splitter->SplitVertically(m_textctrl, gw, 200);
If the window is split in other ways, the cow is drawn properly:
* m_splitter->SplitVertically(m_textctrl, gw, -200);
* m_splitter->SplitVertically(m_textctrl, gw, 0);
* m_splitter->SplitVertically(m_textctrl, gw);
Although the cow isn't shown on screen, the window is repainted
constantly, as checked with the following code in the OnIdle function:
...
float r = float(rand()) / float(RAND_MAX);
float g = float(rand()) / float(RAND_MAX);
float b = float(rand()) / float(RAND_MAX);
_viewer->getCamera()->setClearColor(osg::Vec4(r, g, b, 1));
_viewer->frame();
...
It seems to me that this isn't entirely a wxWidgets problem, as the
wxWidgets-OpenGL examples (eg. the penguin) don't behave like this. I
posted this on the wxWidgets-list as well.
I used:
* OpenSceneGraph 2.3.4;
* wxWidgets 2.8.7;
* Windows XP with VisualStudio 2005;
* Linux with gcc-4.2 works fine.
Thanks in advance,
Reint
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org