Visualization Library 2.0.0-b3

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

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Public Types | Public Member Functions | Static Public Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
vlGLFW::GLFWWindow Class Reference

The GLFWWindow class implements an OpenGLContext using the GLFW API. More...

#include <GLFWWindow.hpp>

+ Inheritance diagram for vlGLFW::GLFWWindow:

Public Types

typedef std::map< ::GLFWwindow *, vlGLFW::GLFWWindow *> WinMapType
 

Public Member Functions

 GLFWWindow ()
 
 GLFWWindow (const vl::String &title, const vl::OpenGLContextFormat &info, int width, int height, GLFWwindow *share=NULL)
 Initializes and shows a GLFW window. More...
 
bool initGLFWWindow (const vl::String &title, const vl::OpenGLContextFormat &info, int width, int height, GLFWwindow *share=NULL)
 Initializes and shows a GLFW window. More...
 
 ~GLFWWindow ()
 
void quitApplication ()
 Attempts to quits the program by destroying all windows. More...
 
void makeCurrent ()
 Sets the OpenGL context as current for the calling thread. More...
 
void update ()
 If the OpenGLContext is a widget this function requests a redraw and generates an updateEvent(). More...
 
void swapBuffers ()
 Swaps the back and front buffers to present the last rendering. More...
 
bool setFullscreen (bool fs)
 If the OpenGL context is a widget this function requests a maximization to fullscreen. More...
 
void setWindowTitle (const vl::String &title)
 If the OpenGL context is a top window this function sets its title. More...
 
void setPosition (int x, int y)
 If the OpenGL context is a widget this function sets its position. More...
 
void setSize (int w, int h)
 If the OpenGL context is a widget this function sets its size. More...
 
vl::ivec2 position () const
 If the OpenGL context is a widget this function returns its position. More...
 
vl::ivec2 size () const
 
void show ()
 If the OpenGL context is a widget this function makes it visible to the user. More...
 
void hide ()
 If the OpenGL context is a widget this function makes it invisible to the user. More...
 
void getFocus ()
 If the OpenGL context is a widget this function requests the mouse focus on it. More...
 
void setMouseVisible (bool visible)
 If the OpenGL context is a widget this function sets whether the mouse is visible over it or not. More...
 
void setMousePosition (int x, int y)
 If the OpenGL context is a widget this function sets the mouse position. More...
 
const GLFWwindow * handle () const
 
GLFWwindow * handle ()
 
void destroyWindow ()
 
- Public Member Functions inherited from vl::OpenGLContext
 OpenGLContext (int w=0, int h=0)
 Constructor. More...
 
 ~OpenGLContext ()
 Destructor. More...
 
bool initGLContext (bool log=true)
 Initializes the supported OpenGL extensions. More...
 
void logOpenGLInfo ()
 Logs some information about the OpenGL context. More...
 
const std::string & extensions () const
 Returns the list of OpenGL extensions supported separated by '|' characters. More...
 
bool isExtensionSupported (const char *ext_name)
 Returns true if the given extension is supported. More...
 
void * getProcAddress (const char *function_name)
 Returns the address of an OpenGL extension function. More...
 
FramebufferleftFramebuffer ()
 The render target representing the default left framebuffer. More...
 
const FramebufferleftFramebuffer () const
 The render target representing the default left framebuffer. More...
 
FramebufferrightFramebuffer ()
 The render target representing the default right framebuffer (if a stereo OpenGL context is present). More...
 
const FramebufferrightFramebuffer () const
 The render target representing the default right framebuffer (if a stereo OpenGL context is present). More...
 
Framebufferframebuffer ()
 The default render target (always returns leftFramebuffer()). More...
 
const Framebufferframebuffer () const
 The default render target (always returns leftFramebuffer()). More...
 
ref< FramebufferObjectcreateFramebufferObject ()
 Equivalent to "createFramebufferObject(0,0);". More...
 
