Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Protected Member Functions | List of all members
BIAS::glfRenderingContext Class Referenceabstract

Interface for OpenGL rendering contexts. More...

#include <OpenGLFramework/RenderingContext/glfRenderingContext.hh>

+ Inheritance diagram for BIAS::glfRenderingContext:

Public Types

enum  GrabSource { GRAB_COLOR, GRAB_DEPTH, GRAB_STENCIL }
 Frame buffer data that can be retrieved by Grab. More...
 

Public Member Functions

virtual void Destroy ()=0
 Uninitializes the rendering context. More...
 
virtual void DoneCurrent ()
 Removes the current state of this context. More...
 
virtual void GetConfig (glfRenderingContextConfig &config)=0
 Gets the currently used config of the rendering context. More...
 
void Grab (BIAS::Image< unsigned char > &image, GrabSource source=GRAB_COLOR, int x=0, int y=0, int width=0, int height=0)
 Copies the contents of the framebuffer to an image. More...
 
virtual void Init (const glfRenderingContextConfig &config)=0
 Initializes the rendering context with the given configuration. More...
 
virtual void MakeCurrent ()=0
 Makes this context the current target for OpenGL calls. More...
 
virtual ~glfRenderingContext ()
 

Protected Member Functions

void InitGlew ()
 Initializes GLEW if enabled in the BIAS configuration. More...
 

Detailed Description

Interface for OpenGL rendering contexts.

Author
05/2007 jkollmann
Examples:
ExampleRenderingContext.cpp.

Definition at line 56 of file glfRenderingContext.hh.

Member Enumeration Documentation

Frame buffer data that can be retrieved by Grab.

Enumerator
GRAB_COLOR 

Grab RGB image.

GRAB_DEPTH 

Grab depth buffer.

GRAB_STENCIL 

Grab stencil buffer.

Definition at line 102 of file glfRenderingContext.hh.

Constructor & Destructor Documentation

virtual BIAS::glfRenderingContext::~glfRenderingContext ( )
inlinevirtual

Definition at line 59 of file glfRenderingContext.hh.

Member Function Documentation

virtual void BIAS::glfRenderingContext::Destroy ( )
pure virtual

Uninitializes the rendering context.

This method must be called before the application quits and after all Open GL resources (textures etc.) have been deleted.

Implemented in BIAS::glfRenderingContext_GLX, and BIAS::glfRenderingContext_WGL.

Examples:
ExampleRenderingContext.cpp.
virtual void BIAS::glfRenderingContext::DoneCurrent ( )
inlinevirtual

Removes the current state of this context.

Must be called before MakeCurrent is called from another thread.

Reimplemented in BIAS::glfRenderingContext_GLX, and BIAS::glfRenderingContext_WGL.

Definition at line 87 of file glfRenderingContext.hh.

virtual void BIAS::glfRenderingContext::GetConfig ( glfRenderingContextConfig config)
pure virtual

Gets the currently used config of the rendering context.

The rendering context must have been successfully initialized before this method may be called.

Parameters
configThe config structure to be filled

Implemented in BIAS::glfRenderingContext_GLX, and BIAS::glfRenderingContext_WGL.

Examples:
ExampleRenderingContext.cpp.
void glfRenderingContext::Grab ( BIAS::Image< unsigned char > &  image,
GrabSource  source = GRAB_COLOR,
int  x = 0,
int  y = 0,
int  width = 0,
int  height = 0 
)

Copies the contents of the framebuffer to an image.

This method calls MakeCurrent on this rendering context.

Examples:
ExampleRenderingContext.cpp.

Definition at line 58 of file glfRenderingContext.cpp.

References BIAS::Image< StorageType >::GetImageData(), BIAS::glfRenderingContextConfig::height, BIAS::Image< StorageType >::Init(), BIAS::ImageBase::IsEmpty(), BIAS::Image< StorageType >::Release(), and BIAS::glfRenderingContextConfig::width.

virtual void BIAS::glfRenderingContext::Init ( const glfRenderingContextConfig config)
pure virtual

Initializes the rendering context with the given configuration.

All implementations should call MakeCurrent and InitGlew in this method. A context may be initialized multiple times.

Parameters
configRequested configuration

Implemented in BIAS::glfRenderingContext_GLX, and BIAS::glfRenderingContext_WGL.

Examples:
ExampleRenderingContext.cpp.
void glfRenderingContext::InitGlew ( )
protected

Initializes GLEW if enabled in the BIAS configuration.

If not, this method does nothing. Should be called during Init by every glfRenderingContext implementation.

Definition at line 117 of file glfRenderingContext.cpp.

References BIAS::Singleton< GlewInitWrapper >::GetInstance(), and BIAS::GlewInitWrapper::Init().

virtual void BIAS::glfRenderingContext::MakeCurrent ( )
pure virtual

Makes this context the current target for OpenGL calls.

Must be called when switching between multiple rendering contexts.

Implemented in BIAS::glfRenderingContext_GLX, and BIAS::glfRenderingContext_WGL.


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