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.
-
enumerator Trace#
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
severitymeets 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
messagetext, 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.
-
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.
-
LogSeverity severity = {}#
-
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.
-
Diligent::IBuffer *positionsBuffer#
-
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.
-
inline std::uint32_t totalRenderableObjectCapacity() const noexcept#
-
struct SourceLocation#
- #include <logger.h>
Source code origin information for a log entry.
-
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).
-
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.
-
template<typename ...Args>
-
using EntityId = std::uint32_t#