class RED::WindowRenderInfo
Customization of low-level hardware parameters for a window. More...
#include <REDWindowRenderInfo.h>
Inherits: Object.
Public functions:
WindowRenderInfo ( ) | |
virtual | ~WindowRenderInfo ( ) |
virtual void * | As ( const RED::CID & iCID ) |
virtual const void * | As ( const RED::CID & iCID ) const |
template< class T_As > const T_As * | As ( ) const |
template< class T_As > T_As * | As ( ) |
HDC | GetDeviceContext ( ) const |
int | GetHardwareAntiAlias ( ) const |
REDMetalCommandQueue | GetHostingMetalCommandQueue ( ) const |
HGLRC | GetRenderingContext ( ) const |
bool | IsBufferSwappingOn ( ) const |
bool | IsContextSharing ( ) const |
bool | IsStereo ( ) const |
bool | IsSynchronized ( ) const |
void | SetBufferSwapping ( bool iBufferSwap ) |
void | SetHardwareAntiAlias ( int iNbSamples ) |
void | SetHostingContext ( HDC iHDC, HGLRC iHGLRC, bool iShareContext = true ) |
void | SetHostingMetalCommandQueue ( void * iMtlCommandQueue ) |
void | SetStereo ( bool iOnOff ) |
void | SetSynchronized ( bool iSynchronized ) |
Public static functions:
static RED::CID | GetClassID ( ) |
Protected variables:
int | _aa_hardware |
bool | _bufswap |
HDC | _hdc |
HGLRC | _hglrc |
bool | _share |
bool | _stereo |
bool | _synchronized |
Detailed description:
Customization of low-level hardware parameters for a window.
This class is only usable at the window creation time, on a call to RED::Factory::CreateREDWindow. It's only needed to setup some window settings that must be set at its creation time:
- Initialization with an existing device / rendering context.
- Vertical synchronization control.
- Buffer swapping control.
- Hardware anti-aliasing.
- GPU class specific initializations.
- Stereoscopic display.
Defaults at the class creation:
- No external window / rendering context.
- Vertical synchronization: false.
- Buffer swapping: true.
- Hardware anti-aliasing: disabled (e.g. 1 sample).
- Stereo display: false.
Using external context enables using REDsdk from a window that was not created by it at all. However, as OpenGL contexts have to be shared to address a common display list space, a few rules have to be enforced here to make sure that all contexts of the external application will work with REDsdk contexts:
- REDsdk creates an internal base context.
- On Windows platform, the base context is used as a pivot for context sharing: all contexts received by REDsdk will be shared with this pivot context. This is valid on windows platform.
- On Linux and MacOS platforms, context sharing takes places at the context creation stage; not afterwards. Therefore, REDsdk will share it's internal base context (generated at the first window creation) with the external context supplied for this first window.
- Still on Linux and MacOs: after that initial sharing, all contexts that may be created by REDsdk will be shared with the internal REDsdk context.
- All contexts created by the application should be shared with the first window context in order to make sure that all contexts are tied together.
Functions documentation
Default constructor.
public virtual RED::WindowRenderInfo::~WindowRenderInfo | ( | ) |
Destructor.
public static RED::CID RED::WindowRenderInfo::GetClassID | ( | ) |
Reimplements: RED::Object::GetClassID.
public virtual void * RED::WindowRenderInfo::As | ( | const RED::CID & | iCID | ) |
Converts the object to an instance of the given type.
Parameters:
iCID: | Requested class. |
Returns:
Reimplements: RED::Object::As.
public virtual const void * RED::WindowRenderInfo::As | ( | const RED::CID & | iCID | ) const |
Converts the object to an instance of the given type.
Parameters:
iCID: | Requested class. |
Returns:
Reimplements: RED::Object::As.
template< class T_As > public const T_As * RED::WindowRenderInfo::As | ( | ) const |
Template version of the as const method.
Simply set T to be the class you want to retrieve an interface to.
Returns:
Reimplements: RED::Object::As.
template< class T_As > public T_As * RED::WindowRenderInfo::As | ( | ) |
Template version of the as method.
Simply set T to be the class you want to retrieve an interface to.
Returns:
Reimplements: RED::Object::As.
public HDC RED::WindowRenderInfo::GetDeviceContext | ( | ) const |
Returns the device context to use for the window.
Returns:
public int RED::WindowRenderInfo::GetHardwareAntiAlias | ( | ) const |
Gets the hardware anti-aliasing parameter.
Returns:
public REDMetalCommandQueue RED::WindowRenderInfo::GetHostingMetalCommandQueue | ( | ) const |
Returns the hosting application Metal command queue to use for this window.
Returns:
public HGLRC RED::WindowRenderInfo::GetRenderingContext | ( | ) const |
Returns the OpenGL rendering context to use for the window.
Returns:
public bool RED::WindowRenderInfo::IsBufferSwappingOn | ( | ) const |
Does the engine swap buffers automatically for this window?
Returns:
public bool RED::WindowRenderInfo::IsContextSharing | ( | ) const |
Returns:
public bool RED::WindowRenderInfo::IsStereo | ( | ) const |
Do we have enabled stereoscopic display?
Returns:
public bool RED::WindowRenderInfo::IsSynchronized | ( | ) const |
Returns whether the vertical synchronization is on or off.
Returns:
public void RED::WindowRenderInfo::SetBufferSwapping | ( | bool | iBufferSwap | ) |
Defines the buffer swapping mode.
Note that desactivating the default VRL of a window disables that window buffer swapping. This can be done using RED::IViewpointRenderList::Activate.
Parameters:
iBufferSwap: | enable or disable buffer swapping at the end of a frame rendering. |
public void RED::WindowRenderInfo::SetHardwareAntiAlias | ( | int | iNbSamples | ) |
Sets the hardware anti-aliasing parameter.
Specify whether we are to use hardware anti-aliasing or not. Accepted values range between 1 (no multi sampling) to the max hardware accepted sampling range. Therefore, the max value depends on the used graphic adapter, and should be queried directly from it. Usually 1,2,4,8 or even 16 on high-end graphic cards are accepted.
Parameters:
iNbSamples: | The number of samples per pixel. |
public void RED::WindowRenderInfo::SetHostingContext | ( | HDC | iHDC, |
HGLRC | iHGLRC, | ||
bool | iShareContext = true | ||
) |
Sets the device context and GL context to use for this window.
iHDC must be a valid device context for the window to render into. iHGLRC must be a valid OpenGL context created for iHDC. Calling this method will cause the window to work with the provided system values iHDC and iHGLRC. This can be used to have the engine render in a window it does not own by itself.
Refer to the Managing multiple windows and external OpenGL contexts paragraph for all details on context sharing.
Parameters:
iHDC: | Device context to use for the window. |
iHGLRC: | OpenGL rendering context to use for the window. |
iShareContext: | Extra option to allow REDsdk to do context sharing or not. If true, REDsdk will share the provided iHGLRC with its internal pivot context. If false, REDsdk will not call wglShareLists and let the caller manage its contexts and how they get shared from an OpenGL perspective. |
public void RED::WindowRenderInfo::SetHostingMetalCommandQueue | ( | void * | iMtlCommandQueue | ) |
Sets the hosting application Metal command queue to use for this window.
This can be used to have the engine render in a window it does not own by itself.
Note:
All RED windows must use the same MTLDevice if multiple devices are available.
Parameters:
iMtlCommandQueue: | MTLCommandQueue to use for the window. |
public void RED::WindowRenderInfo::SetStereo | ( | bool | iOnOff | ) |
Enables or disables stereo.
The stereo must be enabled at the window level and then specified on all VRLs that have to process stereo data using RED::IViewpointRenderList::SetStereo. Please refer to the Stereoscopy chapter in the REDsdk programming guide for all details on the stereoscopy setup.
Parameters:
iOnOff: | Enable or disable stereoscopic display. |
public void RED::WindowRenderInfo::SetSynchronized | ( | bool | iSynchronized | ) |
Defines the vertical synchronization.
Parameters:
iSynchronized: | Enables or disables vsync based on this parameter's value. |
Variables documentation
Hardware anti-aliasing value.
Do we swap buffers or not?
Host device context.
Host rendering context.
Are we allowed to share rendering contexts ?
Do we have requested stereo display?
Do we vsync or not?