Core

group core

Core components of the CoffeeEngine.

The SystemInfo class provides information about the Operating System.

Typedefs

using KeyCode = uint16_t

Functions

Application *CreateApplication()

Creates the application. To be defined in the client.

Returns:

A pointer to the created application.

class Application
#include <Application.h>

The Application class is responsible for managing the main application loop, handling events, and managing layers and overlays.

Public Types

using EventCallbackFn = std::function<void(Event&)>

Type definition for event callback function.

Public Functions

Application()

Constructs the Application object.

virtual ~Application()

Destroys the Application object.

void Run()

Starts the main application loop.

void OnEvent(Event &e)

Handles incoming events.

Parameters:

e – The event to handle.

void PushLayer(Layer *layer)

Pushes a layer onto the layer stack.

Parameters:

layer – The layer to push.

void PushOverlay(Layer *layer)

Pushes an overlay onto the layer stack.

Parameters:

layer – The overlay to push.

inline Window &GetWindow()

Gets the main application window.

Returns:

A reference to the main application window.

inline void SetEventCallback(const EventCallbackFn &callback)

Sets the event callback function.

Parameters:

callback – The event callback function.

void Close()

Closes the application.

inline ImGuiLayer *GetImGuiLayer()

Gets the ImGui layer.

Returns:

A pointer to the ImGui layer.

Public Static Functions

static inline Application &Get()

Gets the singleton instance of the Application.

Returns:

A reference to the singleton instance.

struct FileDialogArgs
#include <FileDialog.h>

Arguments for the file dialog.

Public Members

std::vector<Filter> Filters = {}

List of filters.

std::string DefaultPath = ""

Default path for the file dialog.

std::string DefaultName = ""

Default name for the file dialog.

struct Filter
#include <FileDialog.h>

Filter for file types.

Public Members

const char *Name

Name of the filter.

const char *Extension

Extension of the filter.

class FileDialog
#include <FileDialog.h>

Class for handling file dialogs.

Public Static Functions

static const std::filesystem::path OpenFile(const FileDialogArgs &args = {})

Opens a file dialog to select a file.

Parameters:

args – Arguments for the file dialog.

Returns:

The selected file path.

static const std::filesystem::path SaveFile(const FileDialogArgs &args = {})

Opens a file dialog to save a file.

Parameters:

args – Arguments for the file dialog.

Returns:

The selected file path.

class Input

Public Static Functions

static bool IsKeyPressed(const KeyCode key)

Checks if a specific key is currently being pressed.

Parameters:

key – The key code of the key to check.

Returns:

True if the key is currently being pressed, false otherwise.

static bool IsMouseButtonPressed(const MouseCode button)

Checks if a mouse button is currently pressed.

Parameters:

button – The mouse button to check.

Returns:

True if the mouse button is pressed, false otherwise.

static glm::vec2 GetMousePosition()

Retrieves the current position of the mouse.

Returns:

The current position of the mouse as a 2D vector.

static float GetMouseX()

Retrieves the current x-coordinate of the mouse cursor.

Returns:

The x-coordinate of the mouse cursor.

static float GetMouseY()

Retrieves the current y-coordinate of the mouse cursor.

Returns:

The y-coordinate of the mouse cursor.

class Layer

Subclassed by Coffee::ImGuiLayer

Public Functions

inline Layer(const std::string &name = "Layer")

Constructor for the Layer class.

Parameters:

name – The name of the layer, default is “Layer”.

virtual ~Layer() = default

Virtual destructor for the Layer class.

inline virtual void OnAttach()

Called when the layer is attached.

inline virtual void OnDetach()

Called when the layer is detached.

inline virtual void OnUpdate(float dt)

Called every frame to update the layer.

Parameters:

dt – Delta time since the last frame.

inline virtual void OnImGuiRender()

Called to render ImGui elements.

inline virtual void OnEvent(Event &event)

Called when an event occurs.

Parameters:

event – The event that occurred.

inline const std::string &GetName() const

Gets the name of the layer.

Returns:

The name of the layer.

class Log
#include <Log.h>

The Log class is responsible for initializing and providing access to the core and client loggers.

Public Static Functions

static void Init()

Initializes the logging system.

static inline std::shared_ptr<spdlog::logger> &GetCoreLogger()

Gets the core logger.

Returns:

A shared pointer to the core logger.

static inline std::shared_ptr<spdlog::logger> &GetClientLogger()

Gets the client logger.

Returns:

A shared pointer to the client logger.

class Stopwatch
#include <Stopwatch.h>

A class to measure elapsed time.

The Stopwatch class provides functionality to start, stop, reset, and retrieve the elapsed time. It supports both regular and high-precision timing.

Public Functions

Stopwatch()

Constructs a new Stopwatch object.

void Start()

Starts the stopwatch.

If the stopwatch is already running, this method has no effect.

void Stop()

Stops the stopwatch.

If the stopwatch is not running, this method has no effect.

void Reset()

Resets the stopwatch.

This method stops the stopwatch and resets the elapsed time to zero.

float GetElapsedTime() const

Gets the elapsed time in seconds.

Returns:

The elapsed time in seconds.

double GetPreciseElapsedTime() const

Gets the precise elapsed time in seconds.

This method uses SDL_GetPerformanceCounter for higher precision.

Returns:

The precise elapsed time in seconds.

class SystemInfo

Subclassed by Coffee::LinuxSystemInfo, Coffee::WindowsSystemInfo

Public Functions

virtual uint32_t GetPhysicalProcessorCountImpl() const = 0

Gets the number of physical processors.

Returns:

The number of physical processors.

virtual uint64_t GetAvailableMemoryImpl() const = 0

Gets the amount of available memory in the system.

Returns:

The amount of available memory in the system.

virtual uint64_t GetUsedMemoryImpl() const = 0

Gets the amount of memory used in the system.

Returns:

The amount of memory used in the system.

virtual uint64_t GetProcessMemoryUsageImpl() const = 0

Gets the amount of memory used by the process.

Returns:

The amount of memory used by the process.

Public Static Functions

static uint32_t GetLogicalProcessorCount()

Gets the number of logical processors.

static uint32_t GetPhysicalProcessorCount()

Gets the number of physical processors.

static uint64_t GetTotalMemory()

Gets the total memory in the system.

static uint64_t GetAvailableMemory()

Gets the available memory in the system.

static uint64_t GetUsedMemory()

Gets the used memory in the system.

static uint64_t GetProcessMemoryUsage()

Gets the memory used by the process.

class Timer
#include <Timer.h>

A class that represents a timer with various functionalities.

Public Functions

inline Timer()

Default constructor.

Timer(double waitTime, bool autoStart, bool oneShot, TimerCallback callback)

Parameterized constructor.

Parameters:
  • waitTime – The time to wait before the timer triggers.

  • autoStart – Whether the timer should start automatically.

  • oneShot – Whether the timer should trigger only once.

  • callback – The callback function to be called when the timer triggers.

void Start(double waitTime)

Starts the timer with a specified wait time.

Parameters:

waitTime – The time to wait before the timer triggers.

void Stop()

Stops the timer.

void setWaitTime(double waitTime)

Sets the wait time for the timer.

Parameters:

waitTime – The time to wait before the timer triggers.

inline double getWaitTime() const

Gets the wait time of the timer.

Returns:

The time to wait before the timer triggers.

inline void setOneShot(bool oneShot)

Sets whether the timer should trigger only once.

Parameters:

oneShot – Whether the timer should trigger only once.

inline bool isOneShot() const

Checks if the timer is set to trigger only once.

Returns:

True if the timer is set to trigger only once, false otherwise.

inline void setAutoStart(bool autoStart)

Sets whether the timer should start automatically.

Parameters:

autoStart – Whether the timer should start automatically.

inline bool isAutoStart() const

Checks if the timer is set to start automatically.

Returns:

True if the timer is set to start automatically, false otherwise.

void setPaused(bool paused)

Sets whether the timer is paused.

Parameters:

paused – Whether the timer is paused.

inline bool isPaused() const

Checks if the timer is paused.

Returns:

True if the timer is paused, false otherwise.

void isStopped()

Checks if the timer is stopped.

inline double GetTimeLeft() const

Gets the remaining time before the timer triggers.

Returns:

The remaining time before the timer triggers.

inline void SetCallback(TimerCallback callback)

Sets the callback function to be called when the timer triggers.

Parameters:

callback – The callback function.

inline TimerCallback GetCallback() const

Gets the callback function to be called when the timer triggers.

Returns:

The callback function.

struct WindowProps
#include <Window.h>

Structure to hold window properties such as title, width, and height.

Public Functions

inline WindowProps(const std::string &title = "Coffee Engine", uint32_t width = 1600, uint32_t height = 900)

Constructs WindowProps with default or specified values.

Parameters:
  • title – The title of the window.

  • width – The width of the window.

  • height – The height of the window.

Public Members

std::string Title

The title of the window.

uint32_t Width

The width of the window.

uint32_t Height

The height of the window.

class Window
#include <Window.h>

The Window class is responsible for managing the window and its properties.

Public Functions

Window(const WindowProps &props)

Constructs a Window object with the specified properties.

Parameters:

props – The properties of the window.

virtual ~Window()

Destroys the Window object.

void OnUpdate()

Updates the window.

inline unsigned int GetWidth() const

Gets the width of the window.

Returns:

The width of the window.

inline unsigned int GetHeight() const

Gets the height of the window.

Returns:

The height of the window.

void SetVSync(bool enabled)

Enables or disables VSync.

Parameters:

enabled – True to enable VSync, false to disable.

bool IsVSync() const

Checks if VSync is enabled.

Returns:

True if VSync is enabled, false otherwise.

void SetTitle(const std::string &title)

Sets the title of the window.

Parameters:

title – The new title of the window.

inline const std::string &GetTitle() const

Gets the title of the window.

Returns:

The title of the window.

void SetIcon(const std::string &path)

Sets the icon of the window.

Parameters:

path – The path to the icon file.

inline virtual void *GetNativeWindow() const

Gets the native window handle.

Returns:

A pointer to the native window.

Public Static Functions

static inline Scope<Window> Create(const WindowProps &props = WindowProps())

Creates a window with the specified properties.

Parameters:

props – The properties of the window.

Returns:

A scoped pointer to the created window.

namespace Coffee

Typedefs

template<typename T>
using Scope = std::unique_ptr<T>
template<typename T>
using Ref = std::shared_ptr<T>
using MouseCode = uint16_t

Enums

enum class ResourceType

Enumeration of different types of resources.

Values:

enumerator Unknown

Unknown resource type.

enumerator Texture

Texture resource type.

enumerator Texture2D

Texture2D resource type.

enumerator Cubemap

Cubemap resource type.

enumerator Model

Model resource type.

enumerator Mesh

Mesh resource type.

enumerator Shader

Shader resource type.

enumerator Material

Material resource type.

enum class ResourceFormat

Enumeration of resource formats.

Values:

enumerator Binary

Binary format.

enumerator JSON

JSON format.

enum class IntersectionType

Values:

enumerator Outside
enumerator Inside
enumerator Intersect
enum class ImageFormat

Values:

enumerator R8
enumerator RG8
enumerator RGB8
enumerator SRGB8
enumerator RGBA8
enumerator SRGBA8
enumerator R32F
enumerator RGB32F
enumerator RGBA32F
enumerator DEPTH24STENCIL8
enum class PrimitiveType

Enum class representing different types of primitive meshes.

Values:

enumerator Quad

A quad mesh.

enumerator Cube

A cube mesh.

enumerator Sphere

A sphere mesh.

enumerator Plane

A plane mesh.

enumerator Cylinder

A cylinder mesh.

enumerator Cone

A cone mesh.

enumerator Torus

A torus mesh.

enumerator Capsule

A capsule mesh.

enumerator None

No mesh.

enum class ScriptingLanguage

Values:

enumerator Lua
enumerator cSharp

Functions

