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

Namespaces

namespace  components
 
namespace  detail
 
namespace  Filesystem
 
namespace  log
 
namespace  math
 

Classes

struct  AddComponentCmd
 
struct  Application
 
struct  ApplicationRuntime
 
struct  ApplicationSpecification
 
struct  AppTerminateEvent
 
struct  CommandNode
 
struct  CommandQueue
 
struct  CommandTypeRegistrar
 
struct  ComponentFactory
 
struct  ComponentGroup
 
struct  ComponentPoolNode
 
struct  ComponentSerializer
 
struct  ComponentTraits
 
struct  ComponentTraits< T, ComponentGroup< Ts... > >
 
struct  ConcatComponentGroups
 
struct  ConcatComponentGroups< ComponentGroup< As... >, ComponentGroup< Bs... > >
 
struct  CreateEntityCmd
 
struct  DestroyEntityCmd
 
struct  EngineDebugLayer
 
struct  EngineServices
 
struct  Entity
 
struct  EntityHandle
 
struct  EntityManager
 
struct  EventManager
 
struct  EventVariant
 
struct  FrameSync
 
struct  FrameTimer
 Tracks frame timing, fixed timestep accumulation, and CPU work time. More...
 
struct  GlfwContext
 RAII wrapper for initializing and terminating Glfw. Also sets a glfwErrorCallback. More...
 
struct  IsUniqueComponentGroup
 
struct  IsUniqueComponentGroup< ComponentGroup< T, Ts... > >
 
struct  IsUniqueComponentGroup< ComponentGroup<> >
 
struct  KeyPressedEvent
 
struct  KeyReleasedEvent
 
struct  KeyTypedEvent
 
struct  Layer
 
struct  LayerList
 
struct  LayerNode
 
struct  LayoutManager
 Manages window layouts using ImGui DockBuilder for presets and INI for user layouts. More...
 
struct  MouseMovedEvent
 
struct  MousePressedEvent
 
struct  MouseReleasedEvent
 
struct  MouseScrolledEvent
 
struct  overloaded
 
struct  Panel
 
struct  PerformanceLayer
 
struct  Profile
 
struct  RemoveComponentCmd
 
struct  RenderStage
 
struct  RuntimeStateManager
 
struct  Scene
 
struct  SceneManager
 
struct  SDImGuiCallbacks
 
struct  SDImGuiContext
 
struct  SDImGuiViewport
 
struct  Serializer
 
struct  SourceLocation
 
struct  SparseEntitySet
 
struct  SwapchainOutOfDateEvent
 
struct  SwapchainSync
 
struct  System
 
struct  Texture
 
struct  TypeErasedCommandEntry
 
struct  VertexPNUV
 
struct  View
 
struct  ViewId
 
struct  ViewImpl
 
struct  ViewManager
 
struct  VulkanContext
 
struct  VulkanFramebuffer
 
struct  VulkanRenderer
 
struct  VulkanWindow
 
struct  Window
 
struct  WindowBuilder
 
struct  WindowCloseEvent
 
struct  WindowDesc
 
struct  WindowId
 
struct  WindowManager
 
struct  WindowManagerCallbacks
 
struct  WindowProps
 
struct  WindowResizeEvent
 

Concepts

concept  SerializableComponent
 
concept  IsLayer
 
concept  HasSerialize
 
concept  HasDeserialize
 
concept  HasSerialization
 

Typedefs

template<typename A , typename B >
using ConcatComponentGroups_t = typename ConcatComponentGroups< A, B >::type
 
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  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

template<typename... Ts>
 overloaded (Ts...) -> overloaded< Ts... >
 
SD_EXPORT std::optional< std::vector< U32 > > compile_shader (std::string_view filename, std::string_view profile={})
 
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)
 
template<std::ranges::input_range R>
requires std::constructible_from<std::string_view, std::ranges::range_value_t<R>>
std::string tab_format (R &&items, USize cols=4, USize spacing=2, bool row_major=true)
 
ImVec4 apply_theme ()
 

Variables

template<typename >
constexpr bool k_always_false = false
 
constexpr int g_max_frames_in_flight = 2
 
thread_local Profile _sd_active_profile {}
 
CommandTypeRegistrar s_registrar
 

Typedef Documentation

◆ CharCallbackFn

◆ ConcatComponentGroups_t

◆ 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 

◆ 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 ( )

◆ 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() 
)

◆ compile_shader()

std::optional< std::vector< U32 > > sd::compile_shader ( std::string_view  filename,
std::string_view  profile = {} 
)
Parameters
filenameinput hlsl source
profileOptional override: "vs_6_0", "ps_6_0", "cs_6_0" etc. When omitted, the profile is deduced from the file extension.

Check: https://docs.vulkan.org/guide/latest/hlsl.html#_vulkan_shader_stage_to_hlsl_target_shader_profile_mapping for what shader stage is needed for the different HLSL target shader profiles

◆ 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_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

◆ find_memory_type()

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

◆ overloaded()

template<typename... Ts>
sd::overloaded ( Ts...  ) -> overloaded< Ts... >

◆ 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

◆ 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

◆ tab_format()

template<std::ranges::input_range R>
requires std::constructible_from<std::string_view, std::ranges::range_value_t<R>>
std::string sd::tab_format ( R &&  items,
USize  cols = 4,
USize  spacing = 2,
bool  row_major = true 
)

Formats a range of items into aligned columns.

Parameters
itemsInput range whose elements are convertible to string_view
colsNumber of columns (default 4)
spacingMin spaces between columns (default 2)
row_majorWhen true (default), items fill left-to-right then down. When false, items fill top-to-bottom then right.

◆ 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

◆ _sd_active_profile

thread_local Profile sd::_sd_active_profile {}
inline

◆ g_max_frames_in_flight

constexpr int sd::g_max_frames_in_flight = 2
constexpr

◆ k_always_false

template<typename >
constexpr bool sd::k_always_false = false
inlineconstexpr

◆ s_registrar

CommandTypeRegistrar sd::s_registrar