Visualization Library v1.0.3

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [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 and generates an updateEvent().
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 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 destroyWindow ()
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_close_func ()
static void glut_wmclose_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.

Definition at line 59 of file GLUTWindow.hpp.


Constructor & Destructor Documentation

GLUTWindow::GLUTWindow (  )

Definition at line 44 of file GLUTWindow.cpp.

References mHandle, and mInited.

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

Definition at line 50 of file GLUTWindow.cpp.

References initGLUTWindow(), mHandle, and mInited.

vlGLUT::GLUTWindow::~GLUTWindow (  ) [inline]

Definition at line 69 of file GLUTWindow.hpp.


Member Function Documentation

bool GLUTWindow::initGLUTWindow ( const vl::String title,
const vl::OpenGLContextFormat info,
int  x,
int  y,
int  width,
int  height 
)
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.

Definition at line 315 of file GLUTWindow.cpp.

References vl::OpenGLContext::mMouseVisible.

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

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

Reimplemented from vl::OpenGLContext.

Definition at line 324 of file GLUTWindow.cpp.

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

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

Reimplemented from vl::OpenGLContext.

Definition at line 79 of file GLUTWindow.hpp.

void GLUTWindow::update (  ) [virtual]

If the OpenGLContext is a widget this function requests a redraw and generates an updateEvent().

Implements vl::OpenGLContext.

Definition at line 329 of file GLUTWindow.cpp.

References handle().

bool GLUTWindow::setFullscreen ( bool   ) [virtual]

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

Reimplemented from vl::OpenGLContext.

Definition at line 284 of file GLUTWindow.cpp.

References handle(), vl::OpenGLContext::height(), vl::OpenGLContext::mFullscreen, NULL, and vl::OpenGLContext::width().

void GLUTWindow::makeCurrent (  ) [virtual]

Sets the OpenGL context as current for the calling thread.

Implements vl::OpenGLContext.

Definition at line 335 of file GLUTWindow.cpp.

References handle().

void GLUTWindow::updateOverlay (  )

Definition at line 351 of file GLUTWindow.cpp.

void GLUTWindow::swapBuffers (  ) [virtual]

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

Implements vl::OpenGLContext.

Definition at line 356 of file GLUTWindow.cpp.

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

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

Reimplemented from vl::OpenGLContext.

Definition at line 389 of file GLUTWindow.cpp.

References handle(), and vl::String::toStdString().

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.

Definition at line 400 of file GLUTWindow.cpp.

References handle().

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

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

Reimplemented from vl::OpenGLContext.

Definition at line 411 of file GLUTWindow.cpp.

References handle().

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

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

Reimplemented from vl::OpenGLContext.

Definition at line 422 of file GLUTWindow.cpp.

References handle().

vl::ivec2 GLUTWindow::size (  ) const

Definition at line 436 of file GLUTWindow.cpp.

References handle().

void GLUTWindow::show (  ) [virtual]

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

Reimplemented from vl::OpenGLContext.

Definition at line 361 of file GLUTWindow.cpp.

References handle().

void GLUTWindow::hide (  ) [virtual]

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

Reimplemented from vl::OpenGLContext.

Definition at line 372 of file GLUTWindow.cpp.

References handle().

void GLUTWindow::getFocus (  ) [virtual]

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

Reimplemented from vl::OpenGLContext.

Definition at line 383 of file GLUTWindow.cpp.

References handle().

void GLUTWindow::destroyWindow (  ) [protected]

Definition at line 341 of file GLUTWindow.cpp.

References handle().

void GLUTWindow::initKeymap (  ) [protected]
vl::EKey GLUTWindow::mapAsciiKey ( unsigned char  ascii ) [protected]

Definition at line 555 of file GLUTWindow.cpp.

References vl::Key_Unknown, and mKeymap.

Referenced by glut_keyboard_func(), and glut_keyboard_up_func().

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]

Definition at line 670 of file GLUTWindow.cpp.

References vl::OpenGLContext::dispatchMouseMoveEvent(), mWinMap, and VL_CHECK.

Referenced by initGLUTWindow().

void GLUTWindow::glut_passive_motion_func ( int  x,
int  y 
) [static, protected]

Definition at line 681 of file GLUTWindow.cpp.

References vl::OpenGLContext::dispatchMouseMoveEvent(), mInited, mWinMap, and VL_CHECK.

Referenced by initGLUTWindow().

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]

Definition at line 706 of file GLUTWindow.cpp.

References vl::OpenGLContext::dispatchVisibilityEvent(), mWinMap, and VL_CHECK.

Referenced by initGLUTWindow().

void GLUTWindow::glut_reshape_func ( int  w,
int  h 
) [static, protected]
void GLUTWindow::glut_display_func (  ) [static, protected]

Definition at line 734 of file GLUTWindow.cpp.

References vl::OpenGLContext::dispatchRunEvent(), mWinMap, and VL_CHECK.

Referenced by initGLUTWindow().

void GLUTWindow::glut_close_func (  ) [static, protected]
void GLUTWindow::glut_wmclose_func (  ) [static, protected]

Definition at line 763 of file GLUTWindow.cpp.

References glut_close_func().

Referenced by initGLUTWindow().

void GLUTWindow::glut_idle_func (  ) [static, protected]

Definition at line 768 of file GLUTWindow.cpp.

References mWinMap, and vl::Time::sleep().

Referenced by initGLUTWindow().


Member Data Documentation

std::map<unsigned char, vl::EKey> vlGLUT::GLUTWindow::mKeymap [protected]

Definition at line 157 of file GLUTWindow.hpp.

Referenced by glut_close_func(), initKeymap(), and mapAsciiKey().

int vlGLUT::GLUTWindow::mHandle [protected]

Definition at line 158 of file GLUTWindow.hpp.

Referenced by glut_close_func(), GLUTWindow(), and initGLUTWindow().

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 v1.0.3 Reference Documentation
Copyright Michele Bosi. All rights reserved.
Updated on Tue Feb 7 2017 00:55:12.
Permission is granted to use this page to write and publish articles regarding Visualization Library.