template<typename T, typename ...Args>
Scope<T> CreateScope(Args&&... args)
template<typename T, typename ...Args>
Ref<T> CreateRef(Args&&... args)
static std::mt19937_64 s_Engine(s_RandomDevice())
ResourceFormat GetResourceSaveFormatFromType(ResourceType type)
inline ResourceType GetResourceTypeFromExtension(const std::filesystem::path &path)
inline std::string ResourceTypeToString(ResourceType type)
glm::mat4 aiMatrix4x4ToGLMMat4(const aiMatrix4x4 &aiMat)
void OpenGLMessageCallback(unsigned source, unsigned type, unsigned id, unsigned severity, int length, const char *message, const void *userParam)
GLenum ImageFormatToOpenGLInternalFormat(ImageFormat format)
GLenum ImageFormatToOpenGLFormat(ImageFormat format)
int ImageFormatToChannelCount(ImageFormat format)
static GLenum ShaderDataTypeToOpenGLBaseType(ShaderDataType type)
void BindKeyCodesToLua(sol::state &lua, sol::table &inputTable)
void BindMouseCodesToLua(sol::state &lua, sol::table &inputTable)

Variables

SDL_TimerCallback timerCallback = [](void* param, uint32_t interval, uint32_t elapsed) -> uint32_t{Timer* timer = static_cast<Timer*>(param);if(timer->GetCallback()){timer->GetCallback()();}if(timer->isOneShot()){timer->Stop();return 0;}if(timer->isAutoStart()){timer->Start(timer->getWaitTime());}return 0;}
static std::random_device s_RandomDevice
static std::uniform_int_distribution<uint64_t> s_UniformDistribution
static uint8_t s_SDLWindowCount = 0
static Ref<Project> s_ActiveProject
size_t MaxVertices = 100000
static const uint32_t s_MaxFramebufferSize = 8192
static bool s_viewportResized = false
static uint32_t s_viewportWidth = 0
static uint32_t s_viewportHeight = 0
static Ref<Cubemap> s_EnvironmentMap
static Ref<Mesh> s_SkyboxMesh
static Ref<Shader> s_SkyboxShader
struct AABB
#include <BoundingBox.h>

Structure representing an axis-aligned bounding box (AABB).

Public Functions

inline AABB(const glm::vec3 &min, const glm::vec3 &max)

Constructs an AABB with specified minimum and maximum points.

Parameters:
  • min – The minimum point of the AABB.

  • max – The maximum point of the AABB.

Public Members

glm::vec3 min = glm::vec3(0.0f)

The minimum point of the AABB.

glm::vec3 max = glm::vec3(0.0f)

The maximum point of the AABB.

class Application
#include <Application.h>

The Application class is responsible for managing the main application loop, handling events, and managing layers and overlays.

Public Types

using EventCallbackFn = std::function<void(Event&)>

Type definition for event callback function.

Public Functions

Application()

Constructs the Application object.

virtual ~Application()

Destroys the Application object.

void Run()

Starts the main application loop.

void OnEvent(Event &e)

Handles incoming events.

Parameters:

e – The event to handle.

void PushLayer(Layer *layer)

Pushes a layer onto the layer stack.

Parameters:

layer – The layer to push.

void PushOverlay(Layer *layer)

Pushes an overlay onto the layer stack.

Parameters:

layer – The overlay to push.

inline Window &GetWindow()

Gets the main application window.

Returns:

A reference to the main application window.

inline void SetEventCallback(const EventCallbackFn &callback)

Sets the event callback function.

Parameters:

callback – The event callback function.

void Close()

Closes the application.

inline ImGuiLayer *GetImGuiLayer()

Gets the ImGui layer.

Returns:

A pointer to the ImGui layer.

Public Static Functions

static inline Application &Get()

Gets the singleton instance of the Application.

Returns:

A reference to the singleton instance.

class AppRenderEvent : public Coffee::Event
#include <ApplicationEvent.h>

Event for application render.

class AppTickEvent : public Coffee::Event
#include <ApplicationEvent.h>

Event for application tick.

class AppUpdateEvent : public Coffee::Event
#include <ApplicationEvent.h>

Event for application update.

struct BufferAttribute
#include <Buffer.h>

Structure representing a buffer attribute.

Public Functions

BufferAttribute() = default

Default constructor for BufferAttribute.

inline BufferAttribute(ShaderDataType type, const std::string &name, bool normalized = false)

Constructs a BufferAttribute with the specified parameters.

Parameters:
  • type – The type of the attribute.

  • name – The name of the attribute.

  • normalized – Whether the attribute is normalized.

inline uint32_t GetComponentCount() const

Returns the number of components in the attribute.

Returns:

The number of components.

Public Members

std::string Name

The name of the attribute.

ShaderDataType Type

The type of the attribute.

uint32_t Size

The size of the attribute.

size_t Offset

The offset of the attribute.

bool Normalized

Whether the attribute is normalized.

class BufferLayout
#include <Buffer.h>

Class representing a buffer layout.

Public Functions

inline BufferLayout()

Default constructor for BufferLayout.

inline BufferLayout(std::initializer_list<BufferAttribute> elements)

Constructs a BufferLayout with the specified attributes.

Parameters:

elements – The list of buffer attributes.

inline uint32_t GetStride() const

Returns the stride of the buffer layout.

Returns:

The stride in bytes.

inline const std::vector<BufferAttribute> &GetElements() const

Returns the list of buffer attributes.

Returns:

The list of buffer attributes.

inline std::vector<BufferAttribute>::iterator begin()

Returns an iterator to the beginning of the buffer attributes.

Returns:

An iterator to the beginning.

inline std::vector<BufferAttribute>::iterator end()

Returns an iterator to the end of the buffer attributes.

Returns:

An iterator to the end.

inline std::vector<BufferAttribute>::const_iterator begin() const

Returns a constant iterator to the beginning of the buffer attributes.

Returns:

A constant iterator to the beginning.

inline std::vector<BufferAttribute>::const_iterator end() const

Returns a constant iterator to the end of the buffer attributes.

Returns:

A constant iterator to the end.

class CacheManager
#include <CacheManager.h>

Manages cache-related operations for the CoffeeEngine.

Public Static Functions

static inline void SetCachePath(const std::filesystem::path &path)

Sets the cache path.

Parameters:

path – The path to set as the cache directory.

static inline const std::filesystem::path &GetCachePath()

Gets the current cache path.

Returns:

The current cache path.

static inline void CreateCacheDirectory()

Creates the cache directory.

static inline void ClearCache()

Clears the cache by removing all files in the cache directory.

static inline std::filesystem::path GetCachedFilePath(const std::string &filename)

Gets the file path for a cached file.

Parameters:

filename – The name of the file to be cached.

Returns:

The full path to the cached file.

class Camera
#include <Camera.h>

The Camera class is responsible for managing the camera’s projection matrix.

Subclassed by Coffee::EditorCamera, Coffee::SceneCamera

Public Types

enum class ProjectionType

Enum class representing the type of projection.

Values:

enumerator PERSPECTIVE

Perspective projection.

enumerator ORTHOGRAPHIC

Orthographic projection.

Public Functions

Camera() = default

Default constructor for the Camera class.

inline Camera(const glm::mat4 &projection)

Constructs a Camera object with the specified projection matrix.

Parameters:

projection – The projection matrix.

virtual ~Camera() = default

Virtual destructor for the Camera class.

inline float GetFOV() const

Gets the field of view of the camera.

Returns:

The field of view.

inline void SetFOV(float fov)

Sets the field of view of the camera.

Parameters:

fov – The field of view.

inline float GetAspectRatio() const

Gets the aspect ratio of the camera.

Returns:

The aspect ratio.

inline void SetAspectRatio(float aspectRatio)

Sets the aspect ratio of the camera.

Parameters:

aspectRatio – The aspect ratio.

inline float GetNearClip() const

Gets the near clipping plane distance of the camera.

Returns:

The near clipping plane distance.

inline void SetNearClip(float nearClip)

Sets the near clipping plane distance of the camera.

Parameters:

nearClip – The near clipping plane distance.

inline float GetFarClip() const

Gets the far clipping plane distance of the camera.

Returns:

The far clipping plane distance.

inline void SetFarClip(float farClip)

Sets the far clipping plane distance of the camera.

Parameters:

farClip – The far clipping plane distance.

inline const glm::mat4 &GetProjection() const

Gets the projection matrix of the camera.

Returns:

The projection matrix.

inline ProjectionType GetProjectionType() const

Gets the projection type of the camera.

Returns:

The projection type.

inline void SetProjectionType(ProjectionType projectionType)

Sets the projection type of the camera.

Parameters:

projectionType – The projection type.

inline void SetViewportSize(float width, float height)

Sets the size of the viewport and updates the projection matrix.

Parameters:
  • width – The width of the viewport.

  • height – The height of the viewport.

inline glm::mat4 ProjectionTypeToMat4(ProjectionType projection)

Converts the projection type to a projection matrix.

Parameters:

projection – The type of projection.

Returns:

The projection matrix.

inline void UpdateProjection()

Updates the projection matrix based on the current viewport dimensions and projection type.

struct CameraComponent
#include <Components.h>

Component representing a camera.

Public Functions

template<class Archive>
inline void serialize(Archive &archive)

Serializes the CameraComponent.

Template Parameters:

Archive – The type of the archive.

Parameters:

archive – The archive to serialize to.

Public Members

SceneCamera Camera

The scene camera.

class CSharpBackend
class Cubemap : public Coffee::Texture
class DebugRenderer
#include <DebugRenderer.h>

Class responsible for rendering debug lines.

Public Static Functions

static void Init()

Initializes the DebugRenderer.

static void Shutdown()

Shuts down the DebugRenderer.

static void Flush()

Flushes the batched vertices to the GPU and renders them.

static void DrawLine(const glm::vec3 &start, const glm::vec3 &end, glm::vec4 color = glm::vec4(1.0f), float lineWidth = 1.0f)

Draws a line between two points.

Parameters:
  • start – The starting point of the line.

  • end – The ending point of the line.

  • color – The color of the line. Default is white.

  • lineWidth – The width of the line. Default is 1.0f.

static void DrawCircle(const glm::vec3 &position, float radius, const glm::quat &rotation, glm::vec4 color = glm::vec4(1.0f), float lineWidth = 1.0f)

Draws a circle.

Parameters:
  • position – The center position of the circle.

  • radius – The radius of the circle.

  • rotation – The rotation of the circle.

  • color – The color of the circle. Default is white.

  • lineWidth – The width of the circle line. Default is 1.0f.

static void DrawSphere(const glm::vec3 &position, float radius, const glm::vec4 &color = glm::vec4(1.0f), float lineWidth = 1.0f)

Draws a sphere.

Parameters:
  • position – The center position of the sphere.

  • radius – The radius of the sphere.

  • color – The color of the sphere. Default is white.

  • lineWidth – The width of the sphere line. Default is 1.0f.

static void DrawBox(const glm::vec3 &position, const glm::quat &rotation, const glm::vec3 &size, const glm::vec4 &color = glm::vec4(1.0f), const bool &isCentered = true, float lineWidth = 1.0f)

Draws a box.

Parameters:
  • position – The center position of the box.

  • rotation – The rotation of the box.

  • size – The size of the box.

  • color – The color of the box. Default is white.

  • isCentered – Whether the box is centered at the position.

  • lineWidth – The width of the box line. Default is 1.0f.

static void DrawBox(const glm::vec3 &min, const glm::vec3 &max, const glm::vec4 &color = glm::vec4(1.0f), float lineWidth = 1.0f)

Draws a box.

Parameters:
  • min – The minimum corner of the box.

  • max – The maximum corner of the box.

  • color – The color of the box. Default is white.

  • lineWidth – The width of the box line. Default is 1.0f.

static void DrawBox(const AABB &aabb, const glm::vec4 &color = glm::vec4(1.0f), float lineWidth = 1.0f)

Draws a box.

Parameters:
  • aabb – The axis-aligned bounding box.

  • color – The color of the box. Default is white.

  • lineWidth – The width of the box line. Default is 1.0f.

static void DrawBox(const OBB &obb, const glm::vec4 &color = glm::vec4(1.0f), float lineWidth = 1.0f)

Draws a box.

Parameters:
  • obb – The oriented bounding box.

  • color – The color of the box. Default is white.

  • lineWidth – The width of the box line. Default is 1.0f.

static void DrawArrow(const glm::vec3 &start, const glm::vec3 &end, bool fixedLength, glm::vec4 color = glm::vec4(1.0f), float lineWidth = 1.0f)

Draws an arrow.

Parameters:
  • start – The starting point of the arrow.

  • end – The ending point of the arrow.

  • fixedLength – Whether the arrow has a fixed length.

  • color – The color of the arrow. Default is white.

  • lineWidth – The width of the arrow line. Default is 1.0f.

static void DrawArrow(const glm::vec3 &origin, const glm::vec3 &direction, float length, glm::vec4 color = glm::vec4(1.0f), float lineWidth = 1.0f)

