DirectZ
Loading...
Searching...
No Matches
dz Namespace Reference

Namespaces

namespace  ecs

Classes

struct  AABB
 Axis-Aligned Bounding Box (AABB) template structure. More...
struct  BlendState
struct  Camera
struct  CameraDrawInformation
 Information for a single Camera draw. More...
struct  color_vec
struct  D7Stream
struct  default_delete_array
 Default deleter for arrays. More...
struct  default_delete_single
 Default deleter for single heap-allocated objects. More...
struct  default_free_deleter
 Default deleter using free(). More...
struct  default_noop
 Default no-op deleter. More...
struct  DisplayDescription
struct  DrawIndirectCommand
 Represents a single indirect draw command for use with GPU draw calls. More...
struct  DrawInformation
 struct containing required information to draw More...
struct  DrawListManager
 Template draw list manager for producing draw commands from a struct buffer. More...
struct  ECS
struct  EventInterface
struct  ExpectedType
struct  ExpectedType< D7Type::a >
struct  ExpectedType< D7Type::T >
struct  ExpectedType< D7Type::U >
struct  ExpectedType< D7Type::u >
struct  ExpectedType< D7Type::X >
struct  ExpectedType< D7Type::Y >
struct  ExpectedType< D7Type::Z >
struct  FileHandle
 Represents a generalized file handle that can reference disk files, embedded assets, or memory streams. More...
struct  FirstMatchingOrDefault
struct  FirstMatchingOrDefault< Trait >
struct  FirstMatchingOrDefault< Trait, T, Ts... >
struct  FramebufferInfo
struct  GlobalUID
 Thread-safe UID generator that increments globally across the application. More...
struct  IDrawListManager
 Interface for draw list manager implementations. More...
struct  ImageCreateInfo
struct  ImGuiLayer
struct  IsCameraProvider
struct  IsDrawProvider
struct  IsSceneProvider
class  KeyValueStream
 A key-value binary stream writer/reader with support for serialization, deserialization, and deletion. More...
struct  mat
 A generic fixed-size matrix template supporting common matrix operations. More...
struct  ProgramArgs
 Parses and stores command line program arguments. More...
struct  Provider
struct  quat
 A quaternion class for representing rotations in 3D space. More...
struct  Random
 Utility class for generating random values with optional seeding and support for multiple numeric types. More...
class  ReflectedStructView
struct  Restorable
struct  size_ptr
 A reference-counted smart pointer with associated size and custom deleter. More...
struct  StaticRestorable
struct  vec
 Template struct representing an N-dimensional vector of type T. More...
struct  WindowCreateInfo
struct  WindowReflectableGroup

Typedefs

using Asset = dz::size_ptr<char>
 Asset alias representing a pointer to int8_t data.
using StreamScalar = float
using StreamInteger = std::int64_t
using StreamString = std::string
using StreamTimestamp = std::chrono::time_point<std::chrono::steady_clock>
using StreamIdentifier = std::uint64_t
using StreamPoint = std::tuple<StreamScalar, StreamScalar, StreamScalar, StreamTimestamp, StreamIdentifier, StreamInteger, StreamString>
using DrawList = std::vector<DrawIndirectCommand>
 A list of draw commands.
using ShaderDrawList = std::unordered_map<Shader*, DrawList>
 Maps each Shader pointer to its corresponding list of draw commands.
using DrawTuples = std::vector<std::tuple<Shader*, uint32_t>>
 Maps each Framebuffer pointer to the ShaderDrawList.
using CameraTuple = std::tuple<int, Framebuffer*, std::function<void()>>
 A CameraTuple is the information required to draw from a cameras perspective.

Enumerations

enum class  D7Type : std::uint8_t {
  Unset = 0 , X = 1 << 0 , Y = 1 << 1 , Z = 1 << 2 ,
  T = 1 << 3 , U = 1 << 4 , u = 1 << 5 , a = 1 << 6 ,
  Count = 7 , All = 0x7F
}
enum class  AttachmentType {
  Color , Depth , DepthStencil , Stencil ,
  ColorResolve , DepthResolve
}
enum class  BlendFactor {
  Zero = 0 , One = 1 , SrcColor = 2 , OneMinusSrcColor = 3 ,
  DstColor = 4 , OneMinusDstColor = 5 , SrcAlpha = 6 , OneMinusSrcAlpha = 7 ,
  DstAlpha = 8 , OneMinusDstAlpha = 9 , ConstantColor = 10 , OneMinusConstantColor = 11 ,
  ConstantAlpha = 12 , OneMinusConstantAlpha = 13 , SrcAlphaSaturate = 14 , Src1Color = 15 ,
  OneMinusSrc1Color = 16 , Src1Alpha = 17 , OneMinusSrc1Alpha = 18
}
enum class  BlendOp {
  Add = 0 , Subtract = 1 , ReverseSubtract = 2 , Min = 3 ,
  Max = 4
}
enum class  ShaderModuleType { Vertex = 1 , Fragment = 2 , Compute = 3 }
enum class  ShaderTopology {
  PointList = 0 , LineList = 1 , LineStrip = 2 , TriangleList = 3 ,
  TriangleStrip = 4 , TriangleFan = 5
}
enum class  KEYCODES : uint8_t {
  NUL = 0 , BACKSPACE = 8 , TAB = 9 , ENTER = 10 ,
  HOME = 14 , END = 15 , UP = 17 , DOWN = 18 ,
  RIGHT = 19 , LEFT = 20 , PGUP = 21 , PGDOWN = 22 ,
  INSERT = 23 , NUMLOCK = 24 , CAPSLOCK = 25 , CTRL = 26 ,
  ESCAPE = 27 , SHIFT = 28 , ALT = 29 , PAUSE = 30 ,
  SUPER = 31 , SPACE = 32 , EXCLAMATION = 33 , DOUBLEQUOTE = 34 ,
  HASHTAG = 35 , DOLLAR = 36 , PERCENTSIGN = 37 , AMPERSAND = 38 ,
  SINGLEQUOTE = 39 , LEFTPARENTHESIS = 40 , RIGHTPARENTHESIS = 41 , ASTERISK = 42 ,
  PLUS = 43 , COMMA = 44 , MINUS = 45 , PERIOD = 46 ,
  SLASH = 47 , _0 = 48 , _1 = 49 , _2 = 50 ,
  _3 = 51 , _4 = 52 , _5 = 53 , _6 = 54 ,
  _7 = 55 , _8 = 56 , _9 = 57 , COLON = 58 ,
  SEMICOLON = 59 , LESSTHAN = 60 , EQUAL = 61 , GREATERTHAN = 62 ,
  QUESTIONMARK = 63 , ATSIGN = 64 , A = 65 , B = 66 ,
  C = 67 , D = 68 , E = 69 , F = 70 ,
  G = 71 , H = 72 , I = 73 , J = 74 ,
  K = 75 , L = 76 , M = 77 , N = 78 ,
  O = 79 , P = 80 , Q = 81 , R = 82 ,
  S = 83 , T = 84 , U = 85 , V = 86 ,
  W = 87 , X = 88 , Y = 89 , Z = 90 ,
  LEFTBRACKET = 91 , BACKSLASH = 92 , RIGHTBRACKET = 93 , CARET = 94 ,
  UNDERSCORE = 95 , GRAVEACCENT = 96 , a = 97 , c = 99 ,
  b = 98 , d = 100 , e = 101 , f = 102 ,
  g = 103 , h = 104 , i = 105 , j = 106 ,
  k = 107 , l = 108 , m = 109 , n = 110 ,
  o = 111 , p = 112 , q = 113 , r = 114 ,
  s = 115 , t = 116 , u = 117 , v = 118 ,
  w = 119 , x = 120 , y = 121 , z = 122 ,
  LEFTBRACE = 123 , VERTICALBAR = 124 , RIGHTBRACE = 125 , TILDE = 126 ,
  Delete = 127
}
 Provides a mapping of ASCII keys. More...

Functions

DirectRegistry *& get_direct_registry ()
AssetPack * create_asset_pack (FileHandle &file_handle)
 Creates an AssetPack using the provided file handle.
void free_asset_pack (AssetPack *asset_pack)
 Frees memory associated with the provided AssetPack.
bool get_asset (AssetPack *asset_pack, const std::string &path, Asset &out)
 Retrieves an asset from the pack.
void add_asset (AssetPack *asset_pack, const std::string &path, const Asset &asset)
 Adds a new asset from a size_ptr buffer to the pack.
