summaryrefslogtreecommitdiff
path: root/src/drivers/Cocoa
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2018-10-31 12:45:51 +0000
committerManolo Gouy <Manolo>2018-10-31 12:45:51 +0000
commit6c8115ee9b30a89724df122c0af20c24ac6cfe52 (patch)
treee9142b3a91954f2ca61c3a49fb855af7f6198909 /src/drivers/Cocoa
parent22bcc7b4cacee37be4e0559c84c848d1f6b1daf6 (diff)
Remove use of Fl_Gl_Window_Driver.H in file src/Fl_cocoa.mm
Thus, Fl_cocoa.mm is completely independent from code of libfltk_gl. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13104 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/Cocoa')
-rw-r--r--src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H
index 7ce5fe6aa..b46a66e9f 100644
--- a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H
+++ b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H
@@ -34,10 +34,14 @@ class Fl_Window;
@class CALayer;
@class NSCursor;
@class FLWindow;
+@class NSOpenGLContext;
+@class NSOpenGLPixelFormat;
#else
class CALayer;
class NSCursor;
class FLWindow;
+class NSOpenGLContext;
+class NSOpenGLPixelFormat;
#endif // __OBJC__
/**
@@ -136,10 +140,18 @@ public:
virtual void wait_for_expose();
static void draw_layer_to_context(CALayer *layer, CGContextRef gc, int w, int h);
virtual int scroll(int src_x, int src_y, int src_w, int src_h, int dest_x, int dest_y, void (*draw_area)(void*, int,int,int,int), void* data);
+
+ // these functions are OpenGL-related and use objective-c
+ // they are put here to avoid libfltk_gl dependency in Fl_cocoa.mm
+ static NSOpenGLContext* create_GLcontext_for_window(NSOpenGLPixelFormat *pixelformat, NSOpenGLContext *shared_ctx, Fl_Window *window);
+ static NSOpenGLPixelFormat *mode_to_NSOpenGLPixelFormat(int mode, const int*); // uses Objective-c
+ static void GLcontext_update(NSOpenGLContext*); // uses Objective-c
+ static void GLcontext_release(NSOpenGLContext*); // uses Objective-c
+ static void flush_context(NSOpenGLContext*); // uses Objective-c
+ static void GLcontext_makecurrent(NSOpenGLContext*); // uses Objective-c
+ static void GL_cleardrawable(void); // uses Objective-c
};
-
-
#endif // FL_COCOA_WINDOW_DRIVER_H
//