]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/contrib/glcanvas/msw/myglcanvas.cpp
compilation fix
[wxWidgets.git] / wxPython / contrib / glcanvas / msw / myglcanvas.cpp
index 0def9dc491c317acb687f065cfca73b83fd176e6..3810b6e2fddd056d1fc3fbbcb34472a8905c5078 100644 (file)
@@ -128,9 +128,9 @@ void wxGLContext::SetColour(const char *colour)
  * wxGLCanvas implementation
  */
 
-IMPLEMENT_CLASS(wxGLCanvas, wxScrolledWindow)
+IMPLEMENT_CLASS(wxGLCanvas, wxWindow)
 
-BEGIN_EVENT_TABLE(wxGLCanvas, wxScrolledWindow)
+BEGIN_EVENT_TABLE(wxGLCanvas, wxWindow)
     EVT_SIZE(wxGLCanvas::OnSize)
     EVT_PALETTE_CHANGED(wxGLCanvas::OnPaletteChanged)
     EVT_QUERY_NEW_PALETTE(wxGLCanvas::OnQueryNewPalette)
@@ -138,7 +138,7 @@ END_EVENT_TABLE()
 
 wxGLCanvas::wxGLCanvas(wxWindow *parent, wxWindowID id,
     const wxPoint& pos, const wxSize& size, long style, const wxString& name,
-    int *attribList, const wxPalette& palette) : wxScrolledWindow()
+    int *attribList, const wxPalette& palette) : wxWindow()
 {
   m_glContext = (wxGLContext*) NULL;
 
@@ -162,7 +162,7 @@ wxGLCanvas::wxGLCanvas( wxWindow *parent,
               const wxGLContext *shared, wxWindowID id,
               const wxPoint& pos, const wxSize& size, long style, const wxString& name,
               int *attribList, const wxPalette& palette )
-  : wxScrolledWindow()
+  : wxWindow()
 {
   m_glContext = (wxGLContext*) NULL;
 
@@ -187,7 +187,7 @@ wxGLCanvas::wxGLCanvas( wxWindow *parent,
 wxGLCanvas::wxGLCanvas( wxWindow *parent, const wxGLCanvas *shared, wxWindowID id,
                         const wxPoint& pos, const wxSize& size, long style, const wxString& name,
                         int *attribList, const wxPalette& palette ):
-  wxScrolledWindow()
+  wxWindow()
 {
   m_glContext = (wxGLContext*) NULL;
 
@@ -525,19 +525,6 @@ void wxGLCanvas::SwapBuffers()
 
 void wxGLCanvas::OnSize(wxSizeEvent& event)
 {
-  int width, height;
-  GetClientSize(& width, & height);
-
-  if (m_glContext)
-  {
-    m_glContext->SetCurrent();
-
-    glViewport(0, 0, (GLint)width, (GLint)height);
-    glMatrixMode(GL_PROJECTION);
-    glLoadIdentity();
-    glFrustum( -1.0, 1.0, -1.0, 1.0, 5.0, 15.0 );
-    glMatrixMode(GL_MODELVIEW);
-  }
 }
 
 void wxGLCanvas::SetCurrent()