void add_asset (AssetPack *asset_pack, FileHandle &file_handle)
 Adds a new asset from a file to the pack.
BufferGroup * buffer_group_create (const std::string &group_name)
 Creates a new BufferGroup with the given name.
void buffer_group_restrict_to_keys (BufferGroup *buffer_group, const std::vector< std::string > &restruct_keys)
 Restricts the buffer group to a subset of keys.
void buffer_group_initialize (BufferGroup *buffer_group)
 Initializes GPU-side resources for the buffer group.
Image * buffer_group_define_image_2D (BufferGroup *buffer_group, const std::string &buffer_name, uint32_t image_width, uint32_t image_height, void *data_pointer=0)
 Defines a 2D image in the buffer group.
Image * buffer_group_define_image_3D (BufferGroup *buffer_group, const std::string &buffer_name, uint32_t image_width, uint32_t image_height, uint32_t image_depth, void *data_pointer=0)
 Defines a 3D image in the buffer group.
void buffer_group_set_buffer_element_count (BufferGroup *buffer_group, const std::string &buffer_name, uint32_t element_count)
 Sets the number of elements in a named buffer.
uint32_t buffer_group_get_buffer_element_count (BufferGroup *buffer_group, const std::string &buffer_name)
 Gets the number of elements in a named buffer.
uint32_t buffer_group_get_buffer_element_size (BufferGroup *buffer_group, const std::string &buffer_name)
 Gets the element size of a named buffer.
std::shared_ptr< uint8_t > buffer_group_get_buffer_data_ptr (BufferGroup *buffer_group, const std::string &buffer_name)
 Gets the raw buffer data pointer for a named buffer.
ReflectedStructView buffer_group_get_buffer_element_view (BufferGroup *buffer_group, const std::string &buffer_name, uint32_t index)
 Returns a view into a single struct element in the named buffer.
void CameraInit (Camera &camera, vec< float, 3 > position, vec< float, 3 > center, vec< float, 3 > up, float nearPlane, float farPlane, float width, float height, float fov, Camera::ProjectionType projectionType=Camera::Perspective)
void CameraInit (Camera &camera, vec< float, 3 > position, vec< float, 3 > center, vec< float, 3 > up, float nearPlane, float farPlane, vec< float, 4 > viewport, Camera::ProjectionType projectionType=Camera::Orthographic)
void CameraInit (Camera &camera)
constexpr D7Type operator| (D7Type lhs, D7Type rhs)
constexpr bool operator& (D7Type lhs, D7Type rhs)
constexpr std::size_t D7TypeToIndex (D7Type v)
template<D7Type Axis>
ExpectedType< Axis >::type const & GetStreamPointValue (const StreamPoint &tup)
template<D7Type Axis>
ExpectedType< Axis >::type & GetStreamPointValue (StreamPoint &tup)
template<D7Type type>
constexpr size_t D7TypeToIndex ()
template<>
constexpr size_t D7TypeToIndex< D7Type::X > ()
template<>
constexpr size_t D7TypeToIndex< D7Type::Y > ()
template<>
constexpr size_t D7TypeToIndex< D7Type::Z > ()
template<>
constexpr size_t D7TypeToIndex< D7Type::T > ()
template<>
constexpr size_t D7TypeToIndex< D7Type::U > ()
template<>
constexpr size_t D7TypeToIndex< D7Type::u > ()
template<>
constexpr size_t D7TypeToIndex< D7Type::a > ()
std::vector< WINDOW * >::iterator dr_get_windows_begin ()
 returns the beginning of DirectRegistry window_ptrs
std::vector< WINDOW * >::iterator dr_get_windows_end ()
 returns the end of DirectRegistry window_ptrs
std::vector< WindowReflectableGroup * >::iterator dr_get_window_reflectable_entries_begin ()
 returns the beginning of DirectRegistry window_reflectable_entries
std::vector< WindowReflectableGroup * >::iterator dr_get_window_reflectable_entries_end ()
 returns the end of DirectRegistry window_reflectable_entries
int displays_get_count ()
DisplayDescription displays_describe (int display_index)
Framebuffer * framebuffer_create (const FramebufferInfo &)
 Initializes a Framebuffer given the info provided.
void framebuffer_set_clear_color (Framebuffer *, float r=0.f, float g=0.f, float b=0.f, float a=0.f)
 Sets the clear color of a framebuffer.
void framebuffer_set_clear_depth_stencil (Framebuffer *, float depth=1.f, uint32_t stencil=0)
 Sets the clear depth of a framebuffer.
void framebuffer_bind (Framebuffer *)
 Binds a Framebuffer as the current render target.
void framebuffer_unbind (Framebuffer *)
 Unbinds a Framebuffer.
bool framebuffer_destroy (Framebuffer *&)
 Destroys a Framebuffer, note does not destroy the attached Images Sets framebuffer to nullptr once destroyed.
bool framebuffer_resize (Framebuffer *, uint32_t width, uint32_t height)
 Resizes a framebuffer and associated Image*.
bool framebuffer_changed (Framebuffer *)
Image * framebuffer_get_image (Framebuffer *, AttachmentType, bool new_image=false)
 attempts to return an underlying Image based on AttachmentType
Image * image_create (const ImageCreateInfo &)
 Creates a image given the passed info.
void image_resize_2D (Image *&image, uint32_t image_width, uint32_t image_height, void *data=nullptr, bool create_new=false)
 Resizes a 2D image to the specified dimensions.
void image_resize_3D (Image *&image, uint32_t image_width, uint32_t image_height, uint32_t image_depth, void *data=nullptr, bool create_new=false)
 Resizes a 3D image to the specified dimensions.
void image_free (Image *image)
 Frees an image, should only be called for self owned Images. Images created by BufferGroups should not be passed to this function.
std::pair< VkDescriptorSetLayout, VkDescriptorSet > image_create_descriptor_set (Image *image)
 Creates a single descriptor set for a given Image*.
template<typename T>
mat< T, 4, 4 > lookAt (const vec< T, 3 > &eye, const vec< T, 3 > &center, const vec< T, 3 > &up)
 Constructs a right-handed view matrix simulating a camera "look at" transform.
template<typename T>
mat< T, 4, 4 > perspectiveRH_ZO (T fovy, T aspect, T zNear, T zFar)
template<typename T>
mat< T, 4, 4 > perspectiveRH_NO (T fovy, T aspect, T zNear, T zFar)
template<typename T>
mat< T, 4, 4 > perspectiveLH_ZO (T fovy, T aspect, T zNear, T zFar)
template<typename T>
mat< T, 4, 4 > perspectiveLH_NO (T fovy, T aspect, T zNear, T zFar)
template<typename T>
mat< T, 4, 4 > perspective (T fovy, T aspect, T zNear, T zFar)
 Creates a perspective projection matrix suitable for rendering 3D scenes.
template<typename T>
mat< T, 4, 4 > infinitePerspectiveRH_NO (T fovy, T aspect, T zNear)
template<typename T>
mat< T, 4, 4 > infinitePerspectiveRH_ZO (T fovy, T aspect, T zNear)
template<typename T>
mat< T, 4, 4 > infinitePerspectiveLH_NO (T fovy, T aspect, T zNear)
template<typename T>
mat< T, 4, 4 > infinitePerspectiveLH_ZO (T fovy, T aspect, T zNear)
template<typename T>
mat< T, 4, 4 > infinitePerspective (T fovy, T aspect, T zNear)
 Creates an infinite perspective projection matrix.
template<typename T>
mat< T, 4, 4 > orthographic (T left, T right, T bottom, T top, T znear, T zfar)
 Creates an orthographic projection matrix.
template<typename T>
T radians (T degrees)
 Converts an angle from degrees to radians.
template<typename T>
T degrees (T radians)
 Converts an angle from radians to degrees.
template<typename T>
mat< T, 3, 3 > quat_to_mat3 (const quat< T > &q)
template<typename T>
quat< Tslerp (const quat< T > &a, const quat< T > &b, T t)
 Spherical linear interpolation between two quaternions.
template<typename T>
quat< Tquat_from_axis_angle (const vec< T, 3 > &axis, T angle)
 Constructs a quaternion from an axis-angle representation.
template<typename T>
mat< T, 4, 4 > quat_to_mat4 (const quat< T > &q)
 Converts a quaternion to a 4x4 rotation matrix.
