updated osgviewerWX to remove deprecated calls in wxWidgets 3.x
This commit is contained in:
parent
467baa8c00
commit
a7747972dc
@ -140,7 +140,8 @@ END_EVENT_TABLE()
|
||||
|
||||
OSGCanvas::OSGCanvas(wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos, const wxSize& size, long style, const wxString& name, int *attributes)
|
||||
: wxGLCanvas(parent, id, pos, size, style|wxFULL_REPAINT_ON_RESIZE, name, attributes)
|
||||
: wxGLCanvas(parent, id, attributes, pos, size, style|wxFULL_REPAINT_ON_RESIZE, name)
|
||||
,_context(this)
|
||||
{
|
||||
// default cursor to standard
|
||||
_oldCursor = *wxSTANDARD_CURSOR;
|
||||
@ -150,6 +151,11 @@ OSGCanvas::~OSGCanvas()
|
||||
{
|
||||
}
|
||||
|
||||
void OSGCanvas::SetContextCurrent()
|
||||
{
|
||||
_context.SetCurrent(*this);
|
||||
}
|
||||
|
||||
void OSGCanvas::OnPaint( wxPaintEvent& WXUNUSED(event) )
|
||||
{
|
||||
/* must always be here */
|
||||
@ -158,8 +164,6 @@ void OSGCanvas::OnPaint( wxPaintEvent& WXUNUSED(event) )
|
||||
|
||||
void OSGCanvas::OnSize(wxSizeEvent& event)
|
||||
{
|
||||
// this is also necessary to update the context on some platforms
|
||||
wxGLCanvas::OnSize(event);
|
||||
|
||||
// set GL viewport (not called by wxGLCanvas::OnSize on all platforms...)
|
||||
int width, height;
|
||||
@ -337,7 +341,7 @@ void GraphicsWindowWX::useCursor(bool cursorOn)
|
||||
|
||||
bool GraphicsWindowWX::makeCurrentImplementation()
|
||||
{
|
||||
_canvas->SetCurrent();
|
||||
_canvas->SetContextCurrent();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -38,12 +38,14 @@ public:
|
||||
|
||||
void UseCursor(bool value);
|
||||
|
||||
void SetContextCurrent();
|
||||
private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
osg::ref_ptr<osgViewer::GraphicsWindow> _graphics_window;
|
||||
|
||||
wxCursor _oldCursor;
|
||||
wxGLContext _context;
|
||||
};
|
||||
|
||||
class GraphicsWindowWX : public osgViewer::GraphicsWindow
|
||||
|
Loading…
Reference in New Issue
Block a user