mirror of
https://github.com/fltk/fltk.git
synced 2026-05-28 11:25:22 +08:00
Doxygen: rewording for more clarity.
This commit is contained in:
+6
-6
@@ -209,9 +209,9 @@ public:
|
|||||||
/** Gives the window width in OpenGL pixels.
|
/** Gives the window width in OpenGL pixels.
|
||||||
When an Fl_Gl_Window is mapped to a HighDPI display, the value given by Fl_Gl_Window::w()
|
When an Fl_Gl_Window is mapped to a HighDPI display, the value given by Fl_Gl_Window::w()
|
||||||
which is expressed in FLTK units, may differ from the window width in pixels.
|
which is expressed in FLTK units, may differ from the window width in pixels.
|
||||||
Calls to OpenGL functions expecting pixel values (e.g., glViewport) must therefore
|
Calls to OpenGL functions expecting pixel values (\em e.g., \c glViewport) should therefore
|
||||||
use this method rather than method w().
|
use pixel_w() rather than w().
|
||||||
This method detects when the GUI is rescaled or when the window has been moved
|
Method pixel_w() detects when the GUI is rescaled or when the window has been moved
|
||||||
between low and high resolution displays and automatically adjusts the returned value.
|
between low and high resolution displays and automatically adjusts the returned value.
|
||||||
\version 1.3.4
|
\version 1.3.4
|
||||||
*/
|
*/
|
||||||
@@ -219,9 +219,9 @@ public:
|
|||||||
/** Gives the window height in OpenGL pixels.
|
/** Gives the window height in OpenGL pixels.
|
||||||
When an Fl_Gl_Window is mapped to a HighDPI display, the value given by Fl_Gl_Window::h()
|
When an Fl_Gl_Window is mapped to a HighDPI display, the value given by Fl_Gl_Window::h()
|
||||||
which is expressed in FLTK units, may differ from the window height in pixels.
|
which is expressed in FLTK units, may differ from the window height in pixels.
|
||||||
Calls to OpenGL functions expecting pixel values (e.g., glViewport) must therefore
|
Calls to OpenGL functions expecting pixel values (\em e.g., \c glViewport) should therefore
|
||||||
use this method rather than method h().
|
use pixel_h() rather than h().
|
||||||
This method detects when the GUI is rescaled or when the window has been moved
|
Method pixel_h() detects when the GUI is rescaled or when the window has been moved
|
||||||
between low and high resolution displays and automatically adjusts the returned value.
|
between low and high resolution displays and automatically adjusts the returned value.
|
||||||
\version 1.3.4
|
\version 1.3.4
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -185,13 +185,13 @@ HighDPI displays (including the so-called 'retina' displays of Apple
|
|||||||
hardware) are supported by FLTK in such a way that 1 unit of an FLTK
|
hardware) are supported by FLTK in such a way that 1 unit of an FLTK
|
||||||
quantity (say, the value given by Fl_Gl_Window::w()) corresponds to more
|
quantity (say, the value given by Fl_Gl_Window::w()) corresponds to more
|
||||||
than 1 pixel on the display. Conversely, when a program specifies the width and height of the
|
than 1 pixel on the display. Conversely, when a program specifies the width and height of the
|
||||||
OpenGL viewport, it is necessary to use an API that returns quantities expressed in pixels
|
OpenGL viewport, it is necessary to use an API that returns quantities expressed in pixels.
|
||||||
as follows:
|
That can be done as follows:
|
||||||
\code
|
\code
|
||||||
Fl_Gl_Window *glw = ...;
|
Fl_Gl_Window *glw = ...;
|
||||||
glViewport(0, 0, glw->pixel_w(), glw->pixel_h());
|
glViewport(0, 0, glw->pixel_w(), glw->pixel_h());
|
||||||
\endcode
|
\endcode
|
||||||
which makes use of the Fl_Gl_Window::pixel_w() and Fl_Gl_Window::pixel_h() functions giving
|
which makes use of the Fl_Gl_Window::pixel_w() and Fl_Gl_Window::pixel_h() methods giving
|
||||||
the size in pixels of an Fl_Gl_Window that is potentially mapped to a HighDPI display.
|
the size in pixels of an Fl_Gl_Window that is potentially mapped to a HighDPI display.
|
||||||
Method Fl_Gl_Window::pixels_per_unit() can also be useful in this context.
|
Method Fl_Gl_Window::pixels_per_unit() can also be useful in this context.
|
||||||
\note A further coding rule is necessary to properly support retina displays
|
\note A further coding rule is necessary to properly support retina displays
|
||||||
|
|||||||
Reference in New Issue
Block a user