Shader * shader_create (ShaderTopology topology=ShaderTopology::TriangleList)
 Creates a new Shader object.
void shader_set_render_pass (Shader *, Framebuffer *)
 Sets the shaders RenderPass to the passed Framebuffers RenderPass.
void shader_include_asset_pack (Shader *, AssetPack *asset_pack)
 Sets the include path to an asset_pack for include lookup.
void shader_add_module (Shader *, ShaderModuleType module_type, const std::string &glsl_source)
 Adds a GLSL source module to the shader.
void shader_add_module_from_file (Shader *, const std::filesystem::path &file_path)
 Adds a GLSL source module loaded from a file.
void shader_add_buffer_group (Shader *, BufferGroup *buffer_group)
 Binds a BufferGroup to the shader.
void shader_remove_buffer_group (Shader *, BufferGroup *buffer_group)
 Unbinds a BufferGroup from the shader.
void shader_dispatch (Shader *, vec< int32_t, 3 > dispatch_layout)
 Dispatches the compute shader with the given thread group layout.
void shader_compile (Shader *shader)
 Compiles the shader source code to SPIR-V.
void shader_create_resources (Shader *shader)
 Allocates GPU resources for the shader.
void shader_update_descriptor_sets (Shader *shader)
 Updates descriptor sets associated with the shader.
void shader_initialize (Shader *shader)
 Initializes the shader for usage after resource creation and compilation.
void shader_set_define (Shader *, const std::string &key, const std::string &value="")
 Sets a preprocessor definition for GLSL compilation.
void shader_bind (Shader *shader)
 Binds the shader to the current render pipeline.
void shader_use_image (Shader *, const std::string &sampler_key, Image *image_override)
 Emplaces an override when constructing images from reflection data based on key and provided image.
VkDescriptorSet shader_get_descriptor_set (Shader *, const std::string &)
 Returns a VkDescriptorSet given a key.
int32_t shader_get_push_constant_index (Shader *, const std::string &pc_member_name)
 gets a push constant index given the layout(push_constant) member name
void shader_update_push_constant (Shader *, uint32_t pc_index, void *data, uint32_t size)
 Updates a push_constant by index given data and size.
void track_static_state (int sid, const std::function< bool(Serial &)> &restore, const std::function< bool(Serial &)> &backup)
void set_state_file_path (const std::filesystem::path &path)
 Sets the State file path.
void set_state_istream (std::istream &istream)
 Overrides the States istream (Deserializing) (reading data)
void set_state_ostream (std::ostream &ostream)
 Overrides the States ostream (Serializing) (writing data)
void register_restorable_constructor (int c_id, const std::function< Restorable *(Serial &)> &constructor_fn)
 Registers a constructor function such that State can accurately restore.
bool has_state ()
 Returns a bool value indicating whether the state has date.
bool is_tracking_state ()
 Returns a bool value indicating tracking state.
bool is_state_loaded ()
 Returns a bool value indicating state loaded.
bool save_state ()
 Saves the state to file or ostream.
bool load_state ()
 Loads the State from file or istream.
bool free_state ()
 Frees any Restorables that are owned by the StateHolder.
void track_state (Restorable *restorable_ptr)
 Tracks the state of a restorable by pointer.
void track_window_state (WINDOW *window_ptr)
 Tracks a Windows state (size, xy, title)
Restorablestate_get_restorable_ptr (int cid, int index=0)
 returns a restorable at the index given with Constructor ID
template<typename T>
Tstate_get_ptr (int cid, int index=0)
 casts a restorable at the index given with Constructor ID
WINDOW * window_create (const WindowCreateInfo &info)
 Creates a Window given the specified information and sets up a render context.
bool window_poll_events (WINDOW *)
 Polls a window for events.
bool windows_poll_events ()
 Polls all open windows for events.
void window_render (WINDOW *, bool multi_window_render=false)
 Renders the specified window based on its context configuration.
void windows_render ()
 Renders all open windows.
ImGuiLayerget_ImGuiLayer ()
 Gets the global ImGuiLayer.
const std::string & window_get_title_ref (WINDOW *)
 Returns a reference to the title.
void window_set_title (WINDOW *, const std::string &)
 sets the title of a given WINDOW
size_t window_get_id_ref (WINDOW *)
 Returns a reference to the id.
float & window_get_float_frametime_ref (WINDOW *)
 Returns a reference to the frametime value as a float.
double & window_get_double_frametime_ref (WINDOW *)
 Returns a reference to the frametime value as a double.
void window_set_float_frametime_pointer (WINDOW *, float *pointer)
 Sets the underlying frametime float pointer, useful for binding to GPU memory.
void window_set_double_frametime_pointer (WINDOW *, double *pointer)
 Sets the underlying frametime double pointer, useful for binding to GPU memory.
void window_set_keys_pointer (WINDOW *, int32_t *pointer)
 Sets the underlying keys pointer, useful for binding to GPU memory.
void window_set_buttons_pointer (WINDOW *, int32_t *pointer)
 Sets the underlying buttons pointer, useful for binding to GPU memory.
void window_set_cursor_pointer (WINDOW *, float *pointer)
 Sets the underlying cursor pointer, useful for binding to GPU memory.
void window_set_mod_pointer (WINDOW *, int32_t *pointer)
 Sets the underlying mod pointer, useful for binding to GPU memory.
void window_set_focused_pointer (WINDOW *, int32_t *pointer)
 Sets the underlying focused pointer, useful for binding to GPU memory.
void window_set_width_pointer (WINDOW *, float *pointer)
 Sets the underlying width pointer, useful for binding to GPU memory.
void window_set_height_pointer (WINDOW *, float *pointer)
 Sets the underlying height pointer, useful for binding to GPU memory.
void window_set_float_frametime_pointer (WINDOW *, const std::shared_ptr< float > &pointer)
 Sets the underlying frametime float pointer, useful for binding to GPU memory.
void window_set_double_frametime_pointer (WINDOW *, const std::shared_ptr< double > &pointer)
 Sets the underlying frametime double pointer, useful for binding to GPU memory.
void window_set_keys_pointer (WINDOW *, const std::shared_ptr< int32_t > &pointer)
 Sets the underlying keys pointer, useful for binding to GPU memory.
void window_set_buttons_pointer (WINDOW *, const std::shared_ptr< int32_t > &pointer)
 Sets the underlying buttons pointer, useful for binding to GPU memory.
void window_set_cursor_pointer (WINDOW *, const std::shared_ptr< float > &pointer)
 Sets the underlying cursor pointer, useful for binding to GPU memory.
void window_set_mod_pointer (WINDOW *, const std::shared_ptr< int32_t > &pointer)
 Sets the underlying mod pointer, useful for binding to GPU memory.
void window_set_focused_pointer (WINDOW *, const std::shared_ptr< int32_t > &pointer)
 Sets the underlying focused pointer, useful for binding to GPU memory.
void window_set_width_pointer (WINDOW *, const std::shared_ptr< float > &pointer)
 Sets the underlying width pointer, useful for binding to GPU memory.
void window_set_height_pointer (WINDOW *, const std::shared_ptr< float > &pointer)
 Sets the underlying height pointer, useful for binding to GPU memory.
int32_t & window_get_keypress_ref (WINDOW *, uint8_t keycode)
 Gets a reference to the specified key in the underlying keys pointer.
int32_t & window_get_keypress_ref (WINDOW *, KEYCODES keycode)
 overload of window_get_keypress_ref with KEYCODES enum
int32_t & window_get_buttonpress_ref (WINDOW *, uint8_t button)
 Gets a reference to the specified button in the underlying buttons pointer.
std::shared_ptr< int32_t > & window_get_all_keypress_ref (WINDOW *, uint8_t keycode)
 Gets a shared pointer reference to all key values.
std::shared_ptr< int32_t > & window_get_all_buttonpress_ref (WINDOW *, uint8_t button)
 Gets a shared pointer reference to all button values.
std::shared_ptr< float > & window_get_width_ref (WINDOW *)
 Gets a shared pointer reference to window width.
std::shared_ptr< float > & window_get_height_ref (WINDOW *)
 Gets a shared pointer reference to window height.
void window_add_drawn_buffer_group (WINDOW *, IDrawListManager *mgr, BufferGroup *buffer_group)
 Adds a drawn buffer group.
void window_remove_drawn_buffer_group (WINDOW *, IDrawListManager *mgr, BufferGroup *buffer_group)
 Removes a drawn buffer group.
