summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Gl_Choice.cxx16
-rw-r--r--src/Fl_Gl_Window.cxx8
-rw-r--r--src/Fl_cocoa.mm12
-rw-r--r--src/gl_start.cxx3
4 files changed, 14 insertions, 25 deletions
diff --git a/src/Fl_Gl_Choice.cxx b/src/Fl_Gl_Choice.cxx
index 3ed89cee7..e614db01c 100644
--- a/src/Fl_Gl_Choice.cxx
+++ b/src/Fl_Gl_Choice.cxx
@@ -27,14 +27,6 @@
# include "flstring.h"
# include <FL/fl_utf8.h>
-# ifdef __APPLE__
-extern NSOpenGLContext* gl_create_context_for_window(NSOpenGLPixelFormat *pixelformat,
- NSOpenGLContext *shared_ctx, Fl_Window *window);
-extern void gl_context_release(NSOpenGLContext*);
-extern void gl_context_makecurrent(NSOpenGLContext*);
-extern void gl_cleardrawable(void);
-# endif
-
# ifdef WIN32
void fl_save_dc(HWND, HDC);
# endif
@@ -247,7 +239,7 @@ GLContext fl_create_gl_context(Fl_Window* window, const Fl_Gl_Choice* g, int lay
GLContext fl_create_gl_context(Fl_Window* window, const Fl_Gl_Choice* g, int layer) {
GLContext context, shared_ctx = 0;
if (context_list && nContext) shared_ctx = context_list[0];
- context = gl_create_context_for_window(g->pixelformat, shared_ctx, window);
+ context = Fl_X::create_GLcontext_for_window(g->pixelformat, shared_ctx, window);
if (!context) return 0;
add_context((GLContext)context);
return (context);
@@ -268,7 +260,7 @@ void fl_set_gl_context(Fl_Window* w, GLContext context) {
# elif defined(WIN32)
wglMakeCurrent(Fl_X::i(w)->private_dc, context);
# elif defined(__APPLE_QUARTZ__)
- gl_context_makecurrent(context);
+ Fl_X::GLcontext_makecurrent(context);
# else
# error unsupported platform
# endif
@@ -283,7 +275,7 @@ void fl_no_gl_context() {
# elif defined(WIN32)
wglMakeCurrent(0, 0);
# elif defined(__APPLE_QUARTZ__)
- gl_cleardrawable();
+ Fl_X::GL_cleardrawable();
# else
# error unsupported platform
# endif
@@ -296,7 +288,7 @@ void fl_delete_gl_context(GLContext context) {
# elif defined(WIN32)
wglDeleteContext(context);
# elif defined(__APPLE_QUARTZ__)
- gl_context_release(context);
+ Fl_X::GLcontext_release(context);
# else
# error unsupported platform
# endif
diff --git a/src/Fl_Gl_Window.cxx b/src/Fl_Gl_Window.cxx
index f52703e85..88963b2b6 100644
--- a/src/Fl_Gl_Window.cxx
+++ b/src/Fl_Gl_Window.cxx
@@ -29,8 +29,6 @@ extern void gl_texture_reset();
#include "Fl_Gl_Choice.H"
#ifdef __APPLE__
#include <FL/gl.h>
-extern void gl_context_update(NSOpenGLContext*);
-extern void gl_context_flushbuffer(NSOpenGLContext*);
#endif
#include <FL/Fl_Gl_Window.H>
#include <stdlib.h>
@@ -191,7 +189,7 @@ void Fl_Gl_Window::make_current() {
if (Fl_X::i(this)->changed_resolution()){
Fl_X::i(this)->changed_resolution(false);
invalidate();
- gl_context_update(context_);
+ Fl_X::GLcontext_update(context_);
}
#endif
if (!context_) {
@@ -406,7 +404,7 @@ void Fl_Gl_Window::flush() {
}
#ifdef __APPLE__
- gl_context_flushbuffer(context_);
+ Fl_X::GLcontext_flushbuffer(context_);
#endif
if (overlay==this && SWAP_TYPE != SWAP) { // fake overlay in front buffer
@@ -436,7 +434,7 @@ void Fl_Gl_Window::resize(int X,int Y,int W,int H) {
if (is_a_resize) valid(0);
#ifdef __APPLE__
- if (Fl_X::i(this)->in_windowDidResize()) gl_context_update(context_);
+ if (Fl_X::i(this)->in_windowDidResize()) Fl_X::GLcontext_update(context_);
#endif
#if ! ( defined(__APPLE__) || defined(WIN32) )
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index 0e3aa85cd..938ac4c67 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -2724,7 +2724,7 @@ NSOpenGLPixelFormat* Fl_X::mode_to_NSOpenGLPixelFormat(int m, const int *alistp)
return pixform;
}
-NSOpenGLContext* gl_create_context_for_window(NSOpenGLPixelFormat *pixelformat,
+NSOpenGLContext* Fl_X::create_GLcontext_for_window(NSOpenGLPixelFormat *pixelformat,
NSOpenGLContext *shared_ctx, Fl_Window *window)
{
NSOpenGLContext *context = [[NSOpenGLContext alloc] initWithFormat:pixelformat shareContext:shared_ctx];
@@ -2732,27 +2732,27 @@ NSOpenGLContext* gl_create_context_for_window(NSOpenGLPixelFormat *pixelformat,
return context;
}
-void gl_context_update(NSOpenGLContext* ctxt)
+void Fl_X::GLcontext_update(NSOpenGLContext* ctxt)
{
[ctxt update];
}
-void gl_context_flushbuffer(NSOpenGLContext* ctxt)
+void Fl_X::GLcontext_flushbuffer(NSOpenGLContext* ctxt)
{
[ctxt flushBuffer];
}
-void gl_context_release(NSOpenGLContext* ctxt)
+void Fl_X::GLcontext_release(NSOpenGLContext* ctxt)
{
[ctxt release];
}
-void gl_cleardrawable(void)
+void Fl_X::GL_cleardrawable(void)
{
[[NSOpenGLContext currentContext] clearDrawable];
}
-void gl_context_makecurrent(NSOpenGLContext* ctxt)
+void Fl_X::GLcontext_makecurrent(NSOpenGLContext* ctxt)
{
[ctxt makeCurrentContext];
}
diff --git a/src/gl_start.cxx b/src/gl_start.cxx
index d9e5107b3..7e2bee25c 100644
--- a/src/gl_start.cxx
+++ b/src/gl_start.cxx
@@ -48,7 +48,6 @@ static Fl_Gl_Choice* gl_choice;
#ifdef __APPLE__
static Fl_Gl_Choice* gl_choice;
-extern void gl_context_update(NSOpenGLContext*);
#endif
Fl_Region XRectangleRegion(int x, int y, int w, int h); // in fl_rect.cxx
@@ -69,7 +68,7 @@ void gl_start() {
}
fl_set_gl_context(Fl_Window::current(), context);
#ifdef __APPLE__
- gl_context_update(context); // supports window resizing
+ Fl_X::GLcontext_update(context); // supports window resizing
#elif !defined(WIN32)
glXWaitX();
#endif