|
Cogs.Core
|
Settings for graphics device initialization. More...
#include <IGraphicsDevice.h>
Public Types | |
| using | RedrawRequestCallback = void(*)(void *userData) |
| Optional callback invoked when the device wants the owning application to re-run the frame loop and render again, even though nothing else may have changed. | |
Public Attributes | |
| int | featureLevelMajor |
| Major feature level. | |
| int | featureLevelMinor |
| Minor feature level. | |
| TextureFormat | colorFormat = TextureFormat::R8G8B8A8_UNORM_SRGB |
| Back buffer format. | |
| TextureFormat | depthFormat = TextureFormat::D32_FLOAT |
| Depth buffer format. | |
| int | numSamples = 1 |
| Number of samples to use for back buffer MSAA. | |
| int | flags = GraphicsDeviceFlags::None |
| Flags controlling the behavior of the graphics device. | |
| struct WindowData * | windowData |
| Native window handle used to initialize the graphics device. | |
| void ** | sharedSurface = nullptr |
| Pointer to storage for a pointer to a shared surface. | |
| IIOHandler * | ioHandler |
| Optional pointer to an IO handler. | |
| RedrawRequestCallback | redrawRequestCallback = nullptr |
| void * | redrawRequestCallbackUserData = nullptr |
| uint32_t | fakeAsyncEffectLoadFrames = 0 |
| Testing aid: simulate asynchronous effect loading by delaying the number of frames given here before an effect (and any pipeline using it) reports ResourceStatus::Ready. | |
Settings for graphics device initialization.
Definition at line 90 of file IGraphicsDevice.h.
| using Cogs::GraphicsDeviceSettings::RedrawRequestCallback = void(*)(void * userData) |
Optional callback invoked when the device wants the owning application to re-run the frame loop and render again, even though nothing else may have changed.
This is needed for asynchronously loaded resources (e.g. WebGPU shader compilation) that become ready some time after loadEffect/loadPipeline returned - without this notification, an application using an on-demand ("dirty") render loop would not know to re-render once the load completes.
May be called from any thread, callback-driven backends may complete off the render thread, so the callback must be safe to call from any thread. Typically it will just post/signal a wake-up to the actual render/frame-loop thread.
Definition at line 174 of file IGraphicsDevice.h.
| TextureFormat Cogs::GraphicsDeviceSettings::colorFormat = TextureFormat::R8G8B8A8_UNORM_SRGB |
Back buffer format.
Definition at line 118 of file IGraphicsDevice.h.
Referenced by Cogs::RenderTargetsD3D11::getLayout(), Cogs::RenderTargetsD3D12::getLayout(), Cogs::RenderTargetsGL20::getLayout(), Cogs::RenderTargetsGLES30::getLayout(), Cogs::RenderTargetsVK::getLayout(), and Cogs::SwapChainGL20::recreateOffscreenBuffers().
| TextureFormat Cogs::GraphicsDeviceSettings::depthFormat = TextureFormat::D32_FLOAT |
Depth buffer format.
Definition at line 123 of file IGraphicsDevice.h.
Referenced by Cogs::RenderTargetsVK::getLayout().
| uint32_t Cogs::GraphicsDeviceSettings::fakeAsyncEffectLoadFrames = 0 |
Testing aid: simulate asynchronous effect loading by delaying the number of frames given here before an effect (and any pipeline using it) reports ResourceStatus::Ready.
Zero (default) disables the simulation, effects are ready as soon as loadEffect returns, as today.
Definition at line 186 of file IGraphicsDevice.h.
| int Cogs::GraphicsDeviceSettings::featureLevelMajor |
Major feature level.
Corresponds to the underlying graphics APIs major version number desired. If the underlying API fails to meet the requirements, device initialization will fail.
Setting this to zero defaults the major version.
E.g if the user knows that some of the features desired require OpenGL version 3.2, this would be set to 3.
Definition at line 102 of file IGraphicsDevice.h.
| int Cogs::GraphicsDeviceSettings::featureLevelMinor |
Minor feature level.
Corresponds to the underlying graphics APIs minor version number. If the underlying API fails to meet the requirements, device initialization will fail.
Setting this to zero defaults the minor version.
E.g if the user knows that some of the features desired require OpenGL version 3.2 this would be set to 2.
Definition at line 113 of file IGraphicsDevice.h.
| int Cogs::GraphicsDeviceSettings::flags = GraphicsDeviceFlags::None |
Flags controlling the behavior of the graphics device.
Definition at line 135 of file IGraphicsDevice.h.
| IIOHandler* Cogs::GraphicsDeviceSettings::ioHandler |
Optional pointer to an IO handler.
Definition at line 161 of file IGraphicsDevice.h.
Referenced by Cogs::GraphicsDeviceNull::initialize(), and Cogs::GraphicsDeviceWebGPU::initialize().
| int Cogs::GraphicsDeviceSettings::numSamples = 1 |
Number of samples to use for back buffer MSAA.
Definition at line 128 of file IGraphicsDevice.h.
Referenced by Cogs::RenderTargetsD3D11::getLayout(), Cogs::RenderTargetsD3D12::getLayout(), Cogs::RenderTargetsGL20::getLayout(), Cogs::RenderTargetsGLES30::getLayout(), Cogs::RenderTargetsVK::getLayout(), Cogs::SwapChainGL20::initialize(), Cogs::SwapChainGL20::recreateOffscreenBuffers(), and Cogs::Core::Renderer::render().
| RedrawRequestCallback Cogs::GraphicsDeviceSettings::redrawRequestCallback = nullptr |
Definition at line 175 of file IGraphicsDevice.h.
| void* Cogs::GraphicsDeviceSettings::redrawRequestCallbackUserData = nullptr |
Definition at line 176 of file IGraphicsDevice.h.
| void** Cogs::GraphicsDeviceSettings::sharedSurface = nullptr |
Pointer to storage for a pointer to a shared surface.
When shared surface support is enabled, a pointer to the shared back buffer surface will be stored at the given location whenever the shared surface is updated. The shares surface may be changed during the following operations;
Definition at line 158 of file IGraphicsDevice.h.
| struct WindowData* Cogs::GraphicsDeviceSettings::windowData |
Native window handle used to initialize the graphics device.
On Windows systems this must be valid if the device should create and initialize an OpenGL context from scratch. If there is already an OpenGL context active the window handle can be left as default.
WindowData is a typedef for HWND on Windows, and a structure on Linux.
Definition at line 146 of file IGraphicsDevice.h.
Referenced by Cogs::GraphicsDeviceWebGPU::initialize().