// Copyright: (c) Stefan Csomor
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
// Copyright: (c) Stefan Csomor
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
glGenFramebuffersOES(1, &viewFramebuffer);
glGenRenderbuffersOES(1, &viewRenderbuffer);
glGenFramebuffersOES(1, &viewFramebuffer);
glGenRenderbuffersOES(1, &viewRenderbuffer);
glBindFramebufferOES(GL_FRAMEBUFFER_OES, viewFramebuffer);
glBindRenderbufferOES(GL_RENDERBUFFER_OES, viewRenderbuffer);
glBindFramebufferOES(GL_FRAMEBUFFER_OES, viewFramebuffer);
glBindRenderbufferOES(GL_RENDERBUFFER_OES, viewRenderbuffer);
- [self destroyFramebuffer];
- [self createFramebuffer];
+
+ if ( viewFramebuffer == 0 )
+ {
+ [self destroyFramebuffer];
+ [self createFramebuffer];
+ }
+
#endif
if ( !wxWindow::Create(parent, id, pos, size, style, name) )
#endif
if ( !wxWindow::Create(parent, id, pos, size, style, name) )
[NSNumber numberWithBool:NO], kEAGLDrawablePropertyRetainedBacking,
kEAGLColorFormatRGBA8, kEAGLDrawablePropertyColorFormat, nil];
[NSNumber numberWithBool:NO], kEAGLDrawablePropertyRetainedBacking,
kEAGLColorFormatRGBA8, kEAGLDrawablePropertyColorFormat, nil];
WXGLContext context = WXGLGetCurrentContext();
wxCHECK_MSG(context, false, wxT("should have current context"));
WXGLContext context = WXGLGetCurrentContext();
wxCHECK_MSG(context, false, wxT("should have current context"));