From 09daf20b81cdae78772f07c0af22a571d7cc73eb Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Thu, 29 Nov 2001 19:24:00 +0000 Subject: Documentation updates galore (up to chapter 7, still need to do chapter 8 and 9, tweek the appendices, and recapture the screenshots...) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1786 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- documentation/glut.html | 96 ++++++++++++++++++++++++------------------------- 1 file changed, 48 insertions(+), 48 deletions(-) (limited to 'documentation/glut.html') diff --git a/documentation/glut.html b/documentation/glut.html index c26ee7352..93d7b30e8 100644 --- a/documentation/glut.html +++ b/documentation/glut.html @@ -1,31 +1,31 @@

D - GLUT Compatibility

- This appendix describes the GLUT compatibility header file supplied -with FLTK. + This appendix describes the GLUT compatibility header file supplied +with FLTK.

Using the GLUT Compatibility Header File

You should be able to compile existing GLUT source code by including -<FL/glut.H> instead of <GL/glut.h>. This can be done by -editing the source, by changing the -I switches to the +<FL/glut.H> instead of <GL/glut.h>. This can be done by +editing the source, by changing the -I switches to the compiler, or by providing a symbolic link from GL/glut.h to -FL/glut.H. -

All files calling GLUT procedures must be compiled with C++. - You may have to alter them slightly to get them to compile without -warnings, and you may have to rename them to get make to use the C++ +FL/glut.H. +

All files calling GLUT procedures must be compiled with C++. + You may have to alter them slightly to get them to compile without +warnings, and you may have to rename them to get make to use the C++ compiler.

-

You must link with the FLTK library. If you call any GLUT drawing +

You must link with the FLTK library. If you call any GLUT drawing functions that FLTK does not emulate (glutExtensionsSupported() , glutWire*(), glutSolid*(), and glutStroke*() -), you will also have to link with the GLUT library (after the +), you will also have to link with the GLUT library (after the FLTK library!)

-

Most of FL/glut.H is inline functions. You should take a -look at it (and maybe at test/glpuzzle.cxx in the FLTK source) if +

Most of FL/glut.H is inline functions. You should take a +look at it (and maybe at test/glpuzzle.cxx in the FLTK source) if you are having trouble porting your GLUT program.

-

This has been tested with most of the demo programs that come with +

This has been tested with most of the demo programs that come with the GLUT 3.3 distribution.

Known Problems

- The following functions and/or arguments to functions are missing, and -you will have to replace them or comment them out for your code to -compile: + The following functions and/or arguments to functions are missing, and +you will have to replace them or comment them out for your code to +compile: - Most of the symbols/enumerations have different values than GLUT uses. - This will break code that relies on the actual values. The only + Most of the symbols/enumerations have different values than GLUT uses. + This will break code that relies on the actual values. The only symbols guaranteed to have the same values are true/false pairs like GLUT_DOWN and GLUT_UP, mouse buttons GLUT_LEFT_BUTTON, GLUT_MIDDLE_BUTTON, GLUT_RIGHT_BUTTON, and -GLUT_KEY_F1 thru F12. +GLUT_KEY_F1 thru F12.

The strings passed as menu labels are not copied.

-

glutPostRedisplay() does not work if called from inside a -display function. You must use glutIdleFunc() if you want +

glutPostRedisplay() does not work if called from inside a +display function. You must use glutIdleFunc() if you want your display to update continuously.

-

glutSwapBuffers() does not work from inside a display +

glutSwapBuffers() does not work from inside a display function. This is on purpose, because FLTK swaps the buffers for you.

-

glutUseLayer() does not work well, and should only be used -to initialize transformations inside a resize callback. You should +

glutUseLayer() does not work well, and should only be used +to initialize transformations inside a resize callback. You should redraw overlays by using glutOverlayDisplayFunc().

Overlays are cleared before the overlay display function is called. -glutLayerGet(GLUT_OVERLAY_DAMAGED) always returns true for -compatibility with some GLUT overlay programs. You must rewrite your -code so that gl_color() is used to choose colors in an +glutLayerGet(GLUT_OVERLAY_DAMAGED) always returns true for +compatibility with some GLUT overlay programs. You must rewrite your +code so that gl_color() is used to choose colors in an overlay, or you will get random overlay colors.

-

glutSetCursor(GLUT_CURSOR_FULL_CROSSHAIR) just results in a +

glutSetCursor(GLUT_CURSOR_FULL_CROSSHAIR) just results in a small crosshair.

The fonts used by glutBitmapCharacter() and glutBitmapWidth() may be different.

-

glutInit(argc,argv) will consume different switches than +

glutInit(argc,argv) will consume different switches than GLUT does. It accepts the switches recognized by -Fl::args(), and will accept any abbreviation of these +Fl::args(), and will accept any abbreviation of these switches (such as "-di" for "-display").

Mixing GLUT and FLTK Code

- You can make your GLUT window a child of a Fl_Window with the + You can make your GLUT window a child of a Fl_Window with the following scheme. The biggest trick is that GLUT insists on show() 'ing the window at the point it is created, which means the -Fl_Window parent window must already be shown. +Fl_Window parent window must already be shown.
@@ -110,18 +110,18 @@ loop calling Fl::wait() to run the program.

Description

- Each GLUT window is an instance of this class. You may find it useful -to manipulate instances directly rather than use GLUT window id's. - These may be created without opening the display, and thus can fit -better into FLTK's method of creating windows. + Each GLUT window is an instance of this class. You may find it useful +to manipulate instances directly rather than use GLUT window id's. + These may be created without opening the display, and thus can fit +better into FLTK's method of creating windows.

The current GLUT window is available in the global variable glut_window.

new Fl_Glut_Window(...) is the same as -glutCreateWindow() except it does not show() the window +glutCreateWindow() except it does not show() the window or make the window current.

window->make_current() is the same as glutSetWindow(number). If the window has not had show() - called on it yet, some functions that assumme an OpenGL context will + called on it yet, some functions that assumme an OpenGL context will not work. If you do show() the window, call make_current() again to set the context.

~Fl_Glut_Window() is the same as glutDestroyWindow() @@ -192,15 +192,15 @@ be altered directly:

  • make_current
  • -Fl_Glut_Window::Fl_Glut_Window(int x, int y, int w, int h, const char +Fl_Glut_Window::Fl_Glut_Window(int x, int y, int w, int h, const char *title = 0)
    Fl_Glut_Window::Fl_Glut_Window(int w, int h, const char *title = 0)

    - The first constructor takes 4 int arguments to create the window with -a preset position and size. The second constructor with 2 arguments -will create the window with a preset size, but the window manager will -choose the position according to it's own whims. -

    virtual + The first constructor takes 4 int arguments to create the window with +a preset position and size. The second constructor with 2 arguments +will create the window with a preset size, but the window manager will +choose the position according to it's own whims. +

    virtual Fl_Glut_Window::~Fl_Glut_Window()

    Destroys the GLUT window.

    void Fl_Glut_Window::make_current()

    -- cgit v1.2.3