#include <window.h>
Inheritance diagram for GlutWindow:
Public Types | |
enum | MenuCallbacks { , MENU_CAPTURE_RGB, MENU_CAPTURE_STENCIL, MENU_CAPTURE_ZBUFFER } |
GlutWindow menu callback messages. More... | |
Public Methods | |
GlutWindow (const std::string &title=titleDefault, const int width=widthDefault, const int height=heightDefault, const int x=xDefault, const int y=yDefault, const unsigned int displayMode=displayModeDefault) | |
Constructor. | |
virtual | ~GlutWindow () |
Destructor. | |
virtual void | OnOpen () |
Handler for window open event(s). | |
virtual void | OnClose () |
Handler for window close event(s). | |
virtual void | OnDisplay () |
Handler for window draw events. | |
virtual void | OnTick () |
Handler for tick events, if enabled. | |
virtual void | OnIdle () |
Handler for idle events, if enabled. | |
virtual void | OnTimer (unsigned char val) |
Handler for timer events. | |
virtual void | OnKeyboard (unsigned char key, int x, int y) |
Handler for keyboard events. | |
virtual void | OnKeyboardUp (unsigned char key, int x, int y) |
Handler for keyboard-up events. | |
virtual void | OnSpecial (int key, int x, int y) |
Handler for special keyboard events (function keys, etc). | |
virtual void | OnSpecialUp (int key, int x, int y) |
Handler for special keyboard-up events. | |
virtual void | OnMouse (int button, int state, int x, int y) |
Handler for mouse button events. | |
virtual void | OnMotion (int x, int y) |
Handler for mouse movement events. | |
virtual void | OnPassiveMotion (int x, int y) |
Handler for passive mouse motion events (no button pressed). | |
virtual void | OnEntry (int state) |
Handler for mouse entry/leave events. | |
virtual void | OnMenu (int value) |
Handler for menu events. | |
virtual void | OnReshape (int w, int h) |
Handler for window reshape events. | |
virtual void | OnVisibility (int visible) |
Handler for window visibility events. | |
void | open () |
Open the window. | |
void | grab (const GlutWindow &window) |
Grab an existing GLUT window. | |
void | close () |
Close the window. | |
void | position (int x, int y) |
Position the window. | |
void | reshape (int width, int height) |
Reshape (resize) the window. | |
void | setCursor (int cursor) |
Set window cursor. | |
void | enterGameMode () |
Enter fullscreen game mode. | |
void | leaveGameMode () |
Leave fullscreen game mode. | |
void | toggleGameMode () |
Toggle fullscreen game mode. | |
void | postRedisplay () |
Trigger a redraw. | |
void | setTimer (unsigned int msecs, unsigned char val) |
Configure a timer event to occur after an elapsed time period. | |
void | setTick (unsigned int msec) |
Configure draw events to occur at a given frequency. | |
void | setIdle (bool idle) |
Window will receive OnIdle() events, continuously. | |
void | setSwapBuffers (const bool swap) |
Configure whether front and back buffers should be swapped after each redraw. | |
bool | captureRGB (const std::string &filename) |
Capture OpenGL RGB Buffer. | |
bool | captureZBuffer (const std::string &filename) |
Capture OpenGL Z Buffer. | |
bool | captureStencil (const std::string &filename) |
Capture OpenGL Stencil Buffer. | |
bool | getOpen () const |
Is the window currently open? | |
bool | getIdle () const |
Is the window receiving idle events? | |
unsigned int | getTick () const |
Get the window tick interval. | |
bool | getSwapBuffers () const |
Is the window performing buffer swapping? | |
int | getX () const |
Get X position of window. | |
int | getY () const |
Get Y position of window. | |
int | getWidth () const |
Get width of window. | |
int | getHeight () const |
Get height of window. | |
int | getBufferSize () const |
Get the number of color buffer bits. | |
int | getStencilSize () const |
Get the number of stencil buffer bits. | |
int | getDepthSize () const |
Get the number of z-buffer bits. | |
int | getRedSize () const |
Get the number of red bits. | |
int | getGreenSize () const |
Get the number of green bits. | |
int | getBlueSize () const |
Get the number of blue bits. | |
int | getAlphaSize () const |
Get the number of alpha bits. | |
int | getAccumRedSize () const |
Get the number of red accumulation buffer bits. | |
int | getAccumGreenSize () const |
Get the number of green accumulation buffer bits. | |
int | getAccumBlueSize () const |
Get the number of blue accumulation buffer bits. | |
int | getAccumAlphaSize () const |
Get the number of alpha accumulation buffer bits. | |
bool | getDoubleBuffer () const |
Is the window double buffered? | |
bool | getRGBA () const |
Is the window in RGBA mode? | |
bool | getStereo () const |
Is the window in stereo mode? | |
bool | getTopLevel () const |
Is this a top-level window? | |
int | getNumChildren () const |
Get number of child windows (not counting children of children). | |
int | getColormapSize () const |
Get size of color index map. | |
int | getNumSamples () const |
Get number of samples for multisampling. | |
int | getCursor () const |
Get current cursor. | |
bool | getShiftModifier () const |
Is the shift key pressed? | |
bool | getCtrlModifier () const |
Is the control key pressed? | |
bool | getAltModifier () const |
Is the alt key pressed? | |
Protected Methods | |
virtual void | OnPreDisplay () |
Handler for pre-display event. | |
virtual void | OnPostDisplay () |
Handler for post-display event. | |
virtual void | OnPreTimer (unsigned char val) |
Handler for pre-timer event. | |
int & | windowID () |
GLUT window ID. | |
const int & | windowID () const |
GLUT window ID. | |
std::string | nextFilename () |
Increment file index and determine filename. | |
Protected Attributes | |
GltViewport | _viewport |
Current OpenGL viewport region. | |
GlutMenu | _leftButtonMenu |
Pop-up menu for left mouse button. | |
GlutMenu | _rightButtonMenu |
Pop-up menu for right mouse button. | |
bool | _swapBuffers |
Automatic window buffer swapping mode. | |
int | _fileIndex |
Current file index. | |
Static Protected Attributes | |
const unsigned char | _tickVal = 255 |
Reserved ID for window-tick timer events. |
Definition at line 61 of file window.h.
|
Constructor.
Definition at line 18 of file window.cpp. References _swapBuffers. |
|
Handler for window open event(s).
Reimplemented in GlutWindowExaminer. Definition at line 279 of file window.cpp. Referenced by GlutWindowExaminer::OnOpen(). |
|
Handler for window close event(s).
Reimplemented in GlutWindowExaminer. Definition at line 280 of file window.cpp. Referenced by GlutWindowExaminer::OnClose(). |
|
Handler for window draw events.
Definition at line 231 of file window.cpp. Referenced by captureRGB(), captureStencil(), and captureZBuffer(). |
|
Handler for tick events, if enabled.
Definition at line 241 of file window.cpp. References postRedisplay(). Referenced by OnPreTimer(). |
|
Handler for idle events, if enabled.
Definition at line 246 of file window.cpp. References postRedisplay(). |
|
Handler for timer events.
Definition at line 267 of file window.cpp. |
|
Handler for mouse entry/leave events. The state callback parameter is either GLUT_LEFT or GLUT_ENTERED depending on if the mouse pointer has last left or entered the window.
Definition at line 285 of file window.cpp. |
|
Open the window.
Definition at line 53 of file window.cpp. |
|
Grab an existing GLUT window.
Definition at line 66 of file window.cpp. References _windowID. |
|
Close the window.
Definition at line 59 of file window.cpp. Referenced by GlutWindowExaminer::OnKeyboard(), OnKeyboard(), and OnMenu(). |
|
Position the window.
Definition at line 114 of file window.cpp. Referenced by leaveGameMode(). |
|
Reshape (resize) the window.
Definition at line 120 of file window.cpp. Referenced by leaveGameMode(). |
|
Set window cursor.
setCursor()changes the cursor image of the current window. Each call requests the window system change the cursor appropriately. The cursor image when a window is created is GLUT_CURSOR_INHERIT. The exact cursor images used are implementation dependent. The intent is for the image to convey the meaning of the cursor name. For a top-level window, GLUT_CURSOR_INHERIT uses the default window system cursor. Definition at line 126 of file window.cpp. Referenced by GlutWindowExaminer::OnMotion(), and GlutWindowExaminer::OnMouse(). |
|
Enter fullscreen game mode.
Definition at line 79 of file window.cpp. Referenced by toggleGameMode(). |
|
Leave fullscreen game mode.
Definition at line 94 of file window.cpp. References position(), and reshape(). Referenced by toggleGameMode(). |
|
Toggle fullscreen game mode.
Definition at line 105 of file window.cpp. References enterGameMode(), and leaveGameMode(). Referenced by OnKeyboard(). |
|
Trigger a redraw.
Definition at line 150 of file window.cpp. Referenced by OnIdle(), GlutWindowExaminer::OnKeyboard(), GlutWindowExaminer::OnMotion(), OnReshape(), GlutWindowExaminer::OnSpecial(), and OnTick(). |
|
Configure a timer event to occur after an elapsed time period.
Definition at line 132 of file window.cpp. References uint32. |
|
Configure draw events to occur at a given frequency.
Definition at line 138 of file window.cpp. |
|
Window will receive OnIdle() events, continuously.
Definition at line 144 of file window.cpp. Referenced by GlutWindowExaminer::OnMouse(). |
|
Configure whether front and back buffers should be swapped after each redraw.
Definition at line 164 of file window.cpp. References _swapBuffers. |