const NSOpenGLPixelFormatAttribute defaultAttribs[] =
{
NSOpenGLPFADoubleBuffer,
+ NSOpenGLPFAMinimumPolicy,
+ NSOpenGLPFAColorSize,8,
+ NSOpenGLPFAAlphaSize,0,
+ NSOpenGLPFADepthSize,8,
(NSOpenGLPixelFormatAttribute)nil
};
return false;
[m_glContext setView: win.GetHandle() ];
+ [m_glContext update];
[m_glContext makeCurrentContext];
if ( !m_glFormat )
return false;
- m_macIsUserPane = false ;
+ // m_macIsUserPane = false ;
if ( !wxWindow::Create(parent, id, pos, size, style, name) )
return false;
-
- NSView* sv = (parent->GetHandle() );
-
+/*
NSRect r = wxOSXGetFrameForControl( this, pos , size ) ;
wxNSCustomOpenGLView* v = [[wxNSCustomOpenGLView alloc] initWithFrame:r];
- [sv addSubview:v];
m_peer = new wxWidgetCocoaImpl( this, v );
[v setImplementation:m_peer];
MacPostControlCreate(pos, size) ;
-
+*/
return true;
}
+wxGLCanvas::~wxGLCanvas()
+{
+ if ( m_glFormat )
+ WXGLDestroyPixelFormat(m_glFormat);
+}
+
+
#endif // wxUSE_GLCANVAS