Visualization Library 2.0.0

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

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Classes | Public Member Functions | Static Public Member Functions | Protected Attributes | Friends | List of all members
vl::OpenGLContext Class Referenceabstract

Represents an OpenGL context, possibly a widget or a pbuffer, which can also respond to keyboard, mouse or system events. More...

#include <OpenGLContext.hpp>

+ Inheritance diagram for vl::OpenGLContext:

Public Member Functions

 OpenGLContext (int w=0, int h=0)
 Constructor. More...
 
 ~OpenGLContext ()
 Destructor. More...
 
virtual void swapBuffers ()=0
 Swaps the back and front buffers to present the last rendering. More...
 
virtual void makeCurrent ()=0
 Sets the OpenGL context as current for the calling thread. 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 void quitApplication ()
 Asks to the windowing system that is managing the OpenGLContext to quit the application. More...
 
virtual void update ()=0
 If the OpenGLContext is a widget this function requests a redraw and generates an updateEvent(). More...
 
virtual void setWindowTitle (const String &)
 If the OpenGL context is a top window this function sets its title. More...
 
virtual bool setFullscreen (bool)
 If the OpenGL context is a widget this function requests a maximization to fullscreen. More...
 
virtual bool fullscreen () const
 If the OpenGL context is a widget this function returns whether it has been maximized to fullscreen. More...
 
virtual void show ()
 If the OpenGL context is a widget this function makes it visible to the user. More...
 
virtual void hide ()
 If the OpenGL context is a widget this function makes it invisible to the user. More...
 
virtual void setPosition (int, int)
 If the OpenGL context is a widget this function sets its position. More...
 
virtual ivec2 position () const
 If the OpenGL context is a widget this function returns its position. More...
 
virtual void setSize (int, int)
 If the OpenGL context is a widget this function sets its size. 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 void setMouseVisible (bool)
 If the OpenGL context is a widget this function sets whether the mouse is visible over it or not. 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...
 
virtual void setMousePosition (int, int)
 If the OpenGL context is a widget this function sets the mouse position. More...
 
virtual void getFocus ()
 If the OpenGL context is a widget this function requests the mouse focus on it. 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 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...
 

Protected Attributes

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
 

Friends

class VertexAttrib
 
class Color
 
class SecondaryColor
 
class Normal
 

Additional Inherited Members

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

Detailed Description

Represents an OpenGL context, possibly a widget or a pbuffer, which can also respond to keyboard, mouse or system events.

OpenGLContext is an abstract class that wraps a minimal common subset of GUI APIs like Win32, Qt, wxWidgets, SDL, GLUT, etc.
In order to respond to the events generated by the OpenGLContext you must subclass an UIEventListener and bind it to the OpenGLContext using the functions addEventListener(ref<UIEventListener>) and removeEventListener(ref<UIEventListener>).

OpenGLContext Custom Implementation
  • Key_Alt/Ctrl/Shift events must always be notified before Key_Left/Right-Alt/Ctrl/Shift events.
  • Always update the mKeyboard structure appropriately especially with respect to Key_[Left/Right]-Alt/Ctrl/Shift events.
  • When cycling through EventListeners to dispatch the events you must do it on a temporary copy of mEventListeners so that the EventListeners can safely add/remove themselves or other EventListeners to the OpenGLContext itself.

Definition at line 144 of file OpenGLContext.hpp.

Constructor & Destructor Documentation

◆ OpenGLContext()

OpenGLContext::OpenGLContext ( int  w = 0,
int  h = 0 
)

Constructor.

Definition at line 55 of file OpenGLContext.cpp.

References NULL, vl::RDB_BACK_LEFT, and vl::RDB_BACK_RIGHT.

◆ ~OpenGLContext()

OpenGLContext::~OpenGLContext ( )

Destructor.

Definition at line 92 of file OpenGLContext.cpp.

References VL_TRAP, and vl::Log::warning().

Member Function Documentation

◆ addEventListener()

void OpenGLContext::addEventListener ( UIEventListener el)

Adds an UIEventListener to be notified of OpenGLContext related events.

This method triggers immediately an UIEventListener::addedListenerEvent() and if the OpenGLContext is initialized also an UIEventListener::initEvent().

Note
An UIEventListener can be associated only to one OpenGLContext at a time.

Definition at line 161 of file OpenGLContext.cpp.

References vl::UIEventListener::addedListenerEvent(), vl::UIEventListener::initEvent(), NULL, and VL_CHECK.

Referenced by vl::Applet::addedListenerEvent().

◆ applyEnables()

void OpenGLContext::applyEnables ( const EnableSet cur)

◆ applyRenderStates()

void OpenGLContext::applyRenderStates ( const RenderStateSet cur,
const Camera camera 
)

Applies a RenderStateSet to an OpenGLContext - Typically for internal use only.

Definition at line 549 of file OpenGLContext.cpp.

