SleakEngine 1.0.0
C++23 multi-backend game engine
Loading...
Searching...
No Matches
Sleak Namespace Reference

Root namespace for everything the engine exposes. More...

Namespaces

namespace  Events
 Concrete event types dispatched through Sleak::EventDispatcher.
namespace  Input
 Key and mouse-button code enumerations plus their name lookups.
namespace  Math
 Vectors, matrices, quaternions, colors, AABBs, and random helpers.
namespace  Physics
 Collision shapes, the broadphase tree, and the world that steps them.
namespace  RenderEngine
 Backend-facing rendering layer shared by the four graphics backends.
namespace  UI
 Immediate-mode UI calls available to game code.

Classes

struct  AnimationChannel
class  AnimationClip
struct  AnimationState
class  AnimationStateMachine
struct  AnimationTransition
class  AnimatorComponent
class  Application
struct  ApplicationDefaults
class  AreaLight
struct  Arguments
class  Benchmark
struct  BenchmarkMetric
class  BinarySerializationContext
struct  Bone
class  Camera
class  CameraController
class  CameraNotFound
class  ColliderComponent
class  CommandLine
class  Component
class  CullingSystem
struct  DebugLineCBData
class  DebugLineRenderer
class  DebugOverlay
struct  DebugOverlayConfig
class  Delegate
class  DirectionalLight
class  EmptyContainerException
class  Event
class  EventDelegate
class  EventDelegateBase
class  EventDispatcher
class  File
class  FileIOException
class  FirstPersonController
class  FreeLookCameraController
class  GameBase
class  GameObject
class  Graph
 Represents a graph data structure with vertices and edges. More...
struct  GraphicsConfig
class  HashTable
 Implements a hash table (or map) for efficient key-value storage and retrieval. More...
class  Heap
 Implements a binary heap data structure for efficient priority queue operations. More...
class  IDelegate
class  IndexOutOfBoundsException
class  InvalidArgumentException
class  InvalidIteratorException
interface  ISerializationContext
 Interface for serialization contexts. More...
class  JsonSerializationContext
 ISerializationContext backed by nlohmann::json. More...
struct  Keyframe
class  Light
class  LightManager
class  List
 Implements a dynamic array-like list for storing and managing a collection of elements. More...
class  Logger
class  Material
class  MaterialComponent
class  MeshBatch
class  MeshComponent
struct  MeshData
struct  MeshHandle
struct  MessageBoxColorScheme
class  ModelLoader
struct  ModelLoadOptions
class  MulticastDelegate
struct  NodeData
class  NotImplementedException
class  NullPointerException
class  Object
class  ObjectPtr
class  Pair
 A simple container for storing two values as a pair. More...
struct  Plane
class  PointLight
class  PriorityList
 A list where elements are stored with associated priorities. More...
class  Queue
 Implements a FIFO (First-In, First-Out) queue data structure. More...
class  RefPtr
class  Renderable
class  ResourceBase
 Common lifecycle contract for GPU-backed resources: init, per-frame update, teardown. More...
class  RigidbodyComponent
struct  SampleRequest
class  Scene
class  SceneBase
class  ScopedTimer
 RAII stopwatch: logs elapsed time on destruction under the given name. More...
class  Serializable
 Base class for objects that can be serialized and deserialized. More...
class  SerializationFactory
 Detects file format and creates the appropriate serialization context. More...
struct  SharedControlBlock
class  Skeleton
class  Skybox
struct  SkyboxCBData
 GPU constant buffer layout for the skybox shader. More...
class  SleakException
class  SmartPointer
class  SpotLight
class  Stack
 Implements a LIFO (Last-In, First-Out) stack data structure. More...
class  String
 A dynamic string class, similar to std::string but STL-agnostic. More...
class  SystemMetrics
struct  SystemMetricsData
class  Texture
class  Timer
class  TransformComponent
 Represents the position, rotation, and scale of an entity in 3D space. More...
struct  TransitionCondition
class  Tree
 Implements a binary tree data structure for hierarchical data organization. More...
struct  Vertex
struct  VertexAttribute
class  VertexFormatRegistry
class  VertexGroup
struct  VertexLayoutDesc
class  ViewFrustum
struct  VoidData
 Untyped payload blob, currently unused by any buffer path. More...
class  WeakPtr
class  Window
class  YamlSerializationContext
 ISerializationContext backed by a YAML::Node. More...