EventInterfacewindow_get_event_interface (WINDOW *)
 Returns the EventInterface for a given WINDOW.
void window_register_free_callback (WINDOW *, float priority, const std::function< void()> &)
 Adds a destroy event callback function.
void window_set_capture (WINDOW *window_ptr, bool should_capture)
 sets Window mouse capture (for mouse capture outside window)
void * window_get_native_handle (WINDOW *window_ptr)
 gets the native handle for a given WINDOW*
bool window_get_minimized (WINDOW *window_ptr)
void window_set_focused (WINDOW *window_ptr)
 Attemps to bring a window to the front.
void window_set_size (WINDOW *window_ptr, float width, float height)
 Attempts to set a windows size.
ImVec2 window_get_position (WINDOW *window_ptr)
 Returns a windows screen position.
void window_set_position (WINDOW *window_ptr, float x, float y)
 Attempts to set a windows position.
void window_set_focused (WINDOW *window_ptr, bool focused)
 Directly sets focused override and notifies ImGui.
void window_request_drag (WINDOW *)
 Requests a window to be dragged.
void window_cancel_drag (WINDOW *window_ptr)
 explicitly cancels a window drag
void window_request_close (WINDOW *window_ptr)
 explicitly closes a window
void window_register_compute_dispatch (WINDOW *window_ptr, float priority, Shader *shader, const std::function< int()> &dispatch_count_fn)
 Registers a Compute shader for dispatch.
void window_deregister_compute_dispatch (WINDOW *window_ptr, float priority, Shader *shader)
 Dergisters a Compute shader dispatch.
template<typename T>
Tzmalloc (size_t size, const T &value)
template<typename T>
void zfree (T *ptr, size_t size)

Typedef Documentation

◆ Asset

using dz::Asset = dz::size_ptr<char>

Asset alias representing a pointer to int8_t data.

◆ CameraTuple

using dz::CameraTuple = std::tuple<int, Framebuffer*, std::function<void()>>

A CameraTuple is the information required to draw from a cameras perspective.

◆ DrawList

using dz::DrawList = std::vector<DrawIndirectCommand>

A list of draw commands.

This represents a batch of DrawIndirectCommand structures, typically submitted to the GPU in one draw call.

◆ DrawTuples

using dz::DrawTuples = std::vector<std::tuple<Shader*, uint32_t>>

Maps each Framebuffer pointer to the ShaderDrawList.

A DrawTuples is the information required to produce a DrawList in a DrawListManager

◆ ShaderDrawList

using dz::ShaderDrawList = std::unordered_map<Shader*, DrawList>

Maps each Shader pointer to its corresponding list of draw commands.

This allows organizing draw commands by the shader used, enabling grouped rendering submissions.

◆ StreamIdentifier

using dz::StreamIdentifier = std::uint64_t

◆ StreamInteger

using dz::StreamInteger = std::int64_t

◆ StreamPoint

◆ StreamScalar

using dz::StreamScalar = float

◆ StreamString

using dz::StreamString = std::string

◆ StreamTimestamp

using dz::StreamTimestamp = std::chrono::time_point<std::chrono::steady_clock>

Enumeration Type Documentation

◆ AttachmentType

enum class dz::AttachmentType
strong
Enumerator
Color 
Depth 
DepthStencil 
Stencil 
ColorResolve 
DepthResolve 

◆ BlendFactor

enum class dz::BlendFactor
strong
Enumerator
Zero 
One 
SrcColor 
OneMinusSrcColor 
DstColor 
OneMinusDstColor 
SrcAlpha 
OneMinusSrcAlpha 
DstAlpha 
OneMinusDstAlpha 
ConstantColor 
OneMinusConstantColor 
ConstantAlpha 
OneMinusConstantAlpha 
SrcAlphaSaturate 
Src1Color 
OneMinusSrc1Color 
Src1Alpha 
OneMinusSrc1Alpha 

◆ BlendOp

enum class dz::BlendOp
strong
Enumerator
Add 
Subtract 
ReverseSubtract 
Min 
Max 

◆ D7Type

enum class dz::D7Type : std::uint8_t
strong
Enumerator
Unset 
Count 
All 

◆ KEYCODES

enum class dz::KEYCODES : uint8_t
strong

Provides a mapping of ASCII keys.

Note
Some non printable ASCII codes are used for keys such as RIGHT, HOME, PGUP, etc
Enumerator
NUL 
BACKSPACE 
TAB 
ENTER 
HOME 
END 
UP 
DOWN 
RIGHT 
LEFT 
PGUP 
PGDOWN 
INSERT 
NUMLOCK 
CAPSLOCK 
CTRL 
ESCAPE 
SHIFT 
ALT 
PAUSE 
SUPER 
SPACE 
EXCLAMATION 
DOUBLEQUOTE 
HASHTAG 
DOLLAR 
PERCENTSIGN 
AMPERSAND 
SINGLEQUOTE 
LEFTPARENTHESIS 
RIGHTPARENTHESIS 
ASTERISK 
PLUS 
COMMA 
MINUS 
PERIOD 
SLASH 
_0 
_1 
_2 
_3 
_4 
_5 
_6 
_7 
_8 
_9 
COLON 
SEMICOLON 
LESSTHAN 
EQUAL 
GREATERTHAN 
QUESTIONMARK 
ATSIGN 
LEFTBRACKET 
BACKSLASH 
RIGHTBRACKET 
CARET 
UNDERSCORE 
GRAVEACCENT 
LEFTBRACE 
VERTICALBAR 
RIGHTBRACE 
TILDE 
Delete 

◆ ShaderModuleType

enum class dz::ShaderModuleType
strong
Enumerator
Vertex 

Vertex shader module.

Fragment 

Fragment shader module.

Compute 

Compute shader module.

◆ ShaderTopology

enum class dz::ShaderTopology
strong
Enumerator
PointList 
LineList 
LineStrip 
TriangleList 
TriangleStrip 
TriangleFan 

Function Documentation

◆ add_asset() [1/2]

void dz::add_asset ( AssetPack * asset_pack,
const std::string & path,
const Asset & asset )

Adds a new asset from a size_ptr buffer to the pack.

Parameters
asset_packPointer to the AssetPack.
pathPath to identify the asset.
assetAsset buffer to be added.

◆ add_asset() [2/2]

void dz::add_asset ( AssetPack * asset_pack,
FileHandle & file_handle )

Adds a new asset from a file to the pack.

Parameters
asset_packPointer to the AssetPack.
file_handleFile handle to the asset source.

◆ buffer_group_create()

BufferGroup * dz::buffer_group_create ( const std::string & group_name)

Creates a new BufferGroup with the given name.

Parameters
group_nameLogical name of the buffer group.
Returns
Pointer to the created BufferGroup.

◆ buffer_group_define_image_2D()

Image * dz::buffer_group_define_image_2D ( BufferGroup * buffer_group,
const std::string & buffer_name,
uint32_t image_width,
uint32_t image_height,
void * data_pointer = 0 )

Defines a 2D image in the buffer group.

Parameters
buffer_groupPointer to the BufferGroup.
buffer_nameUnique identifier for the buffer.
image_widthWidth of the image.
image_heightHeight of the image.
data_pointerOptional pointer to image data.
Returns
Pointer to the created Image.

◆ buffer_group_define_image_3D()

Image * dz::buffer_group_define_image_3D ( BufferGroup * buffer_group,
const std::string & buffer_name,
uint32_t image_width,
uint32_t image_height,
uint32_t image_depth,
void * data_pointer = 0 )

Defines a 3D image in the buffer group.

Parameters
buffer_groupPointer to the BufferGroup.
buffer_nameUnique identifier for the buffer.
image_widthWidth of the image.
image_heightHeight of the image.
image_depthDepth of the image.
data_pointerOptional pointer to image data.
Returns
Pointer to the created Image.

◆ buffer_group_get_buffer_data_ptr()

std::shared_ptr< uint8_t > dz::buffer_group_get_buffer_data_ptr ( BufferGroup * buffer_group,
const std::string & buffer_name )

Gets the raw buffer data pointer for a named buffer.

Parameters
buffer_groupPointer to the BufferGroup.
buffer_nameName of the buffer.
Returns
Shared pointer to raw buffer data.

◆ buffer_group_get_buffer_element_count()

uint32_t dz::buffer_group_get_buffer_element_count ( BufferGroup * buffer_group,
const std::string & buffer_name )

Gets the number of elements in a named buffer.

