From 1a6790b219e80fdb4ebcae32532dad884a552424 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Sat, 20 Dec 2014 16:52:48 +0000 Subject: Added documentation about the new support for high resolution OpenGL graphics on Apple retina displays. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10503 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- documentation/src/osissues.dox | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'documentation/src/osissues.dox') diff --git a/documentation/src/osissues.dox b/documentation/src/osissues.dox index cc6f466f4..80edb3624 100644 --- a/documentation/src/osissues.dox +++ b/documentation/src/osissues.dox @@ -824,6 +824,27 @@ Set "Print Front Window" = ""; therein so the application menu doesn't To localize the application name itself, create a file InfoPlist.strings in each .lproj directory and put CFBundleName = "localized name"; in each such file. +\subsection osissues_retina OpenGL and 'retina' displays +It is possible to have OpenGL produce graphics at the high pixel resolution allowed by the so-called 'retina' displays +present on recent Apple hardware. +For this, call +\verbatim +Fl::use_high_res_GL(1); +\endverbatim +before any Fl_Gl_Window is shown. Also, adapt your Fl_Gl_Window::draw() and Fl_Gl_Window::draw_overlay() methods replacing +\verbatim +glViewport(0, 0, w(), h()); +\endverbatim +by +\verbatim +glViewport(0, 0, pixel_w(), pixel_h()); +\endverbatim +making use of the Fl_Gl_Window::pixel_w() and Fl_Gl_Window::pixel_h() functions that return the width and height of +the GL scene in pixels: if the Fl_Gl_Window is mapped on a retina display, these functions return twice as much as +reported by Fl_Widget::w() and Fl_Widget::h(); if it's mapped on a regular display, they return the same values as w() and h(). +If you don't call Fl::use_high_res_GL(1), your Fl_Gl_Window 's will be drawn with low resolution. +These functions are synonyms of w() and h() on non-Mac OS X platforms, so your source code remains cross-platform. + Fl_Double_Window OS X double-buffers all windows automatically. On OS X, -- cgit v1.2.3