Typedefs

using IndexGroup = List<IndexType>
using IndexType = uint32_t
using ParamValue = std::variant<bool, float, int>
using TextureCache = std::unordered_map<std::string, ::Sleak::Texture*>
 Per-load texture cache to avoid loading the same texture file multiple times.
using VertexFormatHandle = uint32_t

Enumerations

enum class  AreaLightShape : uint8_t { AreaLightShape::Rectangle = 0 , AreaLightShape::Disc = 1 }
enum class  BodyType { BodyType::Static , BodyType::Kinematic , BodyType::Dynamic }
enum class  CompareOp {
  CompareOp::Equal , CompareOp::NotEqual , CompareOp::Greater , CompareOp::GreaterEqual ,
  CompareOp::Less , CompareOp::LessEqual
}
enum class  EventCategory {
  EventCategory::None = (1 << 0) , EventCategory::Application = (1 << 1) , EventCategory::Input = (1 << 2) , EventCategory::Keyboard = (1 << 3) ,
  EventCategory::Mouse = (1 << 4) , EventCategory::MouseButton = (1 << 5)
}
enum class  EventType {
  EventType::Unknown = 0 , EventType::WindowOpen , EventType::WindowClose , EventType::WindowResize ,
  EventType::WindowFullscreen , EventType::WindowFocus , EventType::WindowLostFocus , EventType::WindowMoved ,
  EventType::Tick , EventType::Update , EventType::Render , EventType::KeyPressed ,
  EventType::KeyReleased , EventType::KeyTyped , EventType::MousePressed , EventType::MouseReleased ,
  EventType::MouseMoved , EventType::MouseScrolled
}
enum class  GraphicsQuality {
  GraphicsQuality::Off , GraphicsQuality::Low , GraphicsQuality::Medium , GraphicsQuality::High ,
  GraphicsQuality::Ultra
}
enum class  MaterialRenderMode : uint8_t { MaterialRenderMode::Opaque = 0 , MaterialRenderMode::Cutout = 1 , MaterialRenderMode::Transparent = 2 }
enum  MessageBoxReturn { Ok = 0 , Yes = 1 , No = 2 , Cancel = 3 }
enum  MessageBoxType : unsigned int { Info = 0x00000040u , Warning = 0x00000020u , Error = 0x00000010u }
enum class  ProjectionType { ProjectionType::Perspective , ProjectionType::Orthographic }
enum class  SceneState {
  SceneState::Unloaded , SceneState::Loading , SceneState::Active , SceneState::Paused ,
  SceneState::Unloading
}
enum class  SerializationFormat { SerializationFormat::Binary , SerializationFormat::JSON , SerializationFormat::YAML , SerializationFormat::XML , SerializationFormat::Unknown }
enum class  TextureFilter {
  TextureFilter::Nearest , TextureFilter::Bilinear , TextureFilter::Trilinear , TextureFilter::Anisotropic2x ,
  TextureFilter::Anisotropic4x , TextureFilter::Anisotropic8x , TextureFilter::Anisotropic16x , TextureFilter::Linear = Trilinear ,
  TextureFilter::Anisotropic = Anisotropic16x
}
enum class  TextureFormat {
  TextureFormat::RGBA8 , TextureFormat::RGB8 , TextureFormat::BGRA8 , TextureFormat::DXT1 ,
  TextureFormat::DXT5
}
enum class  TextureType { TextureType::Texture2D , TextureType::TextureCube , TextureType::Texture3D }
enum class  TextureWrapMode {
  TextureWrapMode::Repeat , TextureWrapMode::ClampToEdge , TextureWrapMode::ClampToBorder , TextureWrapMode::Mirror ,
  TextureWrapMode::MirrorClampToEdge
}
enum class  VertexAttribFormat : uint8_t {
  VertexAttribFormat::Float1 , VertexAttribFormat::Float2 , VertexAttribFormat::Float3 , VertexAttribFormat::Float4 ,
  VertexAttribFormat::UInt1 , VertexAttribFormat::Int1
}

Functions

static MaterialCreateDefaultMaterial ()
 Fallback material for the primitive factories below, using the default shader.
template<typename T, typename... Args>
std::shared_ptr< Delegate< Args... > > CreateDelegate (T *obj, void(T::*func)(Args...))
 Wraps a member function bound to obj into a shared Delegate.
