LLGL 0.05 Beta
Loading...
Searching...
No Matches
LLGL::RenderSystemDescriptor Struct Reference

Render system descriptor structure. More...

#include <RenderSystemFlags.h>

Public Member Functions

 RenderSystemDescriptor ()=default
 RenderSystemDescriptor (const std::string &moduleName)
 Constructor to initialize the descriptor with the module name from an std::string.
 RenderSystemDescriptor (const char *moduleName)
 Constructor to initialize the descriptor with the module name from a null terminated string.

Public Attributes

StringLiteral moduleName
 Specifies the name from which the new render system is to be loaded.
long flags = 0
 Render system flags. This can be a bitwise OR combination of RenderSystemFlags entries. By default 0.
void * profiler = nullptr
RenderingDebugger * debugger = nullptr
 debugger Optional pointer to a rendering debugger. This is only supported if LLGL was compiled with the LLGL_ENABLE_DEBUG_LAYER flag.
const void * rendererConfig = nullptr
 Optional raw pointer to a renderer specific configuration structure.
std::size_t rendererConfigSize = 0
 Specifies the size (in bytes) of the structure rendererConfig points to (use sizeof with the respective structure). By default 0.
const void * nativeHandle = nullptr
 Optional raw pointer to a backend specific native handle structure. If this is null (default), the render system creates its own native handles. These native handles can later be queried via RenderSystem::GetNativeHandle.
std::size_t nativeHandleSize = 0
 Specifies the size (in bytes) of the structure nativeHandle points to (use sizeof with the respective structure). By default 0.
void * platformContext = nullptr
 Optional raw pointer to a platform specific context structure the render system is brought up with. By default null.
std::size_t platformContextSize = 0
 Specifies the size (in bytes) of the structure platformContext points to (use sizeof with the respective structure). By default 0.

Detailed Description

Render system descriptor structure.

Remarks
This can be used for some refinements of a specific renderer, e.g. to configure the Vulkan device memory manager.
See also
RenderSystem::Load

Constructor & Destructor Documentation

◆ RenderSystemDescriptor() [1/3]

LLGL::RenderSystemDescriptor::RenderSystemDescriptor ( )
default

◆ RenderSystemDescriptor() [2/3]

LLGL::RenderSystemDescriptor::RenderSystemDescriptor ( const std::string & moduleName)
inline

Constructor to initialize the descriptor with the module name from an std::string.

◆ RenderSystemDescriptor() [3/3]

LLGL::RenderSystemDescriptor::RenderSystemDescriptor ( const char * moduleName)
inline

Constructor to initialize the descriptor with the module name from a null terminated string.

Member Data Documentation

◆ debugger

RenderingDebugger* LLGL::RenderSystemDescriptor::debugger = nullptr

debugger Optional pointer to a rendering debugger. This is only supported if LLGL was compiled with the LLGL_ENABLE_DEBUG_LAYER flag.

Remarks
If the default debugger is used (i.e. no sub class of RenderingDebugger), then all reports will be send to the Log. In order to see any reports from the Log, use either Log::RegisterCallback or Log::RegisterCallbackStd.

◆ flags

long LLGL::RenderSystemDescriptor::flags = 0

Render system flags. This can be a bitwise OR combination of RenderSystemFlags entries. By default 0.

Remarks
Use this to create a native debug layer for the device context.
See also
RenderSystemFlags

◆ moduleName

StringLiteral LLGL::RenderSystemDescriptor::moduleName

Specifies the name from which the new render system is to be loaded.

Remarks
This denotes a shared library (*.dll-files on Windows, *.so-files on Unix systems). If compiled in debug mode, the postfix "D" is appended to the module name. Moreover, the platform dependent file extension is always added automatically as well as the prefix "LLGL_", i.e. a module name "OpenGL" will be translated to "LLGL_OpenGLD.dll", if compiled on Windows in Debug mode. If LLGL was built with the LLGL_BUILD_STATIC_LIB option, this member is ignored.

◆ nativeHandle

const void* LLGL::RenderSystemDescriptor::nativeHandle = nullptr

Optional raw pointer to a backend specific native handle structure. If this is null (default), the render system creates its own native handles. These native handles can later be queried via RenderSystem::GetNativeHandle.