Draws an arrow.

Parameters:
  • origin – The origin point of the arrow.

  • direction – The direction of the arrow.

  • length – The length of the arrow.

  • color – The color of the arrow. Default is white.

  • lineWidth – The width of the arrow line. Default is 1.0f.

struct DebugVertex
#include <DebugRenderer.h>

Structure representing a vertex in a line.

Public Members

glm::vec3 Position

The position of the vertex.

glm::vec4 Color

The color of the vertex.

class EditorCamera : public Coffee::Camera
#include <EditorCamera.h>

The EditorCamera class is responsible for managing the editor camera’s view and projection matrices.

Public Types

enum class CameraState

Enum class representing the state of the camera.

Values:

enumerator NONE

No camera state.

enumerator ORBIT

Camera is in orbit mode.

enumerator FLY

Camera is in fly mode.

Public Functions

EditorCamera() = default

Default constructor for the EditorCamera class.

EditorCamera(float fov, ProjectionType projection = ProjectionType::PERSPECTIVE, float aspectRatio = 1.778, float nearClip = 0.1f, float farClip = 1000.0f)

Constructs an EditorCamera object with the specified parameters.

Parameters:
  • fov – The field of view for the perspective projection.

  • projection – The type of projection (perspective or orthographic).

  • aspectRatio – The aspect ratio of the viewport.

  • nearClip – The near clipping plane distance.

  • farClip – The far clipping plane distance.

void OnUpdate(float dt)

Updates the camera’s view matrix.

void OnEvent(Event &event)

Handles events for the camera.

Parameters:

event – The event to handle.

inline void SetFocusPoint(glm::vec3 focusPoint)

Sets the focal point of the camera.

Parameters:

focusPoint – The focal point.

inline const glm::mat4 GetViewMatrix() const

Gets the view matrix of the camera.

Returns:

The view matrix.

glm::vec3 GetUpDirection() const

Gets the up direction of the camera.

Returns:

The up direction.

glm::vec3 GetRightDirection() const

Gets the right direction of the camera.

Returns:

The right direction.

glm::vec3 GetForwardDirection() const

Gets the forward direction of the camera.

Returns:

The forward direction.

inline const glm::vec3 &GetPosition() const

Gets the position of the camera.

Returns:

The position.

glm::quat GetOrientation() const

Gets the orientation of the camera.

Returns:

The orientation.

inline const CameraState &GetState() const

Gets the current state of the camera.

Returns:

The current state of the camera.

class Entity
#include <Entity.h>

Class representing an entity in the scene.

Public Functions

Entity() = default

Default constructor for Entity.

Entity(entt::entity handle, Scene *scene)

Constructor for Entity with handle and scene.

Parameters:
  • handle – The entity handle.

  • scene – The scene the entity belongs to.

Entity(const Entity &other) = default

Copy constructor for Entity.

Parameters:

other – The other entity to copy from.

template<typename T, typename ...Args>
inline T &AddComponent(Args&&... args)

Add a component to the entity.

Template Parameters:
  • T – The component type.

  • Args – The component constructor arguments.

Parameters:

args – The component constructor arguments.

Returns:

Reference to the added component.

template<typename T>
inline T &GetComponent()

Get a component from the entity.

Template Parameters:

T – The component type.

Returns:

Reference to the component.

template<typename T>
inline bool HasComponent()

Check if the entity has a component.

Template Parameters:

T – The component type.

Returns:

True if the entity has the component, false otherwise.

template<typename T>
inline void RemoveComponent()

Remove a component from the entity.

Template Parameters:

T – The component type.

inline operator bool() const

Check if the entity is valid.

Returns:

True if the entity is valid, false otherwise.

inline operator entt::entity() const

Convert the entity to its handle.

Returns:

The entity handle.

inline operator uint32_t() const

Convert the entity to its handle as a uint32_t.

Returns:

The entity handle as a uint32_t.

inline bool operator==(const Entity &other) const

Equality operator.

Parameters:

other – The other entity to compare with.

Returns:

True if the entities are equal, false otherwise.

inline bool operator!=(const Entity &other) const

Inequality operator.

Parameters:

other – The other entity to compare with.

Returns:

True if the entities are not equal, false otherwise.

inline void SetParent(Entity entity)

Set the parent of the entity.

Parameters:

entity – The parent entity.

class Event
#include <Event.h>

Base class for all events.

Subclassed by Coffee::AppRenderEvent, Coffee::AppTickEvent, Coffee::AppUpdateEvent, Coffee::FileDropEvent, Coffee::KeyEvent, Coffee::MouseButtonEvent, Coffee::MouseMovedEvent, Coffee::MouseScrolledEvent, Coffee::WindowCloseEvent, Coffee::WindowResizeEvent

Public Functions

virtual EventType GetEventType() const = 0

Get the type of the event.

Returns:

The event type.

virtual const char *GetName() const = 0

Get the name of the event.

Returns:

The event name.

virtual int GetCategoryFlags() const = 0

Get the category flags of the event.

Returns:

The category flags.

inline virtual std::string ToString() const

Convert the event to a string representation.

Returns:

A string representation of the event.

inline bool IsInCategory(EventCategory category)

Check if the event is in a specific category.

Parameters:

category – The category to check.

Returns:

True if the event is in the category, false otherwise.

class EventDispatcher
#include <Event.h>

Event dispatcher to handle events.

Public Functions

template<typename T, typename F>
inline bool Dispatch(const F &func)

Dispatches the event if it matches the type.

Template Parameters:
  • T – The event type.

  • F – The function type.

Parameters:

func – The function to call if the event matches the type.

Returns:

True if the event was dispatched, false otherwise.

class FileDialog
#include <FileDialog.h>

Class for handling file dialogs.

Public Static Functions

static const std::filesystem::path OpenFile(const FileDialogArgs &args = {})

Opens a file dialog to select a file.

Parameters:

args – Arguments for the file dialog.

Returns:

The selected file path.

static const std::filesystem::path SaveFile(const FileDialogArgs &args = {})

Opens a file dialog to save a file.

Parameters:

args – Arguments for the file dialog.

Returns:

The selected file path.

struct FileDialogArgs
#include <FileDialog.h>

Arguments for the file dialog.

Public Members

std::vector<Filter> Filters = {}

List of filters.

std::string DefaultPath = ""

Default path for the file dialog.

std::string DefaultName = ""

Default name for the file dialog.

struct Filter
#include <FileDialog.h>

Filter for file types.

Public Members

const char *Name

Name of the filter.

const char *Extension

Extension of the filter.

class FileDropEvent : public Coffee::Event
#include <ApplicationEvent.h>

Event for Dropping a file.

Public Functions

inline uint64_t GetTimestamp() const

Get the timestamp of the event.

Returns:

The timestamp of the event.

inline uint32_t GetWindowID() const

Get the window ID of the event.

Returns:

The window ID of the event.

inline float GetX() const

Get the x position of the event.

Returns:

The x position of the event.

inline float GetY() const

Get the y position of the event.

Returns:

The y position of the event.

inline const std::string &GetSource() const

Get the source of the event.

Returns:

The source of the event.

inline const std::string &GetFile() const

Get the file of the event.

Returns:

The file of the event.

inline virtual std::string ToString() const override

Convert the event to a string representation.

Returns:

A string representation of the event.

class Framebuffer
#include <Framebuffer.h>

Class representing a framebuffer.

Public Functions

Framebuffer(uint32_t width, uint32_t height, std::initializer_list<ImageFormat> attachments)

Constructs a Framebuffer with the specified width, height, and attachments.

Parameters:
  • width – The width of the framebuffer.

  • height – The height of the framebuffer.

  • attachments – The list of image formats for the attachments.

~Framebuffer()

Destroys the Framebuffer.

void Invalidate()

Invalidates the framebuffer, forcing it to be recreated.

void Bind()

Binds the framebuffer.

void UnBind()

Unbinds the framebuffer.

void SetDrawBuffers(std::initializer_list<Ref<Texture2D>> colorAttachments)

Sets the draw buffers for the framebuffer.

Warning

This function is not finished, does not work, and is slow. Do not use it 🫡.

Parameters:

colorAttachments – The list of color attachments.

void SetDrawBuffers(std::initializer_list<uint32_t> colorAttachments)

Sets the draw buffers for the framebuffer.

Parameters:

colorAttachments – The list of color attachment indices.

void Resize(uint32_t width, uint32_t height)

Resizes the framebuffer.

Parameters:
  • width – The new width of the framebuffer.

  • height – The new height of the framebuffer.

inline const uint32_t GetWidth() const

Gets the width of the framebuffer.

Returns:

The width of the framebuffer.

inline const uint32_t GetHeight() const

Gets the height of the framebuffer.

Returns:

The height of the framebuffer.

void AttachColorTexture(Ref<Texture2D> &texture)

Attaches a color texture to the framebuffer.

Parameters:

texture – The color texture to attach.

void AttachDepthTexture(Ref<Texture2D> &texture)

Attaches a depth texture to the framebuffer.

Parameters:

texture – The depth texture to attach.

inline const Ref<Texture2D> &GetColorTexture(uint32_t index = 0) const

Gets the color texture at the specified index.

Parameters:

index – The index of the color texture.

Returns:

A reference to the color texture.

inline const Ref<Texture2D> &GetDepthTexture() const

Gets the depth texture.

Returns:

A reference to the depth texture.

Public Static Functions

static Ref<Framebuffer> Create(uint32_t width, uint32_t height, std::initializer_list<ImageFormat> attachments)

Creates a framebuffer with the specified width, height, and attachments.

Parameters:
  • width – The width of the framebuffer.

  • height – The height of the framebuffer.

  • attachments – The list of image formats for the attachments.

Returns:

A reference to the created framebuffer.

class Frustum
class GraphicsContext
#include <GraphicsContext.h>

Class representing the graphics context.

Public Functions

GraphicsContext(SDL_Window *windowHandle)

Constructs a GraphicsContext with the specified window handle.

Parameters:

windowHandle – The handle to the SDL window.

virtual ~GraphicsContext()

Virtual destructor for the GraphicsContext class.

void Init()

Initializes the graphics context.

void SwapBuffers()

Swaps the front and back buffers.

Public Static Functions

static Scope<GraphicsContext> Create(SDL_Window *window)

Creates a graphics context for the specified window.

Parameters:

window – The handle to the SDL window.

Returns:

A scope pointer to the created graphics context.

struct HierarchyComponent
#include <SceneTree.h>

Component for managing entity hierarchy.

Public Functions

HierarchyComponent(entt::entity parent)

Constructor with parent entity.

Parameters:

parent – The parent entity.

HierarchyComponent()

Default constructor.

template<class Archive>
inline void save(Archive &archive) const

Serialize the component.

Template Parameters:

Archive – The archive type.

Parameters:

archive – The archive.

Public Static Functions

static void OnConstruct(entt::registry &registry, entt::entity entity)

Called when the component is constructed.

Parameters:
  • registry – The entity registry.

  • entity – The entity.

static void OnDestroy(entt::registry &registry, entt::entity entity)

Called when the component is destroyed.

Parameters:
  • registry – The entity registry.

  • entity – The entity.

static void OnUpdate(entt::registry &registry, entt::entity entity)

Called when the component is updated.

Parameters:
  • registry – The entity registry.

  • entity – The entity.

static void Reparent(entt::registry &registry, entt::entity entity, entt::entity parent)

Reparent the entity to a new parent.

Parameters:
  • registry – The entity registry.

  • entity – The entity to reparent.

  • parent – The new parent entity.

class ImGuiLayer : public Coffee::Layer
#include <ImGuiLayer.h>

The ImGuiLayer class is responsible for managing the ImGui layer in the application.

Public Functions

ImGuiLayer()

Constructs the ImGuiLayer object.

~ImGuiLayer()

Destroys the ImGuiLayer object.

virtual void OnAttach() override

Attaches the ImGui layer to the application.

virtual void OnDetach() override

Detaches the ImGui layer from the application.

virtual void OnEvent(Event &e) override

Handles events for the ImGui layer.

Parameters:

e – The event to handle.

void Begin()

Begins a new ImGui frame.

void End()

Ends the current ImGui frame.

virtual void OnImGuiRender() override

Renders ImGui elements.

inline void BlockEvents(bool block)

Blocks or unblocks events from being handled by the ImGui layer.

Parameters:

block – True to block events, false to unblock.

void SetTeaColorStyle()

