mirror of
https://github.com/fltk/fltk.git
synced 2026-06-04 23:42:15 +08:00
OpenGL documentation fixes (included header files).
Also reformatted very long lines, removed trailing spaces. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12204 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
@@ -20,14 +20,14 @@ drawing your widgets. To do this you use the
|
|||||||
\ref opengl_gl_finish "gl_finish()"
|
\ref opengl_gl_finish "gl_finish()"
|
||||||
functions around your OpenGL code.
|
functions around your OpenGL code.
|
||||||
|
|
||||||
You must include FLTK's \p <FL/gl.h> header
|
You must include FLTK's \p <FL/gl.h> header file. It will include
|
||||||
file. It will include the file \p <GL/gl.h>, define
|
the file \p <GL/gl.h> (on macOS: \p <OpenGL/gl.h>), define
|
||||||
some extra drawing functions provided by FLTK, and include the
|
some extra drawing functions provided by FLTK, and include the
|
||||||
\p <windows.h> header file needed by WIN32
|
\p <windows.h> header file needed by WIN32 applications.
|
||||||
applications.
|
|
||||||
|
|
||||||
Some simple coding rules (see \ref osissues_retina) allow to write cross-platform code that will draw high resolution
|
Some simple coding rules (see \ref osissues_retina) allow to write
|
||||||
OpenGL graphics if run on 'retina' displays with Mac OS X.
|
cross-platform code that will draw high resolution
|
||||||
|
OpenGL graphics if run on 'retina' displays with MacOS.
|
||||||
|
|
||||||
\section opengl_subclass Making a Subclass of Fl_Gl_Window
|
\section opengl_subclass Making a Subclass of Fl_Gl_Window
|
||||||
|
|
||||||
@@ -456,18 +456,23 @@ showing how to use OpenGL 3.0 (or higher versions) with FLTK in a cross-platform
|
|||||||
It contains also OpenGL3-glut-test.cxx which shows how to use FLTK's GLUT compatibility
|
It contains also OpenGL3-glut-test.cxx which shows how to use FLTK's GLUT compatibility
|
||||||
and OpenGL 3.
|
and OpenGL 3.
|
||||||
|
|
||||||
<b>On the MSWindows and Unix/Linux platforms</b>, FLTK creates contexts implementing
|
<b>On the MSWindows and Unix/Linux platforms</b>, FLTK creates contexts
|
||||||
the highest OpenGL version supported by the hardware,
|
implementing the highest OpenGL version supported by the hardware,
|
||||||
which are also compatible with lower OpenGL versions. Thus, FLTK allows
|
which are also compatible with lower OpenGL versions. Thus, FLTK allows
|
||||||
source code targeting any version of OpenGL. Access to functions from OpenGL versions above 1.1 requires to load function pointers at runtime on these platforms. FLTK recommends to use the GLEW library to perform this. It is therefore
|
source code targeting any version of OpenGL. Access to functions from OpenGL
|
||||||
necessary to install the GLEW library (see below). <b>On the Mac OS X platform</b>,
|
versions above 1.1 requires to load function pointers at runtime on these platforms.
|
||||||
|
FLTK recommends to use the GLEW library to perform this. It is therefore
|
||||||
|
necessary to install the GLEW library (see below). <b>On the macOS platform</b>,
|
||||||
FLTK creates by default contexts implementing OpenGL versions 1 or 2.
|
FLTK creates by default contexts implementing OpenGL versions 1 or 2.
|
||||||
To access OpenGL 3.0 (or higher versions), use the <tt>FL_OPENGL3</tt> flag (see below).
|
To access OpenGL 3.0 (or higher versions), use the <tt>FL_OPENGL3</tt> flag (see below).
|
||||||
Mac OS 10.7 or above is required; GLEW is possible but not necessary.
|
Mac OS 10.7 or above is required; GLEW is possible but not necessary.
|
||||||
|
|
||||||
\par GLEW installation (Unix/Linux and MSWindows platforms)
|
\par GLEW installation (Unix/Linux and MSWindows platforms)
|
||||||
GLEW is available as a package for most Linux distributions and in source form at http://glew.sourceforge.net/.
|
GLEW is available as a package for most Linux distributions and in source
|
||||||
For the MSWindows platform, a Visual Studio static library (glew32.lib) can be downloaded from the same web site; a MinGW-style static library (libglew32.a) can be built from source with the make command.
|
form at http://glew.sourceforge.net/.
|
||||||
|
For the MSWindows platform, a Visual Studio static library (glew32.lib) can
|
||||||
|
be downloaded from the same web site; a MinGW-style static library (libglew32.a)
|
||||||
|
can be built from source with the make command.
|
||||||
|
|
||||||
\par Source-level changes for OpenGL 3:
|
\par Source-level changes for OpenGL 3:
|
||||||
\li Put this in all OpenGL-using source files (instead of \#include <FL/gl.h>,
|
\li Put this in all OpenGL-using source files (instead of \#include <FL/gl.h>,
|
||||||
@@ -484,8 +489,8 @@ and before \#include <FL/glut.h> if you use GLUT):
|
|||||||
\endcode
|
\endcode
|
||||||
\li Add the <tt>FL_OPENGL3</tt> flag when calling Fl_Gl_Window::mode(int a)
|
\li Add the <tt>FL_OPENGL3</tt> flag when calling Fl_Gl_Window::mode(int a)
|
||||||
or glutInitDisplayMode().
|
or glutInitDisplayMode().
|
||||||
\li Put this in the <tt>handle(int event)</tt> member function of the first to be created
|
\li Put this in the <tt>handle(int event)</tt> member function of the first
|
||||||
among your Fl_Gl_Window-derived classes:
|
to be created among your Fl_Gl_Window-derived classes:
|
||||||
\code
|
\code
|
||||||
#ifndef __APPLE__
|
#ifndef __APPLE__
|
||||||
static int first = 1;
|
static int first = 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user