ref< FramebufferObjectcreateFramebufferObject (int width, int height, EReadDrawBuffer draw_buffer=RDB_COLOR_ATTACHMENT0, EReadDrawBuffer read_buffer=RDB_COLOR_ATTACHMENT0)
 Creates a new FramebufferObject (framebuffer object Framebuffer). More...
 
void destroyFramebufferObject (FramebufferObject *fbort)
 Destroys the specified FramebufferObject. More...
 
void destroyAllFramebufferObjects ()
 Removes all FramebufferObjects belonging to an OpenGLContext. More...
 
void destroyAllOpenGLResources ()
 Removes all OpenGL resources handled by the OpenGLContext. More...
 
virtual bool fullscreen () const
 If the OpenGL context is a widget this function returns whether it has been maximized to fullscreen. More...
 
int width () const
 Returns the width in pixels of an OpenGLContext. More...
 
int height () const
 Returns the height in pixels of an OpenGLContext. More...
 
virtual bool mouseVisible () const
 If the OpenGL context is a widget this function returns whether the mouse is visible over it or not. More...
 
void setVSyncEnabled (bool enable)
 If the OpenGL context is a widget this function enabled/disables double buffer swapping to the monitor's vertical synch. More...
 
bool vsyncEnabled () const
 If the OpenGL context is a widget this function returns whether vsync is enabled or not. More...
 
virtual void setContinuousUpdate (bool continuous)
 If the OpenGL context is a widget this function sets whether its area is continuously updated at each frame. More...
 
bool continuousUpdate () const
 If the OpenGL context is a widget this function returns whether its area is continuously updated at each frame. More...
 
void addEventListener (UIEventListener *el)
 Adds an UIEventListener to be notified of OpenGLContext related events. More...
 
void removeEventListener (UIEventListener *el)
 Removes an UIEventListener. More...
 
void eraseAllEventListeners ()
 Removes all UIEventListener previously registered. More...
 
const std::vector< ref< UIEventListener > > & eventListeners () const
 The currently UIEventListener registered to be notified of OpenGLContext related events. More...
 
const UIEventListenereventListener (int i) const
 Returns the i-th UIEventListener registered to an OpenGLContext. More...
 
UIEventListenereventListener (int i)
 Returns the i-th UIEventListener registered to an OpenGLContext. More...
 
int eventListenerCount () const
 Returns the number of UIEventListener registered to an OpenGLContext. More...
 
const OpenGLContextFormatopenglContextInfo () const
 Returns an OpenGLContextFormat structure describing an OpenGLContext. More...
 
void setOpenGLContextInfo (const OpenGLContextFormat &info)
 Sets the OpenGLContextFormat associated to an OpenGLContext. More...
 
void ignoreNextMouseMoveEvent ()
 Requests not to dispatch the next mouse move event. More...
 
void dispatchResizeEvent (int w, int h)
 Dispatches the UIEventListener::resizeEvent() notification to the subscribed UIEventListener objects. More...
 
void dispatchMouseMoveEvent (int x, int y)
 Dispatches the UIEventListener::mouseMoveEvent() notification to the subscribed UIEventListener objects. More...
 
void dispatchMouseUpEvent (EMouseButton button, int x, int y)
 Dispatches the UIEventListener::mouseUpEvent() notification to the subscribed UIEventListener objects. More...
 
void dispatchMouseDownEvent (EMouseButton button, int x, int y)
 Dispatches the UIEventListener::mouseDownEvent() notification to the subscribed UIEventListener objects. More...
 
void dispatchMouseWheelEvent (int n)
 Dispatches the UIEventListener::mouseWheelEvent() notification to the subscribed UIEventListener objects. More...
 
void dispatchKeyPressEvent (unsigned short unicode_ch, EKey key)
 Dispatches the UIEventListener::keyPressEvent() notification to the subscribed UIEventListener objects. More...
 
void dispatchKeyReleaseEvent (unsigned short unicode_ch, EKey key)
 Dispatches the UIEventListener::keyReleaseEvent() notification to the subscribed UIEventListener objects. More...
 