Sets the Coffee color style for ImGui.

void SetGodotColorStyle()

Sets the Godot color style for ImGui.

void SetCoffeeColorStyle()

Sets the Coffee color style for ImGui.

class IndexBuffer
#include <Buffer.h>

Class representing an index buffer.

Public Functions

IndexBuffer(uint32_t *indices, uint32_t count)

Constructs an IndexBuffer with the specified indices and count.

Parameters:
  • indices – The index data.

  • count – The number of indices.

virtual ~IndexBuffer()

Destroys the IndexBuffer.

void Bind()

Binds the index buffer.

void Unbind()

Unbinds the index buffer.

inline uint32_t GetCount() const

Returns the number of indices in the buffer.

Returns:

The number of indices.

Public Static Functions

static Ref<IndexBuffer> Create(uint32_t *indices, uint32_t count)

Creates an index buffer with the specified indices and count.

Parameters:
  • indices – The index data.

  • count – The number of indices.

Returns:

A reference to the created index buffer.

class Input

Public Static Functions

static bool IsKeyPressed(const KeyCode key)

Checks if a specific key is currently being pressed.

Parameters:

key – The key code of the key to check.

Returns:

True if the key is currently being pressed, false otherwise.

static bool IsMouseButtonPressed(const MouseCode button)

Checks if a mouse button is currently pressed.

Parameters:

button – The mouse button to check.

Returns:

True if the mouse button is pressed, false otherwise.

static glm::vec2 GetMousePosition()

Retrieves the current position of the mouse.

Returns:

The current position of the mouse as a 2D vector.

static float GetMouseX()

Retrieves the current x-coordinate of the mouse cursor.

Returns:

The x-coordinate of the mouse cursor.

static float GetMouseY()

Retrieves the current y-coordinate of the mouse cursor.

Returns:

The y-coordinate of the mouse cursor.

class IScriptingBackend

Subclassed by Coffee::LuaBackend

Public Functions

virtual ~IScriptingBackend() = default

Virtual destructor for the IScriptingBackend interface.

virtual void Initialize() = 0

Initializes the scripting backend.

virtual void ExecuteScript(const std::string &script) = 0

Executes a script.

Parameters:

script – The script to execute.

virtual void RegisterFunction(const std::string &script, std::function<int()> func, const std::string &name) = 0

Registers a function with the scripting backend.

Parameters:
  • name – The name of the function.

  • func – The function to register.

class KeyEvent : public Coffee::Event
#include <KeyEvent.h>

Base class for key events.

Subclassed by Coffee::KeyPressedEvent, Coffee::KeyReleasedEvent, Coffee::KeyTypedEvent

Public Functions

inline KeyCode GetKeyCode() const

Get the key code associated with the event.

Returns:

The key code.

class KeyPressedEvent : public Coffee::KeyEvent
#include <KeyEvent.h>

Event for key press.

Public Functions

inline KeyPressedEvent(const KeyCode keycode, bool isRepeat = false)

Constructor for KeyPressedEvent.

Parameters:
  • keycode – The key code associated with the event.

  • isRepeat – Whether the key press is a repeat.

inline bool IsRepeat() const

Check if the key press is a repeat.

Returns:

True if the key press is a repeat, false otherwise.

inline virtual std::string ToString() const override

Convert the event to a string representation.

Returns:

A string representation of the event.

class KeyReleasedEvent : public Coffee::KeyEvent
#include <KeyEvent.h>

Event for key release.

Public Functions

inline KeyReleasedEvent(const KeyCode keycode)

Constructor for KeyReleasedEvent.

Parameters:

keycode – The key code associated with the event.

inline virtual std::string ToString() const override

Convert the event to a string representation.

Returns:

A string representation of the event.

class KeyTypedEvent : public Coffee::KeyEvent
#include <KeyEvent.h>

Event for key typing.

Public Functions

inline KeyTypedEvent(const KeyCode keycode)

Constructor for KeyTypedEvent.

Parameters:

keycode – The key code associated with the event.

inline virtual std::string ToString() const override

Convert the event to a string representation.

Returns:

A string representation of the event.

class Layer

Subclassed by Coffee::ImGuiLayer

Public Functions

inline Layer(const std::string &name = "Layer")

Constructor for the Layer class.

Parameters:

name – The name of the layer, default is “Layer”.

virtual ~Layer() = default

Virtual destructor for the Layer class.

inline virtual void OnAttach()

Called when the layer is attached.

inline virtual void OnDetach()

Called when the layer is detached.

inline virtual void OnUpdate(float dt)

Called every frame to update the layer.

Parameters:

dt – Delta time since the last frame.

inline virtual void OnImGuiRender()

Called to render ImGui elements.

inline virtual void OnEvent(Event &event)

Called when an event occurs.

Parameters:

event – The event that occurred.

inline const std::string &GetName() const

Gets the name of the layer.

Returns:

The name of the layer.

class LayerStack
#include <LayerStack.h>

Manages a stack of layers and overlays.

Public Functions

LayerStack() = default

Default constructor.

~LayerStack()

Destructor.

void PushLayer(Layer *layer)

Adds a layer to the stack.

Parameters:

layer – Pointer to the layer to be added.

void PushOverlay(Layer *overlay)

Adds an overlay to the stack.

Parameters:

overlay – Pointer to the overlay to be added.

void PopLayer(Layer *layer)

Removes a layer from the stack.

Parameters:

layer – Pointer to the layer to be removed.

void PopOverlay(Layer *overlay)

Removes an overlay from the stack.

Parameters:

overlay – Pointer to the overlay to be removed.

inline std::vector<Layer*>::iterator begin()

Returns an iterator to the beginning of the layer stack.

Returns:

Iterator to the beginning of the layer stack.

inline std::vector<Layer*>::iterator end()

Returns an iterator to the end of the layer stack.

Returns:

Iterator to the end of the layer stack.

inline std::vector<Layer*>::reverse_iterator rbegin()

Returns a reverse iterator to the beginning of the layer stack.

Returns:

Reverse iterator to the beginning of the layer stack.

inline std::vector<Layer*>::reverse_iterator rend()

Returns a reverse iterator to the end of the layer stack.

Returns:

Reverse iterator to the end of the layer stack.

inline std::vector<Layer*>::const_iterator begin() const

Returns a constant iterator to the beginning of the layer stack.

Returns:

Constant iterator to the beginning of the layer stack.

inline std::vector<Layer*>::const_iterator end() const

Returns a constant iterator to the end of the layer stack.

Returns:

Constant iterator to the end of the layer stack.

inline std::vector<Layer*>::const_reverse_iterator rbegin() const

Returns a constant reverse iterator to the beginning of the layer stack.

Returns:

Constant reverse iterator to the beginning of the layer stack.

inline std::vector<Layer*>::const_reverse_iterator rend() const

Returns a constant reverse iterator to the end of the layer stack.

Returns:

Constant reverse iterator to the end of the layer stack.

struct LightComponent
#include <Components.h>

Component representing a light.

Public Types

enum Type

Enum representing the type of light.

Values:

enumerator DirectionalLight

Directional light.

enumerator PointLight

Point light.

enumerator SpotLight

Spot light.

Public Functions

template<class Archive>
inline void serialize(Archive &archive)

Serializes the LightComponent.

Template Parameters:

Archive – The type of the archive.

Parameters:

archive – The archive to serialize to.

Public Members

glm::vec3 Color = {1.0f, 1.0f, 1.0f}

The color of the light.

glm::vec3 Direction = {0.0f, -1.0f, 0.0f}

The direction of the light.

glm::vec3 Position = {0.0f, 0.0f, 0.0f}

The position of the light.

float Range = 5.0f

The range of the light.

float Attenuation = 1.0f

The attenuation of the light.

float Intensity = 1.0f

The intensity of the light.

float Angle = 45.0f

The angle of the light.

int type = static_cast<int>(Type::DirectionalLight)

The type of the light.

class LinuxSystemInfo : public Coffee::SystemInfo

Public Functions

virtual uint32_t GetPhysicalProcessorCountImpl() const override

Gets the number of physical processors.

Returns:

The number of physical processors.

virtual uint64_t GetAvailableMemoryImpl() const override

Gets the amount of available memory in the system.

Returns:

The amount of available memory in the system.

virtual uint64_t GetUsedMemoryImpl() const override

Gets the amount of memory used in the system.

Returns:

The amount of memory used in the system.

virtual uint64_t GetProcessMemoryUsageImpl() const override

Gets the amount of memory used by the process.

Returns:

The amount of memory used by the process.

class Log
#include <Log.h>

The Log class is responsible for initializing and providing access to the core and client loggers.

Public Static Functions

static void Init()

Initializes the logging system.

static inline std::shared_ptr<spdlog::logger> &GetCoreLogger()

Gets the core logger.

Returns:

A shared pointer to the core logger.

static inline std::shared_ptr<spdlog::logger> &GetClientLogger()

Gets the client logger.

Returns:

A shared pointer to the client logger.

class LuaBackend : public Coffee::IScriptingBackend

Public Functions

virtual void Initialize() override

Initializes the scripting backend.

virtual void ExecuteScript(const std::string &script) override

Executes a script.

Parameters:

script – The script to execute.

virtual void RegisterFunction(const std::string &script, std::function<int()> func, const std::string &name) override

Registers a function with the scripting backend.

Parameters:
  • name – The name of the function.

  • func – The function to register.

struct LuaVariable
class Material : public Coffee::Resource
#include <Material.h>

Class representing a material.

Public Functions

Material(const std::string &name)

Default constructor for the Material class.

Material(const std::string &name, Ref<Shader> shader)

Constructs a Material with the specified shader.

Parameters:

shader – The shader to be used with the material.

Material(std::filesystem::path &path)

Constructs a Material from a file path.

Note

This constructor is for future use when the material YAML exists.

Parameters:

path – The file path to the material definition.

Material(const std::string &name, MaterialTextures &materialTextures)

Constructs a Material with the specified textures.

Parameters:

materialTextures – The textures to be used with the material.

~Material() = default

Default destructor for the Material class.

void Use()

Uses the material by binding its shader and textures.

inline Ref<Shader> GetShader()

Gets the shader associated with the material.

Returns:

A reference to the shader.

struct MaterialComponent
#include <Components.h>

Component representing a material.

Public Members

Ref<Material> material

The material reference.

struct MaterialProperties
#include <Material.h>

Structure representing the properties of a material.

Public Members

glm::vec4 color = glm::vec4(1.0f)

The color of the material.

float metallic = 0.0f

The metallic value of the material.

float roughness = 1.0f

The roughness value of the material.

float ao = 1.0f

The ambient occlusion value of the material.

glm::vec3 emissive = glm::vec3(0.0f)

The emissive value of the material.

struct MaterialRenderSettings
struct MaterialTextureFlags

Public Members

bool hasAlbedo = false

Whether the material has an albedo texture.

bool hasNormal = false

Whether the material has a normal map texture.

bool hasMetallic = false

Whether the material has a metallic texture.

bool hasRoughness = false

Whether the material has a roughness texture.

bool hasAO = false

Whether the material has an ambient occlusion texture.

bool hasEmissive = false

Whether the material has an emissive texture.

struct MaterialTextures
#include <Material.h>

Structure representing the textures used in a material.

Public Members

Ref<Texture2D> albedo

The albedo texture.

Ref<Texture2D> normal

The normal map texture.

Ref<Texture2D> metallic

The metallic texture.

Ref<Texture2D> roughness

The roughness texture.

Ref<Texture2D> ao

The ambient occlusion texture.

Ref<Texture2D> emissive

The emissive texture.

class Mesh : public Coffee::Resource
#include <Mesh.h>

Class representing a mesh.

Public Functions

Mesh(const std::vector<Vertex> &vertices, const std::vector<uint32_t> &indices)

Constructs a Mesh with the specified indices and vertices.

Parameters:
  • indices – The indices of the mesh.

  • vertices – The vertices of the mesh.

inline const Ref<VertexArray> &GetVertexArray() const

Gets the vertex array of the mesh.

Returns:

A reference to the vertex array.

inline const Ref<VertexBuffer> &GetVertexBuffer() const

Gets the vertex buffer of the mesh.

Returns:

A reference to the vertex buffer.

inline const Ref<IndexBuffer> &GetIndexBuffer() const

Gets the index buffer of the mesh.

Returns:

A reference to the index buffer.

inline void SetMaterial(Ref<Material> &material)

Sets the material of the mesh.