References vl::RenderStateSlot::apply(), vl::Has_Fixed_Function_Pipeline, vl::Has_GL_Version_1_3, vl::Has_GL_Version_1_4, vl::Has_GL_Version_3_0, vl::Has_GL_Version_4_0, vl::Has_GLES, vl::Has_GLES_Version_1_1, vl::Has_GLES_Version_2_0, vl::RenderStateSlot::mRS, NULL, vl::RenderStateSet::renderStates(), vl::RenderStateSet::renderStatesCount(), vl::RS_AlphaFunc, vl::RS_BlendColor, vl::RS_BlendEquation, vl::RS_BlendFunc, vl::RS_ClipPlane0, vl::RS_ClipPlane1, vl::RS_ClipPlane2, vl::RS_ClipPlane3, vl::RS_ClipPlane4, vl::RS_ClipPlane5, vl::RS_Color, vl::RS_ColorMask, vl::RS_CullFace, vl::RS_DepthFunc, vl::RS_DepthMask, vl::RS_DepthRange, vl::RS_Fog, vl::RS_FrontFace, vl::RS_GLSLProgram, vl::RS_Hint, vl::RS_Light0, vl::RS_Light1, vl::RS_Light2, vl::RS_Light3, vl::RS_Light4, vl::RS_Light5, vl::RS_Light6, vl::RS_Light7, vl::RS_LightModel, vl::RS_LineStipple, vl::RS_LineWidth, vl::RS_LogicOp, vl::RS_Material, vl::RS_Normal, vl::RS_PixelTransfer, vl::RS_PointParameter, vl::RS_PointSize, vl::RS_PolygonMode, vl::RS_PolygonOffset, vl::RS_PolygonStipple, vl::RS_RenderStateCount, vl::RS_SampleCoverage, vl::RS_SecondaryColor, vl::RS_ShadeModel, vl::RS_StencilFunc, vl::RS_StencilMask, vl::RS_StencilOp, vl::RS_TexEnv, vl::RS_TexGen, vl::RS_TextureMatrix, vl::RS_TextureSampler, vl::UIEventListener::setEnabled(), vl::RenderStateSlot::type(), VL_CHECK, and VL_CHECK_OGL.

Referenced by vl::OcclusionCullRenderer::render_pass2(), and vl::Renderer::renderRaw().

◆ areUniformsColliding()

bool OpenGLContext::areUniformsColliding ( const UniformSet u1,
const UniformSet u2 
)
static

Returns true if the two UniformSet contain at least one Uniform variable with the same name.

Definition at line 1228 of file OpenGLContext.cpp.

References vl::Log::error(), and vl::UniformSet::uniforms().

Referenced by vl::Renderer::renderRaw().

◆ bindVAS()

void OpenGLContext::bindVAS ( const IVertexAttribSet vas,
bool  use_vbo,
bool  force 
)

Activates the specified vertex attribute set - For internal use only.

Parameters
vasThe IVertexAttribSet to be activated. It can be NULL, in which case all vertex attributes are disabled. If vas is the same as the last activated IVertexAttribSet then no operation is done.
use_vboWhether vertex-buffer-objects should be used when activating the vertex attributes.
forceBinds vas even if it was the last to be activated (this is also valid for NULL).

Definition at line 1693 of file OpenGLContext.cpp.

References vl::Has_Fixed_Function_Pipeline, vl::VA_Position, VL_CHECK_OGL, and VL_TRAP.

Referenced by vl::EdgeRenderer::render(), vl::Text::render_Implementation(), vl::CoreText::render_Implementation(), vl::Geometry::render_Implementation(), and vl::Renderer::renderRaw().

◆ bindVAS_Attribs()

void OpenGLContext::bindVAS_Attribs ( const IVertexAttribSet vas,
bool  use_vbo 
)

◆ bindVAS_Fixed()

void OpenGLContext::bindVAS_Fixed ( const IVertexAttribSet vas,
bool  use_vbo 
)

◆ bindVAS_Reset()

void OpenGLContext::bindVAS_Reset ( )

Definition at line 1625 of file OpenGLContext.cpp.

References vl::Has_Fixed_Function_Pipeline, NULL, and VL_CHECK_OGL.

◆ color()

const fvec4& vl::OpenGLContext::color ( ) const
inline

Definition at line 576 of file OpenGLContext.hpp.

Referenced by vl::Text::render_Implementation().

◆ continuousUpdate()

bool vl::OpenGLContext::continuousUpdate ( ) const
inline

If the OpenGL context is a widget this function returns whether its area is continuously updated at each frame.

Definition at line 285 of file OpenGLContext.hpp.

Referenced by vlWin32::dispatchUpdate(), vlEGL::dispatchUpdate(), and vlWX::WXGLCanvas::OnIdle().

◆ createFramebufferObject() [1/2]

ref<FramebufferObject> vl::OpenGLContext::createFramebufferObject ( )
inline

Equivalent to "createFramebufferObject(0,0);".

Definition at line 210 of file OpenGLContext.hpp.

References createFramebufferObject(), and vl::RDB_COLOR_ATTACHMENT0.

Referenced by createFramebufferObject().

◆ createFramebufferObject() [2/2]

ref< FramebufferObject > OpenGLContext::createFramebufferObject ( int  width,
int  height,
EReadDrawBuffer  draw_buffer = RDB_COLOR_ATTACHMENT0,
EReadDrawBuffer  read_buffer = RDB_COLOR_ATTACHMENT0 
)

Creates a new FramebufferObject (framebuffer object Framebuffer).

Note
A framebuffer object always belongs to an OpenGL context and in order to render on it the appropriate OpenGL context must be active.

Definition at line 101 of file OpenGLContext.cpp.

◆ defaultRenderState()

const RenderStateSlot& vl::OpenGLContext::defaultRenderState ( ERenderState  rs)
inline

Returns the default render state slot used by VL when a specific render state type is left undefined.

Definition at line 527 of file OpenGLContext.hpp.

Referenced by vl::Renderer::render().

◆ destroyAllFramebufferObjects()

void OpenGLContext::destroyAllFramebufferObjects ( )

Removes all FramebufferObjects belonging to an OpenGLContext.

Definition at line 150 of file OpenGLContext.cpp.

References NULL.

◆ destroyAllOpenGLResources()

void OpenGLContext::destroyAllOpenGLResources ( )

