Visualization Library

A lightweight C++ OpenGL middleware for 2D/3D graphics
[Home] [Tutorials] [All Classes] [Grouped Classes]
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes

vlGLUT::GLUTWindow Class Reference

The GLUTWindow class implements an OpenGLContext using the GLUT API. More...

#include <GLUTWindow.hpp>

Inheritance diagram for vlGLUT::GLUTWindow:
vl::OpenGLContext vl::Object

List of all members.

Public Member Functions

 GLUTWindow ()
 GLUTWindow (const vl::String &title, const vl::OpenGLContextFormat &info, int x, int y, int width, int height)
bool initGLUTWindow (const vl::String &title, const vl::OpenGLContextFormat &info, int x, int y, int width, int height)
 Initializes and shows a GLUT window.
 ~GLUTWindow ()
virtual void setMouseVisible (bool visible)
 If the OpenGL context is a widget this function sets whether the mouse is visible over it or not.
virtual void setMousePosition (int x, int y)
 If the OpenGL context is a widget this function sets the mouse position.
void quitApplication ()
 Quits the progra calling the C function exit(0).
void update ()
 If the OpenGLContext is a widget this function requests a redraw.
bool setFullscreen (bool fs)
 If the OpenGL context is a widget this function requests a maximization to fullscreen.
void makeCurrent ()
 Sets the OpenGL context as current for the calling thread.
void destroy ()
 This function should be appropriately reimplemented in all the subclasses of OpenGLContext.
void updateOverlay ()
void swapBuffers ()
 Swaps the back and front buffers to present the last rendering.
void setWindowTitle (const vl::String &title)
 If the OpenGL context is a top window this function sets its title.
int handle () const
void setPosition (int x, int y)
 If the OpenGL context is a widget this function sets its position.
void setSize (int w, int h)
 If the OpenGL context is a widget this function sets its size.
vl::ivec2 position () const
 If the OpenGL context is a widget this function returns its position.
vl::ivec2 size () const
void show ()
 If the OpenGL context is a widget this function makes it visible to the user.
void hide ()
 If the OpenGL context is a widget this function makes it invisible to the user.
void getFocus ()
 If the OpenGL context is a widget this function requests the mouse focus on it.

Protected Member Functions

void initKeymap ()
vl::EKey mapAsciiKey (unsigned char ascii)
void updateModifiers ()

Static Protected Member Functions

static vl::EKey mapSpecialKey (int special_key)
static void glut_keyboard_func (unsigned char ch, int x, int y)
static void glut_keyboard_up_func (unsigned char ch, int x, int y)
static void glut_special_func (int key, int x, int y)
static void glut_special_up_func (int key, int x, int y)
static void glut_mouse_func (int button, int state, int x, int y)
static void glut_motion_func (int x, int y)
static void glut_passive_motion_func (int x, int y)
static void glut_mouse_wheel_func (int a, int rotation, int c, int d)
static void glut_visibility_func (int visibility)
static void glut_reshape_func (int w, int h)
static void glut_display_func ()
static void glut_wmclose_func ()
static void glut_close_func ()
static void glut_idle_func ()

Protected Attributes

std::map< unsigned char, vl::EKeymKeymap
int mHandle
bool mInited

Static Protected Attributes

static std::map< int,
GLUTWindow * > 
mWinMap

Detailed Description

The GLUTWindow class implements an OpenGLContext using the GLUT API.


Constructor & Destructor Documentation

GLUTWindow::GLUTWindow (  )
GLUTWindow::GLUTWindow ( const vl::String title,
const vl::OpenGLContextFormat info,
int  x,
int  y,
int  width,
int  height 
)
vlGLUT::GLUTWindow::~GLUTWindow (  ) [inline]

Member Function Documentation

bool GLUTWindow::initGLUTWindow ( const vl::String title,
const vl::OpenGLContextFormat info,
int  x,
int  y,
int  width,
int  height 
)

Initializes and shows a GLUT window.

*

*

*

*

*

*

*

*

*

*

*

*

*

*

void GLUTWindow::setMouseVisible ( bool   ) [virtual]

If the OpenGL context is a widget this function sets whether the mouse is visible over it or not.

Reimplemented from vl::OpenGLContext.

void GLUTWindow::setMousePosition ( int  ,
int   
) [virtual]

If the OpenGL context is a widget this function sets the mouse position.

Reimplemented from vl::OpenGLContext.

void vlGLUT::GLUTWindow::quitApplication (  ) [inline, virtual]

Quits the progra calling the C function exit(0).