template<typename T, typename... Args>
void DispatchEvent (Args &&... args)
 Constructs a T from args and dispatches it through EventDispatcher.
template<typename T>
static std::pair< int, float > FindKeyframe (const std::vector< Keyframe< T > > &keys, float time)
 Finds the keyframe pair straddling time and the lerp factor between them.
static void InitializeRecursive (GameObject *obj)
 Recursively initialize a GameObject and all its children.
static Math::Vector3D LerpVec3 (const Math::Vector3D &a, const Math::Vector3D &b, float t)
 Componentwise vector lerp.
template<typename T1, typename T2>
Pair< T1, T2 > makePair (T1 &&first, T2 &&second)
 Creates a Pair object with the given values.
void MessageBox (const char *Title, const char *Message, MessageBoxType Type)
 Fire-and-forget OS message box; no return value, no custom buttons.
template<typename T1, typename T2>
bool operator!= (const Pair< T1, T2 > &lhs, const Pair< T1, T2 > &rhs)
template<typename T1, typename T2>
bool operator< (const Pair< T1, T2 > &lhs, const Pair< T1, T2 > &rhs)
std::ostream & operator<< (std::ostream &os, const Event &e)
template<typename T1, typename T2>
bool operator<= (const Pair< T1, T2 > &lhs, const Pair< T1, T2 > &rhs)
template<typename T1, typename T2>
bool operator== (const Pair< T1, T2 > &lhs, const Pair< T1, T2 > &rhs)
template<typename T1, typename T2>
bool operator> (const Pair< T1, T2 > &lhs, const Pair< T1, T2 > &rhs)
template<typename T1, typename T2>
bool operator>= (const Pair< T1, T2 > &lhs, const Pair< T1, T2 > &rhs)
static void RegisterCollidersRecursive (GameObject *obj, Physics::PhysicsWorld *world)
 Walks obj and its children, registering any ColliderComponent found with world.
MessageBoxReturn ShowMessageBox (const char *Title, const char *Message, MessageBoxType Type, MessageBoxColorScheme scheme=MessageBoxColorScheme())
 Blocking Yes/No/Cancel dialog with a custom color scheme; returns the pressed button.
static void UnregisterCollidersRecursive (GameObject *obj, Physics::PhysicsWorld *world)
 Walks obj and its children, unregistering any ColliderComponent found from world.

Variables

static constexpr int MAX_BONE_INFLUENCE = 4
static constexpr int MAX_BONES = 256
static RefPtr< RenderEngine::BufferBases_batchTransformBuffer
class ENGINE_API Window

Detailed Description

Root namespace for everything the engine exposes.

Application and scene lifecycle, the GameObject/Component object model, runtime resources (meshes, materials, textures, models), lighting, culling, and the RefPtr ownership types all live here. Your game code stays in its own namespace or at global scope and reaches into Sleak.

Typedef Documentation

◆ IndexGroup

Definition at line 12 of file MeshData.hpp.

◆ IndexType

using Sleak::IndexType = uint32_t

Definition at line 11 of file MeshData.hpp.

◆ ParamValue

using Sleak::ParamValue = std::variant<bool, float, int>

Definition at line 44 of file AnimationStateMachine.hpp.

◆ TextureCache

using Sleak::TextureCache = std::unordered_map<std::string, ::Sleak::Texture*>

Per-load texture cache to avoid loading the same texture file multiple times.

Definition at line 40 of file ModelLoader.hpp.

◆ VertexFormatHandle

using Sleak::VertexFormatHandle = uint32_t

0 is reserved for the engine's default vertex layout; registered formats start at 1.

Definition at line 88 of file VertexLayout.hpp.

Function Documentation

◆ CreateDefaultMaterial()

Material * Sleak::CreateDefaultMaterial ( )
static

Fallback material for the primitive factories below, using the default shader.

Definition at line 138 of file GameObject.cpp.

◆ CreateDelegate()

template<typename T, typename... Args>
std::shared_ptr< Delegate< Args... > > Sleak::CreateDelegate ( T * obj,
void(T::* func )(Args...) )

Wraps a member function bound to obj into a shared Delegate.

Definition at line 135 of file Delegate.hpp.

◆ DispatchEvent()

template<typename T, typename... Args>
void Sleak::DispatchEvent ( Args &&... args)

Constructs a T from args and dispatches it through EventDispatcher.

Definition at line 217 of file Event.hpp.

◆ FindKeyframe()

