SDEngine
Game Engine
Loading...
Searching...
No Matches
sd Namespace Reference

Namespaces

namespace  detail
 
namespace  Filesystem
 
namespace  log
 
namespace  math
 

Classes

class  AddComponentCmd
 
class  Application
 
struct  ApplicationRuntime
 
struct  ApplicationSpecification
 
class  AppTerminateEvent
 
struct  Camera
 
class  Command
 
class  CommandFactory
 
class  CommandQueue
 
class  CommandRegistry
 
struct  ComponentDebugInfo
 
class  ComponentFactory
 
struct  ComponentGroup
 
struct  ComponentSerializer
 
struct  ComponentSerializer< Camera >
 
struct  ComponentSerializer< DebugName >
 
struct  ComponentSerializer< Renderable >
 
struct  ComponentSerializer< Transform >
 
struct  ComponentTraits
 
class  CreateEntityCmd
 
struct  DebugName
 
class  DestroyEntityCmd
 
class  EngineDebugLayer
 
struct  EngineServices
 
struct  Entity
 
struct  EntityHandle
 
class  EntityManager
 
class  Event
 
class  EventDispatcher
 
class  EventManager
 
struct  FrameSync
 
class  FrameTimer
 Tracks frame timing, fixed timestep accumulation, and CPU work time. More...
 
class  GameContext
 
class  GlfwContext
 RAII wrapper for initializing and terminating Glfw. Also sets a glfwErrorCallback. More...
 
class  KeyPressedEvent
 
class  KeyReleasedEvent
 
class  KeyTypedEvent
 
class  Layer
 Base class for all layers. Prefer using System, RenderStage, or Panel instead. More...
 
class  LayerList
 
class  LayoutManager
 Manages window layouts using ImGui DockBuilder for presets and INI for user layouts. More...
 
class  MouseMovedEvent
 
class  MousePressedEvent
 
class  MouseReleasedEvent
 
class  MouseScrolledEvent
 
class  Panel
 ImGui UI layer: panels, inspectors, debug tools. No GPU rendering. More...
 
class  PerformanceLayer
 
class  PipelineFactory
 Creates and owns graphics pipelines. Handles cleanup on destruction. More...
 
class  RemoveComponentCmd
 
struct  Renderable
 
class  RenderStage
 GPU command recording layer: bound to a View + render stage. No logic or UI. More...
 
class  RuntimeStateManager
 
class  Scene
 
class  SceneManager
 
class  SceneView
 
struct  SDImGuiCallbacks
 
class  SDImGuiContext
 
class  SDImGuiViewport
 
class  Serializable
 
class  Serializer
 
class  ShaderCompiler
 
class  ShaderLibrary
 Compiles HLSL → SPIR-V and caches VkShaderModules. More...
 
class  SparseEntitySet
 
class  SparseEntitySetBase
 
class  SwapchainOutOfDateEvent
 
struct  SwapchainSync
 
class  System
 Logic-only layer: events, update, fixed update. No rendering or UI. More...
 
struct  Texture
 
struct  Transform
 
class  View
 
struct  ViewId
 
class  ViewImpl
 
class  ViewManager
 
class  VulkanContext
 
class  VulkanFramebuffer
 
class  VulkanRenderer
 
class  VulkanWindow
 
class  Window
 
class  WindowBuilder
 
class  WindowCloseEvent
 
struct  WindowDesc
 
struct  WindowId
 
class  WindowManager
 
struct  WindowManagerCallbacks
 
struct  WindowProps
 
class  WindowResizeEvent
 

Concepts

concept  SerializableComponent
 
concept  IsLayer
 

Typedefs

using glfw_error_callback = std::function< void(int, const char *)>
 
using ResizeCallbackFn = std::function< void(int, int)>
 
using KeyCallbackFn = std::function< void(int, int, int, int)>
 
using ScrollCallbackFn = std::function< void(double, double)>
 
using CursorCallbackFn = std::function< void(double, double)>
 
using MouseButtonCallbackFn = std::function< void(int, int, int)>
 
using RefreshCallbackFn = std::function< void()>
 
using CharCallbackFn = std::function< void(unsigned int)>
 

Enumerations

