mirror of
https://github.com/fltk/fltk.git
synced 2026-05-23 15:56:10 +08:00
MacOS Mojave: restore support of gl_start()/gl_finish().
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@13107 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
@@ -197,6 +197,7 @@ public:
|
||||
static void GLcontext_release(NSOpenGLContext*);
|
||||
static void GLcontext_makecurrent(NSOpenGLContext*);
|
||||
static void GL_cleardrawable(void);
|
||||
static void gl_start(NSOpenGLContext*);
|
||||
void destroy(void);
|
||||
void map(void);
|
||||
void unmap(void);
|
||||
|
||||
+16
-3
@@ -2425,9 +2425,11 @@ static CGContextRef prepare_bitmap_for_layer(int w, int h ) {
|
||||
Fl_X::q_release_context();
|
||||
through_drawRect = NO;
|
||||
window->clear_damage();
|
||||
CGImageRef cgimg = CGBitmapContextCreateImage(layer_gc); // requires 10.4
|
||||
layer.contents = (id)cgimg;
|
||||
CGImageRelease(cgimg);
|
||||
if (layer_gc) {
|
||||
CGImageRef cgimg = CGBitmapContextCreateImage(layer_gc); // requires 10.4
|
||||
layer.contents = (id)cgimg;
|
||||
CGImageRelease(cgimg);
|
||||
}
|
||||
}
|
||||
}
|
||||
-(void)viewFrameDidChange
|
||||
@@ -4808,6 +4810,17 @@ void Fl_Paged_Device::print_window(Fl_Window *win, int x_offset, int y_offset)
|
||||
this->print_widget(win, x_offset, y_offset + bt); // print the window inner part
|
||||
}
|
||||
|
||||
void Fl_X::gl_start(NSOpenGLContext *ctxt) {
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_8
|
||||
if (views_use_CA) {
|
||||
Fl_X::q_release_context();
|
||||
[(FLView*)[fl_window contentView] viewFrameDidChange];
|
||||
[(FLView*)[fl_window contentView] layer].contentsScale = 1.;
|
||||
}
|
||||
#endif
|
||||
[ctxt update]; // supports window resizing
|
||||
}
|
||||
|
||||
|
||||
/* Returns the address of a Carbon function after dynamically loading the Carbon library if needed.
|
||||
Supports old Mac OS X versions that may use a couple of Carbon calls:
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ void gl_start() {
|
||||
}
|
||||
fl_set_gl_context(Fl_Window::current(), context);
|
||||
#ifdef __APPLE__
|
||||
Fl_X::GLcontext_update(context); // supports window resizing
|
||||
Fl_X::gl_start(context);
|
||||
#elif !defined(WIN32)
|
||||
glXWaitX();
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user