void dispatchDestroyEvent ()
 Dispatches the UIEventListener::destroyEvent() notification to the subscribed UIEventListener(s), calls destroyAllOpenGLResources() and eraseAllEventListeners() This event must be issued just before the actual GL context is destroyed. More...
 
void dispatchUpdateEvent ()
 Dispatches the UIEventListener::updateEvent() notification to the subscribed UIEventListener objects. More...
 
void dispatchVisibilityEvent (bool visible)
 Dispatches the UIEventListener::visibilityEvent() notification to the subscribed UIEventListener objects. More...
 
void dispatchInitEvent ()
 Dispatches the UIEventListener::initEvent() notification to the subscribed UIEventListener objects. More...
 
void dispatchFileDroppedEvent (const std::vector< String > &files)
 Dispatches the UIEventListener::fileDroppedEvent() notification to the subscribed UIEventListener objects. More...
 
const std::set< EKey > & keyboard () const
 Returns the std::set containing the currently pressed keys. More...
 
bool isKeyPressed (EKey key) const
 Returns true if the given key is pressed. More...
 
void keyPress (EKey key)
 Inserts the specified key in the set of currently active keys - For internal use only. More...
 
void keyRelease (EKey key)
 Removes the specified key from the set of currently active keys - For internal use only. More...
 
bool isInitialized () const
 Returns true if the OpenGLContext is in an initialized state. More...
 
int vertexAttribCount () const
 The number (clamped to VA_MaxAttribCount) of generic vertex attributes as returned by glGet(GL_MAX_VERTEX_ATTRIBS) More...
 
int textureImageUnitCount () const
 The number (clamped to VL_MAX_TEXTURE_IMAGE_UNITS) of texture image units supported by the current hardware. More...
 
int textureCoordCount () const
 The number (clamped to VL_MAX_LEGACY_TEXTURE_UNITS) of fixed function pipeline texture units supported by the current hardware. More...
 
bool hasDoubleBuffer () const
 Returns true if an OpenGLContext supports double buffering. More...
 
void useGLSLProgram (const GLSLProgram *glsl)
 Activates the given GLSLProgram or unbinds the current one if glsl is NULL. More...
 
void bindVAS (const IVertexAttribSet *vas, bool use_vbo, bool force)
 Activates the specified vertex attribute set - For internal use only. More...
 
void bindVAS_Attribs (const IVertexAttribSet *vas, bool use_vbo)
 
void bindVAS_Fixed (const IVertexAttribSet *vas, bool use_vbo)
 
void bindVAS_Reset ()
 
void applyEnables (const EnableSet *cur)
 Applies an EnableSet to an OpenGLContext - Typically for internal use only. More...
 
void applyRenderStates (const RenderStateSet *cur, const Camera *camera)
 Applies a RenderStateSet to an OpenGLContext - Typically for internal use only. More...
 
void resetEnables ()
 Resets all the interanal enable-tables - For internal use only. More...
 
void resetRenderStates ()
 Resets all the interanal render-states-tables - For internal use only. More...
 
void setDefaultRenderState (const RenderStateSlot &rs_slot)
 Defines the default render state slot to be used by the opengl context. More...
 
const RenderStateSlotdefaultRenderState (ERenderState rs)
 Returns the default render state slot used by VL when a specific render state type is left undefined. More...
 
void resetContextStates (EResetContextStates start_or_finish)
 Resets the OpenGL states necessary to begin and finish a rendering. - For internal use only. More...
 
void setTexUnitBinding (int unit_i, ETextureDimension target)
 Declares that texture unit unit_i is currently bound to the specified texture target. - For internal use only. More...
 
ETextureDimension texUnitBinding (int unit_i) const
 Returnes the texture target currently active for the specified texture unit. - For internal use only. More...
 
const GLSLProgramglslProgram () const
 
GLSLProgramglslProgram ()
 
bool isCleanState (bool verbose)
 Checks whether the OpenGL state is clean or not. More...
 
const fvec3normal () const
 
const fvec4color () const
 
const fvec3secondaryColor () const
 
const fvec4vertexAttribValue (int i) const
 