enum class  EventType {
  NONE = 0 , APP_TICK , APP_UPDATE , APP_RENDER ,
  APP_TERMINATE , WINDOW_CLOSE , WINDOW_RESIZE , WINDOW_FOCUS ,
  WINDOW_LOST_FOCUS , SWAPCHAIN_OUT_OF_DATE , KEY_PRESSED , KEY_RELEASED ,
  KEY_TYPED , MOUSE_MOVED , MOUSE_SCROLLED , MOUSE_PRESSED ,
  MOUSE_RELEASED
}
 
enum class  EventCategory : u16 {
  NONE = 0 , EVENT_CATEGORY_ENGINE = bit(0) , EVENT_CATEGORY_APPLICATION = bit(1) , EVENT_CATEGORY_WINDOW = bit(2) ,
  EVENT_CATEGORY_INPUT = bit(3) , EVENT_CATEGORY_KEYBOARD = bit(4) , EVENT_CATEGORY_MOUSE = bit(5) , EVENT_CATEGORY_MOUSE_BUTTON = bit(6) ,
  EVENT_CATEGORY_CONTROLLER = bit(7)
}
 
enum  ViewError { NAME_ALREADY_EXISTS , SUCCESS , VIEW_DOES_NOT_EXIST }
 
enum class  AspectMode { FIXED_HEIGHT , FIXED_WIDTH , BEST_FIT }
 
enum class  RenderMode { SHADED , WIREFRAME }
 
enum class  FileError { NONE , ERROR , FILE_TOO_LARGE , ALREADY_EXISTS }
 

Functions

void engine_abort (const std::string &message)
 
void engine_abort ()
 
 REGISTER_COMMAND (CreateEntityCmd)
 
 REGISTER_COMMAND (DestroyEntityCmd)
 
 REGISTER_COMPONENT_COMMANDS (Transform)
 
 REGISTER_COMPONENT_COMMANDS (Camera)
 
 REGISTER_COMPONENT_COMMANDS (Renderable)
 
 REGISTER_COMPONENT_COMMANDS (DebugName)
 
 REGISTER_SD_COMPONENT (Transform)
 
 REGISTER_SERIALIZABLE_COMPONENT (Transform)
 
 REGISTER_SD_COMPONENT (Camera)
 
 REGISTER_SERIALIZABLE_COMPONENT (Camera)
 
 REGISTER_SD_COMPONENT (Renderable)
 
 REGISTER_SERIALIZABLE_COMPONENT (Renderable)
 
 REGISTER_SD_COMPONENT (DebugName)
 
 REGISTER_SERIALIZABLE_COMPONENT (DebugName)
 
static consteval usize bit (usize idx)
 
EventCategory operator| (const EventCategory a, const EventCategory b)
 
bool operator& (int lhs, EventCategory rhs)
 
void check_vulkan_res (vk::Result result, std::string_view message, std::source_location loc=std::source_location::current())
 
template<typename T >
auto check_vulkan_res_val (T &&result, std::string_view message, std::source_location loc=std::source_location::current())
 
u32 find_memory_type (const vk::PhysicalDevice &physical_device, u32 type_filter, vk::MemoryPropertyFlags properties)
 
std::expected< std::vector< char >, FileErrorread_file (const std::string &filename)
 
std::expected< void, std::string > single_time_command (const vk::Device &device, const vk::Queue &queue, const vk::CommandPool &command_pool, const std::function< void(const vk::CommandBuffer &)> &action)
 
std::pair< vk::UniqueBuffer, vk::UniqueDeviceMemory > create_buffer (const vk::Device &device, const vk::PhysicalDevice &physical_device, vk::DeviceSize size, vk::BufferUsageFlags usage, vk::MemoryPropertyFlags properties)
 
std::pair< vk::UniqueImage, vk::UniqueDeviceMemory > create_image (const vk::Device &device, const vk::PhysicalDevice &physical_device, uint32_t width, uint32_t height, vk::Format format, vk::ImageTiling tiling, vk::ImageUsageFlags usage, vk::MemoryPropertyFlags properties)
 
void copy_buffer_to_image (const vk::CommandBuffer &cmd_buffer, const vk::Buffer &buffer, const vk::Image &image, uint32_t width, uint32_t height)
 
void transition_image_layout (const vk::CommandBuffer &cmd_buffer, const vk::Image &image, vk::Format format, vk::ImageLayout old_layout, vk::ImageLayout new_layout)
 
std::expected< Texture, std::string > create_texture (const vk::Device &device, const vk::PhysicalDevice &physical_device, const vk::Queue &graphics_queue, const vk::CommandPool &command_pool, const std::filesystem::path &file_path)
 