template<typename T>
std::pair< int, float > Sleak::FindKeyframe ( const std::vector< Keyframe< T > > & keys,
float time )
static

Finds the keyframe pair straddling time and the lerp factor between them.

Definition at line 225 of file AnimatorComponent.cpp.

◆ InitializeRecursive()

void Sleak::InitializeRecursive ( GameObject * obj)
static

Recursively initialize a GameObject and all its children.

Definition at line 31 of file ModelLoader.cpp.

◆ LerpVec3()

Math::Vector3D Sleak::LerpVec3 ( const Math::Vector3D & a,
const Math::Vector3D & b,
float t )
static

Componentwise vector lerp.

Definition at line 241 of file AnimatorComponent.cpp.

◆ makePair()

template<typename T1, typename T2>
Pair< T1, T2 > Sleak::makePair ( T1 && first,
T2 && second )

Creates a Pair object with the given values.

This is a helper function for convenient creation of Pair objects.

Parameters
firstThe first value.
secondThe second value.
Returns
A Pair object containing the given values.

Definition at line 109 of file Pair.hpp.

◆ MessageBox()

void Sleak::MessageBox ( const char * Title,
const char * Message,
MessageBoxType Type )

Fire-and-forget OS message box; no return value, no custom buttons.

Definition at line 39 of file WindowHelper.hpp.

◆ operator!=()

template<typename T1, typename T2>
bool Sleak::operator!= ( const Pair< T1, T2 > & lhs,
const Pair< T1, T2 > & rhs )

Definition at line 120 of file Pair.hpp.

◆ operator<()

template<typename T1, typename T2>
bool Sleak::operator< ( const Pair< T1, T2 > & lhs,
const Pair< T1, T2 > & rhs )

Definition at line 125 of file Pair.hpp.

◆ operator<<()

std::ostream & Sleak::operator<< ( std::ostream & os,
const Event & e )
inline

Definition at line 222 of file Event.hpp.

◆ operator<=()

template<typename T1, typename T2>
bool Sleak::operator<= ( const Pair< T1, T2 > & lhs,
const Pair< T1, T2 > & rhs )

Definition at line 132 of file Pair.hpp.

◆ operator==()

template<typename T1, typename T2>
bool Sleak::operator== ( const Pair< T1, T2 > & lhs,
const Pair< T1, T2 > & rhs )

Definition at line 115 of file Pair.hpp.

◆ operator>()

template<typename T1, typename T2>
bool Sleak::operator> ( const Pair< T1, T2 > & lhs,
const Pair< T1, T2 > & rhs )

Definition at line 137 of file Pair.hpp.

◆ operator>=()

template<typename T1, typename T2>
bool Sleak::operator>= ( const Pair< T1, T2 > & lhs,
const Pair< T1, T2 > & rhs )

Definition at line 142 of file Pair.hpp.

◆ RegisterCollidersRecursive()

void Sleak::RegisterCollidersRecursive ( GameObject * obj,
Physics::PhysicsWorld * world )
static

Walks obj and its children, registering any ColliderComponent found with world.

Definition at line 17 of file SceneBase.cpp.

◆ ShowMessageBox()

MessageBoxReturn Sleak::ShowMessageBox ( const char * Title,
const char * Message,
MessageBoxType Type,
MessageBoxColorScheme scheme = MessageBoxColorScheme() )

Blocking Yes/No/Cancel dialog with a custom color scheme; returns the pressed button.

Definition at line 53 of file WindowHelper.hpp.

◆ UnregisterCollidersRecursive()

void Sleak::UnregisterCollidersRecursive ( GameObject * obj,
Physics::PhysicsWorld * world )
static

Walks obj and its children, unregistering any ColliderComponent found from world.

Definition at line 29 of file SceneBase.cpp.

Variable Documentation

◆ MAX_BONE_INFLUENCE

int Sleak::MAX_BONE_INFLUENCE = 4
staticconstexpr

Definition at line 13 of file Skeleton.hpp.

◆ MAX_BONES

int Sleak::MAX_BONES = 256
staticconstexpr

Definition at line 12 of file Skeleton.hpp.

◆ s_batchTransformBuffer

RefPtr<RenderEngine::BufferBase> Sleak::s_batchTransformBuffer
static

Definition at line 12 of file MeshBatch.cpp.

◆ Window

class ENGINE_API Sleak::Window

Definition at line 21 of file VulkanRenderer.hpp.