diff options
Diffstat (limited to 'src/Fl_cocoa.mm')
| -rw-r--r-- | src/Fl_cocoa.mm | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 46deae720..1377c0659 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -34,7 +34,7 @@ extern "C" { #include <pthread.h> } - +#include "config_lib.h" #include <FL/Fl.H> #include <FL/x.H> #include <FL/Fl_Window_Driver.H> @@ -44,6 +44,7 @@ extern "C" { #include <FL/Fl_Printer.H> #include <FL/Fl_Shared_Image.H> #include <FL/fl_draw.H> +#include <FL/Fl_Gl_Window_Driver.H> #include "drivers/Quartz/Fl_Quartz_Graphics_Driver.H" #include "drivers/Quartz/Fl_Quartz_Copy_Surface_Driver.H" #include "drivers/Cocoa/Fl_Cocoa_Screen_Driver.H" @@ -2726,7 +2727,7 @@ static FLTextInputContext* fltextinputcontext_instance = nil; @end -NSOpenGLPixelFormat* Fl_Cocoa_Screen_Driver::mode_to_NSOpenGLPixelFormat(int m, const int *alistp) +NSOpenGLPixelFormat* Fl_Cocoa_Gl_Window_Driver::mode_to_NSOpenGLPixelFormat(int m, const int *alistp) { NSOpenGLPixelFormatAttribute attribs[32]; int n = 0; @@ -2814,7 +2815,7 @@ NSOpenGLPixelFormat* Fl_Cocoa_Screen_Driver::mode_to_NSOpenGLPixelFormat(int m, return pixform; } -NSOpenGLContext* Fl_Cocoa_Screen_Driver::create_GLcontext_for_window(NSOpenGLPixelFormat *pixelformat, +NSOpenGLContext* Fl_Cocoa_Gl_Window_Driver::create_GLcontext_for_window(NSOpenGLPixelFormat *pixelformat, NSOpenGLContext *shared_ctx, Fl_Window *window) { NSOpenGLContext *context = [[NSOpenGLContext alloc] initWithFormat:pixelformat shareContext:shared_ctx]; @@ -2831,27 +2832,27 @@ NSOpenGLContext* Fl_Cocoa_Screen_Driver::create_GLcontext_for_window(NSOpenGLPix return context; } -void Fl_Cocoa_Screen_Driver::GLcontext_update(NSOpenGLContext* ctxt) +void Fl_Cocoa_Gl_Window_Driver::GLcontext_update(NSOpenGLContext* ctxt) { [ctxt update]; } -void Fl_Cocoa_Screen_Driver::GLcontext_flushbuffer(NSOpenGLContext* ctxt) +void Fl_Cocoa_Gl_Window_Driver::flush_context() { - [ctxt flushBuffer]; + [(NSOpenGLContext*)pWindow->context() flushBuffer]; } -void Fl_Cocoa_Screen_Driver::GLcontext_release(NSOpenGLContext* ctxt) +void Fl_Cocoa_Gl_Window_Driver::GLcontext_release(NSOpenGLContext* ctxt) { [ctxt release]; } -void Fl_Cocoa_Screen_Driver::GL_cleardrawable(void) +void Fl_Cocoa_Gl_Window_Driver::GL_cleardrawable(void) { [[NSOpenGLContext currentContext] clearDrawable]; } -void Fl_Cocoa_Screen_Driver::GLcontext_makecurrent(NSOpenGLContext* ctxt) +void Fl_Cocoa_Gl_Window_Driver::GLcontext_makecurrent(NSOpenGLContext* ctxt) { [ctxt makeCurrentContext]; } |
