#include "evas_engine.h"
static Evas_GL_Cocoa_Window *_evas_gl_cocoa_window = NULL;
+static NSOpenGLContext *_evas_gl_cocoa_shared_context = NULL;
@interface EvasGLView : NSOpenGLView
{
{
NSOpenGLPixelFormat * pf = [EvasGLView basicPixelFormat];
self = [super initWithFrame: frameRect pixelFormat: pf];
+
+
+ NSOpenGLContext *ctx;
+ if (!_evas_gl_cocoa_shared_context) {
+ _evas_gl_cocoa_shared_context = [[NSOpenGLContext alloc] initWithFormat: [EvasGLView basicPixelFormat] shareContext: nil];
+ ctx = _evas_gl_cocoa_shared_context;
+ } else {
+ ctx = [[NSOpenGLContext alloc] initWithFormat: [EvasGLView basicPixelFormat] shareContext: _evas_gl_cocoa_shared_context];
+ }
+ [self setOpenGLContext: ctx];
+ [ctx setView: self];
+
return self;
}
[(EvasGLView*)gw->view setFrame:view_frame];
[[(NSOpenGLView*)gw->view openGLContext] flushBuffer];
}
-