Parameters:

material – A reference to the material.

inline void SetAABB(const AABB aabb)

Sets the axis-aligned bounding box (AABB) of the mesh.

Parameters:

aabb – The axis-aligned bounding box to set.

inline const AABB &GetAABB()

Gets the axis-aligned bounding box (AABB) of the mesh.

Returns:

A reference to the AABB.

inline OBB GetOBB(const glm::mat4 &transform)

Gets the oriented bounding box (OBB) of the mesh.

Parameters:

transform – The transformation matrix.

Returns:

The OBB.

inline const Ref<Material> &GetMaterial() const

Gets the material of the mesh.

Returns:

A reference to the material.

inline const std::vector<Vertex> &GetVertices() const

Gets the vertices of the mesh.

Returns:

A reference to the vector of vertices.

inline const std::vector<uint32_t> &GetIndices() const

Gets the indices of the mesh.

Returns:

A reference to the vector of indices.

struct MeshComponent
#include <Components.h>

Component representing a mesh.

Public Functions

inline const Ref<Mesh> &GetMesh() const

Gets the mesh reference.

Returns:

The mesh reference.

Public Members

Ref<Mesh> mesh

The mesh reference.

bool drawAABB = false

Flag to draw the axis-aligned bounding box (AABB).

class Model : public Coffee::Resource, public std::enable_shared_from_this<Model>
#include <Model.h>

Class representing a 3D model.

Public Functions

inline Model()

Default constructor for the Model class.

Model(const std::filesystem::path &path)

Constructs a Model from a file path.

Parameters:

filePath – The file path to the model.

inline const std::vector<Ref<Mesh>> &GetMeshes() const

Gets the meshes of the model.

Returns:

A reference to the vector of meshes.

inline void AddMesh(const Ref<Mesh> mesh)

Adds a mesh to the model.

Parameters:

mesh – A reference to the mesh to add.

inline const std::weak_ptr<Model> GetParent() const

Gets the parent model.

Returns:

A pointer to the parent model.

inline const std::vector<Ref<Model>> GetChildren() const

Gets the children models.

Returns:

A reference to the vector of children models.

inline const glm::mat4 GetTransform() const

Gets the transformation matrix of the model.

Returns:

The transformation matrix.

Public Static Functions

static Ref<Model> Load(const std::filesystem::path &path)

Loads a model from the specified file path.

Parameters:

path – The path to the model file.

class MouseButtonEvent : public Coffee::Event
#include <MouseEvent.h>

Base class for mouse button events.

Subclassed by Coffee::MouseButtonPressedEvent, Coffee::MouseButtonReleasedEvent

Public Functions

inline MouseCode GetMouseButton() const

Get the mouse button associated with the event.

Returns:

The mouse button.

class MouseButtonPressedEvent : public Coffee::MouseButtonEvent
#include <MouseEvent.h>

Event for mouse button press.

Public Functions

inline MouseButtonPressedEvent(const MouseCode button)

Constructor for MouseButtonPressedEvent.

Parameters:

button – The mouse button associated with the event.

inline virtual std::string ToString() const override

Convert the event to a string representation.

Returns:

A string representation of the event.

class MouseButtonReleasedEvent : public Coffee::MouseButtonEvent
#include <MouseEvent.h>

Event for mouse button release.

Public Functions

inline MouseButtonReleasedEvent(const MouseCode button)

Constructor for MouseButtonReleasedEvent.

Parameters:

button – The mouse button associated with the event.

inline virtual std::string ToString() const override

Convert the event to a string representation.

Returns:

A string representation of the event.

class MouseMovedEvent : public Coffee::Event
#include <MouseEvent.h>

Event for mouse movement.

Public Functions

inline MouseMovedEvent(const float x, const float y)

Constructor for MouseMovedEvent.

Parameters:
  • x – The x-coordinate of the mouse.

  • y – The y-coordinate of the mouse.

inline float GetX() const

Get the x-coordinate of the mouse.

Returns:

The x-coordinate.

inline float GetY() const

Get the y-coordinate of the mouse.

Returns:

The y-coordinate.

inline virtual std::string ToString() const override

Convert the event to a string representation.

Returns:

A string representation of the event.

class MouseScrolledEvent : public Coffee::Event
#include <MouseEvent.h>

Event for mouse scrolling.

Public Functions

inline MouseScrolledEvent(const float xOffset, const float yOffset)

Constructor for MouseScrolledEvent.

Parameters:
  • xOffset – The scroll offset along the x-axis.

  • yOffset – The scroll offset along the y-axis.

inline float GetXOffset() const

Get the scroll offset along the x-axis.

Returns:

The x-axis scroll offset.

inline float GetYOffset() const

Get the scroll offset along the y-axis.

Returns:

The y-axis scroll offset.

inline virtual std::string ToString() const override

Convert the event to a string representation.

Returns:

A string representation of the event.

struct OBB
#include <BoundingBox.h>

Structure representing an oriented bounding box (OBB).

Public Functions

inline OBB(const std::array<glm::vec3, 8> &corners)

Constructs an OBB with specified corners.

Parameters:

corners – The corners of the OBB.

inline OBB(const glm::mat4 &transform, const AABB &aabb)

Constructs an OBB from a transformation matrix and an AABB.

Parameters:
  • transform – The transformation matrix.

  • aabb – The axis-aligned bounding box.

Public Members

std::array<glm::vec3, 8> corners

The corners of the OBB.

template<typename T>
struct ObjectContainer
template<typename T>
class Octree
template<typename T>
class OctreeNode
class PrimitiveMesh
#include <PrimitiveMesh.h>

Class representing different types of primitive meshes.

Public Static Functions

static Ref<Mesh> CreateQuad()

Creates a quad mesh.

Returns:

A reference to the created quad mesh.

static Ref<Mesh> CreateCube(const glm::vec3 &size = {1.0f, 1.0f, 1.0f}, int subdivideW = 0, int subdidiveH = 0, int subdivideD = 0)

Creates a cube mesh.

Creates a cube mesh.

Parameters:
  • size – The size of the cube.

  • subdivideW – Number of subdivisions along the width.

  • subdivideH – Number of subdivisions along the height.

  • subdivideD – Number of subdivisions along the depth.

  • size – The size of the cube.

  • subdivideW – Subdivision parameter for width (currently not functional).

  • subdivideH – Subdivision parameter for height (currently not functional).

  • subdivideD – Subdivision parameter for depth (currently not functional).

Returns:

A reference to the created cube mesh.

Returns:

Ref<Mesh> A reference to the created cube mesh.

static Ref<Mesh> CreateSphere(float radius = 0.5f, float height = 1.0f, int radialSegments = 64, int rings = 32, bool isHemiSphere = false)

Creates a sphere mesh.

Parameters:
  • radius – The radius of the sphere.

  • height – The height of the sphere.

  • radialSegments – Number of radial segments.

  • rings – Number of rings.

  • isHemiSphere – Whether the sphere is a hemisphere.

Returns:

A reference to the created sphere mesh.

static Ref<Mesh> CreatePlane(const glm::vec2 &size = {1.0f, 1.0f}, const glm::vec3 &normal = {0.0f, 1.0f, 0.0f})

Creates a plane mesh.

Parameters:
  • size – The size of the plane.

  • normal – The normal vector of the plane.

Returns:

A reference to the created plane mesh.

static Ref<Mesh> CreateCylinder(float topRadius = 0.5f, float bottomRadius = 0.5f, float height = 1.0f, int radialSegments = 64, int rings = 1, bool capTop = true, bool capBottom = true)

Creates a cylinder mesh.

Parameters:
  • topRadius – The radius of the top of the cylinder.

  • bottomRadius – The radius of the bottom of the cylinder.

  • height – The height of the cylinder.

  • radialSegments – Number of radial segments.

  • rings – Number of rings.

  • capTop – Whether to cap the top of the cylinder.

  • capBottom – Whether to cap the bottom of the cylinder.

Returns:

A reference to the created cylinder mesh.

static Ref<Mesh> CreateCone(float radius = 0.5f, float height = 1.0f, int radialSegments = 64, int rings = 1, bool cap = true)

Creates a cone mesh.

Parameters:
  • radius – The radius of the base of the cone.

  • height – The height of the cone.

  • radialSegments – Number of radial segments.

  • rings – Number of rings.

  • cap – Whether to cap the base of the cone.

Returns:

A reference to the created cone mesh.

static Ref<Mesh> CreateTorus(float innerRadius = 0.5f, float outerRadius = 1.0f, int rings = 64, int ringSegments = 32)

Creates a torus mesh.

Parameters:
  • innerRadius – The inner radius of the torus.

  • outerRadius – The outer radius of the torus.

  • rings – Number of rings.

  • ringSegments – Number of ring segments.

Returns:

A reference to the created torus mesh.

static Ref<Mesh> CreateCapsule(float radius = 0.5f, float height = 2.0f, int radialSegments = 64, int rings = 8)

Creates a capsule mesh.

Parameters:
  • radius – The radius of the capsule.

  • height – The height of the capsule.

  • radialSegments – Number of radial segments.

  • rings – Number of rings.

Returns:

A reference to the created capsule mesh.

class Project
#include <Project.h>

The Project class is responsible for managing project data such as name, directory, and start scene path.

Public Functions

template<class Archive>
inline void serialize(Archive &archive)

Serializes the project data.

Template Parameters:

Archive – The type of the archive.

Parameters:

archive – The archive to serialize to.

Public Static Functions

static Ref<Project> New(const std::filesystem::path &path)

Creates a new project.

Returns:

A reference to the newly created project.

static Ref<Project> Load(const std::filesystem::path &path)

Loads a project from the specified path.

Parameters:

path – The path to the project file.

Returns:

A reference to the loaded project.

static void SaveActive()

Saves the active project to the specified path.

Parameters:

path – The path to save the project file.

static inline Ref<Project> GetActive()

Gets the active project.

Returns:

A reference to the active project.

static inline const std::filesystem::path &GetProjectDirectory()

Gets the directory of the active project.

Returns:

The path to the project directory.

static inline const std::string &GetProjectName()

Gets the name of the active project.

Returns:

The name of the project.

static inline std::filesystem::path GetCacheDirectory()

Retrieves the cache directory path of the active project.

This static method returns a constant reference to the cache directory path associated with the currently active project.

Returns:

const std::filesystem::path& Reference to the cache directory path.

struct RenderCommand
class Renderer
#include <Renderer.h>

Class representing the 3D renderer.

Public Static Functions

static void Init()

Initializes the renderer.

static void Shutdown()

Shuts down the renderer.

static void BeginScene(EditorCamera &camera)

Begins a new scene with the specified editor camera.

Parameters:

camera – The editor camera.

static void BeginScene(Camera &camera, const glm::mat4 &transform)

Begins a new scene with the specified camera and transform.

Parameters:
  • camera – The camera.

  • transform – The transform matrix.

static void EndScene()

Ends the current scene.

static void BeginOverlay(EditorCamera &camera)

Begins an overlay with the specified editor camera.

Parameters:

camera – The editor camera.

static void EndOverlay()

Ends the current overlay.

static void Submit(const LightComponent &light)

Submits a light component.

Parameters:

light – The light component.

static void OnResize(uint32_t width, uint32_t height)

Resizes the renderer to the specified width and height.

Parameters:
  • width – The new width.

  • height – The new height.

static inline const Ref<Texture2D> &GetRenderTexture()

Gets the render texture.

Returns:

A reference to the render texture.

static inline const Ref<Texture2D> &GetEntityIDTexture()

Retrieves the texture associated with the entity ID.

This static method returns a reference to the texture that is used to identify entities within the renderer. The texture is stored as a static member of the class.

Returns:

A constant reference to the entity ID texture.

static inline const RendererData &GetData()

Gets the renderer data.

Returns:

A reference to the renderer data.

static inline const RendererStats &GetStats()

Gets the renderer statistics.

Returns:

A reference to the renderer statistics.

static inline RenderSettings &GetRenderSettings()

Gets the render settings.

Returns:

A reference to the render settings.

class RendererAPI
#include <RendererAPI.h>

Class representing the Renderer API.

Public Static Functions

static void Init()

Initializes the Renderer API.

static void SetClearColor(const glm::vec4 &color)

Sets the clear color for the renderer.

Parameters:

color – The clear color as a glm::vec4.

static void Clear()

Clears the current buffer.

static void SetDepthMask(bool enabled)

Enables or disables the depth mask.