vk::UniqueShaderModule create_shader_module (const vk::Device &device, const std::vector< char > &code)
 
ImVec4 apply_theme ()
 

Variables

auto key_category
 
static auto g_mouse_category
 
CComPtr< IDxcUtilsg_dxc_utils
 
CComPtr< IDxcCompiler3g_dxc_compiler
 
constexpr int g_max_frames_in_flight = 2
 

Typedef Documentation

◆ CharCallbackFn

◆ CursorCallbackFn

◆ glfw_error_callback

◆ KeyCallbackFn

using sd::KeyCallbackFn = typedef std::function<void(int, int, int, int)>

◆ MouseButtonCallbackFn

◆ RefreshCallbackFn

◆ ResizeCallbackFn

◆ ScrollCallbackFn

Enumeration Type Documentation

◆ AspectMode

Enumerator
FIXED_HEIGHT 
FIXED_WIDTH 
BEST_FIT 

◆ EventCategory

Enumerator
NONE 
EVENT_CATEGORY_ENGINE 
EVENT_CATEGORY_APPLICATION 
EVENT_CATEGORY_WINDOW 
EVENT_CATEGORY_INPUT 
EVENT_CATEGORY_KEYBOARD 
EVENT_CATEGORY_MOUSE 
EVENT_CATEGORY_MOUSE_BUTTON 
EVENT_CATEGORY_CONTROLLER 

◆ EventType

Enumerator
NONE 
APP_TICK 
APP_UPDATE 
APP_RENDER 
APP_TERMINATE 
WINDOW_CLOSE 
WINDOW_RESIZE 
WINDOW_FOCUS 
WINDOW_LOST_FOCUS 
SWAPCHAIN_OUT_OF_DATE 
KEY_PRESSED 
KEY_RELEASED 
KEY_TYPED 
MOUSE_MOVED 
MOUSE_SCROLLED 
MOUSE_PRESSED 
MOUSE_RELEASED 

◆ FileError

Enumerator
NONE 
ERROR 
FILE_TOO_LARGE 
ALREADY_EXISTS 

◆ RenderMode

Enumerator
SHADED 
WIREFRAME 

◆ ViewError

Enumerator
NAME_ALREADY_EXISTS 
SUCCESS 
VIEW_DOES_NOT_EXIST 

Function Documentation

◆ apply_theme()

ImVec4 sd::apply_theme ( )

◆ bit()

static consteval usize sd::bit ( usize  idx)
static

◆ check_vulkan_res()

void sd::check_vulkan_res ( vk::Result  result,
std::string_view  message,
std::source_location  loc = std::source_location::current() 
)
inline

◆ check_vulkan_res_val()

template<typename T >
auto sd::check_vulkan_res_val ( T &&  result,
std::string_view  message,
std::source_location  loc = std::source_location::current() 
)

◆ copy_buffer_to_image()

void sd::copy_buffer_to_image ( const vk::CommandBuffer &  cmd_buffer,
const vk::Buffer &  buffer,
const vk::Image &  image,
uint32_t  width,
uint32_t  height 
)
inline

◆ create_buffer()

std::pair< vk::UniqueBuffer, vk::UniqueDeviceMemory > sd::create_buffer ( const vk::Device &  device,
const vk::PhysicalDevice &  physical_device,
vk::DeviceSize  size,
vk::BufferUsageFlags  usage,
vk::MemoryPropertyFlags  properties 
)
inline

◆ create_image()

std::pair< vk::UniqueImage, vk::UniqueDeviceMemory > sd::create_image ( const vk::Device &  device,
const vk::PhysicalDevice &  physical_device,
uint32_t  width,
uint32_t  height,
vk::Format  format,
vk::ImageTiling  tiling,
vk::ImageUsageFlags  usage,
vk::MemoryPropertyFlags  properties 
)
inline

◆ create_shader_module()

vk::UniqueShaderModule sd::create_shader_module ( const vk::Device &  device,
const std::vector< char > &  code 
)
inline

Create a Vulkan shader module from SPIR-V bytecode.

Note
The input buffer must be 4-byte aligned. SPIR-V files from DXC are, but if loading from arbitrary sources, ensure alignment before calling.

◆ create_texture()

std::expected< Texture, std::string > sd::create_texture ( const vk::Device &  device,
const vk::PhysicalDevice &  physical_device,
const vk::Queue &  graphics_queue,
const vk::CommandPool &  command_pool,
const std::filesystem::path &  file_path 
)
inline