Removes all OpenGL resources handled by the OpenGLContext.

Definition at line 124 of file OpenGLContext.cpp.

References NULL, vl::RS_RenderStateCount, and vl::TD_TEXTURE_UNKNOWN.

◆ destroyFramebufferObject()

void OpenGLContext::destroyFramebufferObject ( FramebufferObject fbort)

Destroys the specified FramebufferObject.

Definition at line 109 of file OpenGLContext.cpp.

References NULL.

◆ dispatchDestroyEvent()

void vl::OpenGLContext::dispatchDestroyEvent ( )
inline

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.

Definition at line 405 of file OpenGLContext.hpp.

Referenced by vlGLUT::GLUTWindow::glut_close_func(), vlWin32::Win32Window::WindowProc(), and vlEGL::EGLWindow::WindowProc().

◆ dispatchFileDroppedEvent()

void vl::OpenGLContext::dispatchFileDroppedEvent ( const std::vector< String > &  files)
inline

◆ dispatchInitEvent()

void vl::OpenGLContext::dispatchInitEvent ( )
inline

Dispatches the UIEventListener::initEvent() notification to the subscribed UIEventListener objects.

Definition at line 441 of file OpenGLContext.hpp.

Referenced by vlGLUT::GLUTWindow::glut_reshape_func().

◆ dispatchKeyPressEvent()

void vl::OpenGLContext::dispatchKeyPressEvent ( unsigned short  unicode_ch,
EKey  key 
)
inline

◆ dispatchKeyReleaseEvent()

void vl::OpenGLContext::dispatchKeyReleaseEvent ( unsigned short  unicode_ch,
EKey  key 
)
inline

◆ dispatchMouseDownEvent()

void vl::OpenGLContext::dispatchMouseDownEvent ( EMouseButton  button,
int  x,
int  y 
)
inline

◆ dispatchMouseMoveEvent()

void vl::OpenGLContext::dispatchMouseMoveEvent ( int  x,
int  y 
)
inline

◆ dispatchMouseUpEvent()

void vl::OpenGLContext::dispatchMouseUpEvent ( EMouseButton  button,
int  x,
int  y 
)
inline

◆ dispatchMouseWheelEvent()

void vl::OpenGLContext::dispatchMouseWheelEvent ( int  n)
inline

◆ dispatchResizeEvent()

void vl::OpenGLContext::dispatchResizeEvent ( int  w,
int  h 
)
inline

Dispatches the UIEventListener::resizeEvent() notification to the subscribed UIEventListener objects.

Call this function at the beginning if you reimplement it

Definition at line 321 of file OpenGLContext.hpp.

Referenced by vlGLFW::GLFWWindow::glfw_size_callback(), vlGLUT::GLUTWindow::glut_reshape_func(), vlWX::WXGLCanvas::OnSize(), vlWin32::Win32Window::WindowProc(), and vlEGL::EGLWindow::WindowProc().

◆ dispatchUpdateEvent()

void vl::OpenGLContext::dispatchUpdateEvent ( )
inline

◆ dispatchVisibilityEvent()

void vl::OpenGLContext::dispatchVisibilityEvent ( bool  visible)
inline

Dispatches the UIEventListener::visibilityEvent() notification to the subscribed UIEventListener objects.

Definition at line 427 of file OpenGLContext.hpp.

Referenced by vlGLFW::GLFWWindow::glfw_iconify_callback(), and vlGLUT::GLUTWindow::glut_visibility_func().

◆ eraseAllEventListeners()

void OpenGLContext::eraseAllEventListeners ( )

Removes all UIEventListener previously registered.

Definition at line 192 of file OpenGLContext.cpp.

References NULL, and VL_CHECK.

Referenced by vlWX::WXGLCanvas::quitApplication().

◆ eventListener() [1/2]

const UIEventListener* vl::OpenGLContext::eventListener ( int  i) const
inline

Returns the i-th UIEventListener registered to an OpenGLContext.

Definition at line 302 of file OpenGLContext.hpp.

◆ eventListener() [2/2]

UIEventListener* vl::OpenGLContext::eventListener ( int  i)
inline

Returns the i-th UIEventListener registered to an OpenGLContext.

Definition at line 305 of file OpenGLContext.hpp.

◆ eventListenerCount()

int vl::OpenGLContext::eventListenerCount ( ) const
inline

Returns the number of UIEventListener registered to an OpenGLContext.

Definition at line 308 of file OpenGLContext.hpp.

◆ eventListeners()

const std::vector< ref<UIEventListener> >& vl::OpenGLContext::eventListeners ( ) const
inline

The currently UIEventListener registered to be notified of OpenGLContext related events.

Definition at line 299 of file OpenGLContext.hpp.

◆ extensions()

const std::string& vl::OpenGLContext::extensions ( ) const
inline

Returns the list of OpenGL extensions supported separated by '|' characters.

Definition at line 172 of file OpenGLContext.hpp.

◆ framebuffer() [1/2]

Framebuffer* vl::OpenGLContext::framebuffer ( )
inline

◆ framebuffer() [2/2]

const Framebuffer* vl::OpenGLContext::framebuffer ( ) const
inline

The default render target (always returns leftFramebuffer()).

The returned Framebuffer's dimensions will be automatically updated to the OpenGLContext's dimensions.

Definition at line 207 of file OpenGLContext.hpp.

◆ fullscreen()

virtual bool vl::OpenGLContext::fullscreen ( ) const
inlinevirtual

If the OpenGL context is a widget this function returns whether it has been maximized to fullscreen.

Definition at line 240 of file OpenGLContext.hpp.