- Public Member Functions inherited from vl::Object
 Object ()
 Constructor. More...
 
 Object (const Object &other)
 Copy constructor: copies the name, ref count mutex and user data. More...
 
Objectoperator= (const Object &other)
 Copy operator: copies the object's name, ref count mutex and user data. More...
 
const std::string & objectName () const
 The name of the object, by default set to the object's class name. More...
 
void setObjectName (const char *name)
 The name of the object, by default set to the object's class name in debug builds. More...
 
void setObjectName (const std::string &name)
 The name of the object, by default set to the object's class name in debug builds. More...
 
void setRefCountMutex (IMutex *mutex)
 The mutex used to protect the reference counting of an Object across multiple threads. More...
 
IMutexrefCountMutex ()
 The mutex used to protect the reference counting of an Object across multiple threads. More...
 
const IMutexrefCountMutex () const
 The mutex used to protect the reference counting of an Object across multiple threads. More...
 
int referenceCount () const
 Returns the number of references of an object. More...
 
void incReference () const
 Increments the reference count of an object. More...
 
void decReference ()
 Decrements the reference count of an object and deletes it if both automaticDelete() is true the count reaches 0. More...
 
void setAutomaticDelete (bool autodel_on)
 If set to true the Object is deleted when its reference count reaches 0. More...
 
bool automaticDelete () const
 If set to true the Object is deleted when its reference count reaches 0. More...
 
template<class T >
T * as ()
 Casts an Object to the specified class. More...
 
template<class T >
const T * as () const
 Casts an Object to the specified class. More...
 

Static Public Member Functions

static const WinMapTypewindows ()
 
- Static Public Member Functions inherited from vl::OpenGLContext
static bool areUniformsColliding (const UniformSet *u1, const UniformSet *u2)
 Returns true if the two UniformSet contain at least one Uniform variable with the same name. More...
 

Static Protected Member Functions

static void glfw_size_callback (GLFWwindow *window, int w, int h)
 
static void glfw_pos_callback (GLFWwindow *window, int x, int y)
 
static void glfw_refresh_callback (GLFWwindow *window)
 
static void glfw_close_callback (GLFWwindow *window)
 
static void glfw_focus_callback (GLFWwindow *window, int)
 
static void glfw_iconify_callback (GLFWwindow *window, int)
 
static vl::EKey translateKey (int key, int scancode, int mods)
 
static void glfw_key_callback (GLFWwindow *window, int key, int scancode, int action, int mods)
 
static void glfw_unicode_callback (GLFWwindow *, unsigned int)
 
static void glfw_cursor_enter_callback (GLFWwindow *, int)
 
static void glfw_cursor_pos_callback (GLFWwindow *, double, double)
 
static void glfw_mouse_button_callback (GLFWwindow *, int, int, int)
 
static void glfw_scroll_callback (GLFWwindow *, double, double)
 
static void glfw_drop_callback (GLFWwindow *, int, const char **)
 

Protected Attributes

unsigned short mUnicodeChar
 
GLFWwindow * mHandle
 
- Protected Attributes inherited from vl::OpenGLContext
ref< FramebuffermLeftFramebuffer
 
ref< FramebuffermRightFramebuffer
 
std::vector< ref< FramebufferObject > > mFramebufferObject
 
std::vector< ref< UIEventListener > > mEventListeners
 
std::set< EKeymKeyboard
 
OpenGLContextFormat mGLContextInfo
 
int mVertexAttribCount
 
int mTextureImageUnitCount
 
int mTextureCoordCount
 
bool mMouseVisible
 
bool mContinuousUpdate
 
bool mIgnoreNextMouseMoveEvent
 
bool mFullscreen
 
bool mHasDoubleBuffer
 
bool mIsInitialized
 
std::string mExtensions
 
RenderStateSlot mDefaultRenderStates [RS_RenderStateCount]
 
ref< NaryQuickMap< EEnable, EEnable, EN_EnableCount > > mCurrentEnableSet
 
ref< NaryQuickMap< EEnable, EEnable, EN_EnableCount > > mNewEnableSet
 