Parameters:

enabled – True to enable the depth mask, false to disable it.

static void DrawIndexed(const Ref<VertexArray> &vertexArray)

Draws the indexed vertices from the specified vertex array.

Parameters:

vertexArray – The vertex array containing the vertices to draw.

static void DrawLines(const Ref<VertexArray> &vertexArray, uint32_t vertexCount, float lineWidth = 1.0f)

Draws lines from the specified vertex array.

Parameters:
  • vertexArray – The vertex array containing the vertices to draw.

  • vertexCount – The number of vertices to draw.

  • lineWidth – The width of the lines.

static Scope<RendererAPI> Create()

Creates a new Renderer API instance.

Returns:

A scope pointer to the created Renderer API instance.

struct RendererData
#include <Renderer.h>

Structure containing renderer data.

Public Members

CameraData cameraData

Camera data.

RenderData renderData

Render data.

Ref<UniformBuffer> CameraUniformBuffer

Uniform buffer for camera data.

Ref<UniformBuffer> RenderDataUniformBuffer

Uniform buffer for render data.

Ref<Material> DefaultMaterial

Default material.

Ref<Texture2D> RenderTexture

Render texture.

std::vector<RenderCommand> renderQueue

Render queue.

struct CameraData
#include <Renderer.h>

Structure containing camera data.

Public Members

glm::mat4 projection

The projection matrix.

glm::mat4 view

The view matrix.

glm::vec3 position

The position of the camera.

struct RenderData
#include <Renderer.h>

Structure containing render data.

Public Members

LightComponent lights[32]

Array of light components.

int lightCount = 0

Number of lights.

struct RendererStats
#include <Renderer.h>

Structure containing renderer statistics.

Public Members

uint32_t DrawCalls = 0

Number of draw calls.

uint32_t VertexCount = 0

Number of vertices.

uint32_t IndexCount = 0

Number of indices.

struct RenderSettings
#include <Renderer.h>

Structure containing render settings.

Public Members

bool PostProcessing = true

Enable or disable post-processing.

bool SSAO = false

Enable or disable SSAO.

bool Bloom = false

Enable or disable bloom.

bool FXAA = false

Enable or disable FXAA.

float Exposure = 1.0f

Exposure value.

class Resource
#include <Resource.h>

Base class for different types of resources in the CoffeeEngine.

Subclassed by Coffee::Material, Coffee::Mesh, Coffee::Model, Coffee::Shader, Coffee::Texture

Public Functions

inline Resource(ResourceType type = ResourceType::Unknown)

Constructor that initializes the resource with a type.

Parameters:

type – The type of the resource.

virtual ~Resource() = default

Virtual destructor.

inline const std::string &GetName() const

Gets the name of the resource.

Returns:

The name of the resource.

inline const std::filesystem::path &GetPath()

Gets the file path of the resource.

Returns:

The file path of the resource.

inline void SetName(const std::string &name)

Sets the name of the mesh.

Parameters:

name – The name of the mesh.

inline ResourceType GetType() const

Gets the type of the resource.

Returns:

The type of the resource.

inline void SetUUID(UUID uuid)

Sets the UUID of the resource.

Parameters:

uuid – The UUID to set.

inline UUID GetUUID() const

Gets the UUID of the resource.

Returns:

The UUID of the resource.

class ResourceImporter
#include <ResourceImporter.h>

Handles the import of resources such as textures.

Public Functions

Ref<Texture2D> ImportTexture2D(const std::filesystem::path &path, const UUID &uuid, bool srgb, bool cache)

Imports a texture from a given file path.

Parameters:
  • path – The file path of the texture to import.

  • srgb – Whether the texture should be imported in sRGB format.

  • cache – Whether the texture should be cached.

Returns:

A reference to the imported texture.

class ResourceLoader
#include <ResourceLoader.h>

Loads resources such as textures and models for the CoffeeEngine.

Public Static Functions

static void LoadDirectory(const std::filesystem::path &directory)

Loads all resources from a directory.

Parameters:

directory – The directory to load resources from.

static void LoadFile(const std::filesystem::path &path)

Loads a single resource file.

Parameters:

path – The file path of the resource to load.

static Ref<Texture2D> LoadTexture2D(const std::filesystem::path &path, bool srgb = true, bool cache = true)

Loads a texture from a file.

Parameters:
  • path – The file path of the texture to load.

  • srgb – Whether the texture should be loaded in sRGB format.

  • cache – Whether the texture should be cached.

Returns:

A reference to the loaded texture.

static Ref<Model> LoadModel(const std::filesystem::path &path, bool cache = true)

Loads a model from a file.

Parameters:
  • path – The file path of the model to load.

  • cache – Whether the model should be cached.

Returns:

A reference to the loaded model.

class ResourceRegistry
#include <ResourceRegistry.h>

Manages the registration and retrieval of resources.

Public Static Functions

static inline void Add(UUID uuid, Ref<Resource> resource)

Adds a resource to the registry.

Parameters:
  • name – The name of the resource.

  • resource – A reference to the resource to add.

template<typename T>
static inline Ref<T> Get(UUID uuid)

Retrieves a resource from the registry.

Template Parameters:

T – The type of the resource.

Parameters:

name – The name of the resource.

Returns:

A reference to the resource, or nullptr if not found.

template<typename T>
static inline Ref<T> Get(const std::string &name)

Retrieves a resource from the registry.

Parameters:

name – The name of the resource.

Returns:

A reference to the resource, or nullptr if not found.

static inline bool Exists(UUID uuid)

Checks if a resource exists in the registry.

Parameters:

name – The name of the resource.

Returns:

True if the resource exists, false otherwise.

static inline bool Exists(const std::string &name)

Checks if a resource exists in the registry.

Parameters:

name – The name of the resource.

Returns:

True if the resource exists, false otherwise.

static inline void Clear()

Clears all resources from the registry.

static inline const std::unordered_map<UUID, Ref<Resource>> &GetResourceRegistry()

Gets the entire resource registry.

Returns:

A constant reference to the resource registry.

class ResourceSaver
#include <ResourceSaver.h>

Handles saving resources to disk and cache.

Public Static Functions

static void Save(const std::filesystem::path &path, const Ref<Resource> &resource)

Saves a resource to a specified path on disk.

Parameters:
  • path – The file path where the resource will be saved.

  • resource – A reference to the resource to save.

static void SaveToCache(const std::string &filename, const Ref<Resource> &resource)

Saves a resource to the project cache.

Parameters:

resource – A reference to the resource to save to cache.

class Scene
#include <Scene.h>

Class representing a scene.

Public Functions

Scene()

Constructor for Scene.

~Scene() = default

Default destructor.

Entity CreateEntity(const std::string &name = std::string())

Create an entity in the scene.

Parameters:

name – The name of the entity.

Returns:

The created entity.

void DestroyEntity(Entity entity)

Destroy an entity in the scene.

Parameters:

entity – The entity to destroy.

void OnInitEditor()

Initialize the scene.

void OnUpdateEditor(EditorCamera &camera, float dt)

Update the scene in editor mode.

Parameters:
  • camera – The editor camera.

  • dt – The delta time.

void OnUpdateRuntime(float dt)

Update the scene in runtime mode.

Parameters:

dt – The delta time.

void OnEvent(Event &e)

Handle an event in the scene.

Parameters:

e – The event.

void OnExitEditor()

Exit the scene.

Public Static Functions

static Ref<Scene> Load(const std::filesystem::path &path)

Load a scene from a file.

Parameters:

path – The path to the file.

Returns:

The loaded scene.

static void Save(const std::filesystem::path &path, Ref<Scene> scene)

Save a scene to a file.

Parameters:
  • path – The path to the file.

  • scene – The scene to save.

class SceneCamera : public Coffee::Camera
#include <SceneCamera.h>

Camera class for the scene.

Public Functions

SceneCamera()

Constructor for SceneCamera.

~SceneCamera() = default

Default destructor.

class SceneTree
#include <SceneTree.h>

Class for managing the scene tree.

Public Functions

SceneTree(Scene *scene)

Constructor for SceneTree.

Parameters:

scene – The scene context.

~SceneTree() = default

Default destructor.

void Update()

Update the scene tree.

void UpdateTransform(entt::entity entity)

Update the transform of an entity.

Parameters:

entity – The entity to update.

class Script
struct ScriptComponent
class ScriptManager
class Shader : public Coffee::Resource
#include <Shader.h>

Class representing a shader program.

Public Functions

Shader(const std::filesystem::path &shaderPath)

Constructs a Shader with the specified vertex and fragment shader paths.

Parameters:
  • vertexPath – The file path to the vertex shader.

  • fragmentPath – The file path to the fragment shader.

virtual ~Shader()

Destructor for the Shader class.

void Bind()

Binds the shader program for use.

void Unbind()

Unbinds the shader program.

void setBool(const std::string &name, bool value) const

Sets a boolean uniform in the shader.

Parameters:
  • name – The name of the uniform.

  • value – The boolean value to set.

void setInt(const std::string &name, int value) const

Sets an integer uniform in the shader.

Parameters:
  • name – The name of the uniform.

  • value – The integer value to set.

void setFloat(const std::string &name, float value) const

Sets a float uniform in the shader.

Parameters:
  • name – The name of the uniform.

  • value – The float value to set.

void setVec2(const std::string &name, const glm::vec2 &value) const

Sets a vec2 uniform in the shader.

Parameters:
  • name – The name of the uniform.

  • value – The vec2 value to set.

void setVec3(const std::string &name, const glm::vec3 &value) const

Sets a vec3 uniform in the shader.

Parameters:
  • name – The name of the uniform.

  • value – The vec3 value to set.

void setVec4(const std::string &name, const glm::vec4 &value) const

Sets a vec4 uniform in the shader.

Parameters:
  • name – The name of the uniform.

  • value – The vec4 value to set.

void setMat2(const std::string &name, const glm::mat2 &mat) const

Sets a mat2 uniform in the shader.

Parameters:
  • name – The name of the uniform.

  • mat – The mat2 value to set.

void setMat3(const std::string &name, const glm::mat3 &mat) const

Sets a mat3 uniform in the shader.

Parameters:
  • name – The name of the uniform.

  • mat – The mat3 value to set.

void setMat4(const std::string &name, const glm::mat4 &mat) const

Sets a mat4 uniform in the shader.

Parameters:
  • name – The name of the uniform.

  • mat – The mat4 value to set.

void checkCompileErrors(GLuint shader, std::string type)

Checks for compile errors in the shader.

Parameters:
  • shader – The shader ID.

  • type – The type of the shader.

Public Static Functions

static Ref<Shader> Create(const std::filesystem::path &shaderPath)

Creates a shader from the specified vertex and fragment shader paths.

Parameters:
  • vertexPath – The file path to the vertex shader.

  • fragmentPath – The file path to the fragment shader.

Returns:

A reference to the created shader.

class Stopwatch
#include <Stopwatch.h>

A class to measure elapsed time.

The Stopwatch class provides functionality to start, stop, reset, and retrieve the elapsed time. It supports both regular and high-precision timing.

Public Functions

Stopwatch()

Constructs a new Stopwatch object.

void Start()

Starts the stopwatch.

If the stopwatch is already running, this method has no effect.

void Stop()

Stops the stopwatch.

If the stopwatch is not running, this method has no effect.

void Reset()

Resets the stopwatch.

This method stops the stopwatch and resets the elapsed time to zero.

float GetElapsedTime() const

Gets the elapsed time in seconds.

Returns:

The elapsed time in seconds.

double GetPreciseElapsedTime() const

Gets the precise elapsed time in seconds.

This method uses SDL_GetPerformanceCounter for higher precision.

Returns:

The precise elapsed time in seconds.

class SystemInfo

Subclassed by Coffee::LinuxSystemInfo, Coffee::WindowsSystemInfo

Public Functions

virtual uint32_t GetPhysicalProcessorCountImpl() const = 0

Gets the number of physical processors.

Returns:

The number of physical processors.

virtual uint64_t GetAvailableMemoryImpl() const = 0

Gets the amount of available memory in the system.

Returns:

The amount of available memory in the system.

virtual uint64_t GetUsedMemoryImpl() const = 0

Gets the amount of memory used in the system.

Returns:

The amount of memory used in the system.

virtual uint64_t GetProcessMemoryUsageImpl() const = 0

Gets the amount of memory used by the process.

Returns:

The amount of memory used by the process.

Public Static Functions

static uint32_t GetLogicalProcessorCount()