Remarks
This can be used to pass the native device instance or render context for the respective backend if the application has created its own instance. Example usage (for Direct3D12 renderer):
// Create own D3D12 device object
ID3D12Device* myD3D12Device = D3D12CreateDevice(...);
// Initialize native handle for D3D12
nativeHandleD3D12.device = myD3D12Device;
// Load D3D12 render system
rendererDesc.moduleName = "Direct3D12";
rendererDesc.nativeHandle = &nativeHandleD3D12;
rendererDesc.nativeHandleSize = sizeof(nativeHandleD3D12);
auto renderer = LLGL::RenderSystem::Load(rendererDesc);
static RenderSystemPtr Load(const RenderSystemDescriptor &renderSystemDesc, Report *report=nullptr)
Loads a new render system from the specified module.
Native handle structure for the Direct3D 12 render system.
Definition Backend/Direct3D12/NativeHandle.h:29
ID3D12Device * device
COM pointer to the native Direct3D device.
Definition Backend/Direct3D12/NativeHandle.h:47
Render system descriptor structure.
Definition RenderSystemFlags.h:333
const void * nativeHandle
Optional raw pointer to a backend specific native handle structure. If this is null (default),...
Definition RenderSystemFlags.h:431
StringLiteral moduleName
Specifies the name from which the new render system is to be loaded.
Definition RenderSystemFlags.h:357
std::size_t nativeHandleSize
Specifies the size (in bytes) of the structure nativeHandle points to (use sizeof with the respective...
Definition RenderSystemFlags.h:438
See also
RenderSystem::GetNativeHandle
Note
Currently only supported for OpenGL (Windows and Linux), D3D11, D3D12, and Vulkan.
Todo
Add support for all other backends.

◆ nativeHandleSize

std::size_t LLGL::RenderSystemDescriptor::nativeHandleSize = 0

Specifies the size (in bytes) of the structure nativeHandle points to (use sizeof with the respective structure). By default 0.

Remarks
If nativeHandle is null then this field is ignored.
See also
nativeHandle

◆ platformContext

void* LLGL::RenderSystemDescriptor::platformContext = nullptr

Optional raw pointer to a platform specific context structure the render system is brought up with. By default null.

Remarks
The structure it points to is identified by ::platformContextSize. Currently only used on Android, where it is required and points to one of the following two structures:
A NativeActivity-based application - one entered through android_main(android_app*) - must hand over its android_app state. Such an application advances through its startup lifecycle only while the glue's event loop is pumped, and RenderSystem::Load does that pumping until the native window and content are ready. It is also what LLGL's own windowing is built on: Canvas, Display, and the input events they deliver all come from this loop, and LLGL installs its onInputEvent handler here.
void android_main(android_app* state)
{
LLGL::RenderSystemDescriptor desc{ "OpenGLES3" };
desc.platformContext = state;
desc.platformContextSize = sizeof(*state);
myRenderSystem = LLGL::RenderSystem::Load(desc);
}
void * platformContext
Optional raw pointer to a platform specific context structure the render system is brought up with....
Definition RenderSystemFlags.h:470
std::size_t platformContextSize
Specifies the size (in bytes) of the structure platformContext points to (use sizeof with the respect...
Definition RenderSystemFlags.h:478
An application whose Activity is written in Java - as with SDL - has no android_app to give, and supplies an LLGL::AndroidContext filled in from its windowing library instead:
LLGL::AndroidContext androidContext;
androidContext.applicationVM = vm; // from the JNI environment
androidContext.applicationActivity = activity; // a global reference
desc.platformContext = &androidContext;
desc.platformContextSize = sizeof(androidContext);
See also
platformContextSize
AndroidContext

◆ platformContextSize

std::size_t LLGL::RenderSystemDescriptor::platformContextSize = 0

Specifies the size (in bytes) of the structure platformContext points to (use sizeof with the respective structure). By default 0.

Remarks
This size is what identifies which structure platformContext points to.
If platformContext is null then this field is ignored.
See also
platformContext

◆ profiler

void* LLGL::RenderSystemDescriptor::profiler = nullptr

◆ rendererConfig

const void* LLGL::RenderSystemDescriptor::rendererConfig = nullptr

Optional raw pointer to a renderer specific configuration structure.

Remarks
This can be used to pass some refinement configurations to the render system when the module is loaded. Example usage (for Vulkan renderer):
// Initialize Vulkan specific configurations (e.g. always allocate at least 1GB of VRAM for each device memory chunk).
config.minDeviceMemoryAllocationSize = 1024*1024*1024;
// Initialize render system descriptor
rendererDesc.moduleName = "Vulkan";
rendererDesc.rendererConfig = &config;
rendererDesc.rendererConfigSize = sizeof(config);
// Load Vulkan render system
auto renderer = LLGL::RenderSystem::Load(rendererDesc);
std::size_t rendererConfigSize
Specifies the size (in bytes) of the structure rendererConfig points to (use sizeof with the respecti...
Definition RenderSystemFlags.h:405
const void * rendererConfig
Optional raw pointer to a renderer specific configuration structure.
Definition RenderSystemFlags.h:398
Structure for a Vulkan renderer specific configuration.
Definition RendererConfiguration.h:86
std::uint64_t minDeviceMemoryAllocationSize
Minimal allocation size for a device memory chunk. By default 1024*1024, i.e. 1 MB of VRAM.
Definition RendererConfiguration.h:106
See also
rendererConfigSize
RendererConfigurationVulkan
RendererConfigurationOpenGL

◆ rendererConfigSize

std::size_t LLGL::RenderSystemDescriptor::rendererConfigSize = 0

Specifies the size (in bytes) of the structure rendererConfig points to (use sizeof with the respective structure). By default 0.

Remarks
If rendererConfig is null then this field is ignored.
See also
rendererConfig

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