/////////////////////////////////////////////////////////////////////////////
// Name: glcanvas.cpp
-// Purpose: wxGLCanvas, for using OpenGL with wxWindows under Macintosh
+// Purpose: wxGLCanvas, for using OpenGL with wxWidgets under Macintosh
// Author: Stefan Csomor
// Modified by:
// Created: 1998-01-01
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
-#pragma implementation "glcanvas.h"
-#endif
-
#include "wx/wxprec.h"
#if defined(__BORLANDC__)
#pragma hdrstop
#endif
-#include "wx/setup.h"
-
#if wxUSE_GLCANVAS
#ifndef WX_PRECOMP
{
m_window = win;
- m_drawable = (AGLDrawable) UMAGetWindowPort(MAC_WXHWND(win->MacGetRootWindow()));
+ m_drawable = (AGLDrawable) UMAGetWindowPort(MAC_WXHWND(win->MacGetTopLevelWindowRef()));
m_glContext = aglCreateContext(fmt, other ? other->m_glContext : NULL);
wxCHECK_RET( m_glContext, wxT("Couldn't create OpenGl context") );
const wxPoint& pos, const wxSize& size, long style, const wxString& name,
int *attribList, const wxPalette& palette)
{
+ m_macCanvasIsShown = false ;
+ m_glContext = 0 ;
wxWindow::Create( parent, id, pos, size, style, name );
AGLPixelFormat fmt = ChoosePixelFormat(attribList);
int width, height;
GetClientSize(& width, & height);
Rect bounds ;
- GetWindowPortBounds( MAC_WXHWND(MacGetRootWindow()) , &bounds ) ;
+ GetWindowPortBounds( MAC_WXHWND(MacGetTopLevelWindowRef()) , &bounds ) ;
GLint parms[4] ;
parms[0] = x ;
parms[1] = bounds.bottom - bounds.top - ( y + height ) ;
{
if ( !wxWindow::Show( show ) )
return FALSE ;
-
+/*
if ( !show )
{
if ( m_macCanvasIsShown )
}
else
{
- if ( MacIsReallyShown() && !m_macCanvasIsShown )
+ if ( m_peer->IsVisible()&& !m_macCanvasIsShown )
{
m_macCanvasIsShown = true ;
SetViewport() ;
}
}
+*/
return TRUE ;
}
-void wxGLCanvas::MacSuperShown( bool show )
+void wxGLCanvas::MacVisibilityChanged()
{
- if ( !show )
+ if ( !MacIsReallyShown() )
{
if ( m_macCanvasIsShown )
{
}
else
{
- if ( MacIsReallyShown() && !m_macCanvasIsShown )
+ if ( !m_macCanvasIsShown )
{
m_macCanvasIsShown = true ;
SetViewport() ;
}
}
-
- wxWindow::MacSuperShown( show ) ;
+ wxWindowMac::MacVisibilityChanged() ;
}
//---------------------------------------------------------------------------