FrameData

Frame data structure.

Overview

Typical use cases:

  • Holding frame-specific data for rendering

Header

<RaeptorCogs/GAPI/Common/Core/Internal/FrameData.hpp>

Metadata

Author

Estorc

Version

v1.0

Copyright

Copyright (c) 2025 Estorc MIT License.

Types

Type Definitions

Type

Description

RaeptorCogs::GAPI::Common::UniformData

Type alias for uniform data.

RaeptorCogs::GAPI::Common::UniformHashMap

Type alias for uniform hash map.

using RaeptorCogs::GAPI::Common::UniformData = std::variant<bool, int, unsigned int, float, glm::vec2, glm::vec3, glm::vec4, glm::mat2, glm::mat3, glm::mat4>

Type alias for uniform data.

Holds the possible types for uniform variables.

using RaeptorCogs::GAPI::Common::UniformHashMap = std::unordered_map<std::string, UniformData>

Type alias for uniform hash map.

Maps uniform names to their corresponding data.

Structs

Structures

Struct

Description

RaeptorCogs::GAPI::Common::FrameData

Frame data structure.

struct FrameData

Frame data structure.

Holds data relevant to the current frame being rendered.

Public Functions

inline void upload()

Upload uniforms to the active shader.

Uploads all uniforms stored in the uniforms map to the currently active shader.

Public Members

double width

Frame width.

Holds the width of the current frame.

double height

Frame height.

Holds the height of the current frame.

UniformHashMap uniforms = {{"uTime", 0.0f}, {"uViewMatrix", glm::mat4(1.0f)}, {"uProjectionMatrix", glm::mat4(1.0f)},}

Uniforms for the frame.

Holds a map of uniform names to their corresponding data.

float &time = std::get<float>(uniforms["uTime"])

Reference to the time uniform.

glm::mat4 &viewMatrix = std::get<glm::mat4>(uniforms["uViewMatrix"])

Reference to the view matrix uniform.

glm::mat4 &projectionMatrix = std::get<glm::mat4>(uniforms["uProjectionMatrix"])

Reference to the projection matrix uniform.

ObjectHandler<Common::Shader> activeShader

Active shader.

Holds the currently active shader for the frame.