Parameters
buffer_groupPointer to the BufferGroup.
buffer_nameName of the buffer.
Returns
Number of elements.

◆ buffer_group_get_buffer_element_size()

uint32_t dz::buffer_group_get_buffer_element_size ( BufferGroup * buffer_group,
const std::string & buffer_name )

Gets the element size of a named buffer.

◆ buffer_group_get_buffer_element_view()

ReflectedStructView dz::buffer_group_get_buffer_element_view ( BufferGroup * buffer_group,
const std::string & buffer_name,
uint32_t index )

Returns a view into a single struct element in the named buffer.

Parameters
buffer_groupPointer to the BufferGroup.
buffer_nameName of the buffer.
indexIndex of the element.
Returns
Struct view object allowing reflection.

◆ buffer_group_initialize()

void dz::buffer_group_initialize ( BufferGroup * buffer_group)

Initializes GPU-side resources for the buffer group.

Parameters
buffer_groupPointer to the BufferGroup.

◆ buffer_group_restrict_to_keys()

void dz::buffer_group_restrict_to_keys ( BufferGroup * buffer_group,
const std::vector< std::string > & restruct_keys )

Restricts the buffer group to a subset of keys.

Parameters
buffer_groupPointer to the BufferGroup.
restruct_keysList of keys to restrict to.

◆ buffer_group_set_buffer_element_count()

void dz::buffer_group_set_buffer_element_count ( BufferGroup * buffer_group,
const std::string & buffer_name,
uint32_t element_count )

Sets the number of elements in a named buffer.

Parameters
buffer_groupPointer to the BufferGroup.
buffer_nameName of the buffer.
element_countNumber of elements.

◆ CameraInit() [1/3]

void dz::CameraInit ( Camera & camera)

◆ CameraInit() [2/3]

void dz::CameraInit ( Camera & camera,
vec< float, 3 > position,
vec< float, 3 > center,
vec< float, 3 > up,
float nearPlane,
float farPlane,
float width,
float height,
float fov,
Camera::ProjectionType projectionType = Camera::Perspective )

◆ CameraInit() [3/3]

void dz::CameraInit ( Camera & camera,
vec< float, 3 > position,
vec< float, 3 > center,
vec< float, 3 > up,
float nearPlane,
float farPlane,
vec< float, 4 > viewport,
Camera::ProjectionType projectionType = Camera::Orthographic )

◆ create_asset_pack()

AssetPack * dz::create_asset_pack ( FileHandle & file_handle)

Creates an AssetPack using the provided file handle.

Parameters
file_handleReference to the file handle.
Returns
Pointer to the created AssetPack.

◆ D7TypeToIndex() [1/2]

template<D7Type type>
size_t dz::D7TypeToIndex ( )
constexpr

◆ D7TypeToIndex() [2/2]

std::size_t dz::D7TypeToIndex ( D7Type v)
inlineconstexpr

◆ D7TypeToIndex< D7Type::a >()

template<>
size_t dz::D7TypeToIndex< D7Type::a > ( )
constexpr

◆ D7TypeToIndex< D7Type::T >()

template<>
size_t dz::D7TypeToIndex< D7Type::T > ( )
constexpr

◆ D7TypeToIndex< D7Type::U >()

template<>
size_t dz::D7TypeToIndex< D7Type::U > ( )
constexpr

◆ D7TypeToIndex< D7Type::u >()

template<>
size_t dz::D7TypeToIndex< D7Type::u > ( )
constexpr

◆ D7TypeToIndex< D7Type::X >()

template<>
size_t dz::D7TypeToIndex< D7Type::X > ( )
constexpr

◆ D7TypeToIndex< D7Type::Y >()

template<>
size_t dz::D7TypeToIndex< D7Type::Y > ( )
constexpr

◆ D7TypeToIndex< D7Type::Z >()

template<>
size_t dz::D7TypeToIndex< D7Type::Z > ( )
constexpr

◆ degrees()

template<typename T>
T dz::degrees ( T radians)

Converts an angle from radians to degrees.

Performs the conversion using the exact constant 180 / π.

Template Parameters
TNumeric type (float, double, etc.).
Parameters
radiansAngle in radians.
Returns
Angle in degrees.

◆ displays_describe()

DisplayDescription dz::displays_describe ( int display_index)

◆ displays_get_count()

int dz::displays_get_count ( )

◆ dr_get_window_reflectable_entries_begin()

std::vector< WindowReflectableGroup * >::iterator dz::dr_get_window_reflectable_entries_begin ( )

returns the beginning of DirectRegistry window_reflectable_entries

◆ dr_get_window_reflectable_entries_end()

std::vector< WindowReflectableGroup * >::iterator dz::dr_get_window_reflectable_entries_end ( )

returns the end of DirectRegistry window_reflectable_entries

◆ dr_get_windows_begin()

std::vector< WINDOW * >::iterator dz::dr_get_windows_begin ( )

returns the beginning of DirectRegistry window_ptrs

◆ dr_get_windows_end()

std::vector< WINDOW * >::iterator dz::dr_get_windows_end ( )

returns the end of DirectRegistry window_ptrs

◆ framebuffer_bind()

void dz::framebuffer_bind ( Framebuffer * )

Binds a Framebuffer as the current render target.

◆ framebuffer_changed()

bool dz::framebuffer_changed ( Framebuffer * )
Returns
bool indicating whether the Framebuffer is about to change

◆ framebuffer_create()

Framebuffer * dz::framebuffer_create ( const FramebufferInfo & )

Initializes a Framebuffer given the info provided.

Returns
a Framebuffer pointer for use in framebuffer_X calls

◆ framebuffer_destroy()

bool dz::framebuffer_destroy ( Framebuffer *& )

Destroys a Framebuffer, note does not destroy the attached Images Sets framebuffer to nullptr once destroyed.

Returns
bool value indicating destroy success

◆ framebuffer_get_image()

Image * dz::framebuffer_get_image ( Framebuffer * ,
AttachmentType ,
bool new_image = false )

attempts to return an underlying Image based on AttachmentType

Returns
nullptr if not found

◆ framebuffer_resize()

bool dz::framebuffer_resize ( Framebuffer * ,
uint32_t width,
uint32_t height )

Resizes a framebuffer and associated Image*.

Returns
bool value indicating resize success

◆ framebuffer_set_clear_color()

void dz::framebuffer_set_clear_color ( Framebuffer * ,
float r = 0.f,
float g = 0.f,
float b = 0.f,
float a = 0.f )

Sets the clear color of a framebuffer.

◆ framebuffer_set_clear_depth_stencil()

void dz::framebuffer_set_clear_depth_stencil ( Framebuffer * ,
float depth = 1.f,
uint32_t stencil = 0 )

Sets the clear depth of a framebuffer.

◆ framebuffer_unbind()

void dz::framebuffer_unbind ( Framebuffer * )

Unbinds a Framebuffer.

◆ free_asset_pack()

void dz::free_asset_pack ( AssetPack * asset_pack)

Frees memory associated with the provided AssetPack.

Parameters
asset_packPointer to the AssetPack to free.

◆ free_state()

bool dz::free_state ( )

Frees any Restorables that are owned by the StateHolder.

◆ get_asset()

bool dz::get_asset ( AssetPack * asset_pack,
const std::string & path,
Asset & out )

Retrieves an asset from the pack.

Parameters
asset_packPointer to the AssetPack.
pathPath identifying the asset.
Returns
Asset data as size_ptr<int8_t>.

◆ get_direct_registry()

DirectRegistry *& dz::get_direct_registry ( )

◆ get_ImGuiLayer()

ImGuiLayer & dz::get_ImGuiLayer ( )

Gets the global ImGuiLayer.

◆ GetStreamPointValue() [1/2]

template<D7Type Axis>
ExpectedType< Axis >::type const & dz::GetStreamPointValue ( const StreamPoint & tup)
inline

◆ GetStreamPointValue() [2/2]

template<D7Type Axis>
ExpectedType< Axis >::type & dz::GetStreamPointValue ( StreamPoint & tup)
inline

◆ has_state()

bool dz::has_state ( )

Returns a bool value indicating whether the state has date.

Note
will return true only when a state has been saved and is available in path or istream

◆ image_create()

Image * dz::image_create ( const ImageCreateInfo & )

Creates a image given the passed info.

Returns
an Image pointer used in various image_X, framebuffer_Y functions

◆ image_create_descriptor_set()