References vl::OpenGLContextFormat::mFullscreen.

Referenced by vlWX::WXGLCanvas::setFullscreen().

◆ getFocus()

virtual void vl::OpenGLContext::getFocus ( )
inlinevirtual

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

Reimplemented in vlQt4::Qt4Widget, vlQt5::Qt5Widget, vlGLFW::GLFWWindow, vlGLUT::GLUTWindow, vlWX::WXGLCanvas, vlWin32::Win32Context, and vlEGL::EGLWindow.

Definition at line 273 of file OpenGLContext.hpp.

◆ getProcAddress()

void * OpenGLContext::getProcAddress ( const char *  function_name)

Returns the address of an OpenGL extension function.

Definition at line 326 of file OpenGLContext.cpp.

References vl::getGLProcAddress().

◆ glslProgram() [1/2]

const GLSLProgram* vl::OpenGLContext::glslProgram ( ) const
inline

Definition at line 546 of file OpenGLContext.hpp.

◆ glslProgram() [2/2]

GLSLProgram* vl::OpenGLContext::glslProgram ( )
inline

Definition at line 547 of file OpenGLContext.hpp.

◆ hasDoubleBuffer()

bool vl::OpenGLContext::hasDoubleBuffer ( ) const
inline

Returns true if an OpenGLContext supports double buffering.

Definition at line 486 of file OpenGLContext.hpp.

References vl::OpenGLContextFormat::mHasDoubleBuffer.

◆ height()

int vl::OpenGLContext::height ( ) const
inline

Returns the height in pixels of an OpenGLContext.

Definition at line 261 of file OpenGLContext.hpp.

Referenced by vl::FlatManipulator::mouseInViewport(), and vlGLUT::GLUTWindow::setFullscreen().

◆ hide()

virtual void vl::OpenGLContext::hide ( )
inlinevirtual

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

Reimplemented in vlQt4::Qt4Widget, vlQt5::Qt5Widget, vlGLFW::GLFWWindow, vlGLUT::GLUTWindow, vlWX::WXGLCanvas, vlWin32::Win32Context, and vlEGL::EGLWindow.

Definition at line 246 of file OpenGLContext.hpp.

◆ ignoreNextMouseMoveEvent()

void vl::OpenGLContext::ignoreNextMouseMoveEvent ( )
inline

Requests not to dispatch the next mouse move event.

Definition at line 317 of file OpenGLContext.hpp.

Referenced by vl::GhostCameraManipulator::enableEvent(), and vl::GhostCameraManipulator::mouseMoveEvent().

◆ initGLContext()

bool OpenGLContext::initGLContext ( bool  log = true)

◆ isCleanState()

bool OpenGLContext::isCleanState ( bool  verbose)

Checks whether the OpenGL state is clean or not.

Clean state conditions:
  • All functionalities must be disabled, no GL_LIGHTING, GL_DEPTH_TEST, GL_LIGHTn, GL_CLIP_PLANEn etc. enabled, with the sole exception of GL_MULTISAMPLE and GL_DITHER.
  • All buffer objects targets such as GL_ARRAY_BUFFER, GL_ELEMENT_ARRAY_BUFFER etc. must be bound to buffer object #0.
  • Current texture unit and client texture unit must be #0.
  • All texture matrices must be set to identity.
  • All texture targets must be bound to texture #0.
  • All GL_TEXTURE_COORD_ARRAYs must be disabled.
  • All texture targets such as GL_TEXTURE_1D, GL_TEXTURE_2D etc. must be disabled.
  • All texture targets should be bound to texture #0.
  • All texture coordinate generation modes such as GL_TEXTURE_GEN_S/T/R/Q must be disable for all texture units.
  • All vertex arrays such as GL_COLOR_ARRAY, GL_NORMAL_ARRAY etc. must be disabled, including the ones enabled with glEnableVertexAttribArray()
  • NOTE: blending function must be set to glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA).
  • Color write-mask should be glColorMask(GL_TRUE ,GL_TRUE, GL_TRUE, GL_TRUE).
  • Depth write-mask should be glDepthMask(GL_TRUE).
  • Polygon mode should be glPolygonMode(GL_FRONT_AND_BACK, GL_FILL).
  • In general all OpenGL render states should be set to their default values.

Definition at line 695 of file OpenGLContext.cpp.

References vl::String::empty(), vl::EN_DITHER, vl::EN_EnableCount, vl::EN_MULTISAMPLE, vl::Log::error(), vl::Has_BufferObject, vl::Has_Cubemap_Textures, vl::Has_Fixed_Function_Pipeline, vl::Has_GL_Version_1_1, vl::Has_GL_Version_1_3, vl::Has_GL_Version_1_4, vl::Has_GL_Version_2_0, vl::Has_GL_Version_2_1, vl::Has_GLES, vl::Has_GLES_Version_1_1, vl::Has_GLSL, vl::Has_Multitexture, vl::Has_Primitive_Restart, vl::Has_Texture_3D, vl::Has_Texture_Array, vl::Has_Texture_Buffer, vl::Has_Texture_Multisample, vl::Has_Texture_Rectangle, vl::Has_Transform_Feedback, vl::Is_Enable_Supported, vl::Is_OpenGL_Core_Profile, vl::Translate_Enable, vl::Translate_Enable_String, and VL_CHECK_OGL.

Referenced by vl::Renderer::render().

◆ isExtensionSupported()

bool OpenGLContext::isExtensionSupported ( const char *  ext_name)

Returns true if the given extension is supported.

Note
This is a relatively slow function, don't use it inside loops and similar.

Definition at line 308 of file OpenGLContext.cpp.

