diff options
| author | Manolo Gouy <Manolo> | 2016-05-13 06:45:40 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2016-05-13 06:45:40 +0000 |
| commit | 207d8fe09b896cbcdcb4ea46ae6f06ce62b9001e (patch) | |
| tree | 3aa642288ba8768fa7080112f9fbae629997d7e8 /src/Fl_Gl_Window.cxx | |
| parent | 01c5b06fa0a4c4bab0d9f0221439025e178bcbdf (diff) | |
Add GLContext to the set of platform-dependent types defined in FL/platform_types.h
If a platform does not support OpenGL, it can just typedef GLContext as void*
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11733 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Gl_Window.cxx')
| -rw-r--r-- | src/Fl_Gl_Window.cxx | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/Fl_Gl_Window.cxx b/src/Fl_Gl_Window.cxx index 919b868de..7e4693acd 100644 --- a/src/Fl_Gl_Window.cxx +++ b/src/Fl_Gl_Window.cxx @@ -21,7 +21,7 @@ extern int fl_gl_load_plugin; -#include "Fl_Gl_Choice.H" +#include <FL/gl.h> #include <FL/Fl_Gl_Window.H> #include <FL/Fl_Gl_Window_Driver.H> #include <stdlib.h> @@ -277,9 +277,9 @@ void Fl_Gl_Window::resize(int X,int Y,int W,int H) { fltk when the window is destroyed, or when the mode() is changed, or the next time context(x) is called. */ -void Fl_Gl_Window::context(void* v, int destroy_flag) { +void Fl_Gl_Window::context(GLContext v, int destroy_flag) { if (context_ && !(mode_&NON_LOCAL_CONTEXT)) pGlWindowDriver->delete_gl_context(context_); - context_ = (GLContext)v; + context_ = v; if (destroy_flag) mode_ &= ~NON_LOCAL_CONTEXT; else mode_ |= NON_LOCAL_CONTEXT; } @@ -452,11 +452,9 @@ void* Fl_Gl_Window_Driver::GetProcAddress(const char *procName) { #ifdef FL_CFG_GFX_QUARTZ -//#include <FL/gl.h> #include <FL/x.H> #include <OpenGL/OpenGL.h> #include "drivers/Cocoa/Fl_Cocoa_Window_Driver.H" -#include "drivers/Cocoa/Fl_Cocoa_Screen_Driver.H" Fl_Gl_Window_Driver *Fl_Gl_Window_Driver::newGlWindowDriver(Fl_Gl_Window *w) { @@ -505,7 +503,7 @@ void Fl_Cocoa_Gl_Window_Driver::make_current_before() { if (d->changed_resolution()){ d->changed_resolution(false); invalidate(); - GLcontext_update((GLContext)pWindow->context()); + GLcontext_update(pWindow->context()); } } @@ -549,7 +547,7 @@ void Fl_Cocoa_Gl_Window_Driver::swap_buffers() { void Fl_Cocoa_Gl_Window_Driver::resize(int is_a_resize, int unused, int also) { Fl_X *flx = Fl_X::i(pWindow); Fl_Cocoa_Window_Driver *d = Fl_Cocoa_Window_Driver::driver(pWindow); - if (flx && d->in_windowDidResize()) GLcontext_update((GLContext)pWindow->context()); + if (flx && d->in_windowDidResize()) GLcontext_update(pWindow->context()); } char Fl_Cocoa_Gl_Window_Driver::swap_type() {return COPY;} @@ -643,6 +641,7 @@ void* Fl_WinAPI_Gl_Window_Driver::GetProcAddress(const char *procName) { #if defined(FL_CFG_GFX_XLIB) #include <FL/x.H> +#include "Fl_Gl_Choice.H" Fl_Gl_Window_Driver *Fl_Gl_Window_Driver::newGlWindowDriver(Fl_Gl_Window *w) { |
