summaryrefslogtreecommitdiff
path: root/src/Fl_Gl_Window.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2018-11-16 09:11:54 +0000
committerManolo Gouy <Manolo>2018-11-16 09:11:54 +0000
commit015d460c49ae3a17e25801a2921ced1f78f429ad (patch)
treedd3ec7647d0a2add1d97a457e64eca15b24182ec /src/Fl_Gl_Window.cxx
parentd312284099ea1ddae761359c00e76813812662d2 (diff)
MacOS: simpler implementation of extra code necessary at first display of layer-backed GL windows
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13123 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Gl_Window.cxx')
-rw-r--r--src/Fl_Gl_Window.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Fl_Gl_Window.cxx b/src/Fl_Gl_Window.cxx
index 3968fa7ca..af1bcc667 100644
--- a/src/Fl_Gl_Window.cxx
+++ b/src/Fl_Gl_Window.cxx
@@ -524,6 +524,15 @@ void Fl_Cocoa_Gl_Window_Driver::after_show(int need_redraw) {
if(need_redraw) pWindow->redraw();//necessary only after creation of a top-level GL window
}
+int Fl_Cocoa_Gl_Window_Driver::flush_begin(char& valid_f_) {
+ Fl_Cocoa_Window_Driver *d = Fl_Cocoa_Window_Driver::driver(pWindow);
+ if (d->wait_for_expose_value) { // 1st drawing of layer-backed GL window
+ Fl_Cocoa_Window_Driver::GLcontext_update(pWindow->context()); // layer-backed GL windows may be empty without this
+ d->wait_for_expose_value = 0;
+ }
+ return 0;
+}
+
float Fl_Cocoa_Gl_Window_Driver::pixels_per_unit()
{
int retina = (fl_mac_os_version >= 100700 && Fl::use_high_res_GL() && Fl_X::i(pWindow) &&