FLTK Utility Library and Widget Collection (FLU): Flu_GL_Window class Reference

Main Page | Class Hierarchy | Class List | File List | Class Members

# Flu_GL_Window Class Reference

A class designed to supply an easier, more functional FLTK GL window, with callback functionality similar to GLUT. More...

`#include <Flu_GL_Window.h>`

Inheritance diagram for Flu_GL_Window:

List of all members.

## Public Member Functions
| Flu_GL_Window (int x, int y, int w, int h, const char *label=0)
| Normal FLTK widget constructor.
| Flu_GL_Window (int w, int h, const char *label=0)
| Top-level window constructor.
virtual | ~Flu_GL_Window ()
| Default destructor.
void | redraw ()
| Force this window to redraw.
bool | is_context_valid ()
| `true` if the OpenGL context managed by this window is valid to take OpenGL calls, `false` otherwise
void | cartesianInput (bool b)
| Setting this to `true` will report mouse input in cartesian coordinates instead of window coordinates.
bool | cartesianInput () const
| `true` if mouse input is reported in cartesian coordinates, `false` otherwise
Drawing/Input Callback Registration
The registered functions will be called on the indicated event.
void | setInitFunc (void(*cb)(void *), void *cbd=NULL)
| The passed function must have the following signature: (void *user_data).
void | setResizeFunc (void(*cb)(int, int, void *), void *cbd=NULL)
| The passed function must have the following signature: (int width, int height, void *user_data).
void | setDrawFunc (void(*cb)(void *), void *cbd=NULL)
| The passed function must have the following signature: (void *user_data).
void | setMouseWheelFunc (void(*cb)(int, int, int, int, void *), void *cbd=NULL)
| The passed function must have the following signature: (int dx, int dy, int x, int y).
void | setMouseDownFunc (void(*cb)(int, int, int, void *), void *cbd=NULL)
| The passed function must have the following signature: (int button, int x, int y, void *user_data).
void | setMouseUpFunc (void(*cb)(int, int, int, void *), void *cbd=NULL)
| The passed function must have the following signature: (int button, int x, int y, void *user_data).
void | setMouseDragFunc (void(*cb)(int, int, void *), void *cbd=NULL)
| The passed function must have the following signature: (int x, int y, void *user_data).
void | setMouseMoveFunc (void(*cb)(int, int, void *), void *cbd=NULL)
| The passed function must have the following signature:(int x, int y, void *user_data).
void | setMouseEnterFunc (void(*cb)(void *), void *cbd=NULL)
| The passed function must have the following signature: (void *user_data).
void | setMouseExitFunc (void(*cb)(void *), void *cbd=NULL)
| The passed function must have the following signature: (void *user_data).
void | setKeyboardFunc (void(*cb)(int, int, int, void *), void *cbd=NULL)
| The passed function must have the following signature: (int key, int x, int y, void *user_data).
## Static Public Member Functions
void | setAllInitFunc (void(*cb)(void *), void *cbd=NULL)
| Set a function that will be called each time a new OpenGL context is created.
## Protected Attributes
void(* | _drawCB )(void *)
void * | _drawCBD
void(* | _resizeCB )(int, int, void *)
void * | _resizeCBD
void(* | _initCB )(void *)
void * | _initCBD
void(* | _mouseWheelCB )(int, int, int, int, void *)
void * | _mouseWheelCBD
void(* | _mouseDownCB )(int, int, int, void *)
void * | _mouseDownCBD
void(* | _mouseUpCB )(int, int, int, void *)
void * | _mouseUpCBD
void(* | _mouseDragCB )(int, int, void *)
void * | _mouseDragCBD
void(* | _mouseMoveCB )(int, int, void *)
void * | _mouseMoveCBD
void(* | _keyboardCB )(int, int, int, void *)
void * | _keyboardCBD
void(* | _enterCB )(void *)
void * | _enterCBD
void(* | _exitCB )(void *)
void * | _exitCBD

## Detailed Description

A class designed to supply an easier, more functional FLTK GL window, with callback functionality similar to GLUT.

## Member Function Documentation

void Flu_GL_Window::cartesianInput | ( | bool | b | ) | `[inline]`

| Setting this to `true` will report mouse input in cartesian coordinates instead of window coordinates. Default is `true`

bool Flu_GL_Window::is_context_valid | ( |  | ) | `[inline]`

| `true` if the OpenGL context managed by this window is valid to take OpenGL calls, `false` otherwise Note: This does not mean this context is the current one taking OpenGL calls, only that it *can* take calls when it becomes current.

void Flu_GL_Window::setAllInitFunc | ( | void(* | cb)(void *),
|  | void * | cbd = NULL
| ) | `[inline, static]`

| Set a function that will be called each time a new OpenGL context is created. This is useful for doing something globally specific for all contexts, such as loading OpenGL API entrypoints under Windows.

void Flu_GL_Window::setKeyboardFunc | ( | void(* | cb)(int, int, int, void *),
|  | void * | cbd = NULL
| ) | `[inline]`

| The passed function must have the following signature: (int key, int x, int y, void *user_data). key is which key generated the event, and x and y represent where in the OpenGL context the event ocurred.

void Flu_GL_Window::setMouseDownFunc | ( | void(* | cb)(int, int, int, void *),
|  | void * | cbd = NULL
| ) | `[inline]`

| The passed function must have the following signature: (int button, int x, int y, void *user_data). button is which mouse button generated the event: { `FL_LEFT_MOUSE` | `FL_RIGHT_MOUSE` | `FL_MIDDLE_MOUSE` }, and x and y represent where in the OpenGL context the event ocurred.

void Flu_GL_Window::setMouseDragFunc | ( | void(* | cb)(int, int, void *),
|  | void * | cbd = NULL
| ) | `[inline]`

| The passed function must have the following signature: (int x, int y, void *user_data). x and y represent where in the OpenGL context the event ocurred.

void Flu_GL_Window::setMouseMoveFunc | ( | void(* | cb)(int, int, void *),
|  | void * | cbd = NULL
| ) | `[inline]`

| The passed function must have the following signature:(int x, int y, void *user_data). x and y represent where in the OpenGL context the event ocurred.

void Flu_GL_Window::setMouseUpFunc | ( | void(* | cb)(int, int, int, void *),
|  | void * | cbd = NULL
| ) | `[inline]`

| The passed function must have the following signature: (int button, int x, int y, void *user_data). button is which mouse button generated the event: { `FL_LEFT_MOUSE` | `FL_RIGHT_MOUSE` | `FL_MIDDLE_MOUSE` }, and x and y represent where in the OpenGL context the event ocurred.

void Flu_GL_Window::setMouseWheelFunc | ( | void(* | cb)(int, int, int, int, void *),
|  | void * | cbd = NULL
| ) | `[inline]`

| The passed function must have the following signature: (int dx, int dy, int x, int y). dx and dy represent the amount of movement of the mouse wheel (usually 1 or -1), and x and y represent where in the OpenGL context the event ocurred.

void Flu_GL_Window::setResizeFunc | ( | void(* | cb)(int, int, void *),
|  | void * | cbd = NULL
| ) | `[inline]`

| The passed function must have the following signature: (int width, int height, void *user_data). width and height represent the new size of the OpenGL context

The documentation for this class was generated from the following file:

- Flu_GL_Window.h