std::pair< VkDescriptorSetLayout, VkDescriptorSet > dz::image_create_descriptor_set ( Image * image)

Creates a single descriptor set for a given Image*.

Note
no need to free the descriptor as this is done by the DirectRegistry
Returns
a pair containing the SetLayout and Set for usage

◆ image_free()

void dz::image_free ( Image * image)

Frees an image, should only be called for self owned Images. Images created by BufferGroups should not be passed to this function.

◆ image_resize_2D()

void dz::image_resize_2D ( Image *& image,
uint32_t image_width,
uint32_t image_height,
void * data = nullptr,
bool create_new = false )

Resizes a 2D image to the specified dimensions.

Parameters
imagePointer to the Image structure.
image_widthWidth of the image in pixels.
image_heightHeight of the image in pixels.

◆ image_resize_3D()

void dz::image_resize_3D ( Image *& image,
uint32_t image_width,
uint32_t image_height,
uint32_t image_depth,
void * data = nullptr,
bool create_new = false )

Resizes a 3D image to the specified dimensions.

Parameters
imagePointer to the Image structure.
image_widthWidth of the image in pixels.
image_heightHeight of the image in pixels.
image_depthDepth of the image in pixels.

◆ infinitePerspective()

template<typename T>
mat< T, 4, 4 > dz::infinitePerspective ( T fovy,
T aspect,
T zNear )

Creates an infinite perspective projection matrix.

Generates a projection matrix that has a far plane at infinity, which can be useful for scenes where the far plane should not clip distant objects.

The infinite far plane reduces depth buffer precision issues for very large view distances.

The choice of projection variant depends on renderer backend macros:

  • Vulkan uses right-handed coordinate system with zero to one depth range.
  • OpenGL uses right-handed coordinate system with negative one to one depth range.
Template Parameters
TNumeric type (e.g. float, double).
Parameters
fovyField of view angle in radians (vertical).
aspectAspect ratio (width / height).
zNearDistance to near clipping plane (must be > 0).
Returns
mat<T, 4, 4> The resulting infinite perspective projection matrix.
Note
Like perspective(), this function conditionally compiles for different rendering APIs.

◆ infinitePerspectiveLH_NO()

template<typename T>
mat< T, 4, 4 > dz::infinitePerspectiveLH_NO ( T fovy,
T aspect,
T zNear )

◆ infinitePerspectiveLH_ZO()

template<typename T>
mat< T, 4, 4 > dz::infinitePerspectiveLH_ZO ( T fovy,
T aspect,
T zNear )

◆ infinitePerspectiveRH_NO()

template<typename T>
mat< T, 4, 4 > dz::infinitePerspectiveRH_NO ( T fovy,
T aspect,
T zNear )

◆ infinitePerspectiveRH_ZO()

template<typename T>
mat< T, 4, 4 > dz::infinitePerspectiveRH_ZO ( T fovy,
T aspect,
T zNear )

◆ is_state_loaded()

bool dz::is_state_loaded ( )

Returns a bool value indicating state loaded.

Note
will return true only when load_state() has been called

◆ is_tracking_state()

bool dz::is_tracking_state ( )

Returns a bool value indicating tracking state.

Note
will return true only when either set_state_file_path or both (_state_istream & _state_ostream) have been called

◆ load_state()

bool dz::load_state ( )

Loads the State from file or istream.

Note
This should be called after checking has_state()
if (has_state()) { load_state(); } else { your_init(); }

◆ lookAt()

template<typename T>
mat< T, 4, 4 > dz::lookAt ( const vec< T, 3 > & eye,
const vec< T, 3 > & center,
const vec< T, 3 > & up )

Constructs a right-handed view matrix simulating a camera "look at" transform.

This function creates a 4x4 view matrix that positions and orients a virtual camera in 3D space. The camera is placed at the position eye, looking towards the point center, with the specified up vector defining the camera's vertical orientation.

The resulting matrix transforms world coordinates into view (camera) space.

The algorithm follows the standard "look at" computation:

  • f is the forward vector pointing from eye to center (normalized).
  • up_n is the normalized up vector.
  • s (side) is the normalized cross product of f and up_n, representing the camera's right direction.
  • u is the cross product of s and f, representing the true up vector perpendicular to both.

The matrix columns correspond to these orthonormal basis vectors, and the translation part moves the world such that the camera is effectively at the origin looking down the negative Z-axis.

Template Parameters
TNumeric type (float, double).
Parameters
eyePosition of the camera in world space.
centerTarget point the camera is looking at.
upUp direction vector used to orient the camera. Should not be parallel to the line from eye to center.
Returns
mat<T, 4, 4> View matrix that transforms world space to camera (view) space.
Note
It is important that up and the vector from eye to center are not collinear, otherwise the cross products will fail to produce valid orthonormal vectors.
This implementation assumes a right-handed coordinate system where the camera looks towards the negative Z-axis in view space.

◆ operator&()

bool dz::operator& ( D7Type lhs,
D7Type rhs )
inlineconstexpr

◆ operator|()

D7Type dz::operator| ( D7Type lhs,
D7Type rhs )
inlineconstexpr

◆ orthographic()

template<typename T>
mat< T, 4, 4 > dz::orthographic ( T left,
T right,
T bottom,
T top,
T znear,
T zfar )

Creates an orthographic projection matrix.

Generates a 4x4 orthographic projection matrix that maps a defined box volume to normalized device coordinates.

Orthographic projection preserves parallel lines and does not apply perspective distortion.

Template Parameters
TNumeric type (e.g. float, double).
Parameters
leftLeft boundary of the view volume.
rightRight boundary of the view volume.
bottomBottom boundary of the view volume.
topTop boundary of the view volume.
znearNear clipping plane distance.
zfarFar clipping plane distance.
Returns
mat<T, 4, 4> The resulting orthographic projection matrix.
Note
This matrix assumes a right-handed coordinate system with the negative z-axis pointing into the screen.

◆ perspective()

template<typename T>
mat< T, 4, 4 > dz::perspective ( T fovy,
T aspect,
T zNear,
T zFar )

Creates a perspective projection matrix suitable for rendering 3D scenes.

This function generates a 4x4 perspective projection matrix based on the given vertical field of view, aspect ratio, and near/far clipping planes.

The matrix maps 3D points to normalized device coordinates (NDC) for rendering.

The specific projection variant depends on the renderer target:

  • For Vulkan (RENDERER_VULKAN), a right-handed coordinate system with a zero to one (ZO) depth range is used.
  • For OpenGL (RENDERER_GL), a right-handed coordinate system with a negative one to one (NO) depth range is used.
Template Parameters
TNumeric type (e.g. float, double).
Parameters
fovyField of view angle in radians (vertical).
aspectAspect ratio (width / height).
zNearDistance to near clipping plane (must be > 0).
zFarDistance to far clipping plane (must be > zNear).
Returns
mat<T, 4, 4> The resulting perspective projection matrix.
Note
This function switches behavior depending on the rendering backend macros. The code assumes right-handed coordinate system for both Vulkan and OpenGL. The commented-out lines hint at alternative left-handed implementations.

◆ perspectiveLH_NO()

template<typename T>
mat< T, 4, 4 > dz::perspectiveLH_NO ( T fovy,
T aspect,
T zNear,
T zFar )

◆ perspectiveLH_ZO()

template<typename T>
mat< T, 4, 4 > dz::perspectiveLH_ZO ( T fovy,
T aspect,
T zNear,
T zFar )

◆ perspectiveRH_NO()

template<typename T>
mat< T, 4, 4 > dz::perspectiveRH_NO ( T fovy,
T aspect,
T zNear,
T zFar )

◆ perspectiveRH_ZO()

template<typename T>
mat< T, 4, 4 > dz::perspectiveRH_ZO ( T fovy,
T aspect,
T zNear,
T zFar )

◆ quat_from_axis_angle()

template<typename T>
quat< T > dz::quat_from_axis_angle ( const vec< T, 3 > & axis,
T angle )

Constructs a quaternion from an axis-angle representation.

Parameters
axisA normalized 3D axis.
angleAngle in radians.
Returns
Resulting quaternion.

◆ quat_to_mat3()

template<typename T>
mat< T, 3, 3 > dz::quat_to_mat3 ( const quat< T > & q)

◆ quat_to_mat4()

template<typename T>
mat< T, 4, 4 > dz::quat_to_mat4 ( const quat< T > & q)