ref< NaryQuickMap< ERenderState, RenderStateSlot, RS_RenderStateCount > > mCurrentRenderStateSet
 
ref< NaryQuickMap< ERenderState, RenderStateSlot, RS_RenderStateCount > > mNewRenderStateSet
 
ETextureDimension mTexUnitBinding [VL_MAX_TEXTURE_IMAGE_UNITS]
 
ref< GLSLProgrammGLSLProgram
 
bool mGLSLUpdated
 
const IVertexAttribSetmCurVAS
 
VertexArrayInfo mVertexArray
 
VertexArrayInfo mNormalArray
 
VertexArrayInfo mColorArray
 
VertexArrayInfo mSecondaryColorArray
 
VertexArrayInfo mFogArray
 
VertexArrayInfo mTexCoordArray [VA_MaxTexCoordCount]
 
VertexArrayInfo mVertexAttrib [VA_MaxAttribCount]
 
fvec3 mNormal
 
fvec4 mColor
 
fvec3 mSecondaryColor
 
fvec4 mVertexAttribValue [VA_MaxAttribCount]
 
GLuint mDefaultVAO
 
- Protected Attributes inherited from vl::Object
std::string mObjectName
 
IMutexmRefCountMutex
 
int mReferenceCount
 
bool mAutomaticDelete
 

Static Protected Attributes

static WinMapType mWinMap
 

Additional Inherited Members

- Protected Member Functions inherited from vl::Object
virtual ~Object ()
 

Detailed Description

The GLFWWindow class implements an OpenGLContext using the GLFW API.

Definition at line 50 of file GLFWWindow.hpp.

Member Typedef Documentation

◆ WinMapType

typedef std::map< ::GLFWwindow*, vlGLFW::GLFWWindow* > vlGLFW::GLFWWindow::WinMapType

Definition at line 53 of file GLFWWindow.hpp.

Constructor & Destructor Documentation

◆ GLFWWindow() [1/2]

GLFWWindow::GLFWWindow ( )

Definition at line 48 of file GLFWWindow.cpp.

References NULL.

◆ GLFWWindow() [2/2]

GLFWWindow::GLFWWindow ( const vl::String title,
const vl::OpenGLContextFormat info,
int  width,
int  height,
GLFWwindow *  share = NULL 
)

Initializes and shows a GLFW window.

Parameters
[in]titleThe title of the window
[in]infoThe options for the new OpenGL context
[in]widthWidth of the window. If set to 0 and full screen mode is selected it will default to the monitor's size
[in]heightHeight of the window. If set to 0 and full screen mode is selected it will default to the monitor's size
[in]shareIf not NULL the OpenGL context will be shared with the given GLFWwindow

Definition at line 54 of file GLFWWindow.cpp.

References NULL.

◆ ~GLFWWindow()

GLFWWindow::~GLFWWindow ( )

Definition at line 43 of file GLFWWindow.cpp.

Member Function Documentation

◆ destroyWindow()

void GLFWWindow::destroyWindow ( )

Definition at line 169 of file GLFWWindow.cpp.

References NULL.

Referenced by glfw_close_callback().

◆ getFocus()

void GLFWWindow::getFocus ( )
virtual

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

Reimplemented from vl::OpenGLContext.

Definition at line 458 of file GLFWWindow.cpp.

◆ glfw_close_callback()

void GLFWWindow::glfw_close_callback ( GLFWwindow *  window)
staticprotected

Definition at line 227 of file GLFWWindow.cpp.

References destroyWindow(), and NULL.

◆ glfw_cursor_enter_callback()

void GLFWWindow::glfw_cursor_enter_callback ( GLFWwindow *  window,
int  entered 
)
staticprotected

Definition at line 291 of file GLFWWindow.cpp.

References NULL.

◆ glfw_cursor_pos_callback()

void GLFWWindow::glfw_cursor_pos_callback ( GLFWwindow *  window,
double  dx,
double  dy 
)
staticprotected

Definition at line 300 of file GLFWWindow.cpp.