◆ isInitialized()

bool vl::OpenGLContext::isInitialized ( ) const
inline

Returns true if the OpenGLContext is in an initialized state.

Definition at line 473 of file OpenGLContext.hpp.

◆ isKeyPressed()

bool vl::OpenGLContext::isKeyPressed ( EKey  key) const
inline

Returns true if the given key is pressed.

Definition at line 464 of file OpenGLContext.hpp.

Referenced by vl::GhostCameraManipulator::updateEvent().

◆ keyboard()

const std::set<EKey>& vl::OpenGLContext::keyboard ( ) const
inline

Returns the std::set containing the currently pressed keys.

Definition at line 461 of file OpenGLContext.hpp.

◆ keyPress()

void vl::OpenGLContext::keyPress ( EKey  key)
inline

Inserts the specified key in the set of currently active keys - For internal use only.

Definition at line 467 of file OpenGLContext.hpp.

Referenced by vlGLUT::GLUTWindow::updateModifiers().

◆ keyRelease()

void vl::OpenGLContext::keyRelease ( EKey  key)
inline

Removes the specified key from the set of currently active keys - For internal use only.

Definition at line 470 of file OpenGLContext.hpp.

Referenced by vlGLUT::GLUTWindow::updateModifiers().

◆ leftFramebuffer() [1/2]

Framebuffer* vl::OpenGLContext::leftFramebuffer ( )
inline

The render target representing the default left framebuffer.

It's basically just a Framebuffer with both draw-buffer and read-buffer set to RDB_BACK_LEFT by default. The returned Framebuffer's dimensions will be automatically updated to the OpenGLContext's dimensions.

Definition at line 184 of file OpenGLContext.hpp.

◆ leftFramebuffer() [2/2]

const Framebuffer* vl::OpenGLContext::leftFramebuffer ( ) const
inline

The render target representing the default left framebuffer.

It's basically just a Framebuffer with both draw-buffer and read-buffer set to RDB_BACK_LEFT by default. The returned Framebuffer's dimensions will be automatically updated to the OpenGLContext's dimensions.

Definition at line 189 of file OpenGLContext.hpp.

◆ logOpenGLInfo()

void OpenGLContext::logOpenGLInfo ( )

◆ makeCurrent()

virtual void vl::OpenGLContext::makeCurrent ( )
pure virtual

Sets the OpenGL context as current for the calling thread.

Implemented in vlQt4::Qt4Widget, vlQt5::Qt5Widget, vlSDL::SDLWindow, vlGLUT::GLUTWindow, vlGLFW::GLFWWindow, vlWX::WXGLCanvas, vlWin32::Win32Context, and vlEGL::EGLWindow.

◆ mouseVisible()

virtual bool vl::OpenGLContext::mouseVisible ( ) const
inlinevirtual

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

Definition at line 267 of file OpenGLContext.hpp.

Referenced by vlWX::WXGLCanvas::setMouseVisible().

◆ normal()

const fvec3& vl::OpenGLContext::normal ( ) const
inline

Definition at line 575 of file OpenGLContext.hpp.

Referenced by vl::Text::render_Implementation().

◆ openglContextInfo()

const OpenGLContextFormat& vl::OpenGLContext::openglContextInfo ( ) const
inline

Returns an OpenGLContextFormat structure describing an OpenGLContext.

Definition at line 311 of file OpenGLContext.hpp.

◆ position()

virtual ivec2 vl::OpenGLContext::position ( ) const
inlinevirtual

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

Reimplemented in vlQt4::Qt4Widget, vlQt5::Qt5Widget, vlGLFW::GLFWWindow, vlGLUT::GLUTWindow, vlWX::WXGLCanvas, vlWin32::Win32Context, and vlEGL::EGLWindow.

Definition at line 252 of file OpenGLContext.hpp.

◆ quitApplication()

virtual void vl::OpenGLContext::quitApplication ( )
inlinevirtual

Asks to the windowing system that is managing the OpenGLContext to quit the application.

Reimplemented in vlQt4::Qt4Widget, vlQt5::Qt5Widget, vlWin32::Win32Context, vlWX::WXGLCanvas, vlGLUT::GLUTWindow, vlGLFW::GLFWWindow, vlSDL::SDLWindow, and vlEGL::EGLWindow.

Definition at line 228 of file OpenGLContext.hpp.

Referenced by vl::Applet::keyReleaseEvent().

◆ removeEventListener()

void OpenGLContext::removeEventListener ( UIEventListener el)

◆ resetContextStates()

void OpenGLContext::resetContextStates ( EResetContextStates  start_or_finish)

Resets the OpenGL states necessary to begin and finish a rendering. - For internal use only.

Definition at line 1250 of file OpenGLContext.cpp.

References vl::globalSettings(), vl::Is_OpenGL_Core_Profile, NULL, vl::RCS_RenderingStarted, and VL_CHECK_OGL.

Referenced by vl::Rendering::render().

◆ resetEnables()

void OpenGLContext::resetEnables ( )

Resets all the interanal enable-tables - For internal use only.

Definition at line 690 of file OpenGLContext.cpp.

Referenced by vl::OcclusionCullRenderer::render_pass2().

◆ resetRenderStates()

void OpenGLContext::resetRenderStates ( )

Resets all the interanal render-states-tables - For internal use only.

Definition at line 684 of file OpenGLContext.cpp.

Referenced by vl::OcclusionCullRenderer::render_pass2().

◆ rightFramebuffer() [1/2]

Framebuffer* vl::OpenGLContext::rightFramebuffer ( )
inline

