Gateware Libraries  6.3.A
Beta Build
GW::GRAPHICS::GOpenGLSurface Class Referenceabstract

A library used to initialize, create, and manage an OpenGL rendering context. More...

#include <GOpenGLSurface.h>

Inheritance diagram for GW::GRAPHICS::GOpenGLSurface:
GW::CORE::GListener GW::CORE::GMultiThreaded GW::CORE::GInterface

Public Member Functions

virtual GReturn GetContext (void **_outContext)=0
 Returns the current OpenGL context. More...
 
virtual GReturn GetAspectRatio (float &_outAspectRatio)=0
 Returns the aspect ratio for the current window. More...
 
virtual GReturn UniversalSwapBuffers ()=0
 Calls the appropriate method (depending on platform) to swap the front and back buffers. More...
 
virtual GReturn QueryExtensionFunction (const char *_extension, const char *_funcName, void **_outFuncAddress)=0
 Queries if a requested OpenGL extension or function is supported. More...
 
virtual GReturn EnableSwapControl (bool _setSwapControl)=0
 Enables or disables v-synchronization in regards to buffer swapping. More...
 
- Public Member Functions inherited from GW::CORE::GListener
virtual GReturn OnEvent (const GUUIID &_senderInterface, unsigned int _eventID, void *_eventData, unsigned int _dataSize)=0
 This operation is called whenever a GBroadcaster a listener is registered to generates an event. More...
 
- Public Member Functions inherited from GW::CORE::GInterface
virtual GReturn GetCount (unsigned int &_outCount)=0
 Return the total number of active references to this object. More...
 
virtual GReturn IncrementCount ()=0
 Increase the total number of active references to this object. More...
 
virtual GReturn DecrementCount ()=0
 Decrease the total number of active references to this object. More...
 
virtual GReturn RequestInterface (const GUUIID &_interfaceID, void **_outputInterface)=0
 Requests an interface that may or may not be supported by this object. More...
 

Detailed Description

A library used to initialize, create, and manage an OpenGL rendering context.

This library automates the creation of a standard OpenGL context, and is capable of accepting special requests that can guide the initialization to support requested options. GOpenGLSurface is a GListener, which allows it to receive events from a registered broadcaster and react accordingly.

Member Function Documentation

◆ EnableSwapControl()

virtual GReturn GW::GRAPHICS::GOpenGLSurface::EnableSwapControl ( bool  _setSwapControl)
pure virtual

Enables or disables v-synchronization in regards to buffer swapping.

Parameters
[in]_toggleDetermines whether to enable or disable v-sync.
Return values
SUCCESSThe appropriate function was called to enable v-sync.
FEATURE_UNSUPPORTEDThe extension required to use this functionality was not supported.
FAILURENo valid OpenGL context exists.

◆ GetAspectRatio()

virtual GReturn GW::GRAPHICS::GOpenGLSurface::GetAspectRatio ( float &  _outAspectRatio)
pure virtual

Returns the aspect ratio for the current window.

Parameters
[out]_outRatioWill contain the calculated aspect ratio.
Return values
SUCCESSThe current aspect ratio was calculated and returned.
FAILURENo active GWindow exists to calculate an aspect ratio from.

◆ GetContext()

virtual GReturn GW::GRAPHICS::GOpenGLSurface::GetContext ( void **  _outContext)
pure virtual

Returns the current OpenGL context.

Parameters
[out]_outContextWill contain the address of the OpenGL context.
Return values
SUCCESSThe existing OpenGL context was returned.
FAILURENo OpenGL context exists to retrieve.

◆ QueryExtensionFunction()

virtual GReturn GW::GRAPHICS::GOpenGLSurface::QueryExtensionFunction ( const char *  _extension,
const char *  _funcName,
void **  _outFuncAddress 
)
pure virtual

Queries if a requested OpenGL extension or function is supported.

This funtion accepts either an OpenGL extension or OpenGL function (or both) and searches the total list of supported extensions (generated upon creation of the context) to see if that extension/function is supported. When a function name is queried, this function will return it's appropriate address if supported.

Parameters
[in]_extensionThe exact name of an OpenGL, WGL, or GLX extension.
[in]_funcNameThe exact name of an OpenGL, WGL, or GLX function.
[out]_outFuncAddressThe address of a function pointer that matches the queried function (_funcName).
Return values
SUCCESSThe extension/function is supported, and the address was returned successfully (if requested).
INVALID_ARGUMENTThis function was called with an incorrect set of parameters.
FAILUREThe requested extension/function is not supported.

◆ UniversalSwapBuffers()

virtual GReturn GW::GRAPHICS::GOpenGLSurface::UniversalSwapBuffers ( )
pure virtual

Calls the appropriate method (depending on platform) to swap the front and back buffers.

Return values
SUCCESSThe front and back buffers were successfully swapped.
FAILURENo valid OpenGL context exists to perform a buffer swap on.

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