Gets the number of logical processors.

static uint32_t GetPhysicalProcessorCount()

Gets the number of physical processors.

static uint64_t GetTotalMemory()

Gets the total memory in the system.

static uint64_t GetAvailableMemory()

Gets the available memory in the system.

static uint64_t GetUsedMemory()

Gets the used memory in the system.

static uint64_t GetProcessMemoryUsage()

Gets the memory used by the process.

struct TagComponent
#include <Components.h>

Component representing a tag.

Public Functions

template<class Archive>
inline void serialize(Archive &archive)

Serializes the TagComponent.

Template Parameters:

Archive – The type of the archive.

Parameters:

archive – The archive to serialize to.

Public Members

std::string Tag

The tag string.

class Texture : public Coffee::Resource

Subclassed by Coffee::Cubemap, Coffee::Texture2D

class Texture2D : public Coffee::Texture
struct TextureProperties
class Timer
#include <Timer.h>

A class that represents a timer with various functionalities.

Public Functions

inline Timer()

Default constructor.

Timer(double waitTime, bool autoStart, bool oneShot, TimerCallback callback)

Parameterized constructor.

Parameters:
  • waitTime – The time to wait before the timer triggers.

  • autoStart – Whether the timer should start automatically.

  • oneShot – Whether the timer should trigger only once.

  • callback – The callback function to be called when the timer triggers.

void Start(double waitTime)

Starts the timer with a specified wait time.

Parameters:

waitTime – The time to wait before the timer triggers.

void Stop()

Stops the timer.

void setWaitTime(double waitTime)

Sets the wait time for the timer.

Parameters:

waitTime – The time to wait before the timer triggers.

inline double getWaitTime() const

Gets the wait time of the timer.

Returns:

The time to wait before the timer triggers.

inline void setOneShot(bool oneShot)

Sets whether the timer should trigger only once.

Parameters:

oneShot – Whether the timer should trigger only once.

inline bool isOneShot() const

Checks if the timer is set to trigger only once.

Returns:

True if the timer is set to trigger only once, false otherwise.

inline void setAutoStart(bool autoStart)

Sets whether the timer should start automatically.

Parameters:

autoStart – Whether the timer should start automatically.

inline bool isAutoStart() const

Checks if the timer is set to start automatically.

Returns:

True if the timer is set to start automatically, false otherwise.

void setPaused(bool paused)

Sets whether the timer is paused.

Parameters:

paused – Whether the timer is paused.

inline bool isPaused() const

Checks if the timer is paused.

Returns:

True if the timer is paused, false otherwise.

void isStopped()

Checks if the timer is stopped.

inline double GetTimeLeft() const

Gets the remaining time before the timer triggers.

Returns:

The remaining time before the timer triggers.

inline void SetCallback(TimerCallback callback)

Sets the callback function to be called when the timer triggers.

Parameters:

callback – The callback function.

inline TimerCallback GetCallback() const

Gets the callback function to be called when the timer triggers.

Returns:

The callback function.

struct TransformComponent
#include <Components.h>

Component representing a transform.

Public Functions

inline glm::mat4 GetLocalTransform() const

Gets the local transformation matrix.

Returns:

The local transformation matrix.

inline void SetLocalTransform(const glm::mat4 &transform)

Sets the local transformation matrix.

Parameters:

transform – The transformation matrix to set.

inline const glm::mat4 &GetWorldTransform() const

Gets the world transformation matrix.

Returns:

The world transformation matrix.

inline void SetWorldTransform(const glm::mat4 &transform)

Sets the world transformation matrix.

Parameters:

transform – The transformation matrix to set.

template<class Archive>
inline void serialize(Archive &archive)

Serializes the TransformComponent.

Template Parameters:

Archive – The type of the archive.

Parameters:

archive – The archive to serialize to.

Public Members

glm::vec3 Position = {0.0f, 0.0f, 0.0f}

The position vector.

glm::vec3 Rotation = {0.0f, 0.0f, 0.0f}

The rotation vector.

glm::vec3 Scale = {1.0f, 1.0f, 1.0f}

The scale vector.

class UniformBuffer
#include <UniformBuffer.h>

Class representing a uniform buffer.

Public Functions

UniformBuffer(uint32_t size, uint32_t binding)

Constructs a UniformBuffer with the specified size and binding.

Parameters:
  • size – The size of the buffer.

  • binding – The binding point of the buffer.

virtual ~UniformBuffer()

Destructor for the UniformBuffer class.

void SetData(const void *data, uint32_t size, uint32_t offset = 0)

Sets the data of the uniform buffer.

Parameters:
  • data – A pointer to the data to set.

  • size – The size of the data.

  • offset – The offset in the buffer to set the data.

Public Static Functions

static Ref<UniformBuffer> Create(uint32_t size, uint32_t binding)

Creates a uniform buffer with the specified size and binding.

Parameters:
  • size – The size of the buffer.

  • binding – The binding point of the buffer.

Returns:

A reference to the created uniform buffer.

class UUID
struct Vertex
#include <Mesh.h>

Structure representing a vertex in a mesh.

Public Members

glm::vec3 Position = glm::vec3(0.0f)

The position of the vertex.

glm::vec2 TexCoords = glm::vec2(0.0f)

The texture coordinates of the vertex.

glm::vec3 Normals = glm::vec3(0.0f)

The normal vector of the vertex.

glm::vec3 Tangent = glm::vec3(0.0f)

The tangent vector of the vertex.

glm::vec3 Bitangent = glm::vec3(0.0f)

The bitangent vector of the vertex.

class VertexArray
#include <VertexArray.h>

Class representing a vertex array.

Public Functions

VertexArray()

Constructs a VertexArray.

virtual ~VertexArray()

Destructor for the VertexArray class.

void Bind()

Binds the vertex array.

void Unbind()

Unbinds the vertex array.

void AddVertexBuffer(const Ref<VertexBuffer> &vertexBuffer)

Adds a vertex buffer to the vertex array.

Parameters:

vertexBuffer – A reference to the vertex buffer to add.

void SetIndexBuffer(const Ref<IndexBuffer> &indexBuffer)

Sets the index buffer for the vertex array.

Parameters:

indexBuffer – A reference to the index buffer to set.

inline const std::vector<Ref<VertexBuffer>> &GetVertexBuffers() const

Gets the vertex buffers of the vertex array.

Returns:

A constant reference to the vector of vertex buffers.

inline const Ref<IndexBuffer> &GetIndexBuffer() const

Gets the index buffer of the vertex array.

Returns:

A constant reference to the index buffer.

Public Static Functions

static Ref<VertexArray> Create()

Creates a vertex array.

Returns:

A reference to the created vertex array.

class VertexBuffer
#include <Buffer.h>

Class representing a vertex buffer.

Public Functions

VertexBuffer(uint32_t size)

Constructs a VertexBuffer with the specified size.

Parameters:

size – The size of the buffer.

VertexBuffer(float *vertices, uint32_t size)

Constructs a VertexBuffer with the specified vertices and size.

Parameters:
  • vertices – The vertex data.

  • size – The size of the buffer.

virtual ~VertexBuffer()

Destroys the VertexBuffer.

void Bind()

Binds the vertex buffer.

void Unbind()

Unbinds the vertex buffer.

void SetData(void *data, uint32_t size)

Sets the data of the vertex buffer.

Parameters:
  • data – The data to set.

  • size – The size of the data.

inline const BufferLayout &GetLayout() const

Returns the layout of the vertex buffer.

Returns:

The buffer layout.

inline void SetLayout(const BufferLayout &layout)

Sets the layout of the vertex buffer.

Parameters:

layout – The buffer layout.

Public Static Functions

static Ref<VertexBuffer> Create(uint32_t size)

Creates a vertex buffer with the specified size.

Parameters:

size – The size of the buffer.

Returns:

A reference to the created vertex buffer.

static Ref<VertexBuffer> Create(float *vertices, uint32_t size)

Creates a vertex buffer with the specified vertices and size.

Parameters:
  • vertices – The vertex data.

  • size – The size of the buffer.

Returns:

A reference to the created vertex buffer.

class Window
#include <Window.h>

The Window class is responsible for managing the window and its properties.

Public Functions

Window(const WindowProps &props)

Constructs a Window object with the specified properties.

Parameters:

props – The properties of the window.

virtual ~Window()

Destroys the Window object.

void OnUpdate()

Updates the window.

inline unsigned int GetWidth() const

Gets the width of the window.

Returns:

The width of the window.

inline unsigned int GetHeight() const

Gets the height of the window.

Returns:

The height of the window.

void SetVSync(bool enabled)

Enables or disables VSync.

Parameters:

enabled – True to enable VSync, false to disable.

bool IsVSync() const

Checks if VSync is enabled.

Returns:

True if VSync is enabled, false otherwise.

void SetTitle(const std::string &title)

Sets the title of the window.

Parameters:

title – The new title of the window.

inline const std::string &GetTitle() const

Gets the title of the window.

Returns:

The title of the window.

void SetIcon(const std::string &path)

Sets the icon of the window.

Parameters:

path – The path to the icon file.

inline virtual void *GetNativeWindow() const

Gets the native window handle.

Returns:

A pointer to the native window.

Public Static Functions

static inline Scope<Window> Create(const WindowProps &props = WindowProps())

Creates a window with the specified properties.

Parameters:

props – The properties of the window.

Returns:

A scoped pointer to the created window.

class WindowCloseEvent : public Coffee::Event
#include <ApplicationEvent.h>

Event for window close.

struct WindowProps
#include <Window.h>

Structure to hold window properties such as title, width, and height.

Public Functions

inline WindowProps(const std::string &title = "Coffee Engine", uint32_t width = 1600, uint32_t height = 900)

Constructs WindowProps with default or specified values.

Parameters:
  • title – The title of the window.

  • width – The width of the window.

  • height – The height of the window.

Public Members

std::string Title

The title of the window.

uint32_t Width

The width of the window.

uint32_t Height

The height of the window.

class WindowResizeEvent : public Coffee::Event
#include <ApplicationEvent.h>

Event for window resize.

Public Functions

inline unsigned int GetWidth() const

Get the width of the window.

Returns:

The width of the window.

inline unsigned int GetHeight() const

Get the height of the window.

Returns:

The height of the window.

inline virtual std::string ToString() const override

Convert the event to a string representation.

Returns:

A string representation of the event.

class WindowsSystemInfo : public Coffee::SystemInfo

Public Functions

virtual uint32_t GetPhysicalProcessorCountImpl() const override

Gets the number of physical processors.

Returns:

The number of physical processors.

virtual uint64_t GetAvailableMemoryImpl() const override

Gets the amount of available memory in the system.

Returns:

The amount of available memory in the system.

virtual uint64_t GetUsedMemoryImpl() const override

Gets the amount of memory used in the system.

Returns:

The amount of memory used in the system.

virtual uint64_t GetProcessMemoryUsageImpl() const override

Gets the amount of memory used by the process.

Returns:

The amount of memory used by the process.

namespace Key

Enums

Values:

enumerator Unknown
enumerator A
enumerator B
enumerator C
enumerator D
enumerator E
enumerator F
enumerator G
enumerator H
enumerator I
enumerator J
enumerator K
enumerator L
enumerator M
enumerator N
enumerator O
enumerator P
enumerator Q
enumerator R
enumerator S
enumerator T
enumerator U
enumerator V
enumerator W
enumerator X
enumerator Y
enumerator Z
enumerator D1
enumerator D2
enumerator D3
enumerator D4
enumerator D5
enumerator D6
enumerator D7
enumerator D8
enumerator D9
enumerator D0
enumerator Return
enumerator Escape
enumerator Backspace
enumerator Tab
enumerator Space
enumerator Minus
enumerator Equals
enumerator LeftBracket
enumerator RightBracket
enumerator Backslash

Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout.

enumerator NonUsHash

ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I’ve seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards.

enumerator Semicolon
enumerator Apostrophe
enumerator Grave

Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards.

enumerator Comma
enumerator Period
enumerator Slash
enumerator CapsLock
enumerator F1
enumerator F2
enumerator F3
enumerator F4
enumerator F5
enumerator F6
enumerator F7
enumerator F8
enumerator F9
enumerator F10
enumerator F11
enumerator F12
enumerator PrintScreen
enumerator ScrollLock
enumerator Pause
enumerator Insert

insert on PC, help on some Mac keyboards (but does send code 73, not 117)