The render target representing the default right framebuffer (if a stereo OpenGL context is present).

It's basically just a Framebuffer with both draw-buffer and read-buffer set to RDB_BACK_RIGHT by default. The returned Framebuffer's dimensions will be automatically updated to the OpenGLContext's dimensions.

Definition at line 194 of file OpenGLContext.hpp.

◆ rightFramebuffer() [2/2]

const Framebuffer* vl::OpenGLContext::rightFramebuffer ( ) const
inline

The render target representing the default right framebuffer (if a stereo OpenGL context is present).

It's basically just a Framebuffer with both draw-buffer and read-buffer set to RDB_BACK_RIGHT by default. The returned Framebuffer's dimensions will be automatically updated to the OpenGLContext's dimensions.

Definition at line 199 of file OpenGLContext.hpp.

◆ secondaryColor()

const fvec3& vl::OpenGLContext::secondaryColor ( ) const
inline

Definition at line 577 of file OpenGLContext.hpp.

◆ setContinuousUpdate()

virtual void vl::OpenGLContext::setContinuousUpdate ( bool  continuous)
inlinevirtual

If the OpenGL context is a widget this function sets whether its area is continuously updated at each frame.

Reimplemented in vlQt4::Qt4Widget, and vlQt5::Qt5Widget.

Definition at line 282 of file OpenGLContext.hpp.

Referenced by vl::GhostCameraManipulator::enableEvent(), vl::FlatManipulator::enableEvent(), vl::TrackballManipulator::enableEvent(), and vl::Applet::keyReleaseEvent().

◆ setDefaultRenderState()

void vl::OpenGLContext::setDefaultRenderState ( const RenderStateSlot rs_slot)
inline

Defines the default render state slot to be used by the opengl context.

Definition at line 516 of file OpenGLContext.hpp.

References vl::RenderStateSlot::apply(), NULL, vl::RenderStateSlot::type(), and VL_CHECK_OGL.

Referenced by vl::Renderer::render().

◆ setFullscreen()

virtual bool vl::OpenGLContext::setFullscreen ( bool  )
inlinevirtual

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

Reimplemented in vlQt4::Qt4Widget, vlQt5::Qt5Widget, vlWin32::Win32Context, vlGLFW::GLFWWindow, vlGLUT::GLUTWindow, and vlWX::WXGLCanvas.

Definition at line 237 of file OpenGLContext.hpp.

References vl::OpenGLContextFormat::mFullscreen.

Referenced by vl::Applet::keyReleaseEvent().

◆ setMousePosition()

virtual void vl::OpenGLContext::setMousePosition ( int  ,
int   
)
inlinevirtual

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

Reimplemented in vlQt4::Qt4Widget, vlQt5::Qt5Widget, vlGLFW::GLFWWindow, vlWX::WXGLCanvas, vlSDL::SDLWindow, vlWin32::Win32Context, vlEGL::EGLWindow, and vlGLUT::GLUTWindow.

Definition at line 270 of file OpenGLContext.hpp.

Referenced by vl::GhostCameraManipulator::enableEvent(), and vl::GhostCameraManipulator::mouseMoveEvent().

◆ setMouseVisible()

virtual void vl::OpenGLContext::setMouseVisible ( bool  )
inlinevirtual

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

Reimplemented in vlQt4::Qt4Widget, vlQt5::Qt5Widget, vlGLFW::GLFWWindow, vlWX::WXGLCanvas, vlWin32::Win32Context, vlSDL::SDLWindow, vlGLUT::GLUTWindow, and vlEGL::EGLWindow.

Definition at line 264 of file OpenGLContext.hpp.

Referenced by vl::GhostCameraManipulator::enableEvent(), vl::FlatManipulator::enableEvent(), and vl::TrackballManipulator::enableEvent().

◆ setOpenGLContextInfo()

void vl::OpenGLContext::setOpenGLContextInfo ( const OpenGLContextFormat info)
inline

Sets the OpenGLContextFormat associated to an OpenGLContext.

Definition at line 314 of file OpenGLContext.hpp.

Referenced by vlGLUT::GLUTWindow::initGLUTWindow().

◆ setPosition()

virtual void vl::OpenGLContext::setPosition ( int  ,
int   
)
inlinevirtual

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

Reimplemented in vlQt4::Qt4Widget, vlQt5::Qt5Widget, vlGLFW::GLFWWindow, vlGLUT::GLUTWindow, vlWX::WXGLCanvas, vlWin32::Win32Context, vlEGL::EGLWindow, and vlSDL::SDLWindow.

Definition at line 249 of file OpenGLContext.hpp.

◆ setSize()

virtual void vl::OpenGLContext::setSize ( int  ,
int   
)
inlinevirtual

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

Reimplemented in vlQt4::Qt4Widget, vlQt5::Qt5Widget, vlGLFW::GLFWWindow, vlGLUT::GLUTWindow, vlWin32::Win32Context, vlWX::WXGLCanvas, and vlEGL::EGLWindow.

Definition at line 255 of file OpenGLContext.hpp.

◆ setTexUnitBinding()

void vl::OpenGLContext::setTexUnitBinding ( int  unit_i,
ETextureDimension  target 
)
inline

Declares that texture unit unit_i is currently bound to the specified texture target. - For internal use only.

Definition at line 533 of file OpenGLContext.hpp.

References VL_CHECK.

Referenced by vl::TextureSampler::apply().

◆ setVSyncEnabled()

void OpenGLContext::setVSyncEnabled ( bool  enable)

If the OpenGL context is a widget this function enabled/disables double buffer swapping to the monitor's vertical synch.

Definition at line 206 of file OpenGLContext.cpp.

