Engine²
Open-source game engine written in C++.
Loading...
Searching...
No Matches
Graphic::Resource Namespace Reference

Classes

class  AGPUBuffer
class  AMultipleExecutionRenderPass
struct  ColorOutput
struct  DepthOutput
struct  OutputContainer
struct  InputContainer
class  ARenderPass
class  ASingleExecutionRenderPass
class  BindGroup
class  Context
struct  DeviceContext
class  GraphicSettings
struct  Image
struct  Limits
class  RenderGraph
class  Sampler
class  Shader
class  ShaderDescriptor
struct  Surface
struct  CallbackData
class  Texture

Typedefs

using BindGroupManager = Object::Resource::ResourceManager<BindGroup>
 BindGroupManager is a resource that stores BindGroup resources.
using GPUBufferContainer = Object::Resource::ResourceManager<std::unique_ptr<AGPUBuffer>>
 GPUBufferContainer is a resource that stores GPUBuffer resources.
using RenderGraphContainer = Object::Resource::ResourceManager<RenderGraph>
 RenderGraphContainer is a resource that stores RenderGraph resources.
using SamplerContainer = Object::Resource::ResourceManager<Sampler>
 SamplerContainer is a resource that stores Sampler resources.
using ShaderContainer = Object::Resource::ResourceManager<Shader>
 ShaderContainer is a resource that stores Shader resources.
using TextureContainer = Object::Resource::ResourceManager<Texture>
 TextureContainer is a resource that stores Texture resources.

Enumerations

enum class  WindowSystem { None , GLFW }
enum class  PowerPreference { LowPower , HighPerformance }

Functions

static void TextureRetrieveCallback (WGPUMapAsyncStatus status, WGPUStringView message, void *userdata1, void *userdata2)
 Callback invoked when a readback buffer mapping completes; converts mapped texture data into RGBA8 pixels stored in the provided CallbackData.

Typedef Documentation

◆ BindGroupManager

BindGroupManager is a resource that stores BindGroup resources.

This class provides a convenient way to manage multiple BindGroups in the graphics system. It uses the ResourceManager template to store and retrieve BindGroups by their unique identifiers.

See also
Object::Resource::ResourceManager
Graphic::Resource::BindGroup

◆ GPUBufferContainer

GPUBufferContainer is a resource that stores GPUBuffer resources.

This class provides a convenient way to manage multiple GPUBuffers in the graphics system. It uses the ResourceManager template to store and retrieve GPUBuffers by their unique identifiers.

See also
Object::Resource::ResourceManager
Graphic::Resource::GPUBuffer

◆ RenderGraphContainer

RenderGraphContainer is a resource that stores RenderGraph resources.

This class provides a convenient way to manage multiple render graphs in the graphics system. It uses the ResourceManager template to store and retrieve render graphs by their unique identifiers.

See also
Object::Resource::ResourceManager
Graphic::Resource::RenderGraph

◆ SamplerContainer

SamplerContainer is a resource that stores Sampler resources.

This class provides a convenient way to manage multiple Samplers in the graphics system. It uses the ResourceManager template to store and retrieve Samplers by their unique identifiers.

See also
Object::Resource::ResourceManager
Graphic::Resource::Sampler

◆ ShaderContainer

ShaderContainer is a resource that stores Shader resources.

This class provides a convenient way to manage multiple shaders in the graphics system. It uses the ResourceManager template to store and retrieve shaders by their unique identifiers.

See also
Object::Resource::ResourceManager
Graphic::Resource::Shader

◆ TextureContainer

TextureContainer is a resource that stores Texture resources.

This class provides a convenient way to manage multiple textures in the graphics system. It uses the ResourceManager template to store and retrieve textures by their unique identifiers.

See also
Object::Resource::ResourceManager
Graphic::Resource::Texture

Enumeration Type Documentation

◆ PowerPreference

Enumerator
LowPower 
HighPerformance 

◆ WindowSystem

Enumerator
None 
GLFW 

Function Documentation

◆ TextureRetrieveCallback()

void Graphic::Resource::TextureRetrieveCallback ( WGPUMapAsyncStatus status,
WGPUStringView message,
void * userdata1,
void * userdata2 )
static

Callback invoked when a readback buffer mapping completes; converts mapped texture data into RGBA8 pixels stored in the provided CallbackData.

Parameters
statusResult of the mapAsync operation.
messageOptional message produced by the mapping operation.
userdata1Pointer to a CallbackData instance that will receive the resulting Image pixels and control flags (must be a valid CallbackData*).
userdata2Unused.

If status is not success the function logs the failure, sets CallbackData::done to true and returns. If mapping succeeded the function reads the mapped buffer, iterates over texels while skipping per-row padding, converts each texel to a 4-channel 8-bit RGBA pixel according to CallbackData::format, appends pixels to CallbackData::data.pixels, unmaps the buffer, and marks CallbackData::done true. Supported source formats: RGBA8UnormSrgb, RGBA8Unorm, BGRA8Unorm, RGBA16Float (per-channel half floats unpacked, clamped to [0,1], and scaled to 0–255), and Depth32Float (depth mapped to a grayscale RGBA with alpha=255).

Exceptions
Exception::UnsupportedTextureFormatErrorIf the texture format in CallbackData is not supported for retrieval.