References vl::OpenGLContext::dispatchMouseMoveEvent(), vl::floor(), and NULL.

◆ glfw_drop_callback()

void GLFWWindow::glfw_drop_callback ( GLFWwindow *  window,
int  count,
const char **  df 
)
staticprotected

Definition at line 354 of file GLFWWindow.cpp.

References vl::OpenGLContext::dispatchFileDroppedEvent(), and NULL.

◆ glfw_focus_callback()

void GLFWWindow::glfw_focus_callback ( GLFWwindow *  window,
int  focused 
)
staticprotected

Definition at line 238 of file GLFWWindow.cpp.

References NULL.

◆ glfw_iconify_callback()

void GLFWWindow::glfw_iconify_callback ( GLFWwindow *  window,
int  iconified 
)
staticprotected

Definition at line 248 of file GLFWWindow.cpp.

References vl::OpenGLContext::dispatchVisibilityEvent(), and NULL.

◆ glfw_key_callback()

void GLFWWindow::glfw_key_callback ( GLFWwindow *  window,
int  key,
int  scancode,
int  action,
int  mods 
)
staticprotected

◆ glfw_mouse_button_callback()

void GLFWWindow::glfw_mouse_button_callback ( GLFWwindow *  window,
int  button,
int  action,
int  mods 
)
staticprotected

◆ glfw_pos_callback()

void GLFWWindow::glfw_pos_callback ( GLFWwindow *  window,
int  x,
int  y 
)
staticprotected

Definition at line 208 of file GLFWWindow.cpp.

References NULL.

◆ glfw_refresh_callback()

void GLFWWindow::glfw_refresh_callback ( GLFWwindow *  window)
staticprotected

Definition at line 218 of file GLFWWindow.cpp.

References vl::OpenGLContext::dispatchUpdateEvent(), and NULL.

◆ glfw_scroll_callback()

void GLFWWindow::glfw_scroll_callback ( GLFWwindow *  window,
double  dx,
double  dy 
)
staticprotected

Definition at line 343 of file GLFWWindow.cpp.

References vl::OpenGLContext::dispatchMouseWheelEvent(), vl::floor(), and NULL.

◆ glfw_size_callback()

void GLFWWindow::glfw_size_callback ( GLFWwindow *  window,
int  w,
int  h 
)
staticprotected

Definition at line 199 of file GLFWWindow.cpp.

References vl::OpenGLContext::dispatchResizeEvent(), and NULL.

◆ glfw_unicode_callback()

void GLFWWindow::glfw_unicode_callback ( GLFWwindow *  window,
unsigned int  unicode 
)
staticprotected

Definition at line 278 of file GLFWWindow.cpp.

References mUnicodeChar, and NULL.

◆ handle() [1/2]

const GLFWwindow* vlGLFW::GLFWWindow::handle ( ) const
inline

Definition at line 114 of file GLFWWindow.hpp.

◆ handle() [2/2]

GLFWwindow* vlGLFW::GLFWWindow::handle ( )
inline

Definition at line 116 of file GLFWWindow.hpp.

◆ hide()

void GLFWWindow::hide ( )
virtual

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

Reimplemented from vl::OpenGLContext.

Definition at line 450 of file GLFWWindow.cpp.

◆ initGLFWWindow()

bool GLFWWindow::initGLFWWindow ( const vl::String title,
const vl::OpenGLContextFormat info,
int  width,
int  height,
GLFWwindow *  share = NULL 
)

Initializes and shows a GLFW window.

Parameters
[in]titleThe title of the window
[in]infoThe options for the new OpenGL context
[in]widthWidth of the window. If set to 0 and full screen mode is selected it will default to the monitor's size
[in]heightHeight of the window. If set to 0 and full screen mode is selected it will default to the monitor's size
[in]shareIf not NULL the OpenGL context will be shared with the given GLFWwindow

Definition at line 63 of file GLFWWindow.cpp.

