![]() |
RAMSES Documentation
27.0.130
Information for RAMSES users and developers
|
The DisplayConfig holds a set of parameters to be used to initialize a display. More...
#include <DisplayConfig.h>
Public Member Functions | |
DisplayConfig () | |
Default constructor of DisplayConfig. More... | |
DisplayConfig (int32_t argc, char const *const *argv) | |
Constructor of DisplayConfig that takes command line parameters and parses them to initialize the parameters. More... | |
DisplayConfig (const DisplayConfig &other) | |
Copy constructor of DisplayConfig. More... | |
virtual | ~DisplayConfig () |
Destructor of DisplayConfig. More... | |
status_t | setWindowRectangle (int32_t x, int32_t y, uint32_t width, uint32_t height) |
Sets the window size and position in display pixel space. This is ignored if window is set fullscreen. More... | |
status_t | getWindowRectangle (int32_t &x, int32_t &y, uint32_t &width, uint32_t &height) const |
Get the window size and position in display pixel space, as it was specified by setWindowRectangle() or command line options These values have no relevance if window is set fullscreen. More... | |
status_t | setWindowFullscreen (bool fullscreen) |
Automatically sets the window size so that it fills the entire display. Overrides DisplayConfig::setWindowRectangle() when set to true. More... | |
bool | isWindowFullscreen () const |
Gets the currently set fullscreen state, which was set either via DisplayConfig::setWindowFullscreen or parsed from command line arguments. More... | |
status_t | setWindowBorderless (bool borderless) |
Sets window hints/properties to tell the window manager to disable window borders. More... | |
status_t | setMultiSampling (uint32_t numSamples) |
Set number of samples to be used for multisampled rendering. More... | |
status_t | getMultiSamplingSamples (uint32_t &numSamples) const |
Get number of samples currently set. More... | |
status_t | enableWarpingPostEffect () |
Enable warping post effect. User has to set warping mesh data later in the display, otherwise the mesh is a fullscreen quad. More... | |
status_t | setWaylandIviLayerID (waylandIviLayerId_t waylandIviLayerID) |
[Mandatory on Wayland] Set IVI layer ID to use for attaching the IVI surface created by the display. More... | |
waylandIviLayerId_t | getWaylandIviLayerID () const |
Get the ID of the Wayland IVI layer to which the IVI surface used by the display is attached. More... | |
status_t | setWaylandIviSurfaceID (waylandIviSurfaceId_t waylandIviSurfaceID) |
[Mandatory on Wayland] Set IVI surface ID to use when creating the display window on Wayland. More... | |
waylandIviSurfaceId_t | getWaylandIviSurfaceID () const |
Get the current setting of IVI surface ID. More... | |
status_t | setIntegrityRGLDeviceUnit (uint32_t rglDeviceUnit) |
[Mandatory on Integrity] Set device unit number to use when creating the display window on Integrity using RGL Window Manager API. More... | |
uint32_t | getIntegrityRGLDeviceUnit () const |
Get the current setting of RGL device unit number. More... | |
void * | getAndroidNativeWindow () const |
Get the current setting of Android native window. More... | |
status_t | setAndroidNativeWindow (void *nativeWindowPtr) |
[Mandatory on Android] Set native window to use for rendering on Android. More... | |
status_t | setWindowIviVisible () |
Set IVI window to be visible right after window creation. More... | |
status_t | keepEffectsUploaded (bool enable) |
By default uploaded effects are kept forever in VRAM to avoid recompiling and reuploading. As their size is mostly negligible this should not have any disadvantages. If however it is desired to delete unused effects same as any other resources use this method to disable that optimization. Note that GPU cache can still prevent effect deletion (see ramses::DisplayConfig::setGPUMemoryCacheSize). More... | |
status_t | setGPUMemoryCacheSize (uint64_t size) |
Set the amount of GPU memory in bytes that will be used as cache for resources. Uploaded resources are kept in GPU memory even if not in use by any scene anymore. They are only freed from memory in order to make space for new resources to be uploaded which would not fit in the cache otherwise. First in first out method is used when deciding which unused resource to remove from cache. More... | |
status_t | setResizable (bool resizable) |
Enables/disables resizing of the window (Default=Disabled) More... | |
status_t | setClearColor (float red, float green, float blue, float alpha) |
Sets the clear color of the displays framebuffer (Default=0.0, 0.0, 0.0, 1.0) More... | |
status_t | setX11WindowHandle (unsigned long x11WindowHandle) |
[Only for X11] Set the X11 window handle to create a ramses display from an existing X11 window. More... | |
unsigned long | getX11WindowHandle () const |
[Only for X11] Get the current setting of the X11 window handle More... | |
status_t | setWindowsWindowHandle (void *hwnd) |
[Only for Windows] Set the HWND handle to create a ramses display from an existing HWND window on a Window platform. More... | |
void * | getWindowsWindowHandle () const |
Get the current setting of the Windows window handle (HWND) More... | |
status_t | setWaylandDisplay (const char *waylandDisplay) |
Set the Wayland display name to connect to. This will override the default behavior which is to use WAYLAND_DISPLAY environment variable. More... | |
const char * | getWaylandDisplay () const |
Get the current setting of Wayland display name. More... | |
status_t | setWaylandEmbeddedCompositingSocketName (const char *socketname) |
Set the name to be used for the embedded compositing display socket name. More... | |
const char * | getWaylandEmbeddedCompositingSocketName () const |
Get the current setting of embedded compositing display socket name. More... | |
status_t | setWaylandEmbeddedCompositingSocketGroup (const char *groupname) |
Request that the embedded compositing display socket belongs to the given group. More... | |
status_t | setWaylandEmbeddedCompositingSocketFD (int socketFileDescriptor) |
Set the file descriptor for the embedded compositor display socket. More... | |
status_t | setWaylandEmbeddedCompositingSocketPermissions (uint32_t permissions) |
Request that the embedded compositing display socket obtains the permissions given. More... | |
status_t | setSystemCompositorWaylandDisplay (const char *waylandDisplay) |
Set the Wayland display name to connect system compositor to. This will override the default behavior which is to use WAYLAND_DISPLAY environment variable. More... | |
status_t | setPlatformRenderNode (const char *renderNode) |
Set the render node to use for creating GBM buffer objects used for creating DMA Offscreen buffers on platforms that support creation of DMA buffers. More... | |
status_t | setSwapInterval (int32_t interval) |
Specifies the minimum number of video frames that are displayed before a buffer swap will occur. More... | |
status_t | setScenePriority (sceneId_t sceneId, int32_t priority) |
Specifies the scene's priority on this display. More... | |
status_t | setResourceUploadBatchSize (uint32_t batchSize) |
Sets the batch size for resource uploads. More... | |
DisplayConfig & | operator= (const DisplayConfig &other)=delete |
Deleted copy assignment. More... | |
![]() | |
status_t | validate () const |
Generates verbose validation of the object. More... | |
const char * | getValidationReport (EValidationSeverity minSeverity=EValidationSeverity_Info) const |
Provides verbose report in human readable form generated by validate. More... | |
const char * | getStatusMessage (status_t status) const |
Get the string description for a status provided by a RAMSES API function. More... | |
StatusObject (const StatusObject &other)=delete | |
Deleted copy constructor. More... | |
StatusObject & | operator= (const StatusObject &other)=delete |
Deleted copy assignment. More... | |
Static Public Member Functions | |
static status_t | setDepthStencilBufferType (DisplayConfig &config, EDepthBufferType depthBufferType) |
Sets whether depth/stencil buffer should be created for the framebuffer of the display. The framebuffer always has a color buffer. By default depth-stencil buffer is created as well. More... | |
static status_t | setAsyncEffectUploadEnabled (DisplayConfig &config, bool enabled) |
Sets whether async shader/effect compilation and upload should be enabled. By default async effect compile and upload is enabled. More... | |
Public Attributes | |
class DisplayConfigImpl & | impl |
![]() | |
class StatusObjectImpl & | impl |
Additional Inherited Members | |
![]() | |
StatusObject (StatusObjectImpl &pimpl) | |
Constructor for StatusObject. More... | |
virtual | ~StatusObject () |
Destructor of the StatusObject. More... | |
The DisplayConfig holds a set of parameters to be used to initialize a display.
ramses::DisplayConfig::DisplayConfig | ( | ) |
Default constructor of DisplayConfig.
ramses::DisplayConfig::DisplayConfig | ( | int32_t | argc, |
char const *const * | argv | ||
) |
Constructor of DisplayConfig that takes command line parameters and parses them to initialize the parameters.
[in] | argc | Number of arguments in arguments array parameter |
[in] | argv | Array of arguments as strings |
ramses::DisplayConfig::DisplayConfig | ( | const DisplayConfig & | other | ) |
Copy constructor of DisplayConfig.
[in] | other | Other instance of DisplayConfig |
|
virtual |
Destructor of DisplayConfig.
status_t ramses::DisplayConfig::enableWarpingPostEffect | ( | ) |
Enable warping post effect. User has to set warping mesh data later in the display, otherwise the mesh is a fullscreen quad.
void* ramses::DisplayConfig::getAndroidNativeWindow | ( | ) | const |
Get the current setting of Android native window.
uint32_t ramses::DisplayConfig::getIntegrityRGLDeviceUnit | ( | ) | const |
Get the current setting of RGL device unit number.
status_t ramses::DisplayConfig::getMultiSamplingSamples | ( | uint32_t & | numSamples | ) | const |
Get number of samples currently set.
[out] | numSamples | Number of samples per pixel. |
const char* ramses::DisplayConfig::getWaylandDisplay | ( | ) | const |
Get the current setting of Wayland display name.
const char* ramses::DisplayConfig::getWaylandEmbeddedCompositingSocketName | ( | ) | const |
Get the current setting of embedded compositing display socket name.
waylandIviLayerId_t ramses::DisplayConfig::getWaylandIviLayerID | ( | ) | const |
Get the ID of the Wayland IVI layer to which the IVI surface used by the display is attached.
waylandIviSurfaceId_t ramses::DisplayConfig::getWaylandIviSurfaceID | ( | ) | const |
Get the current setting of IVI surface ID.
status_t ramses::DisplayConfig::getWindowRectangle | ( | int32_t & | x, |
int32_t & | y, | ||
uint32_t & | width, | ||
uint32_t & | height | ||
) | const |
Get the window size and position in display pixel space, as it was specified by setWindowRectangle() or command line options These values have no relevance if window is set fullscreen.
[out] | x | Horizontal offset (distance from left border of the display) |
[out] | y | Vertical offset (distance from top border of the display) |
[out] | width | Width of the window |
[out] | height | Height of the window |
void* ramses::DisplayConfig::getWindowsWindowHandle | ( | ) | const |
Get the current setting of the Windows window handle (HWND)
unsigned long ramses::DisplayConfig::getX11WindowHandle | ( | ) | const |
[Only for X11] Get the current setting of the X11 window handle
::Windowfrom the X11 headers.
bool ramses::DisplayConfig::isWindowFullscreen | ( | ) | const |
Gets the currently set fullscreen state, which was set either via DisplayConfig::setWindowFullscreen or parsed from command line arguments.
status_t ramses::DisplayConfig::keepEffectsUploaded | ( | bool | enable | ) |
By default uploaded effects are kept forever in VRAM to avoid recompiling and reuploading. As their size is mostly negligible this should not have any disadvantages. If however it is desired to delete unused effects same as any other resources use this method to disable that optimization. Note that GPU cache can still prevent effect deletion (see ramses::DisplayConfig::setGPUMemoryCacheSize).
[in] | enable | Set to true if effects should be always kept in VRAM (default), false if they should be deleted if unused as other resources |
|
delete |
Deleted copy assignment.
other | unused |
status_t ramses::DisplayConfig::setAndroidNativeWindow | ( | void * | nativeWindowPtr | ) |
[Mandatory on Android] Set native window to use for rendering on Android.
[in] | nativeWindowPtr | ANativeWindow* which can be obtained with ANativeWindow_fromSurface() from a Java Surface object |
No ownership is transferred, the user is responsible to call ANativeWindow_release after destroying the RAMSES Renderer.
|
static |
Sets whether async shader/effect compilation and upload should be enabled. By default async effect compile and upload is enabled.
Shader compilation can be a relatively slow and computationally intense task on some platforms. This can lead to undesirable performance overhead, i.e., if shader compilation stalls rendering and upload of other resources.
Enabling async effect upload lets the renderer create a shared context and a separate thread that are used exclusively for shader compilation and upload.
It is recommended to leave async effect compile and upload enabled, and to disable it only for development and debugging purposes when necessary. If async effect compile and upload is disabled using this function the renderer will still create the components normally used for this purpose, i.e., a shared context and an additional thread, but their logic will not be triggered. Instead, shaders will be compiled and uploaded within the rendering loop, i.e. potentially stalling rendering.
[in] | config | The display config to call this method on. This API is temporarily added in static fashion for ABI compatibility. |
[in] | enabled | Set to true to enable async effect upload, false to disable it. |
status_t ramses::DisplayConfig::setClearColor | ( | float | red, |
float | green, | ||
float | blue, | ||
float | alpha | ||
) |
Sets the clear color of the displays framebuffer (Default=0.0, 0.0, 0.0, 1.0)
[in] | red | clear value for red channel |
[in] | green | clear value for green channel |
[in] | blue | clear value for blue channel |
[in] | alpha | clear value for alpha channel |
|
static |
Sets whether depth/stencil buffer should be created for the framebuffer of the display. The framebuffer always has a color buffer. By default depth-stencil buffer is created as well.
The set configuration will be passed to WGL/EGL, which uses this information as a lower-limit for the chosen configuration. If the configuration is not available exactly as requested, WGL/EGL will try the nearest configuration with the requested capabilities or more, e.g., if depth buffer is requested but stencil buffer is not it can happen that a stencil buffer will still be created because WGL/EGL does not have a configuration with that specific description.
[in] | config | The display config to call this method on. This API is temporarily added in static fashion for ABI compatibility. |
[in] | depthBufferType | Configure depth and stencil buffers. |
status_t ramses::DisplayConfig::setGPUMemoryCacheSize | ( | uint64_t | size | ) |
Set the amount of GPU memory in bytes that will be used as cache for resources. Uploaded resources are kept in GPU memory even if not in use by any scene anymore. They are only freed from memory in order to make space for new resources to be uploaded which would not fit in the cache otherwise. First in first out method is used when deciding which unused resource to remove from cache.
Note that the cache size does not act as hard limit, the renderer can still upload resources taking up more space. As long as cache limit is exceeded, newly unused resources are unloaded immediately.
Only client resources are considered for this cache, not scene resources (eg. render targets/render buffers). Cache is disabled by default (size is 0).
[in] | size | GPU resource cache size in bytes. Disabled if 0 (default) |
status_t ramses::DisplayConfig::setIntegrityRGLDeviceUnit | ( | uint32_t | rglDeviceUnit | ) |
[Mandatory on Integrity] Set device unit number to use when creating the display window on Integrity using RGL Window Manager API.
[in] | rglDeviceUnit | Device unit number to use for the display window |
status_t ramses::DisplayConfig::setMultiSampling | ( | uint32_t | numSamples | ) |
Set number of samples to be used for multisampled rendering.
Valid values are 1, 2, 4 or 8. Default value is 1 meaning multisampling is disabled. This value is just a hint for the device, the actual number of samples is guaranteed to be at least the given value but can be also more than that depending on device driver implementation. Ramses cannot check the device capability before the display is created, therefore exceeding the maximum number of samples supported by the device will likely result in fatal error.
[in] | numSamples | Number of samples per pixel. |
status_t ramses::DisplayConfig::setPlatformRenderNode | ( | const char * | renderNode | ) |
Set the render node to use for creating GBM buffer objects used for creating DMA Offscreen buffers on platforms that support creation of DMA buffers.
Set the socket of a DRM driver's render node to load and create a GBM (Generic Buffer Manager) device. If the socket is opened successfully a GBM device is created using gbm_create_device. The GBM device can be used to create DMA buffers which act as regular offscreen buffers but also allow direct memory access from application's side. This can be helpful for use cases that require CPU read or write of memory that is used for rendering as well.
Setting a valid render node is a pre-requisite to creating DMA offscreen buffers using ramses::RamsesRenderer::createDmaOffscreenBuffer. Setting an invalid render node, or failing to create a GBM device using the passed render node will result in display creation failure.
[in] | renderNode | Render node used to load for creating of GBM device using gbm_create_device |
status_t ramses::DisplayConfig::setResizable | ( | bool | resizable | ) |
Enables/disables resizing of the window (Default=Disabled)
[in] | resizable | The resizable flag |
status_t ramses::DisplayConfig::setResourceUploadBatchSize | ( | uint32_t | batchSize | ) |
Sets the batch size for resource uploads.
The resource upload batch size defines the number of resources that should be uploaded in a single step. Time budgets (ramses::RamsesRenderer::setFrameTimerLimits) are checked at the latest when a batch was uploaded. It should be safe to configure a batch size of 1 unless time measurement has a significant performance impact on the target device. The batch size may not be 0.
[in] | batchSize | the number of resources to upload in a single step (default: 10) |
Specifies the scene's priority on this display.
The renderer will apply scene updates according to scene priority so that there will be less latency between client scene flush and rendering for scenes with higher priority. This could result in more latency for scenes with less priority. This setting should be used in combination with time budgets for resource uploads (ramses::RamsesRenderer::setFrameTimerLimits) to get the desired effect.
Default priority is 0. Higher values mean less priority. (Use negative values to increase priority)
[in] | sceneId | scene id of the preferred scene |
[in] | priority | scene priority. Higher value means less priority |
status_t ramses::DisplayConfig::setSwapInterval | ( | int32_t | interval | ) |
Specifies the minimum number of video frames that are displayed before a buffer swap will occur.
If interval is set to 0, buffer swaps are not synchronized to a video frame. Interval is silently clamped to a platform specific minimum and maximum value. Default value is platform dependent.
[in] | interval | Minimum number of video frames that are displayed before a buffer swap will occur |
status_t ramses::DisplayConfig::setSystemCompositorWaylandDisplay | ( | const char * | waylandDisplay | ) |
Set the Wayland display name to connect system compositor to. This will override the default behavior which is to use WAYLAND_DISPLAY environment variable.
[in] | waylandDisplay | Wayland display name to use for connection |
status_t ramses::DisplayConfig::setWaylandDisplay | ( | const char * | waylandDisplay | ) |
Set the Wayland display name to connect to. This will override the default behavior which is to use WAYLAND_DISPLAY environment variable.
[in] | waylandDisplay | Wayland display name to use for connection |
status_t ramses::DisplayConfig::setWaylandEmbeddedCompositingSocketFD | ( | int | socketFileDescriptor | ) |
Set the file descriptor for the embedded compositor display socket.
The embedded compositor communicates with its clients via a socket file. There are two distinct ways to connect the embedded compositor with its socketfile.
Either you provide a name for the socket file or the file descriptor of the socket file.
This method is used to set the file descriptor.
When the file descriptor is set, the embedded compositor will use this file descriptor directly as its socket. It is expected that this file descriptor is belonging to a file already open, bind and listen to.
If both filename and file descriptor are set display creation will fail.
socketFileDescriptor | The file descriptor of the socket for the embedded compositor. |
status_t ramses::DisplayConfig::setWaylandEmbeddedCompositingSocketGroup | ( | const char * | groupname | ) |
Request that the embedded compositing display socket belongs to the given group.
[in] | groupname | The group name of the socket. |
status_t ramses::DisplayConfig::setWaylandEmbeddedCompositingSocketName | ( | const char * | socketname | ) |
Set the name to be used for the embedded compositing display socket name.
The embedded compositor communicates with its clients via a socket file. There are two distinct ways to connect the embedded compositor with its socketfile. Either you provide a name for the socket file or the file descriptor of the socket file.
This method is used to set the file name of the socket.
Providing the name of the socket file leads to the embedded compositor searching/creating the socket file in the directory pointed to by $XDG_RUNTIME_DIR. If a groupname is set, also the group is set.
Be aware that the socket file name is only used if the file descriptor is set to an invalid value (default), see RendererConfig::setWaylandEmbeddedCompositingSocketFD
If both filename and file descriptor are set display creation will fail.
[in] | socketname | The file name of the socket file. |
status_t ramses::DisplayConfig::setWaylandEmbeddedCompositingSocketPermissions | ( | uint32_t | permissions | ) |
Request that the embedded compositing display socket obtains the permissions given.
The format should be the same as expected by chmod() mode argument. Permissions value may not be 0. If not set "user+group can read/write (0660)" is used as default.
The socket should be readable and writable for the required users, some examples values are:
This value is only used when socket is given as name, e.g. via setWaylandEmbeddedCompositingSocketName(), not when passed in as filedescriptor.
[in] | permissions | The permissions of the socket. |
status_t ramses::DisplayConfig::setWaylandIviLayerID | ( | waylandIviLayerId_t | waylandIviLayerID | ) |
[Mandatory on Wayland] Set IVI layer ID to use for attaching the IVI surface created by the display.
RAMSES does not try to create the layer, instead the layer must be already existing before creating the display. Trying to create a display on Wayland without setting this variable or giving it a non-valid layer ID, e.g., the ID of a non-existing layer, will result in display creation failure.
This values is ignored on other systems than Wayland.
[in] | waylandIviLayerID | IVI layer ID to use for attaching the surface used by the display |
status_t ramses::DisplayConfig::setWaylandIviSurfaceID | ( | waylandIviSurfaceId_t | waylandIviSurfaceID | ) |
[Mandatory on Wayland] Set IVI surface ID to use when creating the display window on Wayland.
[in] | waylandIviSurfaceID | IVI surface ID to use for the display window |
status_t ramses::DisplayConfig::setWindowBorderless | ( | bool | borderless | ) |
Sets window hints/properties to tell the window manager to disable window borders.
[in] | borderless | flag specifying whether window should be drawn without window-border |
status_t ramses::DisplayConfig::setWindowFullscreen | ( | bool | fullscreen | ) |
Automatically sets the window size so that it fills the entire display. Overrides DisplayConfig::setWindowRectangle() when set to true.
[in] | fullscreen | Flag specifying whether window should be fullscreen |
status_t ramses::DisplayConfig::setWindowIviVisible | ( | ) |
Set IVI window to be visible right after window creation.
status_t ramses::DisplayConfig::setWindowRectangle | ( | int32_t | x, |
int32_t | y, | ||
uint32_t | width, | ||
uint32_t | height | ||
) |
Sets the window size and position in display pixel space. This is ignored if window is set fullscreen.
[in] | x | Horizontal offset (distance from left border of the display) |
[in] | y | Vertical offset (distance from top border of the display) |
[in] | width | Width of the window |
[in] | height | Height of the window |
status_t ramses::DisplayConfig::setWindowsWindowHandle | ( | void * | hwnd | ) |
[Only for Windows] Set the HWND handle to create a ramses display from an existing HWND window on a Window platform.
[in] | hwnd | Windows window handle to use for the display window |
status_t ramses::DisplayConfig::setX11WindowHandle | ( | unsigned long | x11WindowHandle | ) |
[Only for X11] Set the X11 window handle to create a ramses display from an existing X11 window.
[in] | x11WindowHandle | native X11 window id to use for the display window. The type is equivalent to::Windowfrom the X11 headers. |
class DisplayConfigImpl& ramses::DisplayConfig::impl |
Stores internal data for implementation specifics of DisplayConfig.