enumerator Home
enumerator PageUp
enumerator Delete
enumerator End
enumerator PageDown
enumerator Right
enumerator Left
enumerator Down
enumerator Up
enumerator NumLockClear

num lock on PC, clear on Mac keyboards

enumerator KpDivide
enumerator KpMultiply
enumerator KpMinus
enumerator KpPlus
enumerator KpEnter
enumerator Kp1
enumerator Kp2
enumerator Kp3
enumerator Kp4
enumerator Kp5
enumerator Kp6
enumerator Kp7
enumerator Kp8
enumerator Kp9
enumerator Kp0
enumerator KpPeriod
enumerator NonUsBackslash

This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout.

enumerator Application

windows contextual menu, compose

enumerator Power

The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key.

enumerator KpEquals
enumerator F13
enumerator F14
enumerator F15
enumerator F16
enumerator F17
enumerator F18
enumerator F19
enumerator F20
enumerator F21
enumerator F22
enumerator F23
enumerator F24
enumerator Execute
enumerator Help

AL Integrated Help Center

enumerator Menu

Menu (show menu)

enumerator Select
enumerator Stop

AC Stop

enumerator Again

AC Redo/Repeat

enumerator Undo

AC Undo

enumerator Cut

AC Cut

enumerator Copy

AC Copy

enumerator Paste

AC Paste

enumerator Find

AC Find

enumerator Mute
enumerator VolumeUp
enumerator VolumeDown
enumerator KpComma
enumerator KpEqualsAs400
enumerator International1

used on Asian keyboards, see footnotes in USB doc

enumerator International2
enumerator International3

Yen

enumerator International4
enumerator International5
enumerator International6
enumerator International7
enumerator International8
enumerator International9
enumerator Lang1

Hangul/English toggle

enumerator Lang2

Hanja conversion

enumerator Lang3

Katakana

enumerator Lang4

Hiragana

enumerator Lang5

Zenkaku/Hankaku

enumerator Lang6

reserved

enumerator Lang7

reserved

enumerator Lang8

reserved

enumerator Lang9

reserved

enumerator AltErase

Erase-Eaze

enumerator SysReq
enumerator Cancel

AC Cancel

enumerator Clear
enumerator Prior
enumerator Return2
enumerator Separator
enumerator Out
enumerator Oper
enumerator ClearAgain
enumerator CrSel
enumerator ExSel
enumerator Kp00
enumerator Kp000
enumerator ThousandsSeparator
enumerator DecimalSeparator
enumerator CurrencyUnit
enumerator CurrencySubUnit
enumerator KpLeftParen
enumerator KpRightParen
enumerator KpLeftBrace
enumerator KpRightBrace
enumerator KpTab
enumerator KpBackspace
enumerator KpA
enumerator KpB
enumerator KpC
enumerator KpD
enumerator KpE
enumerator KpF
enumerator KpXor
enumerator KpPower
enumerator KpPercent
enumerator KpLess
enumerator KpGreater
enumerator KpAmpersand
enumerator KpDblAmpersand
enumerator KpVerticalBar
enumerator KpDblVerticalBar
enumerator KpColon
enumerator KpHash
enumerator KpSpace
enumerator KpAt
enumerator KpExclam
enumerator KpMemStore
enumerator KpMemRecall
enumerator KpMemClear
enumerator KpMemAdd
enumerator KpMemSubtract
enumerator KpMemMultiply
enumerator KpMemDivide
enumerator KpPlusMinus
enumerator KpClear
enumerator KpClearEntry
enumerator KpBinary
enumerator KpOctal
enumerator KpDecimal
enumerator KpHexadecimal
enumerator LCtrl
enumerator LShift
enumerator LAlt

alt, option

enumerator LGui

windows, command (apple), meta

enumerator RCtrl
enumerator RShift
enumerator RAlt

alt gr, option

enumerator RGui

windows, command (apple), meta

enumerator Mode

I’m not sure if this is really not covered by any of the above, but since there’s a special SDL_KMOD_MODE for it I’m adding it here

enumerator Sleep

Sleep

enumerator Wake

Wake

enumerator ChannelIncrement

Channel Increment

enumerator ChannelDecrement

Channel Decrement

enumerator MediaPlay

Play

enumerator MediaPause

Pause

enumerator MediaRecord

Record

enumerator MediaFastForward

Fast Forward

enumerator MediaRewind

Rewind

enumerator MediaNextTrack

Next Track

enumerator MediaPreviousTrack

Previous Track

enumerator MediaStop

Stop

enumerator MediaEject

Eject

enumerator MediaPlayPause

Play / Pause

enumerator MediaSelect
enumerator AcNew

AC New

enumerator AcOpen

AC Open

enumerator AcClose

AC Close

enumerator AcExit

AC Exit

enumerator AcSave

AC Save

enumerator AcPrint

AC Print

enumerator AcProperties

AC Properties

enumerator AcSearch

AC Search

enumerator AcHome

AC Home

enumerator AcBack

AC Back

enumerator AcForward

AC Forward

enumerator AcStop

AC Stop

enumerator AcRefresh

AC Refresh

enumerator AcBookmarks

AC Bookmarks

enumerator SoftLeft

Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display.

enumerator SoftRight

Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display.

enumerator Call

Used for accepting phone calls.

enumerator EndCall

Used for rejecting phone calls.

enumerator Reserved

400-500 reserved for dynamic keycodes

enumerator Count

not a key, just marks the number of scancodes for array bounds

namespace Mouse

Enums

Values:

enumerator ButtonLeft

Left mouse button.

enumerator ButtonMiddle

Middle mouse button.

enumerator ButtonRight

Right mouse button.

enumerator ButtonX1

Extra mouse button 1.

enumerator ButtonX2

Extra mouse button 2.

namespace Key

Enums

Values:

enumerator Unknown
enumerator A
enumerator B
enumerator C
enumerator D
enumerator E
enumerator F
enumerator G
enumerator H
enumerator I
enumerator J
enumerator K
enumerator L
enumerator M
enumerator N
enumerator O
enumerator P
enumerator Q
enumerator R
enumerator S
enumerator T
enumerator U
enumerator V
enumerator W
enumerator X
enumerator Y
enumerator Z
enumerator D1
enumerator D2
enumerator D3
enumerator D4
enumerator D5
enumerator D6
enumerator D7
enumerator D8
enumerator D9
enumerator D0
enumerator Return
enumerator Escape
enumerator Backspace
enumerator Tab
enumerator Space
enumerator Minus
enumerator Equals
enumerator LeftBracket
enumerator RightBracket
enumerator Backslash

Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout.

enumerator NonUsHash

ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I’ve seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards.

enumerator Semicolon
enumerator Apostrophe
enumerator Grave

Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards.

enumerator Comma
enumerator Period
enumerator Slash
enumerator CapsLock
enumerator F1
enumerator F2
enumerator F3
enumerator F4
enumerator F5
enumerator F6
enumerator F7
enumerator F8
enumerator F9
enumerator F10
enumerator F11
enumerator F12
enumerator PrintScreen
enumerator ScrollLock
enumerator Pause
enumerator Insert

insert on PC, help on some Mac keyboards (but does send code 73, not 117)

enumerator Home
enumerator PageUp
enumerator Delete
enumerator End
enumerator PageDown
enumerator Right
enumerator Left
enumerator Down
enumerator Up
enumerator NumLockClear

num lock on PC, clear on Mac keyboards

enumerator KpDivide
enumerator KpMultiply
enumerator KpMinus
enumerator KpPlus
enumerator KpEnter
enumerator Kp1
enumerator Kp2
enumerator Kp3
enumerator Kp4
enumerator Kp5
enumerator Kp6
enumerator Kp7
enumerator Kp8
enumerator Kp9
enumerator Kp0
enumerator KpPeriod
enumerator NonUsBackslash

This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout.

enumerator Application

windows contextual menu, compose

enumerator Power

The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key.

enumerator KpEquals
enumerator F13
enumerator F14
enumerator F15
enumerator F16
enumerator F17
enumerator F18
enumerator F19
enumerator F20
enumerator F21
enumerator F22
enumerator F23
enumerator F24
enumerator Execute
enumerator Help

AL Integrated Help Center

enumerator Menu

Menu (show menu)

enumerator Select
enumerator Stop

AC Stop

enumerator Again

AC Redo/Repeat

enumerator Undo

AC Undo

enumerator Cut

AC Cut

enumerator Copy

AC Copy

enumerator Paste

AC Paste

enumerator Find

AC Find

enumerator Mute
enumerator VolumeUp
enumerator VolumeDown
enumerator KpComma
enumerator KpEqualsAs400
enumerator International1

used on Asian keyboards, see footnotes in USB doc

enumerator International2
enumerator International3

Yen

enumerator International4
enumerator International5
enumerator International6
enumerator International7
enumerator International8
enumerator International9
enumerator Lang1

Hangul/English toggle

enumerator Lang2

Hanja conversion

enumerator Lang3

Katakana

enumerator Lang4

Hiragana

enumerator Lang5

Zenkaku/Hankaku

enumerator Lang6

reserved

enumerator Lang7

reserved

enumerator Lang8

reserved

enumerator Lang9

reserved

enumerator AltErase

Erase-Eaze

enumerator SysReq
enumerator Cancel

AC Cancel

enumerator Clear
enumerator Prior
enumerator Return2
enumerator Separator
enumerator Out
enumerator Oper
enumerator ClearAgain
enumerator CrSel
enumerator ExSel
enumerator Kp00
enumerator Kp000
enumerator ThousandsSeparator
enumerator DecimalSeparator
enumerator CurrencyUnit
enumerator CurrencySubUnit
enumerator KpLeftParen
enumerator KpRightParen
enumerator KpLeftBrace
enumerator KpRightBrace
enumerator KpTab
enumerator KpBackspace
enumerator KpA
enumerator KpB
enumerator KpC
enumerator KpD
enumerator KpE
enumerator KpF
enumerator KpXor
enumerator KpPower
enumerator KpPercent
enumerator KpLess
enumerator KpGreater
enumerator KpAmpersand
enumerator KpDblAmpersand
enumerator KpVerticalBar
enumerator KpDblVerticalBar
enumerator KpColon
enumerator KpHash
enumerator KpSpace
enumerator KpAt
enumerator KpExclam
enumerator KpMemStore
enumerator KpMemRecall
enumerator KpMemClear
enumerator KpMemAdd
enumerator KpMemSubtract
enumerator KpMemMultiply
enumerator KpMemDivide
enumerator KpPlusMinus
enumerator KpClear
enumerator KpClearEntry
enumerator KpBinary
enumerator KpOctal
enumerator KpDecimal
enumerator KpHexadecimal
enumerator LCtrl
enumerator LShift
enumerator LAlt

alt, option

enumerator LGui

windows, command (apple), meta

enumerator RCtrl
enumerator RShift
enumerator RAlt

alt gr, option

enumerator RGui

windows, command (apple), meta

enumerator Mode

I’m not sure if this is really not covered by any of the above, but since there’s a special SDL_KMOD_MODE for it I’m adding it here

enumerator Sleep

Sleep

enumerator Wake

Wake

enumerator ChannelIncrement

Channel Increment

enumerator ChannelDecrement

Channel Decrement

enumerator MediaPlay

Play

enumerator MediaPause

Pause

enumerator MediaRecord

Record

enumerator MediaFastForward

Fast Forward

enumerator MediaRewind

Rewind

enumerator MediaNextTrack

Next Track

enumerator MediaPreviousTrack

Previous Track

enumerator MediaStop

Stop

enumerator MediaEject

Eject

enumerator MediaPlayPause

Play / Pause

enumerator MediaSelect
enumerator AcNew

AC New

enumerator AcOpen

AC Open

enumerator AcClose

AC Close

enumerator AcExit

AC Exit

enumerator AcSave

AC Save

enumerator AcPrint

AC Print

enumerator AcProperties

AC Properties

enumerator AcSearch

AC Search

enumerator AcHome

AC Home

enumerator AcBack

AC Back

enumerator AcForward

AC Forward

enumerator AcStop

AC Stop

enumerator AcRefresh

AC Refresh

enumerator AcBookmarks

AC Bookmarks

enumerator SoftLeft

Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display.

enumerator SoftRight

Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display.

enumerator Call

Used for accepting phone calls.

enumerator EndCall

Used for rejecting phone calls.

enumerator Reserved

400-500 reserved for dynamic keycodes

enumerator Count

not a key, just marks the number of scancodes for array bounds