Reimplemented from vl::OpenGLContext.

void GLUTWindow::update (  ) [virtual]

If the OpenGLContext is a widget this function requests a redraw.

Reimplemented from vl::OpenGLContext.

bool GLUTWindow::setFullscreen ( bool   ) [virtual]

If the OpenGL context is a widget this function requests a maximization to fullscreen.

Reimplemented from vl::OpenGLContext.

void GLUTWindow::makeCurrent (  ) [virtual]

Sets the OpenGL context as current for the calling thread.

Implements vl::OpenGLContext.

void GLUTWindow::destroy (  ) [virtual]

This function should be appropriately reimplemented in all the subclasses of OpenGLContext.

Reimplemented from vl::OpenGLContext.

void GLUTWindow::updateOverlay (  )
void GLUTWindow::swapBuffers (  ) [virtual]

Swaps the back and front buffers to present the last rendering.

Implements vl::OpenGLContext.

void GLUTWindow::setWindowTitle ( const vl::String  ) [virtual]

If the OpenGL context is a top window this function sets its title.

Reimplemented from vl::OpenGLContext.

int vlGLUT::GLUTWindow::handle (  ) const [inline]
void GLUTWindow::setPosition ( int  ,
int   
) [virtual]

If the OpenGL context is a widget this function sets its position.

Reimplemented from vl::OpenGLContext.

void GLUTWindow::setSize ( int  ,
int   
) [virtual]

If the OpenGL context is a widget this function sets its size.

Reimplemented from vl::OpenGLContext.

vl::ivec2 GLUTWindow::position (  ) const [virtual]

If the OpenGL context is a widget this function returns its position.

Reimplemented from vl::OpenGLContext.

vl::ivec2 GLUTWindow::size (  ) const
void GLUTWindow::show (  ) [virtual]

If the OpenGL context is a widget this function makes it visible to the user.

Reimplemented from vl::OpenGLContext.

void GLUTWindow::hide (  ) [virtual]

If the OpenGL context is a widget this function makes it invisible to the user.

Reimplemented from vl::OpenGLContext.

void GLUTWindow::getFocus (  ) [virtual]

If the OpenGL context is a widget this function requests the mouse focus on it.

Reimplemented from vl::OpenGLContext.

void GLUTWindow::initKeymap (  ) [protected]
vl::EKey GLUTWindow::mapAsciiKey ( unsigned char  ascii ) [protected]
vl::EKey GLUTWindow::mapSpecialKey ( int  special_key ) [static, protected]
void GLUTWindow::updateModifiers (  ) [protected]
void GLUTWindow::glut_keyboard_func ( unsigned char  ch,
int  x,
int  y 
) [static, protected]
void GLUTWindow::glut_keyboard_up_func ( unsigned char  ch,
int  x,
int  y 
) [static, protected]
void GLUTWindow::glut_special_func ( int  key,
int  x,
int  y 
) [static, protected]
void GLUTWindow::glut_special_up_func ( int  key,
int  x,
int  y 
) [static, protected]
void GLUTWindow::glut_mouse_func ( int  button,
int  state,
int  x,
int  y 
) [static, protected]
void GLUTWindow::glut_motion_func ( int  x,
int  y 
) [static, protected]
void GLUTWindow::glut_passive_motion_func ( int  x,
int  y 
) [static, protected]
void GLUTWindow::glut_mouse_wheel_func ( int  a,
int  rotation,
int  c,
int  d 
) [static, protected]
void GLUTWindow::glut_visibility_func ( int  visibility ) [static, protected]
void GLUTWindow::glut_reshape_func ( int  w,
int  h 
) [static, protected]
void GLUTWindow::glut_display_func (  ) [static, protected]
void GLUTWindow::glut_wmclose_func (  ) [static, protected]
void GLUTWindow::glut_close_func (  ) [static, protected]
void GLUTWindow::glut_idle_func (  ) [static, protected]

Member Data Documentation

std::map<unsigned char, vl::EKey> vlGLUT::GLUTWindow::mKeymap [protected]
int vlGLUT::GLUTWindow::mHandle [protected]
bool vlGLUT::GLUTWindow::mInited [protected]
std::map< int, GLUTWindow * > GLUTWindow::mWinMap [static, protected]

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

Visualization Library v2010.11.1125 Reference Documentation
Copyright 2005-2009 Michele Bosi. All rights reserved.
Updated on Fri Nov 26 2010 10:33:55.
Permission is granted to use this page to write and publish articles regarding Visualization Library.