References vl::Vector4< T_Scalar >::a(), vl::OpenGLContextFormat::accumRGBABits(), vl::Vector4< T_Scalar >::b(), vl::OpenGLContextFormat::depthBufferBits(), vl::OpenGLContextFormat::doubleBuffer(), vl::OpenGLContextFormat::fullscreen(), vl::Vector4< T_Scalar >::g(), vl::GLP_Compatibility, vl::GLP_Core, vl::GLP_Default, vl::OpenGLContextFormat::majVersion(), vl::OpenGLContextFormat::minVersion(), vl::OpenGLContextFormat::multisample(), vl::OpenGLContextFormat::multisampleSamples(), NULL, vl::OpenGLContextFormat::openGLProfile(), vl::Vector4< T_Scalar >::r(), vl::OpenGLContextFormat::rgbaBits(), vl::OpenGLContextFormat::stencilBufferBits(), vl::OpenGLContextFormat::stereo(), and vl::String::toStdString().

◆ makeCurrent()

void GLFWWindow::makeCurrent ( )
virtual

Sets the OpenGL context as current for the calling thread.

Implements vl::OpenGLContext.

Definition at line 180 of file GLFWWindow.cpp.

◆ position()

vl::ivec2 GLFWWindow::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 GLFWWindow.cpp.

◆ quitApplication()

void vlGLFW::GLFWWindow::quitApplication ( )
inlinevirtual

Attempts to quits the program by destroying all windows.

Reimplemented from vl::OpenGLContext.

Definition at line 77 of file GLFWWindow.hpp.

◆ setFullscreen()

bool GLFWWindow::setFullscreen ( bool  )
virtual

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

Reimplemented from vl::OpenGLContext.

Definition at line 367 of file GLFWWindow.cpp.

◆ setMousePosition()

void GLFWWindow::setMousePosition ( int  ,
int   
)
virtual

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

Reimplemented from vl::OpenGLContext.

Definition at line 474 of file GLFWWindow.cpp.

◆ setMouseVisible()

void GLFWWindow::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 466 of file GLFWWindow.cpp.

◆ setPosition()

void GLFWWindow::setPosition ( int  ,
int   
)
virtual

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

Reimplemented from vl::OpenGLContext.

Definition at line 406 of file GLFWWindow.cpp.

◆ setSize()

void GLFWWindow::setSize ( int  ,
int   
)
virtual

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

Reimplemented from vl::OpenGLContext.

Definition at line 414 of file GLFWWindow.cpp.

◆ setWindowTitle()

void GLFWWindow::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 398 of file GLFWWindow.cpp.

References vl::String::toStdString().

◆ show()

void GLFWWindow::show ( )
virtual

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

Reimplemented from vl::OpenGLContext.

Definition at line 442 of file GLFWWindow.cpp.

◆ size()

vl::ivec2 GLFWWindow::size ( ) const

Definition at line 432 of file GLFWWindow.cpp.

◆ swapBuffers()

void GLFWWindow::swapBuffers ( )
virtual

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

Implements vl::OpenGLContext.

Definition at line 192 of file GLFWWindow.cpp.

◆ translateKey()

vl::EKey GLFWWindow::translateKey ( int  key,
int  scancode,
int  mods 
)
staticprotected

◆ update()

void GLFWWindow::update ( )
virtual

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

Implements vl::OpenGLContext.

Definition at line 188 of file GLFWWindow.cpp.

◆ windows()

static const WinMapType& vlGLFW::GLFWWindow::windows ( )
inlinestatic

Definition at line 120 of file GLFWWindow.hpp.

References translateKey().

Member Data Documentation

◆ mHandle

GLFWwindow* vlGLFW::GLFWWindow::mHandle
protected

Definition at line 156 of file GLFWWindow.hpp.

◆ mUnicodeChar

unsigned short vlGLFW::GLFWWindow::mUnicodeChar
protected

Definition at line 155 of file GLFWWindow.hpp.

Referenced by glfw_key_callback(), and glfw_unicode_callback().

◆ mWinMap

GLFWWindow::WinMapType GLFWWindow::mWinMap
staticprotected

Definition at line 154 of file GLFWWindow.hpp.


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