All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Luminous::CustomOpenGL Class Reference

Guard for executing plain OpenGL commands. More...

#include <Luminous/RenderContext.hpp>

Inheritance diagram for Luminous::CustomOpenGL:
Patterns::NotCopyable

Public Member Functions

LUMINOUS_API CustomOpenGL (RenderContext &r, bool reset=false)
 Creates guard for the given OpenGL context. More...
 
ProgramGLhandle (const Program &program)
 Returns the GL resources handle corresponding to given program. More...
 
TextureGLhandle (const Texture &texture)
 Returns the GL resources handle corresponding to given texture. More...
 
BufferGLhandle (const Buffer &buffer)
 Returns the GL resources handle corresponding to given buffer (vertex/index). More...
 
VertexArrayGLhandle (const VertexArray &vertexArray, ProgramGL *program)
 Returns the GL resources handle corresponding to given vertex array. More...
 
RenderBufferGLhandle (const RenderBuffer &buffer)
 Returns the GL resources handle corresponding to given render buffer. More...
 
FrameBufferGLhandle (const FrameBuffer &target)
 Returns the GL resources handle corresponding to given frame buffer. More...
 
LUMINOUS_API ~CustomOpenGL ()
 Sets the given render context to the default state.
 

Detailed Description

Guard for executing plain OpenGL commands.

With the help of this object one can inject custom OpenGL commands into Cornerstone application. The usage of this class is strongly discouraged because it can cause big performance losses. When using more exotic states, user should set the state of OpenGL state machine to the state it was before.

Examples:
LegacyGLExample.cpp.

Constructor & Destructor Documentation

LUMINOUS_API Luminous::CustomOpenGL::CustomOpenGL ( RenderContext r,
bool  reset = false 
)

Creates guard for the given OpenGL context.

Executes all queued drawing commands in the given context.

Parameters
rContext to guard.
resetDo we reset OpenGL state

Member Function Documentation

ProgramGL& Luminous::CustomOpenGL::handle ( const Program program)
inline

Returns the GL resources handle corresponding to given program.

Parameters
programCPU side object representing the shader program
Returns
Handle to OpenGL resources of given program
TextureGL& Luminous::CustomOpenGL::handle ( const Texture texture)
inline

Returns the GL resources handle corresponding to given texture.

Parameters
textureCPU side object representing the texture
Returns
Handle to OpenGL resources of given texture
BufferGL& Luminous::CustomOpenGL::handle ( const Buffer buffer)
inline

Returns the GL resources handle corresponding to given buffer (vertex/index).

Parameters
bufferCPU side object representing the buffer
Returns
Handle to OpenGL resources of given buffer
VertexArrayGL& Luminous::CustomOpenGL::handle ( const VertexArray vertexArray,
ProgramGL program 
)
inline

Returns the GL resources handle corresponding to given vertex array.

Parameters
vertexArrayCPU side object representing the vertex array
programHandle to OpenGL program associated with vertexarray
Returns
Handle to OpenGL resources of queried vertex array
RenderBufferGL& Luminous::CustomOpenGL::handle ( const RenderBuffer buffer)
inline

Returns the GL resources handle corresponding to given render buffer.

Parameters
bufferCPU side object representing the render buffer
Returns
Handle to OpenGL resources of given render buffer
FrameBufferGL& Luminous::CustomOpenGL::handle ( const FrameBuffer target)
inline

Returns the GL resources handle corresponding to given frame buffer.

Parameters
targetCPU side object representing the frame buffer
Returns
Handle to OpenGL resources of given frame buffer