Converts a quaternion to a 4x4 rotation matrix.

Parameters
qA normalized quaternion.
Returns
A 4x4 rotation matrix.

◆ radians()

template<typename T>
T dz::radians ( T degrees)

Converts an angle from degrees to radians.

Performs the conversion using the exact constant π / 180.

Template Parameters
TNumeric type (float, double, etc.).
Parameters
degreesAngle in degrees.
Returns
Angle in radians.

◆ register_restorable_constructor()

void dz::register_restorable_constructor ( int c_id,
const std::function< Restorable *(Serial &)> & constructor_fn )

Registers a constructor function such that State can accurately restore.

◆ save_state()

bool dz::save_state ( )

Saves the state to file or ostream.

Note
Typically you would call this inside a window_register_free_callback (root window)

◆ set_state_file_path()

void dz::set_state_file_path ( const std::filesystem::path & path)

Sets the State file path.

◆ set_state_istream()

void dz::set_state_istream ( std::istream & istream)

Overrides the States istream (Deserializing) (reading data)

◆ set_state_ostream()

void dz::set_state_ostream ( std::ostream & ostream)

Overrides the States ostream (Serializing) (writing data)

◆ shader_add_buffer_group()

void dz::shader_add_buffer_group ( Shader * ,
BufferGroup * buffer_group )

Binds a BufferGroup to the shader.

Parameters
shaderPointer to the Shader.
buffer_groupPointer to the BufferGroup.

◆ shader_add_module()

void dz::shader_add_module ( Shader * ,
ShaderModuleType module_type,
const std::string & glsl_source )

Adds a GLSL source module to the shader.

Parameters
shaderPointer to the Shader.
module_typeThe type of shader module.
glsl_sourceGLSL source code string.

◆ shader_add_module_from_file()

void dz::shader_add_module_from_file ( Shader * ,
const std::filesystem::path & file_path )

Adds a GLSL source module loaded from a file.

Parameters
shaderPointer to the Shader.
file_pathPath to the file containing GLSL source code.

◆ shader_bind()

void dz::shader_bind ( Shader * shader)

Binds the shader to the current render pipeline.

Parameters
shaderPointer to the Shader.

◆ shader_compile()

void dz::shader_compile ( Shader * shader)

Compiles the shader source code to SPIR-V.

Parameters
shaderPointer to the Shader.

◆ shader_create()

Shader * dz::shader_create ( ShaderTopology topology = ShaderTopology::TriangleList)

Creates a new Shader object.

Returns
A pointer to the newly created Shader.

◆ shader_create_resources()

void dz::shader_create_resources ( Shader * shader)

Allocates GPU resources for the shader.

Parameters
shaderPointer to the Shader.

◆ shader_dispatch()

void dz::shader_dispatch ( Shader * ,
vec< int32_t, 3 > dispatch_layout )

Dispatches the compute shader with the given thread group layout.

Parameters
shaderPointer to the Shader.
dispatch_layoutLayout dimensions as vec<int32_t, 3>.

◆ shader_get_descriptor_set()

VkDescriptorSet dz::shader_get_descriptor_set ( Shader * ,
const std::string &  )

Returns a VkDescriptorSet given a key.

◆ shader_get_push_constant_index()

int32_t dz::shader_get_push_constant_index ( Shader * ,
const std::string & pc_member_name )

gets a push constant index given the layout(push_constant) member name

◆ shader_include_asset_pack()

void dz::shader_include_asset_pack ( Shader * ,
AssetPack * asset_pack )

Sets the include path to an asset_pack for include lookup.

◆ shader_initialize()

void dz::shader_initialize ( Shader * shader)

Initializes the shader for usage after resource creation and compilation.

Parameters
shaderPointer to the Shader.

◆ shader_remove_buffer_group()

void dz::shader_remove_buffer_group ( Shader * ,
BufferGroup * buffer_group )

Unbinds a BufferGroup from the shader.

Parameters
shaderPointer to the Shader.
buffer_groupPointer to the BufferGroup.

◆ shader_set_define()

void dz::shader_set_define ( Shader * ,
const std::string & key,
const std::string & value = "" )

Sets a preprocessor definition for GLSL compilation.

Parameters
shaderPointer to the Shader.
keyDefine macro name.
valueOptional value for the macro.

◆ shader_set_render_pass()

void dz::shader_set_render_pass ( Shader * ,
Framebuffer *  )

Sets the shaders RenderPass to the passed Framebuffers RenderPass.

Note
must be called before shader is compiled (call this before adding modules)

◆ shader_update_descriptor_sets()

void dz::shader_update_descriptor_sets ( Shader * shader)

Updates descriptor sets associated with the shader.

Parameters
shaderPointer to the Shader.

◆ shader_update_push_constant()

void dz::shader_update_push_constant ( Shader * ,
uint32_t pc_index,
void * data,
uint32_t size )

Updates a push_constant by index given data and size.

◆ shader_use_image()

void dz::shader_use_image ( Shader * ,
const std::string & sampler_key,
Image * image_override )

Emplaces an override when constructing images from reflection data based on key and provided image.

Note
Should be called before adding any modules (directly after create)

◆ slerp()

template<typename T>
quat< T > dz::slerp ( const quat< T > & a,
const quat< T > & b,
T t )

Spherical linear interpolation between two quaternions.

Parameters
aStart quaternion.
bEnd quaternion.
tInterpolation factor between 0 and 1.
Returns
Interpolated quaternion.

◆ state_get_ptr()

template<typename T>
T * dz::state_get_ptr ( int cid,
int index = 0 )

casts a restorable at the index given with Constructor ID

◆ state_get_restorable_ptr()

Restorable * dz::state_get_restorable_ptr ( int cid,
int index = 0 )

returns a restorable at the index given with Constructor ID

◆ track_state()

void dz::track_state ( Restorable * restorable_ptr)

Tracks the state of a restorable by pointer.

Note
Only needs to be called the first run of a stateful program, future loads do not need to call

◆ track_static_state()

void dz::track_static_state ( int sid,
const std::function< bool(Serial &)> & restore,
const std::function< bool(Serial &)> & backup )

◆ track_window_state()

void dz::track_window_state ( WINDOW * window_ptr)

Tracks a Windows state (size, xy, title)

Note
windows created by ImGui will be automatically tracked

◆ window_add_drawn_buffer_group()

void dz::window_add_drawn_buffer_group ( WINDOW * ,
IDrawListManager * mgr,
BufferGroup * buffer_group )

Adds a drawn buffer group.

Registers a DrawListManager along with a compatible buffer group so draw commands can be computed dynamically based on buffer data.

◆ window_cancel_drag()

void dz::window_cancel_drag ( WINDOW * window_ptr)

explicitly cancels a window drag

Note
this is called internally on some platforms

◆ window_create()

WINDOW * dz::window_create ( const WindowCreateInfo & info)

Creates a Window given the specified information and sets up a render context.

This function must be called before creating any resources in your program.

◆ window_deregister_compute_dispatch()

void dz::window_deregister_compute_dispatch ( WINDOW * window_ptr,
float priority,
Shader * shader )

Dergisters a Compute shader dispatch.

◆ window_get_all_buttonpress_ref()

std::shared_ptr< int32_t > & dz::window_get_all_buttonpress_ref ( WINDOW * ,
uint8_t button )

Gets a shared pointer reference to all button values.

◆ window_get_all_keypress_ref()

std::shared_ptr< int32_t > & dz::window_get_all_keypress_ref ( WINDOW * ,
uint8_t keycode )

Gets a shared pointer reference to all key values.

◆ window_get_buttonpress_ref()

int32_t & dz::window_get_buttonpress_ref ( WINDOW * ,
uint8_t button )

Gets a reference to the specified button in the underlying buttons pointer.

Note
If the buttons pointer is updated (e.g., to GPU memory), a previously fetched reference becomes invalid.

◆ window_get_double_frametime_ref()

double & dz::window_get_double_frametime_ref ( WINDOW * )

Returns a reference to the frametime value as a double.

◆ window_get_event_interface()

EventInterface * dz::window_get_event_interface ( WINDOW * )

Returns the EventInterface for a given WINDOW.

◆ window_get_float_frametime_ref()

float & dz::window_get_float_frametime_ref ( WINDOW * )

Returns a reference to the frametime value as a float.

◆ window_get_height_ref()

std::shared_ptr< float > & dz::window_get_height_ref ( WINDOW * )

Gets a shared pointer reference to window height.