◆ engine_abort() [1/2]

void sd::engine_abort ( )
inline

◆ engine_abort() [2/2]

void sd::engine_abort ( const std::string &  message)
inline

Terminates the engine and prints following fatal message

Parameters
message

◆ find_memory_type()

u32 sd::find_memory_type ( const vk::PhysicalDevice &  physical_device,
u32  type_filter,
vk::MemoryPropertyFlags  properties 
)
inline

◆ operator&()

bool sd::operator& ( int  lhs,
EventCategory  rhs 
)
inline

◆ operator|()

EventCategory sd::operator| ( const EventCategory  a,
const EventCategory  b 
)
inline

◆ read_file()

std::expected< std::vector< char >, FileError > sd::read_file ( const std::string &  filename)
inline

Reads a file from given path

Parameters
filename
Returns
array of chars

◆ REGISTER_COMMAND() [1/2]

sd::REGISTER_COMMAND ( CreateEntityCmd  )

◆ REGISTER_COMMAND() [2/2]

sd::REGISTER_COMMAND ( DestroyEntityCmd  )

◆ REGISTER_COMPONENT_COMMANDS() [1/4]

sd::REGISTER_COMPONENT_COMMANDS ( Camera  )

◆ REGISTER_COMPONENT_COMMANDS() [2/4]

sd::REGISTER_COMPONENT_COMMANDS ( DebugName  )

◆ REGISTER_COMPONENT_COMMANDS() [3/4]

sd::REGISTER_COMPONENT_COMMANDS ( Renderable  )

◆ REGISTER_COMPONENT_COMMANDS() [4/4]

sd::REGISTER_COMPONENT_COMMANDS ( Transform  )

◆ REGISTER_SD_COMPONENT() [1/4]

sd::REGISTER_SD_COMPONENT ( Camera  )

◆ REGISTER_SD_COMPONENT() [2/4]

sd::REGISTER_SD_COMPONENT ( DebugName  )

◆ REGISTER_SD_COMPONENT() [3/4]

sd::REGISTER_SD_COMPONENT ( Renderable  )

◆ REGISTER_SD_COMPONENT() [4/4]

sd::REGISTER_SD_COMPONENT ( Transform  )

◆ REGISTER_SERIALIZABLE_COMPONENT() [1/4]

sd::REGISTER_SERIALIZABLE_COMPONENT ( Camera  )

◆ REGISTER_SERIALIZABLE_COMPONENT() [2/4]

sd::REGISTER_SERIALIZABLE_COMPONENT ( DebugName  )

◆ REGISTER_SERIALIZABLE_COMPONENT() [3/4]

sd::REGISTER_SERIALIZABLE_COMPONENT ( Renderable  )

◆ REGISTER_SERIALIZABLE_COMPONENT() [4/4]

sd::REGISTER_SERIALIZABLE_COMPONENT ( Transform  )

◆ single_time_command()

std::expected< void, std::string > sd::single_time_command ( const vk::Device &  device,
const vk::Queue &  queue,
const vk::CommandPool &  command_pool,
const std::function< void(const vk::CommandBuffer &)> &  action 
)
inline

◆ transition_image_layout()

void sd::transition_image_layout ( const vk::CommandBuffer &  cmd_buffer,
const vk::Image &  image,
vk::Format  format,
vk::ImageLayout  old_layout,
vk::ImageLayout  new_layout 
)
inline

Variable Documentation

◆ g_dxc_compiler

CComPtr<IDxcCompiler3> sd::g_dxc_compiler
inline

◆ g_dxc_utils

CComPtr<IDxcUtils> sd::g_dxc_utils
inline

◆ g_max_frames_in_flight

constexpr int sd::g_max_frames_in_flight = 2
constexpr

◆ g_mouse_category

auto sd::g_mouse_category
inlinestatic
Initial value:
= EventCategory::EVENT_CATEGORY_WINDOW |
EventCategory::EVENT_CATEGORY_INPUT |
EventCategory::EVENT_CATEGORY_MOUSE

◆ key_category

auto sd::key_category
inline
Initial value:
= EventCategory::EVENT_CATEGORY_WINDOW |
EventCategory::EVENT_CATEGORY_INPUT |
EventCategory::EVENT_CATEGORY_KEYBOARD