WindowRenderInfo

Functions

SET_CID

WindowRenderInfo

~WindowRenderInfo

REDMetalCommandQueue

GetHostingMetalCommandQueue

void

SetHostingMetalCommandQueue

bool

IsSynchronized

void

SetSynchronized

bool

IsBufferSwappingOn

void

SetBufferSwapping

int

GetHardwareAntiAlias

void

SetHardwareAntiAlias

bool

IsStereo

void

SetStereo

Detailed Description

class WindowRenderInfo : public RED::Object

Customization of low-level hardware parameters for a window.

@related function RED::Factory::CreateREDWindow, Integration into an External OpenGL Window, Integrating a HOOPS Luminate Window into an Existing OpenGL Window, Integration into an Existing OpenGL Application

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.

Public Functions

SET_CID (CID_class_REDWindowRenderInfo) IMPLEMENT_AS()
WindowRenderInfo()

Default constructor.

virtual ~WindowRenderInfo()

Destructor.

inline REDMetalCommandQueue 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.

inline void 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.

inline bool IsSynchronized() const

Returns whether the vertical synchronization is on or off.

Returns

Vsync on or off.

inline void SetSynchronized(bool iSynchronized)

Defines the vertical synchronization.

Parameters

iSynchronized – Enables or disables vsync based on this parameter’s value.

inline bool IsBufferSwappingOn() const

Does the engine swap buffers automatically for this window?

Returns

yes or no !

inline void 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.

inline int GetHardwareAntiAlias() const

Gets the hardware anti-aliasing parameter.

Returns

The current number of samples requested per pixel for the rendering.

inline void 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.

inline bool IsStereo() const

Do we have enabled stereoscopic display?

Returns

true or false depending on the chosen stereo setup.

inline void 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 \ref bk_ba_stereoscopy chapter in the REDsdk programming guide for all details on the stereoscopy setup.

Parameters

iOnOff – Enable or disable stereoscopic display.