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 ( )
HDCGetDeviceContext ( ) const
intGetHardwareAntiAlias ( ) const
REDMetalCommandQueueGetHostingMetalCommandQueue ( ) const
HGLRCGetRenderingContext ( ) const
boolIsBufferSwappingOn ( ) const
boolIsContextSharing ( ) const
boolIsStereo ( ) const
boolIsSynchronized ( ) const
voidSetBufferSwapping ( bool iBufferSwap )
voidSetHardwareAntiAlias ( int iNbSamples )
voidSetHostingContext ( HDC iHDC, HGLRC iHGLRC, bool iShareContext = true )
voidSetHostingMetalCommandQueue ( void * iMtlCommandQueue )
voidSetStereo ( bool iOnOff )
voidSetSynchronized ( bool iSynchronized )

Public static functions:

static RED::CIDGetClassID ( )

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:

Defaults at the class creation:

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:

Functions documentation

Default constructor.

Destructor.

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:

An object pointer of the given class on success, NULL otherwise.

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:

An object pointer of the given class on success, NULL otherwise.

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:

A pointer to a const instance of class T on success, NULL otherwise.

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:

A pointer to an instance of class T on success, NULL otherwise.

Reimplements: RED::Object::As.

Returns the device context to use for the window.

Returns:

The context to use for the window. When the returned value is NULL, the window creates its own device context. In this case the context value is retrieved through the RED::IWindow interface.

Gets the hardware anti-aliasing parameter.

Returns:

The current number of samples requested per pixel for the rendering.
public REDMetalCommandQueue RED::WindowRenderInfo::GetHostingMetalCommandQueue() const

Returns the hosting application Metal command queue to use for this window.

Returns:

If the returned value is NULL, then the window will use its own Metal setup, using default Metal device.

Returns the OpenGL rendering context to use for the window.

Returns:

The OpenGL rendering context for the window. If the returned value is NULL, then the window will create its own context.

Does the engine swap buffers automatically for this window?

Returns:

yes or no !

Returns:

true if REDsdk is allowed to share external contexts with its own pivot context, false otherwise.

Do we have enabled stereoscopic display?

Returns:

true or false depending on the chosen stereo setup.

Returns whether the vertical synchronization is on or off.

Returns:

Vsync on or off.
public void RED::WindowRenderInfo::SetBufferSwapping(booliBufferSwap)

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.

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(HDCiHDC,
HGLRCiHGLRC,
booliShareContext = 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(booliOnOff)

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(booliSynchronized)

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?