diff --git a/ogl_editor/src/macosx/RocketView.m b/ogl_editor/src/macosx/RocketView.m index 6a56bd6..e2c81a6 100644 --- a/ogl_editor/src/macosx/RocketView.m +++ b/ogl_editor/src/macosx/RocketView.m @@ -4,6 +4,8 @@ #include #include +NSOpenGLContext* g_context = 0; + @implementation RocketView /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -20,10 +22,19 @@ self = [super initWithFrame:frame]; if (self == nil) return nil; - - oglContext = [[NSOpenGLContext alloc] initWithFormat: [NSOpenGLView defaultPixelFormat] shareContext: nil]; + + NSOpenGLPixelFormatAttribute attributes[4]; + + attributes[0] = NSOpenGLPFADoubleBuffer; + attributes[1] = 0; + + NSOpenGLPixelFormat* format = [[NSOpenGLPixelFormat alloc] initWithAttributes:attributes]; + oglContext = [[NSOpenGLContext alloc] initWithFormat:format shareContext:nil]; + //oglContext = [[NSOpenGLContext alloc] initWithFormat: [NSOpenGLView defaultPixelFormat] shareContext: nil]; [oglContext makeCurrentContext]; + g_context = oglContext; + EMGFXBackend_create(); Editor_create(); @@ -167,3 +178,9 @@ @end +////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void swapBuffers() +{ + [g_context flushBuffer]; +}