X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d5f46cddf12e131312240cf64e2dda084b07207d..71a09c3579dd5cb4cd8fa7fdc143561cbff74e12:/src/osx/iphone/glcanvas.mm diff --git a/src/osx/iphone/glcanvas.mm b/src/osx/iphone/glcanvas.mm index ca71c5bda3..9883f9f0e3 100644 --- a/src/osx/iphone/glcanvas.mm +++ b/src/osx/iphone/glcanvas.mm @@ -4,7 +4,6 @@ // Author: Stefan Csomor // Modified by: // Created: 1998-01-01 -// RCS-ID: $Id: glcanvas.cpp 54129 2008-06-11 19:30:52Z SC $ // Copyright: (c) Stefan Csomor // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// @@ -142,15 +141,13 @@ - (void) setContext:(EAGLContext*) ctx { context = ctx; [EAGLContext setCurrentContext:ctx]; -#if 0 - CGRect newRect = [self frame]; - if ( /* (CGRectEqualToRect(newRect, oldRect) == NO && ![self isHidden] && newRect.size.width > 0 && newRect.size.height > 0 ) - || */ viewFramebuffer == 0 ) + + if ( viewFramebuffer == 0 ) { [self destroyFramebuffer]; [self createFramebuffer]; } -#endif + glBindFramebufferOES(GL_FRAMEBUFFER_OES, viewFramebuffer); } @@ -382,7 +379,7 @@ bool wxGLCanvas::Create(wxWindow *parent, return false; */ #if USE_SEPARATE_VIEW - m_macIsUserPane = false ; + DontCreatePeer(); #endif if ( !wxWindow::Create(parent, id, pos, size, style, name) ) @@ -397,7 +394,7 @@ bool wxGLCanvas::Create(wxWindow *parent, [NSNumber numberWithBool:NO], kEAGLDrawablePropertyRetainedBacking, kEAGLColorFormatRGBA8, kEAGLDrawablePropertyColorFormat, nil]; - m_peer = new wxWidgetIPhoneImpl( this, v ); + SetPeer(new wxWidgetIPhoneImpl( this, v )); MacPostControlCreate(pos, size) ; #endif @@ -415,7 +412,7 @@ bool wxGLCanvas::SwapBuffers() WXGLContext context = WXGLGetCurrentContext(); wxCHECK_MSG(context, false, wxT("should have current context")); - wxUICustomOpenGLView* v = (wxUICustomOpenGLView*) m_peer->GetWXWidget(); + wxUICustomOpenGLView* v = (wxUICustomOpenGLView*) GetPeer()->GetWXWidget(); [v swapBuffers]; return true; }