Common#

namespace common#

Typedefs

using EntityId = std::uint32_t#

Unique numeric identifier for entities within an ECS scene graph or World.

using ResourceId = std::uint32_t#

Unique numeric identifier for managed engine resources (meshes, textures, materials).

using LogCallback = void (*)(const LogMessageView &message, void *userData)#

Function pointer signature for custom log sink callbacks.

Param message:

Non-owning view of the formatted log message and metadata.

Param userData:

User-supplied context pointer passed during callback registration.

Enums

enum class LogSeverity#

Logging severity levels in ascending priority.

Values:

enumerator Trace#

Verbose low-level diagnostic tracing.

enumerator Debug#

Diagnostic information useful for debugging.

enumerator Info#

General informational operational events.

enumerator Warning#

Non-fatal warnings indicating unexpected conditions.

enumerator Error#

Recoverable errors or operation failures.

enumerator Fatal#

Unrecoverable fatal errors.

Functions

void setMinLogSeverity(LogSeverity severity) noexcept#

Sets the minimum severity threshold for log messages to be emitted.

Parameters:

severity – Minimum severity level to log.

LogSeverity minLogSeverity() noexcept#

Gets the current minimum logging severity threshold.

Returns:

Currently active minimum LogSeverity.

bool shouldLog(LogSeverity severity) noexcept#

Checks whether the logging helpers will emit a message of the given severity.

Parameters:

severity – Severity level to test.

Returns:

True if severity meets the current minimum threshold, false otherwise.

void setLogCallback(LogCallback callback, void *userData) noexcept#

Registers a callback that observes each message written through writeLogMessage().

Messages continue to be written to the default console sink while a callback is registered.

Parameters:
  • callback – Function pointer to invoke after default-sink output.

  • userData – User context pointer passed to the callback.

void clearLogCallback() noexcept#

Clears any previously registered log callback, resetting to default console output.

void writeLogMessage(LogSeverity severity, const SourceLocation &location, const std::string &message)#

Writes a message to the default sink and, if registered, the callback.

This low-level function does not apply the minimum severity threshold; use logMessage() or a CRESSIM_LOG_* macro when threshold filtering is required. The callback receives the original message text, while console output includes formatted severity and source information.

Parameters:
  • severity – Log severity level.

  • location – Source code origin location.

  • message – Log message string content.

Variables

constexpr EntityId kInvalidEntityId = 0#

Sentinel constant representing an invalid or unallocated EntityId.

constexpr ResourceId kInvalidResourceId = 0#

Sentinel constant representing an invalid or unallocated ResourceId.

struct FrameContext#
#include <frame_context.h>

Temporal execution state and timing parameters for a single simulation or rendering frame.

Public Members

std::uint64_t frameIndex = 0#

Index of this frame, typically monotonically increasing.

double timeSeconds = 0.0#

Accumulated simulation time at this frame, in seconds.

float deltaSeconds = 0.0f#

Elapsed time step for this frame, in seconds.

struct LogMessageView#
#include <logger.h>

Non-owning view of a log message event passed to log sink callbacks.

Public Members

LogSeverity severity = {}#

Severity level of the log message.

SourceLocation location = {}#

Source location where the message was logged.

const char *message = ""#

Null-terminated log message text.

struct PoseBufferView#
#include <scene_primitives.h>

Non-owning view of GPU buffers holding structured instance transformation data.

Public Members

Diligent::IBuffer *positionsBuffer#

GPU buffer containing instance 3D position vectors.

Diligent::IBuffer *orientationsBuffer#

GPU buffer containing instance orientation quaternions.

Diligent::IBuffer *scalesBuffer = nullptr#

GPU buffer containing instance 3D scale vectors.

std::uint32_t count = 0#

Number of valid transform instances in the buffers.

std::uint64_t bindingGeneration#

Revision counter tracking buffer reallocation/rebind events.

struct SceneLayoutDesc#
#include <scene_primitives.h>

Capacity descriptor specifying limits and environment counts for multi-environment scenes.

Public Functions

inline std::uint32_t totalRenderableObjectCapacity() const noexcept#

Computes the total renderable object capacity across all environments.

Returns:

Total renderable object slots (envCount * maxRenderableObjectsPerEnv).

inline std::uint32_t totalLightCapacity() const noexcept#

Computes the total light capacity across all environments.

Returns:

Total light slots (envCount * maxLightsPerEnv).

inline std::uint32_t totalCameraCapacity() const noexcept#

Computes the total camera capacity across all environments.

Returns:

Total camera slots (envCount * maxCamerasPerEnv).

Public Members

std::uint32_t envCount = 1u#

Number of parallel simulation and rendering environments.

std::uint32_t maxRenderableObjectsPerEnv#

Maximum number of renderable mesh objects in each environment.

std::uint32_t maxLightsPerEnv = 4u#

Maximum number of light sources per environment.

std::uint32_t maxCamerasPerEnv = 4u#

Maximum number of cameras per environment.

struct SourceLocation#
#include <logger.h>

Source code origin information for a log entry.

Public Members

const char *file = ""#

Source file path.

const char *function = ""#

Function or method name.

int line = 0#

Source line number.

struct Transform#
#include <math_types.h>

Represents a 3D affine transformation composed of translation, orientation, and scale.

It is used across physics, graphics, and ECS transform components (engine::TransformComponent).

Public Functions

inline bool operator==(const Transform &rhs) const noexcept#

Checks equality with another Transform.

Parameters:

rhs – Right-hand side Transform to compare against.

Returns:

True if position, rotation, and scale match exactly.

inline bool operator!=(const Transform &rhs) const noexcept#

Checks inequality with another Transform.

Parameters:

rhs – Right-hand side Transform to compare against.

Returns:

True if any component differs.

Public Members

Diligent::float3 position = {0.0f, 0.0f, 0.0f}#

World-space 3D translation (x, y, z).

Diligent::QuaternionF rotation#

World-space orientation quaternion (x, y, z, w).

Diligent::float3 scale = {1.0f, 1.0f, 1.0f}#

Per-axis 3D scale factors (sx, sy, sz).

namespace detail#

Functions

template<typename ...Args>
std::string buildLogMessage(Args&&... args)#

Concatenates variadic arguments into a single string using std::ostringstream.

Template Parameters:

Args – Argument types supported by stream insertion (operator<<).

Parameters:

args – Arguments to format into the message.

Returns:

Resulting concatenated message string.

template<typename ...Args>
void logMessage(LogSeverity severity, const SourceLocation &location, Args&&... args)#

Checks severity and formats/writes a log message if active.

Template Parameters:

Args – Argument types supported by stream insertion.

Parameters:
  • severity – Log severity level.

  • location – Source code location.

  • args – Arguments to format into the message.