Referenced by vlGLUT::GLUTWindow::initGLUTWindow().

◆ setWindowTitle()

virtual void vl::OpenGLContext::setWindowTitle ( const String )
inlinevirtual

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

Reimplemented in vlQt4::Qt4Widget, vlQt5::Qt5Widget, vlGLFW::GLFWWindow, vlGLUT::GLUTWindow, vlWX::WXGLCanvas, vlSDL::SDLWindow, vlEGL::EGLWindow, and vlWin32::Win32Context.

Definition at line 234 of file OpenGLContext.hpp.

◆ show()

virtual void vl::OpenGLContext::show ( )
inlinevirtual

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

Reimplemented in vlQt4::Qt4Widget, vlQt5::Qt5Widget, vlGLFW::GLFWWindow, vlGLUT::GLUTWindow, vlWX::WXGLCanvas, vlEGL::EGLWindow, and vlWin32::Win32Context.

Definition at line 243 of file OpenGLContext.hpp.

◆ swapBuffers()

virtual void vl::OpenGLContext::swapBuffers ( )
pure virtual

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

Implemented in vlQt4::Qt4Widget, vlQt5::Qt5Widget, vlGLUT::GLUTWindow, vlGLFW::GLFWWindow, vlWX::WXGLCanvas, vlWin32::Win32Context, vlSDL::SDLWindow, and vlEGL::EGLWindow.

Referenced by vl::Applet::updateEvent().

◆ textureCoordCount()

int vl::OpenGLContext::textureCoordCount ( ) const
inline

The number (clamped to VL_MAX_LEGACY_TEXTURE_UNITS) of fixed function pipeline texture units supported by the current hardware.

This is the number of texture units that support vl::TexEnv, vl::TexGen, vl::TextureMatrix and glClientActiveTexture().

Definition at line 483 of file OpenGLContext.hpp.

◆ textureImageUnitCount()

int vl::OpenGLContext::textureImageUnitCount ( ) const
inline

The number (clamped to VL_MAX_TEXTURE_IMAGE_UNITS) of texture image units supported by the current hardware.

Definition at line 479 of file OpenGLContext.hpp.

◆ texUnitBinding()

ETextureDimension vl::OpenGLContext::texUnitBinding ( int  unit_i) const
inline

Returnes the texture target currently active for the specified texture unit. - For internal use only.

Definition at line 540 of file OpenGLContext.hpp.

References VL_CHECK.

Referenced by vl::TextureSampler::apply().

◆ update()

virtual void vl::OpenGLContext::update ( )
pure virtual

◆ useGLSLProgram()

void OpenGLContext::useGLSLProgram ( const GLSLProgram glsl)

Activates the given GLSLProgram or unbinds the current one if glsl is NULL.

Definition at line 1744 of file OpenGLContext.cpp.

References vl::Log::bug(), vl::GLSLProgram::handle(), vl::Has_GLSL, vl::GLSLProgram::linked(), NULL, vl::Object::objectName(), vl::GLSLProgram::shaderCount(), VL_CHECK, and VL_CHECK_OGL.

Referenced by vl::GLSLProgram::apply().

◆ vertexAttribCount()

int vl::OpenGLContext::vertexAttribCount ( ) const
inline

The number (clamped to VA_MaxAttribCount) of generic vertex attributes as returned by glGet(GL_MAX_VERTEX_ATTRIBS)

Definition at line 476 of file OpenGLContext.hpp.

◆ vertexAttribValue()

const fvec4& vl::OpenGLContext::vertexAttribValue ( int  i) const
inline

Definition at line 578 of file OpenGLContext.hpp.

References vl::VA_MaxAttribCount, and VL_CHECK.

◆ vsyncEnabled()

bool OpenGLContext::vsyncEnabled ( ) const

If the OpenGL context is a widget this function returns whether vsync is enabled or not.

Definition at line 222 of file OpenGLContext.cpp.

◆ width()

int vl::OpenGLContext::width ( ) const
inline

Returns the width in pixels of an OpenGLContext.

Definition at line 258 of file OpenGLContext.hpp.

Referenced by vlGLUT::GLUTWindow::setFullscreen().

Friends And Related Function Documentation

◆ Color

friend class Color
friend

Definition at line 148 of file OpenGLContext.hpp.

◆ Normal

friend class Normal
friend

Definition at line 150 of file OpenGLContext.hpp.

◆ SecondaryColor

friend class SecondaryColor
friend

Definition at line 149 of file OpenGLContext.hpp.

◆ VertexAttrib

friend class VertexAttrib
friend

Definition at line 147 of file OpenGLContext.hpp.

Member Data Documentation

◆ mColor

fvec4 vl::OpenGLContext::mColor
protected

Definition at line 640 of file OpenGLContext.hpp.

Referenced by vl::Color::apply().

◆ mColorArray

VertexArrayInfo vl::OpenGLContext::mColorArray
protected

Definition at line 632 of file OpenGLContext.hpp.

◆ mContinuousUpdate

bool vl::OpenGLContext::mContinuousUpdate
protected

Definition at line 591 of file OpenGLContext.hpp.

◆ mCurrentEnableSet

ref< NaryQuickMap<EEnable, EEnable, EN_EnableCount> > vl::OpenGLContext::mCurrentEnableSet
protected

Definition at line 604 of file OpenGLContext.hpp.

◆ mCurrentRenderStateSet

ref< NaryQuickMap<ERenderState, RenderStateSlot, RS_RenderStateCount> > vl::OpenGLContext::mCurrentRenderStateSet
protected

Definition at line 608 of file OpenGLContext.hpp.