◆ window_get_id_ref()

size_t dz::window_get_id_ref ( WINDOW * )

Returns a reference to the id.

◆ window_get_keypress_ref() [1/2]

int32_t & dz::window_get_keypress_ref ( WINDOW * ,
KEYCODES keycode )

overload of window_get_keypress_ref with KEYCODES enum

◆ window_get_keypress_ref() [2/2]

int32_t & dz::window_get_keypress_ref ( WINDOW * ,
uint8_t keycode )

Gets a reference to the specified key in the underlying keys pointer.

Note
If the keys pointer is updated (e.g., to GPU memory), a previously fetched reference becomes invalid.

◆ window_get_minimized()

bool dz::window_get_minimized ( WINDOW * window_ptr)
Returns
bool value indicating WINDOW minimized

◆ window_get_native_handle()

void * dz::window_get_native_handle ( WINDOW * window_ptr)

gets the native handle for a given WINDOW*

Note
HWND (WIN32), xcb_window_t (Linux), NSWindow (Apple), ANativeWindow (Android)

◆ window_get_position()

ImVec2 dz::window_get_position ( WINDOW * window_ptr)

Returns a windows screen position.

◆ window_get_title_ref()

const std::string & dz::window_get_title_ref ( WINDOW * )

Returns a reference to the title.

◆ window_get_width_ref()

std::shared_ptr< float > & dz::window_get_width_ref ( WINDOW * )

Gets a shared pointer reference to window width.

◆ window_poll_events()

bool dz::window_poll_events ( WINDOW * )

Polls a window for events.

This should be called in a loop before any update and render code. Returns true if the window is still active, false if it has been closed.

◆ window_register_compute_dispatch()

void dz::window_register_compute_dispatch ( WINDOW * window_ptr,
float priority,
Shader * shader,
const std::function< int()> & dispatch_count_fn )

Registers a Compute shader for dispatch.

Note
shader dispatch will be called during window_render

◆ window_register_free_callback()

void dz::window_register_free_callback ( WINDOW * ,
float priority,
const std::function< void()> &  )

Adds a destroy event callback function.

◆ window_remove_drawn_buffer_group()

void dz::window_remove_drawn_buffer_group ( WINDOW * ,
IDrawListManager * mgr,
BufferGroup * buffer_group )

Removes a drawn buffer group.

◆ window_render()

void dz::window_render ( WINDOW * ,
bool multi_window_render = false )

Renders the specified window based on its context configuration.

◆ window_request_close()

void dz::window_request_close ( WINDOW * window_ptr)

explicitly closes a window

◆ window_request_drag()

void dz::window_request_drag ( WINDOW * )

Requests a window to be dragged.

Note
call this whenever you want to drag a window with the mouse (see ECS Test "Menu" example)

◆ window_set_buttons_pointer() [1/2]

void dz::window_set_buttons_pointer ( WINDOW * ,
const std::shared_ptr< int32_t > & pointer )

Sets the underlying buttons pointer, useful for binding to GPU memory.

Note
Buttons expects the pointer to have a size of 8 * sizeof(int32_t).

◆ window_set_buttons_pointer() [2/2]

void dz::window_set_buttons_pointer ( WINDOW * ,
int32_t * pointer )

Sets the underlying buttons pointer, useful for binding to GPU memory.

Note
Buttons expects the pointer to have a size of 8 * sizeof(int32_t).

◆ window_set_capture()

void dz::window_set_capture ( WINDOW * window_ptr,
bool should_capture )

sets Window mouse capture (for mouse capture outside window)

◆ window_set_cursor_pointer() [1/2]

void dz::window_set_cursor_pointer ( WINDOW * ,
const std::shared_ptr< float > & pointer )

Sets the underlying cursor pointer, useful for binding to GPU memory.

Note
Cursor expects the pointer to have a size of 2 * sizeof(float).

◆ window_set_cursor_pointer() [2/2]

void dz::window_set_cursor_pointer ( WINDOW * ,
float * pointer )

Sets the underlying cursor pointer, useful for binding to GPU memory.

Note
Cursor expects the pointer to have a size of 2 * sizeof(float).

◆ window_set_double_frametime_pointer() [1/2]

void dz::window_set_double_frametime_pointer ( WINDOW * ,
const std::shared_ptr< double > & pointer )

Sets the underlying frametime double pointer, useful for binding to GPU memory.

◆ window_set_double_frametime_pointer() [2/2]

void dz::window_set_double_frametime_pointer ( WINDOW * ,
double * pointer )

Sets the underlying frametime double pointer, useful for binding to GPU memory.

◆ window_set_float_frametime_pointer() [1/2]

void dz::window_set_float_frametime_pointer ( WINDOW * ,
const std::shared_ptr< float > & pointer )

Sets the underlying frametime float pointer, useful for binding to GPU memory.

◆ window_set_float_frametime_pointer() [2/2]

void dz::window_set_float_frametime_pointer ( WINDOW * ,
float * pointer )

Sets the underlying frametime float pointer, useful for binding to GPU memory.

◆ window_set_focused() [1/2]

void dz::window_set_focused ( WINDOW * window_ptr)

Attemps to bring a window to the front.

◆ window_set_focused() [2/2]

void dz::window_set_focused ( WINDOW * window_ptr,
bool focused )

Directly sets focused override and notifies ImGui.

Note
does not call any OS related calls

◆ window_set_focused_pointer() [1/2]

void dz::window_set_focused_pointer ( WINDOW * ,
const std::shared_ptr< int32_t > & pointer )

Sets the underlying focused pointer, useful for binding to GPU memory.

◆ window_set_focused_pointer() [2/2]

void dz::window_set_focused_pointer ( WINDOW * ,
int32_t * pointer )

Sets the underlying focused pointer, useful for binding to GPU memory.

◆ window_set_height_pointer() [1/2]

void dz::window_set_height_pointer ( WINDOW * ,
const std::shared_ptr< float > & pointer )

Sets the underlying height pointer, useful for binding to GPU memory.

◆ window_set_height_pointer() [2/2]

void dz::window_set_height_pointer ( WINDOW * ,
float * pointer )

Sets the underlying height pointer, useful for binding to GPU memory.

◆ window_set_keys_pointer() [1/2]

void dz::window_set_keys_pointer ( WINDOW * ,
const std::shared_ptr< int32_t > & pointer )

Sets the underlying keys pointer, useful for binding to GPU memory.

Note
Keys expects the pointer to have a size of 256 * sizeof(int32_t).

◆ window_set_keys_pointer() [2/2]

void dz::window_set_keys_pointer ( WINDOW * ,
int32_t * pointer )

Sets the underlying keys pointer, useful for binding to GPU memory.

Note
Keys expects the pointer to have a size of 256 * sizeof(int32_t).

◆ window_set_mod_pointer() [1/2]

void dz::window_set_mod_pointer ( WINDOW * ,
const std::shared_ptr< int32_t > & pointer )

Sets the underlying mod pointer, useful for binding to GPU memory.

◆ window_set_mod_pointer() [2/2]

void dz::window_set_mod_pointer ( WINDOW * ,
int32_t * pointer )

Sets the underlying mod pointer, useful for binding to GPU memory.

◆ window_set_position()

void dz::window_set_position ( WINDOW * window_ptr,
float x,
float y )

Attempts to set a windows position.

◆ window_set_size()

void dz::window_set_size ( WINDOW * window_ptr,
float width,
float height )

Attempts to set a windows size.

◆ window_set_title()

void dz::window_set_title ( WINDOW * ,
const std::string &  )

sets the title of a given WINDOW

◆ window_set_width_pointer() [1/2]

void dz::window_set_width_pointer ( WINDOW * ,
const std::shared_ptr< float > & pointer )

Sets the underlying width pointer, useful for binding to GPU memory.

◆ window_set_width_pointer() [2/2]

void dz::window_set_width_pointer ( WINDOW * ,
float * pointer )

Sets the underlying width pointer, useful for binding to GPU memory.

◆ windows_poll_events()

bool dz::windows_poll_events ( )

Polls all open windows for events.

Note
this should be used over the former due to compatibility with multi-viewports
Returns
bool value indicating whether to continue polling

◆ windows_render()

void dz::windows_render ( )

Renders all open windows.

◆ zfree()

template<typename T>
void dz::zfree ( T * ptr,
size_t size )

◆ zmalloc()

template<typename T>
T * dz::zmalloc ( size_t size,
const T & value )