From d7b88a3bcc7e76f38ee5799be7722fd5a10781ef Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Wed, 13 Jan 1999 19:28:54 +0000 Subject: Updated all links so they work between files. Revision 1. git-svn-id: file:///fltk/svn/fltk/trunk@219 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- documentation/opengl.html | 436 ++++++++++++++++++++-------------------------- 1 file changed, 189 insertions(+), 247 deletions(-) (limited to 'documentation/opengl.html') diff --git a/documentation/opengl.html b/documentation/opengl.html index f566d30ad..d618815d1 100644 --- a/documentation/opengl.html +++ b/documentation/opengl.html @@ -1,48 +1,33 @@ - - - -

9 - Using OpenGL

- -This chapter discusses using FLTK for your OpenGL applications. - -

Using OpenGL in FLTK

- -The easiest way to make an OpenGL display is to subclass Fl_Gl_Window. Your subclass must -implement a draw() method which uses OpenGL calls to draw the -display. Your main program should call redraw() when the -display needs to change, and (somewhat later) FLTK will call -draw(). - -

With a bit of care you can also use OpenGL to draw into normal FLTK -windows. This is mostly useful because you can use Gourand shading for -drawing your widgets. To do this you use the gl_start() and gl_finish() functions around your OpenGL -code. - -

You must include FLTK's <FL/gl.h> header file. It will include -the file <GL/gl.h>, define some extra drawing functions -provided by FLTK, and include the <windows.h> header file needed -by WIN32 applications. - -

Making a Subclass of Fl_Gl_Window

- -To make a subclass of Fl_Gl_Window, you must provide: - - - -

Defining the Subclass

- -To define the subclass you just subclass Fl_Gl_Window class: - - +
 
+

The camera() Method

- -The camera() method sets the camera (projection and viewpoint) -to use when drawing the scene. The scene is redrawn after this call. - -

The draw() Method

- -The draw() method performs the needed initialization -and does the actual drawing: - -

The scene() Method

- -The scene() method sets the scene to be drawn. The scene is -a collection of 3D objects in a csGroup. The scene is redrawn -after this call. - - - + The scene() method sets the scene to be drawn. The scene is +a collection of 3D objects in a csGroup. The scene is redrawn +after this call. \ No newline at end of file -- cgit v1.2.3