◆ mCurVAS

const IVertexAttribSet* vl::OpenGLContext::mCurVAS
protected

Definition at line 629 of file OpenGLContext.hpp.

◆ mDefaultRenderStates

RenderStateSlot vl::OpenGLContext::mDefaultRenderStates[RS_RenderStateCount]
protected

Definition at line 601 of file OpenGLContext.hpp.

◆ mDefaultVAO

GLuint vl::OpenGLContext::mDefaultVAO
protected

Definition at line 643 of file OpenGLContext.hpp.

◆ mEventListeners

std::vector< ref<UIEventListener> > vl::OpenGLContext::mEventListeners
protected

Definition at line 584 of file OpenGLContext.hpp.

◆ mExtensions

std::string vl::OpenGLContext::mExtensions
protected

Definition at line 596 of file OpenGLContext.hpp.

◆ mFogArray

VertexArrayInfo vl::OpenGLContext::mFogArray
protected

Definition at line 634 of file OpenGLContext.hpp.

◆ mFramebufferObject

std::vector< ref<FramebufferObject> > vl::OpenGLContext::mFramebufferObject
protected

Definition at line 583 of file OpenGLContext.hpp.

◆ mFullscreen

bool vl::OpenGLContext::mFullscreen
protected

◆ mGLContextInfo

OpenGLContextFormat vl::OpenGLContext::mGLContextInfo
protected

Definition at line 586 of file OpenGLContext.hpp.

◆ mGLSLProgram

ref<GLSLProgram> vl::OpenGLContext::mGLSLProgram
protected

Definition at line 615 of file OpenGLContext.hpp.

◆ mGLSLUpdated

bool vl::OpenGLContext::mGLSLUpdated
protected

Definition at line 616 of file OpenGLContext.hpp.

◆ mHasDoubleBuffer

bool vl::OpenGLContext::mHasDoubleBuffer
protected

Definition at line 594 of file OpenGLContext.hpp.

◆ mIgnoreNextMouseMoveEvent

bool vl::OpenGLContext::mIgnoreNextMouseMoveEvent
protected

Definition at line 592 of file OpenGLContext.hpp.

◆ mIsInitialized

bool vl::OpenGLContext::mIsInitialized
protected

Definition at line 595 of file OpenGLContext.hpp.

◆ mKeyboard

std::set<EKey> vl::OpenGLContext::mKeyboard
protected

Definition at line 585 of file OpenGLContext.hpp.

◆ mLeftFramebuffer

ref<Framebuffer> vl::OpenGLContext::mLeftFramebuffer
protected

Definition at line 581 of file OpenGLContext.hpp.

◆ mMouseVisible

bool vl::OpenGLContext::mMouseVisible
protected

◆ mNewEnableSet

ref< NaryQuickMap<EEnable, EEnable, EN_EnableCount> > vl::OpenGLContext::mNewEnableSet
protected

Definition at line 605 of file OpenGLContext.hpp.

◆ mNewRenderStateSet

ref< NaryQuickMap<ERenderState, RenderStateSlot, RS_RenderStateCount> > vl::OpenGLContext::mNewRenderStateSet
protected

Definition at line 609 of file OpenGLContext.hpp.

◆ mNormal

fvec3 vl::OpenGLContext::mNormal
protected

Definition at line 639 of file OpenGLContext.hpp.

Referenced by vl::Normal::apply().

◆ mNormalArray

VertexArrayInfo vl::OpenGLContext::mNormalArray
protected

Definition at line 631 of file OpenGLContext.hpp.

◆ mRightFramebuffer

ref<Framebuffer> vl::OpenGLContext::mRightFramebuffer
protected

Definition at line 582 of file OpenGLContext.hpp.

◆ mSecondaryColor

fvec3 vl::OpenGLContext::mSecondaryColor
protected

Definition at line 641 of file OpenGLContext.hpp.

Referenced by vl::SecondaryColor::apply().

◆ mSecondaryColorArray

VertexArrayInfo vl::OpenGLContext::mSecondaryColorArray
protected

Definition at line 633 of file OpenGLContext.hpp.

◆ mTexCoordArray

VertexArrayInfo vl::OpenGLContext::mTexCoordArray[VA_MaxTexCoordCount]
protected

Definition at line 635 of file OpenGLContext.hpp.

◆ mTextureCoordCount

int vl::OpenGLContext::mTextureCoordCount
protected

Definition at line 589 of file OpenGLContext.hpp.

◆ mTextureImageUnitCount

int vl::OpenGLContext::mTextureImageUnitCount
protected

Definition at line 588 of file OpenGLContext.hpp.

◆ mTexUnitBinding

ETextureDimension vl::OpenGLContext::mTexUnitBinding[VL_MAX_TEXTURE_IMAGE_UNITS]
protected

Definition at line 612 of file OpenGLContext.hpp.

◆ mVertexArray

VertexArrayInfo vl::OpenGLContext::mVertexArray
protected

Definition at line 630 of file OpenGLContext.hpp.

◆ mVertexAttrib

VertexArrayInfo vl::OpenGLContext::mVertexAttrib[VA_MaxAttribCount]
protected

Definition at line 636 of file OpenGLContext.hpp.

◆ mVertexAttribCount

int vl::OpenGLContext::mVertexAttribCount
protected

Definition at line 587 of file OpenGLContext.hpp.

◆ mVertexAttribValue

fvec4 vl::OpenGLContext::mVertexAttribValue[VA_MaxAttribCount]
protected

Definition at line 642 of file OpenGLContext.hpp.

Referenced by vl::VertexAttrib::apply().


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