mitiru
Top-level engine surface. Entry-point helpers (`Run`), core configuration (`EngineConfig`), the game loop (`Game`), scenes (`Scene`, `MultiSceneManager`), the event bus, the localization manager, and other engine-wide primitives.
Top-level engine surface. Entry-point helpers (`Run`), core configuration (`EngineConfig`), the game loop (`Game`), scenes (`Scene`, `MultiSceneManager`), the event bus, the localization manager, and other engine-wide primitives.
Free functions and typedefs
inline void Run(Game& game, const EngineConfig& config = {})template <typename T> void Run(const char* title = "Mitiru Game", int width = 1280, int height = 720)class BinaryWriter 13
explicit BinaryWriter(const std::string& path)[[nodiscard]] bool isOpen() constvoid writeU8(uint8_t v)void writeU16(uint16_t v)void writeU32(uint32_t v)void writeI32(int32_t v)void writeF32(float v)void writeBool(bool v)void writeString(const std::string& s)void writeVec3(const float v[3])void writeRaw(const void* data, size_t size)[[nodiscard]] std::streampos beginBlock()void endBlock(std::streampos blockStart)class BinaryReader 13
explicit BinaryReader(const std::string& path)[[nodiscard]] bool isOpen() const[[nodiscard]] uint32_t version() const[[nodiscard]] uint8_t readU8()[[nodiscard]] uint16_t readU16()[[nodiscard]] uint32_t readU32()[[nodiscard]] int32_t readI32()[[nodiscard]] float readF32()[[nodiscard]] bool readBool()[[nodiscard]] std::string readString()void readVec3(float out[3])[[nodiscard]] uint32_t readBlockSize()void skip(uint32_t bytes)class Clock 8
explicit Clock(float targetTps = 60.0f, bool deterministic = false) noexcept[[nodiscard]] float tick() noexcept[[nodiscard]] std::uint64_t frameNumber() const noexcept[[nodiscard]] float elapsed() const noexcept[[nodiscard]] float targetTps() const noexcept[[nodiscard]] float fixedDt() const noexcept[[nodiscard]] bool isDeterministic() const noexceptvoid reset() noexceptstruct CommandResult 2
bool success = falsestd::string messagestruct ScriptLine 2
std::string rawint lineNumber = 0class CommandScript 12
using EchoHandler = std::function<void(const std::string&)>;using WaitHandler = std::function<void(float)>;bool loadFromFile(const std::string& path)void loadFromString(const std::string& text)[[nodiscard]] std::vector<CommandResult> execute(CommandSystem& cmdSystem)void setEchoHandler(EchoHandler handler)void setWaitHandler(WaitHandler handler)void setVariable(const std::string& name, const std::string& value)[[nodiscard]] std::string getVariable(const std::string& name) const[[nodiscard]] std::size_t lineCount() const noexcept[[nodiscard]] const std::string& sourcePath() const noexceptusing CommandArg = std::variant<std::monostate, bool, int, float, std::string>;struct CommandResult 6
bool success = truestd::string messagestd::vector<std::string> outputstatic CommandResult ok(const std::string& msg = {})static CommandResult ok(const std::string& msg, const std::vector<std::string>& lines)static CommandResult fail(const std::string& msg)struct CommandDef 8
std::string namestd::string categorystd::string descriptionstd::string usagestd::vector<std::string> argNamesstd::vector<std::string> argTypesstd::vector<bool> argRequiredstd::function<CommandResult(const std::vector<CommandArg>&)> executeclass CommandSystem 20
void registerCommand(const CommandDef& def)CommandResult execute(const std::string& name, const std::vector<CommandArg>& args = {})CommandResult executeString(const std::string& commandLine)[[nodiscard]] const std::vector<CommandDef>& commands() const noexcept[[nodiscard]] std::vector<const CommandDef*> commandsInCategory( const std::string& category) const[[nodiscard]] std::vector<std::string> categories() const[[nodiscard]] const CommandDef* findCommand(const std::string& name) const[[nodiscard]] std::vector<std::string> autocomplete(const std::string& prefix) const[[nodiscard]] std::vector<const CommandDef*> fuzzySearch(const std::string& query) constvoid pushHistory(const std::string& line)[[nodiscard]] const std::vector<std::string>& history() const noexceptvoid clearHistory() noexceptstd::vector<CommandResult> executeBatch(const std::string& multiLineScript)void beginRecording(const std::string& macroName)void endRecording()void playMacro(const std::string& macroName)[[nodiscard]] const std::vector<std::string>& getMacro(const std::string& name) const[[nodiscard]] std::vector<std::string> macroNames() const[[nodiscard]] bool isRecording() const noexcept[[nodiscard]] std::size_t commandCount() const noexceptenum Backend 8
AutoDx11Dx12VulkanOpenGLWebGLWebGPUNullenum DisplayMode 2
WindowedBorderlessFullscreenstruct EngineConfig 46
enum `FontAtlas : std::uint32_t` { None = 0, Ascii = 1u << 0, Hiragana = 1u << 1, Katakana = 1u << 2, CjkPunctuation = 1u << 3, Fullwidth = 1u << 4, CommonKanji = 1u << 5, Latin = Ascii, Kana = Ascii | Hiragana | Katakana, Japanese = Ascii | Hiragana | Katakana | CjkPunctuation | Fullwidth | CommonKanji }std::string title = "Mitiru Game"int windowWidth = 1920int windowHeight = 1080bool useLogicalWindowSize = falseDisplayMode displayMode = DisplayMode::Windowedbool vsync = trueint targetFps = 0bool headless = falsebool deterministic = falsestd::uint64_t randomSeed = 42float targetTps = 60.0fgfx::Backend gfxBackend = gfx::Backend::Autobool enableObserver = trueint observePort = 0bool enableDiffTracking = falsebool enableCausalTracking = falsebool enableTemporalValidation = falsebool enableUIValidation = falsebool enableHttpApi = falseint httpApiPort = 8090bool imguiVisibleOnStart = falsestd::string fontPathbool skipDefaultFont = falseFontAtlas fontAtlasRanges = FontAtlas::Japanesebool enableCef = truestd::string cefLogPathstd::string cefStartUrlint cefRemoteDebuggingPort = 0std::vector<std::string> cefAdditionalAssetDirsfloat masterVolume = 1.0ffloat bgmVolume = 0.8ffloat seVolume = 1.0ffloat voiceVolume = 1.0fstd::string language = "ja"std::map<std::string, int> keyBindingsbool persistSettings = falsestd::string settingsFileName = "settings.json"bool autoTestMode = falseint autoTestFrames = 60std::string autoTestOutputDir = "."bool autoTestExitAfter = true[[nodiscard]] inline std::string argString( const std::vector<CommandArg>& args, std::size_t idx, const std::string& defaultVal = {})[[nodiscard]] inline int argInt( const std::vector<CommandArg>& args, std::size_t idx, int defaultVal = 0)[[nodiscard]] inline float argFloat( const std::vector<CommandArg>& args, std::size_t idx, float defaultVal = 0.0f)[[nodiscard]] inline bool argBool( const std::vector<CommandArg>& args, std::size_t idx, bool defaultVal = false)class EngineCommands 1
static void registerAll(CommandSystem& cmd, Engine& engine)enum InputEventType : uint8_t 5
KeyDown = 0KeyUpMouseDownMouseUpMouseMoveenum AudioEventType : uint8_t 4
Play = 0StopPauseResumeenum GameStateEventType : uint8_t 7
Started = 0PausedResumedSavedLoadedCustomusing SubscriptionId = uint64_t;struct WindowResizeEvent 2
int width = 0int height = 0struct SceneChangeEvent 2
std::string fromScenestd::string toScenestruct InputEvent 4
InputEventType type = InputEventType::KeyDownint key = 0float mouseX = 0.0ffloat mouseY = 0.0fstruct AudioEvent 2
AudioEventType type = AudioEventType::Playint trackId = -1struct GameStateEvent 2
GameStateEventType type = GameStateEventType::Customstd::string dataclass EventBus 12
EventBus() = defaultEventBus(const EventBus&) = deleteEventBus& operator=(const EventBus&) = deleteEventBus(EventBus&&) = deleteEventBus& operator=(EventBus&&) = deletetemplate <typename EventType> SubscriptionId subscribe(std::function<void(const EventType&)> handler)void unsubscribe(SubscriptionId subscriptionId)template <typename EventType> void publish(const EventType& event)template <typename EventType> void publishDeferred(const EventType& event)void processDeferred()template <typename EventType> [[nodiscard]] std::size_t subscriberCount() constvoid clear()class FrameTimer 12
explicit FrameTimer( std::size_t smoothFrames = DEFAULT_SMOOTH_FRAMES, float maxDelta = DEFAULT_MAX_DELTA) noexcept[[nodiscard]] float tick() noexcept[[nodiscard]] float getFps() const noexcept[[nodiscard]] std::uint64_t getFrameCount() const noexcept[[nodiscard]] float getSmoothedDelta() const noexceptvoid setFixedDeltaTime(float dt) noexcept[[nodiscard]] float getFixedDeltaTime() const noexcept[[nodiscard]] float getAccumulator() const noexcept[[nodiscard]] bool consumeFixedStep() noexceptvoid setMaxDelta(float maxDelta) noexcept[[nodiscard]] float getMaxDelta() const noexceptvoid reset() noexceptstruct Size 3
int width = 0int height = 0[[nodiscard]] constexpr bool operator==(const Size&) const noexcept = defaultclass Game 16
virtual ~Game() = defaultvirtual void onExit()virtual void update(float dt) = 0virtual void draw(Screen& screen) = 0[[nodiscard]] virtual Size layout(int outsideWidth, int outsideHeight) = 0void setInputState(const InputState* input) noexceptvoid setRenderer3D(render::IRenderer3D* renderer) noexceptvoid setEngine(Engine* engine) noexcept[[nodiscard]] Engine* engine() noexcept[[nodiscard]] const Engine* engine() const noexcept[[nodiscard]] Scene& scene() noexcept[[nodiscard]] const Scene& scene() const noexceptbool loadScene(const std::string& path)bool saveScene(const std::string& path) consttemplate <typename UpdateFn, typename RenderFn, typename QuitFn> std::uint64_t runGameLoop( const GameLoopConfig& config, UpdateFn&& updateFn, RenderFn&& renderFn, QuitFn&& shouldQuitFn)template <typename UpdateFn, typename RenderFn> std::uint64_t runGameLoopFrames( const GameLoopConfig& config, std::uint64_t maxFrames, UpdateFn&& updateFn, RenderFn&& renderFn)struct GameLoopConfig 3
float targetFps = 60.0ffloat fixedDeltaTime = 1.0f / 60.0fint maxFrameSkip = 5class GamePlugin 21
other.m_handle = nullptrother.m_createFn = nullptrother.m_destroyFn = nullptrother.m_nameFn = nullptrother.m_loadTime = 0GamePlugin() = default~GamePlugin()GamePlugin(const GamePlugin&) = deleteGamePlugin& operator=(const GamePlugin&) = deleteGamePlugin(GamePlugin&& other) noexcept} GamePlugin& operator=(GamePlugin&& other) noexceptbool load(const std::string& path)void unload()bool reload()[[nodiscard]] Game* createGame()void destroyGame(Game* game)[[nodiscard]] std::string gameName() const[[nodiscard]] bool isLoaded() const noexcept[[nodiscard]] const std::string& dllPath() const noexcept[[nodiscard]] std::uint64_t lastModified() const[[nodiscard]] bool isModified() constclass GameSettings 3
[[nodiscard]] static std::filesystem::path resolvePath( const std::string& appName, const std::string& fileName = "settings.json")static bool loadInto(EngineConfig& config)static bool saveFrom(const EngineConfig& config)enum JobPriority 3
HighNormalLowclass JobHandle 3
JobHandle() noexcept[[nodiscard]] bool isComplete() const noexceptvoid wait() constclass JobSystem 16
JobSystem() noexcept = default~JobSystem()JobSystem(const JobSystem&) = deleteJobSystem& operator=(const JobSystem&) = deleteJobSystem(JobSystem&&) = deleteJobSystem& operator=(JobSystem&&) = deletevoid init(int threadCount = 0)[[nodiscard]] bool isInitialized() const noexcept[[nodiscard]] int threadCount() const noexcept[[nodiscard]] JobHandle schedule(std::function<void()> job, JobPriority priority = JobPriority::Normal)[[nodiscard]] JobHandle schedule(std::function<void()> job, const JobHandle& dependency, JobPriority priority = JobPriority::Normal)[[nodiscard]] JobHandle scheduleParallel( std::size_t itemCount, std::size_t batchSize, std::function<void(std::size_t, std::size_t)> func)void wait(const JobHandle& handle)[[nodiscard]] bool isComplete(const JobHandle& handle) const noexceptvoid shutdown()using TranslationTable = std::map<std::string, std::map<std::string, std::string>>;struct Language 3
std::string codestd::string namestd::string fontPathclass LocalizationManager 12
bool loadTranslationsFromString(std::string_view jsonString)bool loadTranslations(std::string_view jsonPath)void setLanguage(std::string_view code)[[nodiscard]] const std::string& currentLanguage() const noexcept[[nodiscard]] std::string t(std::string_view key) const[[nodiscard]] std::string t(std::string_view key, std::string_view language) const[[nodiscard]] bool hasKey(std::string_view key) const[[nodiscard]] const std::vector<Language>& availableLanguages() const noexcepttemplate <typename... Args> [[nodiscard]] std::string tf(std::string_view key, Args&&... args) const[[nodiscard]] std::string tp(std::string_view key, int count) const[[nodiscard]] std::string fontForLanguage(std::string_view code) const[[nodiscard]] const TranslationTable& translations() const noexceptstruct AllocationInfo 5
const void* ptr = nullptrstd::size_t size = 0std::string tagstd::uint64_t frameNumber = 0std::uint64_t timestamp = 0struct LeakInfo 4
const void* ptr = nullptrstd::size_t size = 0std::string tagstd::uint64_t frameNumber = 0struct MemoryBudget 2
std::size_t maxBytes = 0std::size_t currentBytes = 0class MemoryProfiler 18
explicit MemoryProfiler(std::size_t historySize = kDefaultHistorySize) noexceptvoid trackAllocation(const void* ptr, std::size_t size, const std::string& tag = "default")void trackDeallocation(const void* ptr)[[nodiscard]] std::size_t getCurrentUsage() const noexcept[[nodiscard]] std::size_t getPeakUsage() const noexcept[[nodiscard]] std::size_t getUsageByTag(const std::string& tag) const[[nodiscard]] std::vector<AllocationInfo> getAllocations() const[[nodiscard]] std::vector<LeakInfo> detectLeaks() constvoid setBudget(const std::string& tag, std::size_t maxBytes)[[nodiscard]] bool isOverBudget(const std::string& tag) constvoid advanceFrame() noexcept[[nodiscard]] std::vector<AllocationInfo> getHistory() const[[nodiscard]] std::uint64_t allocationCount() const noexcept[[nodiscard]] std::uint64_t deallocationCount() const noexcept[[nodiscard]] std::size_t activeAllocationCount() const noexcept[[nodiscard]] std::unordered_map<std::string, std::size_t> tagUsageMap() constvoid reset()void drawOverlay(Screen& screen) conststruct AppConfig 6
std::string windowTitle = "Mitiru Game"int width = 1280int height = 720gfx::Backend gfxBackend = gfx::Backend::Nullbool vsync = truefloat fixedTimestep = 1.0f / 60.0fclass IGameScene 5
virtual ~IGameScene() = defaultvirtual void onInit(MitiruApp& app) = 0virtual void onUpdate(float dt) = 0virtual void onDraw() = 0virtual void onShutdown() = 0class MitiruApp 16
explicit MitiruApp(const AppConfig& config = {})~MitiruApp() = defaultMitiruApp(const MitiruApp&) = deleteMitiruApp& operator=(const MitiruApp&) = deleteMitiruApp(MitiruApp&&) noexcept = defaultMitiruApp& operator=(MitiruApp&&) noexcept = default[[nodiscard]] bool init()void run(IGameScene& scene)void shutdown()[[nodiscard]] IWindow* getWindow() const noexcept[[nodiscard]] gfx::IDevice* getDevice() const noexcept[[nodiscard]] FrameTimer& getTimer() noexcept[[nodiscard]] const FrameTimer& getTimer() const noexcept[[nodiscard]] const AppConfig& getConfig() const noexceptvoid setWindow(IWindow* window) noexceptvoid setDevice(gfx::IDevice* device) noexceptstruct SceneEntry 5
std::string namestd::string filePathstd::unique_ptr<Scene> sceneSceneEntry() = defaultexplicit SceneEntry(const std::string& sceneName)class MultiSceneManager 20
int openScene(const std::string& name)void closeScene(int index)void setActiveScene(int index)[[nodiscard]] int activeSceneIndex() const noexcept[[nodiscard]] Scene& activeScene()[[nodiscard]] const Scene& activeScene() const[[nodiscard]] Scene* activeScenePtr() noexcept[[nodiscard]] Scene& sceneAt(int index)[[nodiscard]] const Scene& sceneAt(int index) const[[nodiscard]] int sceneCount() const noexcept[[nodiscard]] bool empty() const noexcept[[nodiscard]] const std::string& sceneName(int index) const[[nodiscard]] const std::string& scenePath(int index) constvoid renameScene(int index, const std::string& name)int duplicateScene(int index)[[nodiscard]] bool isSceneDirty(int index) constbool saveScene(int index, const std::string& path)int loadScene(const std::string& path)void saveAll(const std::string& dirPath)[[nodiscard]] int findByName(const std::string& name) conststruct NoLock 2
void lock() noexceptvoid unlock() noexceptstruct MutexLock 2
void lock()void unlock()class ObjectPool 12
explicit ObjectPool(std::size_t capacity)~ObjectPool()ObjectPool(const ObjectPool&) = deleteObjectPool& operator=(const ObjectPool&) = deleteObjectPool(ObjectPool&&) = deleteObjectPool& operator=(ObjectPool&&) = delete[[nodiscard]] T* acquire()void release(T* ptr) noexcept[[nodiscard]] bool owns(const T* ptr) const noexcept[[nodiscard]] std::size_t capacity() const noexcept[[nodiscard]] std::size_t available() const noexcept[[nodiscard]] std::size_t activeCount() const noexceptstruct PrefabDef 6
std::string namestd::string categorystd::string descriptionstd::vector<Node> nodes[[nodiscard]] std::size_t nodeCount() const noexcept[[nodiscard]] bool empty() const noexceptclass PrefabLibrary 17
void registerPrefab(PrefabDef def)void createFromNode(const Scene& scene, int nodeId, const std::string& name, const std::string& category = "")int instantiate(Scene& scene, const std::string& prefabName, int parentId = -1) const[[nodiscard]] bool hasPrefab(const std::string& name) const[[nodiscard]] const PrefabDef* getPrefab(const std::string& name) const[[nodiscard]] std::vector<std::string> prefabNames() const[[nodiscard]] std::vector<std::string> prefabsInCategory( const std::string& category) const[[nodiscard]] std::vector<std::string> categories() const[[nodiscard]] std::size_t count() const noexceptvoid removePrefab(const std::string& name)void clear()[[nodiscard]] std::string toJson(const std::string& prefabName) const[[nodiscard]] std::string toJsonAll() constbool saveToFile(const std::string& prefabName, const std::string& path) constvoid saveAllToFile(const std::string& dirPath) constvoid loadFromJson(const std::string& json)void loadFromFile(const std::string& path)class Random 13
explicit Random(uint32_t seed = 42) noexceptvoid setSeed(uint32_t seed) noexcept[[nodiscard]] uint32_t next() noexcept[[nodiscard]] int nextInt(int min, int max) noexcept[[nodiscard]] float nextFloat(float min = 0.0f, float max = 1.0f) noexcept[[nodiscard]] bool nextBool(float probability = 0.5f) noexcept[[nodiscard]] int pick(int size) noexceptusing TraitJson = nlohmann::json;using SceneDocument = Scene;using SceneNodeData = Node;inline TraitJson parseTraitJson(const std::string& s) noexceptinline void readFloatArray(const TraitJson& j, const char* key, float* out, int count)inline TraitJson floatArray(const float* in, int count)struct ITrait 4
virtual ~ITrait() = default[[nodiscard]] virtual std::string traitType() const = 0[[nodiscard]] virtual std::string toJson() const = 0virtual void fromJson(const std::string& json) = 0struct MeshTrait : ITrait 5
std::string meshPathstd::string materialName[[nodiscard]] std::string traitType() const override[[nodiscard]] std::string toJson() const overridevoid fromJson(const std::string& json) overridestruct LightTrait : ITrait 7
std::string lightType = "directional"float intensity = 1.0ffloat range = 10.0ffloat spotAngle = 45.0f[[nodiscard]] std::string traitType() const override[[nodiscard]] std::string toJson() const overridevoid fromJson(const std::string& json) overridestruct CameraTrait : ITrait 6
float fov = 60.0ffloat nearClip = 0.1ffloat farClip = 1000.0f[[nodiscard]] std::string traitType() const override[[nodiscard]] std::string toJson() const overridevoid fromJson(const std::string& json) overridestruct PhysicsTrait : ITrait 11
std::string bodyType = "dynamic"float mass = 1.0ffloat friction = 0.5ffloat restitution = 0.3fstd::string colliderType = "box"bool isTrigger = falseint collisionLayer = 0int collisionMask = 0x7FFFFFFF[[nodiscard]] std::string traitType() const override[[nodiscard]] std::string toJson() const overridevoid fromJson(const std::string& json) overridestruct ScriptTrait : ITrait 5
std::string scriptPathstd::map<std::string, std::string> variables[[nodiscard]] std::string traitType() const override[[nodiscard]] std::string toJson() const overridevoid fromJson(const std::string& json) overridestruct AudioTrait : ITrait 7
std::string audioPathfloat volume = 1.0fbool loop = falsebool spatial = false[[nodiscard]] std::string traitType() const override[[nodiscard]] std::string toJson() const overridevoid fromJson(const std::string& json) overridestruct CustomTrait : ITrait 5
std::string customTypestd::map<std::string, std::string> properties[[nodiscard]] std::string traitType() const override[[nodiscard]] std::string toJson() const overridevoid fromJson(const std::string& ) overridestruct Node 20
int id = -1std::string nameint parentId = -1bool visible = truebool locked = falsestd::vector<std::shared_ptr<ITrait>> traitstemplate<typename T> [[nodiscard]] T* getTrait()template<typename T> [[nodiscard]] const T* getTrait() consttemplate<typename T, typename... Args> T& addTrait(Args&&... args)template<typename T> [[nodiscard]] bool hasTrait() constvoid removeTrait(const std::string& traitTypeName)[[nodiscard]] std::string type() const[[nodiscard]] std::string meshPath() const[[nodiscard]] std::string materialName() const[[nodiscard]] std::string lightType() const[[nodiscard]] const float* lightColor() const[[nodiscard]] float* lightColor()[[nodiscard]] float lightIntensity() const[[nodiscard]] const std::map<std::string, std::string>& properties() const[[nodiscard]] std::map<std::string, std::string>& propertiesMut()class Scene 28
int addNode(const std::string& name, int parent = -1)int addNode(const Node& node)void removeNode(int id)[[nodiscard]] Node* getNode(int id)[[nodiscard]] const Node* getNode(int id) const[[nodiscard]] const std::vector<Node>& nodes() const noexcept[[nodiscard]] std::size_t nodeCount() const noexcept[[nodiscard]] int findByName(const std::string& name) const[[nodiscard]] std::vector<int> findByTrait(const std::string& traitTypeName) const[[nodiscard]] std::vector<int> findByType(const std::string& typeName) const[[nodiscard]] std::vector<int> rootNodes() const[[nodiscard]] std::vector<int> children(int parentId) constint duplicateNode(int id)int createEmpty(const std::string& name, int parent = -1)int addMesh(const std::string& name, const std::string& meshPath, int parent = -1)int addLight(const std::string& name, const std::string& lt = "directional", int parent = -1)int addCamera(const std::string& name, int parent = -1)int createMesh(const std::string& name, const std::string& meshPath, int parent = -1)int createLight(const std::string& name, const std::string& lt, int parent = -1)int createCamera(const std::string& name, int parent = -1)[[nodiscard]] std::string toJson() constbool fromJson(const std::string& json)bool saveToFile(const std::string& path) constbool loadFromFile(const std::string& path)[[nodiscard]] bool isDirty() const noexceptvoid clearDirty() noexcept[[nodiscard]] std::string snapshot() constvoid restore(const std::string& snap)enum JsonType : std::uint8_t 14
NullBoolIntFloatStringArrayObjecttemplate <> inline bool JsonReader::read<bool>(const std::string& key, const bool& def) consttemplate <> inline int JsonReader::read<int>(const std::string& key, const int& def) consttemplate <> inline float JsonReader::read<float>(const std::string& key, const float& def) consttemplate <> inline std::string JsonReader::read<std::string>(const std::string& key, const std::string& def) consttemplate <> inline sgc::Vec2f JsonReader::read<sgc::Vec2f>(const std::string& key, const sgc::Vec2f& def) consttemplate <> inline sgc::Colorf JsonReader::read<sgc::Colorf>(const std::string& key, const sgc::Colorf& def) consttemplate <> inline sgc::Rectf JsonReader::read<sgc::Rectf>(const std::string& key, const sgc::Rectf& def) constclass JsonValue 23
JsonValue() = defaultexplicit JsonValue(bool v)explicit JsonValue(int v)explicit JsonValue(float v)explicit JsonValue(double v)explicit JsonValue(std::string v)explicit JsonValue(std::string_view v)explicit JsonValue(const char* v)[[nodiscard]] JsonType type() const noexcept[[nodiscard]] bool isNull() const noexcept[[nodiscard]] bool asBool(bool def = false) const noexcept[[nodiscard]] int asInt(int def = 0) const noexcept[[nodiscard]] float asFloat(float def = 0.0f) const noexcept[[nodiscard]] const std::string& asString(const std::string& def = s_empty) const noexceptvoid pushBack(JsonValue val)[[nodiscard]] std::size_t arraySize() const noexcept[[nodiscard]] const JsonValue& at(std::size_t index) const[[nodiscard]] const std::vector<JsonValue>& asArray() const noexceptvoid set(const std::string& key, JsonValue val)[[nodiscard]] bool has(const std::string& key) const[[nodiscard]] const JsonValue& get(const std::string& key) const[[nodiscard]] const std::unordered_map<std::string, JsonValue>& asObject() const noexcept[[nodiscard]] std::string toJson(int indent = 0) constclass JsonWriter 18
JsonWriter() = defaultvoid beginObject()void endObject()void beginArray(const std::string& key)void endArray()void write(const std::string& key, bool value)void write(const std::string& key, int value)void write(const std::string& key, float value)void write(const std::string& key, const std::string& value)void write(const std::string& key, std::string_view value)void write(const std::string& key, const sgc::Vec2f& v)void writeVec3(const std::string& key, float x, float y, float z)void write(const std::string& key, const sgc::Colorf& c)void write(const std::string& key, const sgc::Rectf& r)template <typename T> void writeVector(const std::string& key, const std::vector<T>& vec)template <typename T> void writeMap(const std::string& key, const std::unordered_map<std::string, T>& map)[[nodiscard]] const JsonValue& root() const noexcept[[nodiscard]] std::string toJson(int indent = 2) constclass JsonReader 16
explicit JsonReader(const JsonValue& value)[[nodiscard]] bool has(const std::string& key) const[[nodiscard]] bool readBool(const std::string& key, bool def = false) const[[nodiscard]] int readInt(const std::string& key, int def = 0) const[[nodiscard]] float readFloat(const std::string& key, float def = 0.0f) const[[nodiscard]] std::string readString(const std::string& key, const std::string& def = "") const[[nodiscard]] sgc::Vec2f readVec2(const std::string& key, const sgc::Vec2f& def = {}) const[[nodiscard]] sgc::Colorf readColor(const std::string& key, const sgc::Colorf& def = {1.0f, 1.0f, 1.0f, 1.0f}) const[[nodiscard]] sgc::Rectf readRect(const std::string& key, const sgc::Rectf& def = {}) const[[nodiscard]] std::vector<int> readIntVector(const std::string& key) const[[nodiscard]] std::vector<float> readFloatVector(const std::string& key) const[[nodiscard]] std::vector<std::string> readStringVector(const std::string& key) const[[nodiscard]] std::unordered_map<std::string, std::string> readStringMap( const std::string& key) consttemplate <typename T> [[nodiscard]] T read(const std::string& key, const T& def = T{}) const[[nodiscard]] JsonReader subReader(const std::string& key) const[[nodiscard]] const JsonValue& value() const noexceptclass ISerializable 3
virtual ~ISerializable() = defaultvirtual void serialize(JsonWriter& writer) const = 0virtual void deserialize(JsonReader& reader) = 0class SerializationRegistry 7
using FactoryFunc = std::function<std::unique_ptr<ISerializable>()>;[[nodiscard]] static SerializationRegistry& instance()template <typename T> void registerType(const std::string& name)void registerFactory(const std::string& name, FactoryFunc factory)[[nodiscard]] std::unique_ptr<ISerializable> createFromJson( const std::string& name, const JsonValue& json) const[[nodiscard]] bool isRegistered(const std::string& name) constvoid clear()class ServiceRegistry 12
ServiceRegistry() = defaultServiceRegistry(const ServiceRegistry&) = deleteServiceRegistry& operator=(const ServiceRegistry&) = deleteServiceRegistry(ServiceRegistry&&) = deleteServiceRegistry& operator=(ServiceRegistry&&) = deletetemplate <typename T> void registerService(std::shared_ptr<T> service)template <typename T> [[nodiscard]] T* get() consttemplate <typename T> [[nodiscard]] bool has() consttemplate <typename T> bool unregister()void clear()[[nodiscard]] std::size_t size() const[[nodiscard]] bool empty() constclass Signal 132
using Slot = std::function<void(Args...)>;using SlotId = uint32_t;SlotId connect(Slot slot)void disconnect(SlotId id)void disconnectAll()void emit(Args... args) const[[nodiscard]] int connectionCount() const noexceptMITIRU_INLINE mitiru::Engine::~Engine()MITIRU_INLINE CefContext* mitiru::Engine::cefContext() noexceptMITIRU_INLINE void mitiru::Engine::setWorld(ecs::MitiruWorld* world) noexceptMITIRU_INLINE void mitiru::Engine::setSceneManager(scene::MitiruSceneManager* mgr) noexceptMITIRU_INLINE mitiru::audio::IAudioEngine* mitiru::Engine::audioEngine() noexceptMITIRU_INLINE float mitiru::Engine::masterVolume() const noexceptMITIRU_INLINE float mitiru::Engine::bgmVolume() const noexceptMITIRU_INLINE float mitiru::Engine::seVolume() const noexceptMITIRU_INLINE float mitiru::Engine::voiceVolume() const noexceptMITIRU_INLINE const mitiru::EngineConfig& mitiru::Engine::config() const noexceptMITIRU_INLINE mitiru::EngineConfig& mitiru::Engine::mutableConfig() noexceptMITIRU_INLINE void mitiru::Engine::setTemporalChecker(validate::TemporalInvariantChecker* checker) noexceptMITIRU_INLINE void mitiru::Engine::setDiffTracker(observe::StructuredDiff* tracker) noexceptMITIRU_INLINE void mitiru::Engine::setCausalChain(observe::CausalChain* chain) noexceptMITIRU_INLINE mitiru::render::PostProcessManager* mitiru::Engine::postProcess() noexceptMITIRU_INLINE const mitiru::render::PostProcessManager* mitiru::Engine::postProcess() const noexceptMITIRU_INLINE void mitiru::Engine::requestStop() noexceptMITIRU_INLINE std::uint64_t mitiru::Engine::frameNumber() const noexceptMITIRU_INLINE mitiru::InputInjector& mitiru::Engine::inputInjector() noexceptMITIRU_INLINE const mitiru::InputState& mitiru::Engine::inputState() const noexceptMITIRU_INLINE const mitiru::Screen* mitiru::Engine::screen() const noexceptMITIRU_INLINE mitiru::Screen* mitiru::Engine::screen() noexceptMITIRU_INLINE mitiru::server::EngineHttpServer* mitiru::Engine::httpServer() noexceptMITIRU_INLINE void mitiru::Engine::setCommandSystem(CommandSystem* cmd) noexceptMITIRU_INLINE const mitiru::Clock* mitiru::Engine::clock() const noexceptMITIRU_INLINE void mitiru::Engine::setGameFlag(const std::string& key, const std::string& value)MITIRU_INLINE std::string mitiru::Engine::getGameFlag(const std::string& key) constMITIRU_INLINE float mitiru::Engine::clampVol(float v) noexceptMITIRU_INLINE void mitiru::Engine::saveBmp(const std::string& path, const std::vector<std::uint8_t>& pixels, int w, int h)MITIRU_INLINE void mitiru::Engine::savePng(const std::string& path, const std::vector<std::uint8_t>& pixels, int w, int h)MITIRU_INLINE void mitiru::Engine::setAudioEngine(std::shared_ptr<audio::IAudioEngine> engine) noexceptMITIRU_INLINE void mitiru::Engine::setMasterVolume(float v) noexceptMITIRU_INLINE void mitiru::Engine::setBgmVolume(float v) noexceptMITIRU_INLINE void mitiru::Engine::setSeVolume(float v) noexceptMITIRU_INLINE void mitiru::Engine::setVoiceVolume(float v) noexceptMITIRU_INLINE void mitiru::Engine::applyVolumes() noexceptMITIRU_INLINE void mitiru::Engine::saveAutoTestScreenshot(const std::string& outputDir)MITIRU_INLINE void mitiru::Engine::saveAutoTestReport( const std::string& outputDir, const EngineConfig& config)MITIRU_INLINE void mitiru::Engine::initializeCef(const EngineConfig& config)MITIRU_INLINE std::vector<std::uint8_t> mitiru::Engine::capture() constMITIRU_INLINE void mitiru::Engine::tickOneFrame()MITIRU_INLINE bool mitiru::Engine::tickInputPollPhase()MITIRU_INLINE void mitiru::Engine::tickMouseScalingPhase()MITIRU_INLINE void mitiru::Engine::tickFixedUpdatePhase()MITIRU_INLINE void mitiru::Engine::tickRenderPhase()MITIRU_INLINE void mitiru::Engine::tickPresentPhase()MITIRU_INLINE void mitiru::Engine::tickCefComposite()MITIRU_INLINE bool mitiru::Engine::tickAutoCaptureAndEndFrame()MITIRU_INLINE void mitiru::Engine::tickHttpPollAndCap( const std::chrono::steady_clock::time_point& frameStart)MITIRU_INLINE void mitiru::Engine::initHttpServer(int port, Game& game)MITIRU_INLINE void mitiru::Engine::initFont(const std::string& userPath)MITIRU_INLINE void mitiru::Engine::initSdfFont(std::vector<std::uint8_t> fontData)MITIRU_INLINE void mitiru::Engine::applyInjectedInput()MITIRU_INLINE void mitiru::Engine::initialize(const EngineConfig& config)MITIRU_INLINE void mitiru::Engine::createRenderPipeline(int screenWidth, int screenHeight)MITIRU_INLINE void mitiru::Engine::onWindowResize(int w, int h)MITIRU_INLINE void mitiru::Engine::syncViewport()MITIRU_INLINE void mitiru::Engine::create3DRenderer(int screenWidth, int screenHeight)MITIRU_INLINE void mitiru::Engine::run(Game& game, const EngineConfig& configIn)MITIRU_INLINE void mitiru::Engine::stepFrames( Game& game, std::uint64_t frameCount, const EngineConfig& config)MITIRU_INLINE std::vector<std::uint8_t> mitiru::Engine::runAndCapture( Game& game, int frameCount, const EngineConfig& config)MITIRU_INLINE bool mitiru::Engine::saveSettings() noexceptMITIRU_INLINE void mitiru::Engine::persistIfEnabled() noexceptMITIRU_INLINE std::string mitiru::Engine::snapshot() constMITIRU_INLINE void mitiru::Engine::setFullscreen(bool enable) noexceptMITIRU_INLINE bool mitiru::Engine::isFullscreen() const noexceptinline void mitiru::Screen::drawGradientRectH(const sgc::Rectf& rect, const sgc::Colorf& leftColor, const sgc::Colorf& rightColor)inline void mitiru::Screen::drawGradientRect4(const sgc::Rectf& rect, const sgc::Colorf& topLeft, const sgc::Colorf& topRight, const sgc::Colorf& bottomRight, const sgc::Colorf& bottomLeft)inline void mitiru::Screen::drawRectRotated(const sgc::Rectf& rect, const sgc::Colorf& color, float angleDeg)inline void mitiru::Screen::drawGradientRect(const sgc::Rectf& rect, const sgc::Colorf& topColor, const sgc::Colorf& bottomColor)inline void mitiru::Screen::drawRectPattern(const sgc::Rectf& rect, PatternType pattern, float cellSize, const sgc::Colorf& color1, const sgc::Colorf& color2)inline void mitiru::Screen::drawInnerShadow(const sgc::Rectf& rect, const sgc::Colorf& shadowColor, float blurSize, float offsetX, float offsetY)inline void mitiru::Screen::drawFrostedRect(const sgc::Rectf& rect, const sgc::Colorf& tintColor, int layers)inline void mitiru::Screen::drawRectPerspective(const sgc::Rectf& rect, const sgc::Colorf& color, bool vanishTop, float strength)inline void mitiru::Screen::drawRectPerspectiveGradient(const sgc::Rectf& rect, const sgc::Colorf& topColor, const sgc::Colorf& bottomColor, bool vanishTop, float strength)inline void mitiru::Screen::setPipeline(render::RenderPipeline2D* pipeline) noexceptinline void mitiru::Screen::setValidator(validate::DrawCallValidator* validator) noexceptinline void mitiru::Screen::clear(const sgc::Colorf& color)inline void mitiru::Screen::renderUI(const ui::UINode& root, const ui::UITheme& theme)inline void mitiru::Screen::resetDrawCallCount() noexceptinline void mitiru::Screen::resize(int width, int height) noexceptinline void mitiru::Screen::present()inline void mitiru::Screen::pushClipRect(const sgc::Rectf& rect)inline void mitiru::Screen::popClipRect()inline void mitiru::Screen::setBlendMode(gfx::BlendMode mode)inline void Screen::drawPixelGrid( const sgc::Rectf& dest, const std::uint32_t* pixels, int pixelWidth, int pixelHeight)inline void Screen::drawPixelGrid( const sgc::Rectf& dest, const std::uint32_t* pixels, int pixelWidth, int pixelHeight, render::PixelArtFilter filter)inline void mitiru::Screen::drawZigzagEdge(const sgc::Rectf& rect, const render::ZigzagStyle& zs)inline void mitiru::Screen::drawScanlines(const sgc::Rectf& rect, float lineHeight, const sgc::Colorf& color)inline void mitiru::Screen::drawDashedLine(const sgc::Vec2f& from, const sgc::Vec2f& to, float thickness, float dashLen, float gapLen, const sgc::Colorf& color)inline void mitiru::Screen::drawRect(const sgc::Rectf& rect, const sgc::Colorf& color)inline void mitiru::Screen::drawRectFrame(const sgc::Rectf& rect, const sgc::Colorf& color, float thickness)inline void mitiru::Screen::drawRoundedRect(const sgc::Rectf& rect, const sgc::Colorf& color, float radius)inline void mitiru::Screen::drawRoundedRectFrame(const sgc::Rectf& rect, const sgc::Colorf& color, float radius, float thickness)inline void mitiru::Screen::drawPie(const sgc::Vec2f& center, float radius, float startAngle, float endAngle, const sgc::Colorf& color)inline void mitiru::Screen::drawArc(const sgc::Vec2f& center, float radius, float startAngle, float endAngle, const sgc::Colorf& color, float thickness)inline void mitiru::Screen::drawTriangle(const sgc::Vec2f& p0, const sgc::Vec2f& p1, const sgc::Vec2f& p2, const sgc::Colorf& color)inline void mitiru::Screen::drawCircle(const sgc::Vec2f& center, float radius, const sgc::Colorf& color)inline void mitiru::Screen::drawLine(const sgc::Vec2f& from, const sgc::Vec2f& to, const sgc::Colorf& color, float thickness)inline void mitiru::Screen::drawPolygon(const std::vector<sgc::Vec2f>& points, const sgc::Colorf& color)inline void mitiru::Screen::drawEllipse(const sgc::Vec2f& center, float radiusX, float radiusY, const sgc::Colorf& color)inline void mitiru::Screen::drawRing(const sgc::Vec2f& center, float outerRadius, float innerRadius, const sgc::Colorf& color)inline void mitiru::Screen::drawRoundedRect4(const sgc::Rectf& rect, const sgc::Colorf& color, float tl, float tr, float br, float bl)inline void mitiru::Screen::drawCircleFrame(const sgc::Vec2f& center, float radius, const sgc::Colorf& color, float thickness)inline void mitiru::Screen::drawSprite(const render::Texture& texture, const sgc::Rectf& dstRect)inline void mitiru::Screen::drawSprite(const render::Texture& texture, const sgc::Rectf& dstRect, const sgc::Colorf& tintColor)inline void mitiru::Screen::setTrueTypeFont(void* font, TtDrawFunc drawFn, TtMeasureFunc measureFn) noexceptinline void mitiru::Screen::setSdfFont(void* font, SdfDrawFunc drawFn, SdfMeasureFunc measureFn) noexceptinline void mitiru::Screen::clearSdfFont() noexceptinline void mitiru::Screen::registerFont(const std::string& name, void* font, TtDrawFunc drawFn, TtMeasureFunc measureFn)inline void mitiru::Screen::setFont(const std::string& name)inline void mitiru::Screen::drawText(const sgc::Vec2f& position, std::string_view text, const sgc::Colorf& color, float fontSize)inline void mitiru::Screen::drawTextClipped(const sgc::Rectf& rect, std::string_view text, const sgc::Colorf& color, float fontSize, float padX, float padY)inline void mitiru::Screen::drawTextInRect(const sgc::Rectf& rect, std::string_view text, const sgc::Colorf& color, float fontSize, TextAlignH alignH, TextAlignV alignV, float padX, float padY)inline void mitiru::Screen::drawTextWrapped(const sgc::Rectf& rect, std::string_view text, const sgc::Colorf& color, float fontSize, float padX, float padY, float lineSpacing)inline void mitiru::Screen::drawTextHQ(const sgc::Vec2f& position, std::string_view text, const sgc::Colorf& color, float fontSize)inline void mitiru::Screen::drawTextWithShadow(const sgc::Rectf& rect, std::string_view text, const sgc::Colorf& color, float fontSize, const sgc::Colorf& shadowColor, float shadowOffsetX, float shadowOffsetY, TextAlignH alignH, TextAlignV alignV)inline void mitiru::Screen::drawTextOutlined(const sgc::Rectf& rect, std::string_view text, const sgc::Colorf& color, const sgc::Colorf& outlineColor, float outlineWidth, float fontSize, TextAlignH alignH, TextAlignV alignV)inline void mitiru::Screen::drawTextStrikethrough(const sgc::Rectf& rect, std::string_view text, const sgc::Colorf& color, float fontSize, TextAlignH alignH, TextAlignV alignV)inline void mitiru::Screen::drawTextBold(const sgc::Rectf& rect, std::string_view text, const sgc::Colorf& color, float fontSize, TextAlignH alignH, TextAlignV alignV)inline void mitiru::Screen::drawTextSpaced(const sgc::Vec2f& position, std::string_view text, const sgc::Colorf& color, float fontSize, float letterSpacing)inline void mitiru::Screen::pushTransform(float tx, float ty, float sx, float sy)inline void mitiru::Screen::pushTransform(const Transform2D& t)inline void mitiru::Screen::pushRotation(float rad, float pivotX, float pivotY)inline void mitiru::Screen::popTransform()class FrameBudget 15
enum `Category : std::uint8_t` { Render, Physics, Audio, Script, UI, Other, Count }FrameBudget() noexceptvoid beginFrame()void beginCategory(Category cat)void endCategory()void endFrame()[[nodiscard]] float totalFrameMs() const noexcept[[nodiscard]] float categoryMs(Category cat) const noexcept[[nodiscard]] float budgetUsagePercent() const noexcept[[nodiscard]] bool isOverlayVisible() const noexceptvoid toggleOverlay() noexceptvoid setOverlayVisible(bool visible) noexceptvoid drawOverlay(Screen& screen, float x, float y, float w, float h) const[[nodiscard]] static constexpr std::string_view categoryName(Category cat) noexcept[[nodiscard]] static constexpr sgc::Colorf categoryColor(Category cat) noexceptclass FrameBudgetScope 6
FrameBudgetScope(FrameBudget& budget, FrameBudget::Category cat) noexcept~FrameBudgetScope()FrameBudgetScope(const FrameBudgetScope&) = deleteFrameBudgetScope& operator=(const FrameBudgetScope&) = deleteFrameBudgetScope(FrameBudgetScope&&) = deleteFrameBudgetScope& operator=(FrameBudgetScope&&) = deletestruct LogEntry 5
LogLevel level = LogLevel::Infostd::string messagedouble timestamp = 0.0std::string sourcestd::string categoryclass LogViewer 19
explicit LogViewer(std::size_t maxEntries = 1000)void addEntry(const LogEntry& entry)void addEntry(LogLevel level, std::string_view category, std::string_view message, double timestamp = 0.0)void clear()[[nodiscard]] std::size_t entryCount() constvoid setMinLevel(LogLevel level) noexceptvoid setCategoryFilter(std::string_view category)void setTextFilter(std::string_view text)void toggleVisible() noexceptvoid setCollapsed(bool collapsed) noexcept[[nodiscard]] bool isCollapsed() const noexceptvoid setVisible(bool visible) noexcept[[nodiscard]] bool isVisible() const noexceptvoid setAutoScroll(bool autoScroll) noexceptvoid scrollUp(int lines = 1)void scrollDown(int lines = 1)void setMaxEntries(std::size_t max)[[nodiscard]] std::string copyToClipboard() constvoid drawOverlay(Screen& screen) conststruct FrameBreakdown 8
float totalMs = 0.0ffloat renderMs = 0.0ffloat physicsMs = 0.0ffloat audioMs = 0.0ffloat inputMs = 0.0ffloat uiMs = 0.0ffloat otherMs = 0.0f[[nodiscard]] std::string toJson() conststruct MemoryBreakdown 6
float totalMB = 0.0ffloat texturesMB = 0.0ffloat meshesMB = 0.0ffloat audioMB = 0.0ffloat uiMB = 0.0f[[nodiscard]] std::string toJson() constclass ScopeTimer 6
explicit ScopeTimer(float& targetMs) noexcept~ScopeTimer()ScopeTimer(const ScopeTimer&) = deleteScopeTimer& operator=(const ScopeTimer&) = deleteScopeTimer(ScopeTimer&&) = deleteScopeTimer& operator=(ScopeTimer&&) = deleteclass ProfilerConnection 15
using HttpHandler = std::function<std::string()>;explicit ProfilerConnection(std::size_t historySize = 120) noexceptvoid connect(Engine& engine)void registerHttpEndpoint(server::EngineHttpServer* httpServer)void setAudioMixer(audio::AudioMixer* mixer) noexceptvoid beginFrame()void endFrame()[[nodiscard]] FrameBreakdown& currentFrame() noexcept[[nodiscard]] const FrameBreakdown& frameBreakdown() const noexcept[[nodiscard]] MemoryBreakdown getMemoryBreakdown() constvoid setEstimatedCounts(int textureCount, int meshCount, int audioChannels, int uiNodeCount) noexcept[[nodiscard]] const ProfilerOverlay& overlay() const noexcept[[nodiscard]] std::uint64_t frameCount() const noexcept[[nodiscard]] std::string toApiJson() const[[nodiscard]] HttpHandler getApiHandler() conststruct SectionTiming 8
std::string namefloat durationMs = 0.0ffloat minMs = 1e9ffloat maxMs = 0.0ffloat avgMs = 0.0ffloat totalMs = 0.0fstd::uint32_t sampleCount = 0int depth = 0struct FrameData 2
float frameDurationMs = 0.0fstd::vector<SectionTiming> sectionsclass ProfilerGUI 16
enum `OverlayPosition : std::uint8_t` { TopLeft, TopRight, BottomLeft, BottomRight }explicit ProfilerGUI(std::size_t historySize = 300)void beginFrame()void endFrame()void beginSection(std::string_view name)void endSection()[[nodiscard]] FrameData getFrameData() constvoid drawOverlay(Screen& screen) constvoid drawDetailed(Screen& screen) constvoid setVisible(bool visible) noexcept[[nodiscard]] bool isVisible() const noexceptvoid setOverlayPosition(OverlayPosition pos) noexceptvoid setTransparency(float alpha) noexceptvoid setTopNSections(int n) noexceptvoid reset()inline void mitiru::effects::ColorFlash::draw(Screen& screen) constclass ColorFlash 6
void flash(const sgc::Colorf& color, float duration = 0.2f)void update(float dt)void draw(Screen& screen) const[[nodiscard]] bool isActive() const noexcept[[nodiscard]] float progress() const noexcept[[nodiscard]] float currentAlpha() const noexceptenum FadeDirection 3
InOutinline void mitiru::effects::Fade::draw(Screen& screen) constclass Fade 9
void fadeIn(float duration = 1.0f, const sgc::Colorf& color = {0, 0, 0, 1})void fadeOut(float duration = 1.0f, const sgc::Colorf& color = {0, 0, 0, 1})void update(float dt)void draw(Screen& screen) const[[nodiscard]] bool isComplete() const noexcept[[nodiscard]] bool isActive() const noexcept[[nodiscard]] float progress() const noexcept[[nodiscard]] FadeDirection direction() const noexceptinline void mitiru::effects::Trail::draw( Screen& screen, const sgc::Colorf& color, float thickness) conststruct TrailPoint 2
sgc::Vec2f positionfloat age = 0class Trail 9
int maxPoints = 50float lifetime = 0.5fvoid addPoint(const sgc::Vec2f& pos)void update(float dt)void draw(Screen& screen, const sgc::Colorf& color, float thickness = 2.0f) const[[nodiscard]] int pointCount() const noexceptvoid clear()[[nodiscard]] const std::vector<TrailPoint>& points() const noexcept#pragma once #ifdef _WIN32 #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #ifndef NOMINMAX #define NOMINMAX #endif #include <Windows.h> #include <Xinput.h> #pragma comment(lib, "xinput.lib") #include <algorithm> #include <array> #include <cmath> #include <cstdint> namespace mitiruenum InputCommandType : std::uint8_t 5
KeyDownKeyUpMouseMoveMouseDownMouseUpstruct InputCommand 5
InputCommandType type = InputCommandType::KeyDownint keyCode = 0int mouseButton = 0float mouseX = 0.0ffloat mouseY = 0.0fclass InputInjector 4
void inject(const InputCommand& command)[[nodiscard]] std::vector<InputCommand> consumePending()[[nodiscard]] std::size_t pendingCount() constvoid clear()enum GamepadButtonId : std::uint16_t 14
DPadUp = 0x0001DPadDown = 0x0002DPadLeft = 0x0004DPadRight = 0x0008Start = 0x0010Back = 0x0020LS = 0x0040RS = 0x0080LB = 0x0100RB = 0x0200A = 0x1000B = 0x2000X = 0x4000Y = 0x8000enum BindingType : std::uint8_t 4
KeyMouseButtonGamepadButtonGamepadAxisstruct InputBinding 6
BindingType type = BindingType::Keyint code = 0[[nodiscard]] static constexpr InputBinding fromKey(KeyCode key) noexcept[[nodiscard]] static constexpr InputBinding fromMouseButton(int button) noexcept[[nodiscard]] static constexpr InputBinding fromGamepadButton(GamepadButtonId button) noexcept[[nodiscard]] static constexpr InputBinding fromGamepadAxis(int axisId) noexceptstruct InputStateProvider 7
std::function<bool(int keyCode)> isKeyDownstd::function<bool(int keyCode)> isKeyPressedstd::function<bool(int button)> isMouseButtonDownstd::function<bool(int button)> isMouseButtonPressedstd::function<bool(int buttonCode)> isGamepadButtonDownstd::function<bool(int buttonCode)> isGamepadButtonPressedstd::function<float(int axisId)> getGamepadAxisclass InputMapper 15
void setProvider(const InputStateProvider& provider)void bindKey(std::string_view actionName, KeyCode key)void bindMouseButton(std::string_view actionName, int button)void bindGamepadButton(std::string_view actionName, GamepadButtonId button)void bindGamepadAxis(std::string_view actionName, int axisId)void triggerActionFromBridge(std::string_view actionName)void endFrame() noexceptvoid unbindAll(std::string_view actionName)void clearAllBindings()[[nodiscard]] bool isActionDown(std::string_view actionName) const[[nodiscard]] bool isActionPressed(std::string_view actionName) const[[nodiscard]] float getActionAxis(std::string_view actionName) const[[nodiscard]] std::size_t bindingCount(std::string_view actionName) const[[nodiscard]] std::size_t actionCount() const noexcept[[nodiscard]] const std::vector<InputBinding>& getBindings( std::string_view actionName) conststruct InputFrame 3
std::uint64_t frameNumber = 0std::vector<InputCommand> commands[[nodiscard]] std::string toJson() conststruct ReplayData 6
std::uint64_t seed = 0int tps = 60std::vector<InputFrame> frames[[nodiscard]] std::string toJson() const[[nodiscard]] static ReplayData fromJson(const std::string& jsonStr)[[nodiscard]] std::size_t totalFrames() const noexceptclass InputRecorder 5
void beginRecording(std::uint64_t seed = 0, int tps = 60)void recordFrame(std::uint64_t frameNumber, const std::vector<InputCommand>& commands)[[nodiscard]] ReplayData endRecording()[[nodiscard]] bool isRecording() const noexcept[[nodiscard]] std::size_t recordedFrameCount() const noexceptclass InputReplayer 9
void load(const ReplayData& data)[[nodiscard]] std::vector<InputCommand> getCommandsForFrame(std::uint64_t frameNumber) const[[nodiscard]] std::vector<InputCommand> consumeNextFrame()[[nodiscard]] bool isFinished() const noexceptvoid reset() noexcept[[nodiscard]] std::size_t totalFrames() const noexcept[[nodiscard]] std::size_t currentIndex() const noexcept[[nodiscard]] std::uint64_t seed() const noexcept[[nodiscard]] int tps() const noexceptenum MouseButton : std::uint8_t 3
Left = 0Right = 1Middle = 2class InputState 26
static inline float s_dbgLastSetX = 0static inline float s_dbgLastSetY = 0static inline int s_dbgSetCount = 0InputState() noexcept, m_mouseX(0.0f) , m_mouseY(0.0f) , m_prevMouseX(0.0f) , m_prevMouseY(0.0f) , m_mouseCaptured(false) , m_rawDeltaX(0.0f) , m_rawDeltaY(0.0f)[[nodiscard]] bool isKeyDown(int keyCode) const noexcept[[nodiscard]] bool isKeyDown(KeyCode keyCode) const noexcept[[nodiscard]] std::pair<float, float> mousePosition() const noexceptvoid beginFrame() noexceptvoid endTick() noexcept[[nodiscard]] std::pair<float, float> mouseDelta() const noexceptvoid setCursorCaptured(bool captured) noexcept[[nodiscard]] bool isCursorCaptured() const noexceptvoid setRawMouseDelta(float dx, float dy) noexcept[[nodiscard]] bool isKeyJustPressed(int keyCode) const noexcept[[nodiscard]] bool isKeyJustPressed(KeyCode keyCode) const noexcept[[nodiscard]] bool isKeyJustReleased(int keyCode) const noexcept[[nodiscard]] bool isKeyJustReleased(KeyCode keyCode) const noexcept[[nodiscard]] bool isMouseButtonJustPressed(MouseButton button) const noexcept[[nodiscard]] bool isMouseButtonJustReleased(MouseButton button) const noexcept[[nodiscard]] bool isMouseButtonDown(MouseButton button) const noexceptvoid setKeyDown(int keyCode, bool down) noexceptvoid setKeyDown(KeyCode keyCode, bool down) noexceptvoid setMousePosition(float x, float y) noexceptvoid setMouseButtonDown(MouseButton button, bool down) noexceptusing Key = KeyCode;enum KeyCode : int 107
Unknown = 0Num0 = 48Num1 = 49Num2 = 50Num3 = 51Num4 = 52Num5 = 53Num6 = 54Num7 = 55Num8 = 56Num9 = 57A = 65B = 66C = 67D = 68E = 69F = 70G = 71H = 72I = 73J = 74K = 75L = 76M = 77N = 78O = 79P = 80Q = 81R = 82S = 83T = 84U = 85V = 86W = 87X = 88Y = 89Z = 90Backspace = 8Tab = 9Enter = 13Shift = 16Ctrl = 17Alt = 18Escape = 27Space = 32LShift = 160RShift = 161LCtrl = 162RCtrl = 163LAlt = 164RAlt = 165Left = 37Up = 38Right = 39Down = 40ArrowLeft = LeftArrowUp = UpArrowRight = RightArrowDown = DownF1 = 112F2 = 113F3 = 114F4 = 115F5 = 116F6 = 117F7 = 118F8 = 119F9 = 120F10 = 121F11 = 122F12 = 123Delete = 46Insert = 45Home = 36End = 35PageUp = 33PageDown = 34CapsLock = 20Semicolon = 186Equal = 187Comma = 188Minus = 189Period = 190Slash = 191Backquote = 192LeftBracket = 219Backslash = 220RightBracket = 221Quote = 222Numpad0 = 96Numpad1 = 97Numpad2 = 98Numpad3 = 99Numpad4 = 100Numpad5 = 101Numpad6 = 102Numpad7 = 103Numpad8 = 104Numpad9 = 105NumpadMultiply = 106NumpadAdd = 107NumpadSubtract = 109NumpadDecimal = 110NumpadDivide = 111NumpadEnter = Enter[[nodiscard]] inline std::string_view keyCodeToString(KeyCode code) noexcept[[nodiscard]] inline KeyCode stringToKeyCode(std::string_view name) noexceptenum TouchPhase : std::uint8_t 4
Began = 0Moved = 1Ended = 2Cancelled = 3enum SwipeDirection : std::uint8_t 4
Up = 0Down = 1Left = 2Right = 3struct TouchPoint 5
int id = 0float x = 0.0ffloat y = 0.0ffloat pressure = 1.0fTouchPhase phase = TouchPhase::Beganstruct GestureConfig 7
float tapMaxDuration = 0.3ffloat doubleTapInterval = 0.3ffloat swipeMinDistance = 50.0ffloat longPressDuration = 0.5ffloat pinchMinDistance = 10.0ffloat rotateMinAngle = 0.1f[[nodiscard]] static GestureConfig defaults() noexceptstruct PinchInfo 3
float scale = 1.0ffloat centerX = 0.0ffloat centerY = 0.0fstruct RotateInfo 3
float angle = 0.0ffloat centerX = 0.0ffloat centerY = 0.0fclass TouchInputManager 19
explicit TouchInputManager( const GestureConfig& config = GestureConfig::defaults()) noexceptvoid onTouchEvent(const TouchPoint& point)void update(float deltaTime)[[nodiscard]] const std::vector<TouchPoint>& activeTouches() const noexcept[[nodiscard]] std::size_t touchCount() const noexceptvoid onTap(std::function<void(float, float)> callback)void onDoubleTap(std::function<void(float, float)> callback)void onLongPress(std::function<void(float, float)> callback, float duration = 0.0f)void onSwipe(std::function<void(SwipeDirection, float, float)> callback, SwipeDirection direction = SwipeDirection::Up)void onPinch(std::function<void(const PinchInfo&)> callback)void onRotate(std::function<void(const RotateInfo&)> callback)void applyToMouseState(InputState& state) const[[nodiscard]] const GestureConfig& config() const noexceptvoid setConfig(const GestureConfig& config) noexceptTouchInputManager(const TouchInputManager&) = deleteTouchInputManager& operator=(const TouchInputManager&) = deleteTouchInputManager(TouchInputManager&&) noexcept = defaultTouchInputManager& operator=(TouchInputManager&&) noexcept = default~TouchInputManager() = defaultenum MouseWheelAxis : std::uint8_t 2
Vertical = 0Horizontal = 1class Win32Input 16
Win32Input() noexceptbool processMessage(UINT msg, WPARAM wParam, LPARAM lParam) noexceptvoid update() noexcept[[nodiscard]] bool isKeyDown(KeyCode code) const noexcept[[nodiscard]] bool isKeyPressed(KeyCode code) const noexcept[[nodiscard]] bool isKeyReleased(KeyCode code) const noexcept[[nodiscard]] bool isKeyDownRaw(int vk) const noexcept[[nodiscard]] std::pair<int, int> getMousePosition() const noexcept[[nodiscard]] int mouseX() const noexcept[[nodiscard]] int mouseY() const noexcept[[nodiscard]] bool isMouseButtonDown(MouseButton button) const noexcept[[nodiscard]] bool isMouseButtonPressed(MouseButton button) const noexcept[[nodiscard]] bool isMouseButtonReleased(MouseButton button) const noexcept[[nodiscard]] int getMouseWheel() const noexcept[[nodiscard]] int getMouseHWheel() const noexceptvoid fillInputState(InputState& state) const noexceptstruct ObserveServerConfig 5
std::uint16_t port = 8080std::string host = "127.0.0.1"bool enableCors = truebool enableScreenshot = trueint maxSnapshotRateMs = 0class ObserveServer 12
ObserveServer() = defaultexplicit ObserveServer(const ObserveServerConfig& config)~ObserveServer()ObserveServer(const ObserveServer&) = deleteObserveServer& operator=(const ObserveServer&) = deleteObserveServer(ObserveServer&&) = deleteObserveServer& operator=(ObserveServer&&) = deletebool start(std::uint16_t port, Engine& engine, Inspector& inspector)bool start(Engine& engine, Inspector& inspector)void stop() noexcept[[nodiscard]] bool isRunning() const noexcept[[nodiscard]] const ObserveServerConfig& config() const noexceptstruct SnapshotData 7
std::uint64_t frameNumber = 0float timestamp = 0.0fint entityCount = 0std::string worldSnapshotstd::string sceneInfoint drawCallCount = 0[[nodiscard]] std::string toJson() constenum PlatformType 7
HeadlessWindowsLinuxMacOSiOSAndroidEmscriptenclass IPlatform 3
virtual ~IPlatform() = default[[nodiscard]] virtual std::unique_ptr<IWindow> createWindow( std::string_view title, int width, int height) = 0[[nodiscard]] virtual PlatformType type() const noexcept = 0class IWindow 9
virtual ~IWindow() = default[[nodiscard]] virtual bool shouldClose() const = 0virtual void pollEvents() = 0[[nodiscard]] virtual int width() const = 0[[nodiscard]] virtual int height() const = 0virtual void setTitle(std::string_view title) = 0virtual void requestClose() = 0virtual void setInputState(InputState* )virtual void setResizeCallback(std::function<void(int, int)> )enum OsType : std::uint8_t 5
Unknown = 0WindowsLinuxMacOSEmscriptenenum CpuArch : std::uint8_t 6
Unknown = 0X86X64Arm32Arm64Wasmstruct AvailableBackends 8
bool dx11 = falsebool dx12 = falsebool vulkan = falsebool opengl = falsebool webgl = falsebool null = true[[nodiscard]] std::vector<std::string> list() const[[nodiscard]] int count() const noexceptstruct AvailableWindowBackends 4
bool win32 = falsebool sdl2 = falsebool glfw = false[[nodiscard]] std::vector<std::string> list() conststruct PlatformInfo 7
OsType os = OsType::UnknownCpuArch arch = CpuArch::UnknownAvailableBackends backendsAvailableWindowBackends windowBackends[[nodiscard]] std::string osName() const[[nodiscard]] std::string archName() const[[nodiscard]] static PlatformInfo detect() noexceptenum WindowBackend 5
AutoWin32Sdl2Glfw[[nodiscard]] inline std::unique_ptr<IWindow> createWindow( WindowBackend backend, std::string_view title, int width, int height)class EmscriptenPlatform : public IPlatform 2
[[nodiscard]] std::unique_ptr<IWindow> createWindow( std::string_view title, int width, int height) override[[nodiscard]] PlatformType type() const noexcept overrideclass EmscriptenWindow : public IWindow 10
explicit EmscriptenWindow( std::string_view canvasSelector, int width, int height)[[nodiscard]] bool shouldClose() const overridevoid pollEvents() override[[nodiscard]] int width() const override[[nodiscard]] int height() const overridevoid setTitle(std::string_view title) overridevoid requestClose() override[[nodiscard]] const std::string& canvasSelector() const noexceptvoid setInputState(InputState* input) noexcept override[[nodiscard]] float consumeWheelDelta() noexceptstruct GlfwInputConfig 8
bool enableKeyboard = truebool enableMouse = truebool enableJoystick = truebool rawMouseMotion = falsebool stickyKeys = falsefloat mouseSensitivity = 1.0f[[nodiscard]] static GlfwInputConfig defaults() noexcept[[nodiscard]] static GlfwInputConfig fps() noexceptstruct GlfwJoystickState 5
bool connected = falseint joystickId = -1void beginFrame() noexcept[[nodiscard]] bool isButtonJustPressed(int index) const noexcept[[nodiscard]] bool isButtonJustReleased(int index) const noexceptstruct GlfwScrollState 3
double xOffset = 0.0double yOffset = 0.0void reset() noexceptclass GlfwInput 12
explicit GlfwInput(GLFWwindow* window, const GlfwInputConfig& config = GlfwInputConfig::defaults())~GlfwInput()GlfwInput(const GlfwInput&) = deleteGlfwInput& operator=(const GlfwInput&) = deleteGlfwInput(GlfwInput&&) = deleteGlfwInput& operator=(GlfwInput&&) = deletevoid beginFrame() noexceptvoid pollJoysticks()[[nodiscard]] const InputState& state() const noexcept[[nodiscard]] const GlfwJoystickState& joystick() const noexcept[[nodiscard]] const GlfwScrollState& scroll() const noexcept[[nodiscard]] const GlfwInputConfig& config() const noexceptstruct GlfwVulkanSurfaceDesc 2
bool requirePresentation = true[[nodiscard]] static std::vector<std::string> defaultRequiredExtensions()struct SurfaceCreateResult 4
bool success = falsestd::string errorMessage[[nodiscard]] static SurfaceCreateResult ok() noexcept[[nodiscard]] static SurfaceCreateResult fail(const std::string& message)class GlfwVulkanSurface 2
[[nodiscard]] static std::vector<std::string> getRequiredExtensions()[[nodiscard]] static SurfaceCreateResult createSurface( VkInstance instance, GLFWwindow* window, VkSurfaceKHR* outSurface)enum GlfwGraphicsMode : std::uint8_t 2
VulkanOpenGLclass GlfwWindow : public IWindow 19
explicit GlfwWindow(std::string_view title, int width, int height, GlfwGraphicsMode mode = GlfwGraphicsMode::Vulkan)~GlfwWindow() overrideGlfwWindow(const GlfwWindow&) = deleteGlfwWindow& operator=(const GlfwWindow&) = deleteGlfwWindow(GlfwWindow&&) = deleteGlfwWindow& operator=(GlfwWindow&&) = delete[[nodiscard]] bool shouldClose() const overridevoid pollEvents() override[[nodiscard]] int width() const override[[nodiscard]] int height() const overridevoid setTitle(std::string_view title) overridevoid requestClose() overridevoid swapBuffers()[[nodiscard]] GlfwGraphicsMode graphicsMode() const noexceptvoid setInputState(InputState* state) override[[nodiscard]] GLFWwindow* nativeWindow() const noexceptvoid resize(int width, int height)void setFullscreen(bool fullscreen)[[nodiscard]] bool isFullscreen() const noexceptclass HeadlessWindow : public IWindow 7
explicit HeadlessWindow(std::string_view title, int width, int height)[[nodiscard]] bool shouldClose() const overridevoid pollEvents() override[[nodiscard]] int width() const override[[nodiscard]] int height() const overridevoid setTitle(std::string_view title) overridevoid requestClose() overrideclass HeadlessPlatform : public IPlatform 2
[[nodiscard]] std::unique_ptr<IWindow> createWindow( std::string_view title, int width, int height) override[[nodiscard]] PlatformType type() const noexcept overrideenum AudioSampleFormat : std::uint8_t 2
Int16 = 0Float32struct AudioDeviceConfig 9
std::uint32_t sampleRate = 44100std::uint8_t channels = 2AudioSampleFormat format = AudioSampleFormat::Float32std::uint16_t bufferSize = 4096std::string deviceName[[nodiscard]] static AudioDeviceConfig defaults() noexcept[[nodiscard]] static AudioDeviceConfig lowLatency() noexcept[[nodiscard]] std::uint32_t bytesPerSample() const noexcept[[nodiscard]] std::uint32_t bufferSizeBytes() const noexceptstruct ObtainedAudioFormat 5
std::uint32_t sampleRate = 0std::uint8_t channels = 0AudioSampleFormat format = AudioSampleFormat::Float32std::uint16_t bufferSize = 0[[nodiscard]] bool isValid() const noexceptclass Sdl2Audio 13
using AudioCallback = void(*)(void* userdata, std::uint8_t* stream, int len);explicit Sdl2Audio( const AudioDeviceConfig& config, AudioCallback callback = nullptr, void* userdata = nullptr)~Sdl2Audio()Sdl2Audio(const Sdl2Audio&) = deleteSdl2Audio& operator=(const Sdl2Audio&) = deleteSdl2Audio(Sdl2Audio&&) = deleteSdl2Audio& operator=(Sdl2Audio&&) = deletevoid start() noexceptvoid stop() noexcept[[nodiscard]] bool isPlaying() const noexcept[[nodiscard]] bool isOpen() const noexcept[[nodiscard]] const ObtainedAudioFormat& obtainedFormat() const noexcept[[nodiscard]] const AudioDeviceConfig& config() const noexceptstruct Sdl2InputConfig 7
bool enableKeyboard = truebool enableMouse = truebool enableGamepad = trueint gamepadDeadzone = 8000bool enableTextInput = falsefloat mouseSensitivity = 1.0f[[nodiscard]] static Sdl2InputConfig defaults() noexceptstruct GamepadState 4
bool connected = falsevoid beginFrame() noexcept[[nodiscard]] bool isButtonJustPressed(int index) const noexcept[[nodiscard]] bool isButtonJustReleased(int index) const noexceptstruct MouseWheelState 3
float scrollX = 0.0ffloat scrollY = 0.0fvoid reset() noexceptclass Sdl2Input 12
explicit Sdl2Input(const Sdl2InputConfig& config = Sdl2InputConfig::defaults())~Sdl2Input()Sdl2Input(const Sdl2Input&) = deleteSdl2Input& operator=(const Sdl2Input&) = deleteSdl2Input(Sdl2Input&&) = deleteSdl2Input& operator=(Sdl2Input&&) = deletevoid beginFrame() noexceptvoid processEvent(const SDL_Event& event)[[nodiscard]] const InputState& state() const noexcept[[nodiscard]] const GamepadState& gamepad() const noexcept[[nodiscard]] const MouseWheelState& wheel() const noexcept[[nodiscard]] const Sdl2InputConfig& config() const noexceptclass Sdl2Window : public IWindow 18
explicit Sdl2Window(std::string_view title, int width, int height, Uint32 flags = SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE)~Sdl2Window() overrideSdl2Window(const Sdl2Window&) = deleteSdl2Window& operator=(const Sdl2Window&) = deleteSdl2Window(Sdl2Window&&) = deleteSdl2Window& operator=(Sdl2Window&&) = delete[[nodiscard]] bool shouldClose() const overridevoid setInputState(InputState* inputState) noexcept overridevoid pollEvents() override[[nodiscard]] int width() const override[[nodiscard]] int height() const overridevoid setTitle(std::string_view title) overridevoid requestClose() overridevoid resize(int width, int height)void setFullscreen(bool fullscreen, bool borderless = true)[[nodiscard]] bool isFullscreen() const noexcept[[nodiscard]] SDL_Window* nativeWindow() const noexcept[[nodiscard]] void* platformHandle() constclass Win32Platform : public IPlatform 3
[[nodiscard]] std::unique_ptr<IWindow> createWindow( std::string_view title, int width, int height) override[[nodiscard]] std::unique_ptr<IWindow> createWindowWithMode( std::string_view title, int width, int height, DisplayMode mode)[[nodiscard]] PlatformType type() const noexcept overrideclass Win32Window : public IWindow 28
using ResizeCallback = std::function<void(int, int)>;float m_lastMouseX = -1float m_lastMouseY = -1float m_dbgReadbackX = -1float m_dbgReadbackY = -1int m_mouseMoveCount = 0explicit Win32Window(std::string_view title, int width, int height, DisplayMode displayMode = DisplayMode::Windowed)~Win32Window() overrideWin32Window(const Win32Window&) = deleteWin32Window& operator=(const Win32Window&) = deleteWin32Window(Win32Window&&) = deleteWin32Window& operator=(Win32Window&&) = delete[[nodiscard]] bool shouldClose() const overridevoid pollEvents() override[[nodiscard]] int width() const override[[nodiscard]] int height() const overridevoid setTitle(std::string_view title) overridevoid requestClose() overridevoid setFullscreen(bool enable)[[nodiscard]] bool isFullscreen() const noexceptvoid show()void hide()[[nodiscard]] HWND getHandle() const noexceptvoid setInputState(InputState* state) noexcept override[[nodiscard]] const InputState* getInputStatePtr() const noexceptvoid setResizeCallback(std::function<void(int, int)> cb) noexcept override[[nodiscard]] static UINT systemDpi() noexceptinline void mitiru::render::AaRenderer::plotAA( Screen& screen, int x, int y, const sgc::Colorf& color, float alpha)class AaRenderer 5
void drawLineAA(Screen& screen, const sgc::Vec2f& from, const sgc::Vec2f& to, const sgc::Colorf& color, float thickness = 1.0f) constvoid drawCircleAA(Screen& screen, const sgc::Vec2f& center, float radius, const sgc::Colorf& fillColor, float borderWidth = 0.0f, const sgc::Colorf& borderColor = sgc::Colorf{0.0f, 0.0f, 0.0f, 1.0f}) constvoid drawRoundedRectAA(Screen& screen, const sgc::Rectf& rect, float cornerRadius, const sgc::Colorf& fillColor) constvoid drawRoundedRectAA(Screen& screen, const sgc::Rectf& rect, float cornerRadius, const sgc::Colorf& fillColor, float borderWidth, const sgc::Colorf& borderColor) constvoid drawTriangleAA(Screen& screen, const sgc::Vec2f& p0, const sgc::Vec2f& p1, const sgc::Vec2f& p2, const sgc::Colorf& color) constclass FontRenderer 13
FontRenderer() noexcept = default[[nodiscard]] sgc::Vec2f measureText(std::string_view text, float scale) const noexcepttemplate <typename ScreenType> void drawTextWrapped(ScreenType& screen, std::string_view text, float x, float y, float maxWidth, float scale, const sgc::Colorf& color) consttemplate <typename ScreenType> void drawTextCentered(ScreenType& screen, std::string_view text, float cx, float cy, float scale, const sgc::Colorf& color) consttemplate <typename ScreenType> void drawText(ScreenType& screen, std::string_view text, float x, float y, float scale, const sgc::Colorf& color) const[[nodiscard]] int countWrappedLines(std::string_view text, float maxWidth, float scale) const noexcept[[nodiscard]] sgc::Vec2f measureTextWrapped(std::string_view text, float maxWidth, float scale) const noexceptinline void mitiru::render::GradientRenderer::drawLinearGradient( Screen& screen, const sgc::Rectf& rect, const LinearGradient& gradient) constinline void mitiru::render::GradientRenderer::drawRadialGradient( Screen& screen, const sgc::Rectf& rect, const RadialGradient& gradient) constinline void mitiru::render::GradientRenderer::drawConicGradient( Screen& screen, const sgc::Rectf& rect, const ConicGradient& gradient) constinline void mitiru::render::GradientRenderer::drawLinearGradient( Screen& screen, const sgc::Rectf& rect, float angleDegrees, const std::vector<GradientStop>& stops) constinline void mitiru::render::GradientRenderer::drawRadialGradient( Screen& screen, const sgc::Rectf& rect, float centerX, float centerY, float radius, const std::vector<GradientStop>& stops) constinline void mitiru::render::GradientRenderer::drawConicGradient( Screen& screen, const sgc::Rectf& rect, float centerX, float centerY, float startAngleDegrees, const std::vector<GradientStop>& stops) conststruct GradientStop 3
float position = 0.0fconstexpr GradientStop() noexcept = defaultconstexpr GradientStop(float position, const sgc::Colorf& color) noexceptstruct LinearGradient 2
float angleDegrees = 0.0fstd::vector<GradientStop> stopsstruct RadialGradient 4
float centerX = 0.5ffloat centerY = 0.5ffloat radius = 0.5fstd::vector<GradientStop> stopsstruct ConicGradient 4
float centerX = 0.5ffloat centerY = 0.5ffloat startAngleDegrees = 0.0fstd::vector<GradientStop> stopsclass GradientRenderer 6
void drawLinearGradient(Screen& screen, const sgc::Rectf& rect, const LinearGradient& gradient) constvoid drawRadialGradient(Screen& screen, const sgc::Rectf& rect, const RadialGradient& gradient) constvoid drawConicGradient(Screen& screen, const sgc::Rectf& rect, const ConicGradient& gradient) constvoid drawLinearGradient(Screen& screen, const sgc::Rectf& rect, float angleDegrees, const std::vector<GradientStop>& stops) constvoid drawRadialGradient(Screen& screen, const sgc::Rectf& rect, float centerX, float centerY, float radius, const std::vector<GradientStop>& stops) constvoid drawConicGradient(Screen& screen, const sgc::Rectf& rect, float centerX, float centerY, float startAngleDegrees, const std::vector<GradientStop>& stops) constclass TextRenderer 6
template <typename ScreenType> static void drawText(ScreenType& screen, std::string_view text, float x, float y, int scale, const sgc::Colorf& color)template <typename ScreenType> static void drawTextFloat(ScreenType& screen, std::string_view text, float x, float y, float scale, const sgc::Colorf& color, float letterSpacing = 0.0f)[[nodiscard]] static constexpr float measureWidthFloat(std::string_view text, float scale, float letterSpacing = 0.0f) noexcept[[nodiscard]] static constexpr float measureHeightFloat(float scale) noexcept[[nodiscard]] static constexpr int measureWidth(std::string_view text, int scale = 1) noexcept[[nodiscard]] static constexpr int measureHeight(int scale = 1) noexceptenum FilterMode 4
NearestBilinearBicubicinline void mitiru::render::TextureFilter::drawSpriteFiltered( Screen& screen, const Texture& texture, const sgc::Rectf& destRect, FilterMode mode, float alpha)struct TextureFilter 17
[[nodiscard]] static sgc::Colorf sampleNearest( const Texture& texture, float u, float v) noexcept[[nodiscard]] static sgc::Colorf sampleBilinear( const Texture& texture, float u, float v) noexcept[[nodiscard]] static sgc::Colorf sampleBicubic( const Texture& texture, float u, float v) noexcept[[nodiscard]] static sgc::Colorf sample( const Texture& texture, float u, float v, FilterMode mode) noexceptstatic void drawSpriteFiltered(Screen& screen, const Texture& texture, const sgc::Rectf& destRect, FilterMode mode = FilterMode::Bilinear, float alpha = 1.0f)[[nodiscard]] inline constexpr float smoothstep(float edge0, float edge1, float x) noexcept[[nodiscard]] inline float roundedRect(float px, float py, float halfW, float halfH, float radius) noexcept[[nodiscard]] inline float circle(float px, float py, float radius) noexcept[[nodiscard]] inline sgc::Colorf alphaBlend(const sgc::Colorf& dst, const sgc::Colorf& src) noexceptinline void mitiru::render::UiShapeRenderer::writePixel( Screen& screen, int x, int y, const sgc::Colorf& color)inline void mitiru::render::UiShapeRenderer::drawRoundedRect( Screen& screen, const RoundedRectParams& params) constinline void mitiru::render::UiShapeRenderer::drawCircle( Screen& screen, float cx, float cy, float radius, const sgc::Colorf& fillColor, float borderWidth, const sgc::Colorf& borderColor) constinline void mitiru::render::UiShapeRenderer::drawPill( Screen& screen, float x, float y, float w, float h, const sgc::Colorf& fillColor) constinline void mitiru::render::UiShapeRenderer::drawRoundedRectShadow( Screen& screen, const sgc::Rectf& rect, float cornerRadius, const sgc::Colorf& shadowColor, float shadowBlur, float offsetX, float offsetY) constinline void mitiru::render::UiShapeRenderer::drawProgressArc( Screen& screen, float cx, float cy, float radius, float thickness, float progress, const sgc::Colorf& color, const sgc::Colorf& bgColor) constinline const mitiru::render::Texture& mitiru::render::UiShapeCache::getOrCreate( Screen& screen, const RoundedRectParams& params)inline mitiru::render::Texture mitiru::render::UiShapeCache::renderToTexture( Screen& screen, const RoundedRectParams& params)struct RoundedRectParams 13
float x = 0.0ffloat y = 0.0ffloat width = 100.0ffloat height = 50.0ffloat cornerRadius = 8.0ffloat borderWidth = 0.0ffloat shadowOffsetX = 0.0ffloat shadowOffsetY = 0.0ffloat shadowBlur = 0.0ffloat glowRadius = 0.0ffloat opacity = 1.0f[[nodiscard]] std::size_t hash() const noexcept[[nodiscard]] bool operator==(const RoundedRectParams& rhs) const noexcept = defaultclass UiShapeRenderer 5
void drawRoundedRect(Screen& screen, const RoundedRectParams& params) constvoid drawCircle(Screen& screen, float cx, float cy, float radius, const sgc::Colorf& fillColor, float borderWidth = 0.0f, const sgc::Colorf& borderColor = {0.5f, 0.5f, 0.5f, 1.0f}) constvoid drawPill(Screen& screen, float x, float y, float w, float h, const sgc::Colorf& fillColor) constvoid drawRoundedRectShadow(Screen& screen, const sgc::Rectf& rect, float cornerRadius, const sgc::Colorf& shadowColor, float shadowBlur, float offsetX, float offsetY) constvoid drawProgressArc(Screen& screen, float cx, float cy, float radius, float thickness, float progress, const sgc::Colorf& color, const sgc::Colorf& bgColor) constclass UiShapeCache 49
explicit UiShapeCache(std::size_t maxEntries = 64) noexcept[[nodiscard]] const Texture& getOrCreate(Screen& screen, const RoundedRectParams& params)void clear() noexcept[[nodiscard]] std::size_t size() const noexcept[[nodiscard]] std::size_t maxEntries() const noexceptvoid setMaxEntries(std::size_t maxEntries) noexceptvoid createCommandResources()void compileShaders()void createRootSignature()static void getInputLayoutInternal(D3D12_INPUT_ELEMENT_DESC* desc, UINT& count)void createMainPSO()void createOutlinePSO()void createDepthBuffer()void createHDRIntermediate()void createOutlinePostProcess()void createColorCopyBuffer()void createFresnelMainPSO()void createOverlay2D()void drawPostProcessOutline()void pollD3D12Validation()void resolveMSAAColorToHDR()void createTonemapPipeline()void applyTonemap()[[nodiscard]] D3D12_GPU_VIRTUAL_ADDRESS uploadTonemapCB()void createFXAAPipelines()void createFXAAIntermediate()void drawFXAAPass()void renderOverlay2D()[[nodiscard]] D3D12_GPU_VIRTUAL_ADDRESS uploadTransformCB( const sgc::Mat4f& worldTransform)[[nodiscard]] D3D12_GPU_VIRTUAL_ADDRESS uploadLightingCB( const Material& material)void createShadowPSO()void renderShadowPass()void createAlbedoSrvHeap()void ensureDefaultWhiteTexture()[[nodiscard]] dx12::Dx12Texture2D* getOrUploadAlbedo(const Texture* tex)[[nodiscard]] D3D12_GPU_DESCRIPTOR_HANDLE writeMainSrvTable(const Texture* tex)[[nodiscard]] D3D12_GPU_DESCRIPTOR_HANDLE writeAlbedoSrv(const Texture* tex)[[nodiscard]] D3D12_GPU_VIRTUAL_ADDRESS uploadShadowCB()[[nodiscard]] D3D12_GPU_VIRTUAL_ADDRESS uploadLightArrayCB()void drawOutlineMesh(const OutlineDrawCommand& cmd)[[nodiscard]] ComPtr<ID3D12Resource> createUploadBuffer(UINT64 sizeBytes) conststatic void uploadToBuffer(ID3D12Resource* resource, const void* data, UINT sizeBytes)void ensureSkyboxTextureDx12()void ensureSkyboxPipelineDx12()void uploadSkyboxTextureDx12()void drawSkyboxIfNeededDx12()using NodePtr = std::shared_ptr<Node>;inline void mitiru::scene::SpriteNode::onDraw(Screen& screen) constinline void mitiru::scene::LabelNode::onDraw(Screen& screen) constclass Node 21
float rotation = 0.0fbool m_active = truebool m_visible = trueNode() = defaultexplicit Node(const std::string& name)virtual ~Node() = defaultvirtual void onReady()virtual void onUpdate(float dt)virtual void onDraw(Screen& screen) constvirtual void onExit()void addChild(NodePtr child)void removeChild(const std::string& name)[[nodiscard]] NodePtr findChild(const std::string& name) const[[nodiscard]] NodePtr findDescendant(const std::string& name) constvoid updateTree(float dt)void drawTree(Screen& screen) const[[nodiscard]] const std::string& name() const noexceptvoid setName(const std::string& n)[[nodiscard]] Node* parent() const noexcept[[nodiscard]] const std::vector<NodePtr>& children() const noexcept[[nodiscard]] int childCount() const noexceptclass SpriteNode : public Node 3
float width = 32float height = 32void onDraw(Screen& screen) const overrideclass LabelNode : public Node 3
std::string textfloat fontSize = 16.0fvoid onDraw(Screen& screen) const overrideclass TimerNode : public Node 9
float duration = 1.0fbool oneShot = truestd::function<void()> onTimeoutvoid start()void stop()[[nodiscard]] bool isRunning() const noexcept[[nodiscard]] float elapsed() const noexceptvoid onUpdate(float dt) overrideinline void initEngineHttpCallbacks(EngineCallbacks& cb, const EngineBridgeContext& ctx, Game& game)struct EngineBridgeContext 8
std::map<std::string, std::string>* gameFlags = nullptrconst EngineConfig* config = nullptrstd::function<std::uint64_t()> getFrameNumberstd::function<const Clock*()> getClockstd::function<const Screen*()> getScreenstd::function<std::vector<std::uint8_t>()> capturestd::function<std::string()> getSnapshotstd::function<void()> requestStopstruct EngineCallbacks 22
std::function<std::uint64_t()> getFrameNumberstd::function<const Clock*()> getClockstd::function<const Screen*()> getScreenstd::function<std::vector<std::uint8_t>()> capturestd::function<std::string()> getSnapshotstd::function<void()> requestStopstd::function<std::string()> getSceneJsonstd::function<int(const std::string&, const std::string&, int)> createNodestd::function<bool(int)> deleteNodestd::function<bool(int, const std::string&, const std::string&)> updateNodePropertystd::function<bool(int, const std::string&, const std::string&)> addTraitstd::function<bool(int, const std::string&)> removeTraitstd::function<bool(const std::string&)> saveScenestd::function<bool(const std::string&)> loadScenestd::function<bool(int)> selectNodestd::function<bool(int)> focusNodestd::function<std::string()> getErrorsstd::function<std::string()> getLogstd::function<std::string()> getProjectInfostd::function<bool()> runGamestd::function<bool()> stopGamestd::function<bool(float, float, float, float, float, float)> setEditorCameraclass EngineHttpServer 9
bool init(int)void shutdown()void poll()[[nodiscard]] bool isRunning() const noexceptvoid setCommandSystem(CommandSystem*)void setCallbacks(const EngineCallbacks&)void setInputInjector(InputInjector*)void setFlags(std::map<std::string, std::string>*)void setConfig(const EngineConfig*)struct EngineCallbacks 22
std::function<std::uint64_t()> getFrameNumberstd::function<const Clock*()> getClockstd::function<const Screen*()> getScreenstd::function<std::vector<std::uint8_t>()> capturestd::function<std::string()> getSnapshotstd::function<void()> requestStopstd::function<std::string()> getSceneJsonstd::function<int(const std::string& name, const std::string& type, int parentId)> createNodestd::function<bool(int nodeId)> deleteNodestd::function<bool(int nodeId, const std::string& prop, const std::string& value)> updateNodePropertystd::function<bool(int nodeId, const std::string& traitType, const std::string& traitData)> addTraitstd::function<bool(int nodeId, const std::string& traitType)> removeTraitstd::function<bool(const std::string& path)> saveScenestd::function<bool(const std::string& path)> loadScenestd::function<bool(int nodeId)> selectNodestd::function<bool(int nodeId)> focusNodestd::function<std::string()> getErrorsstd::function<std::string()> getLogstd::function<std::string()> getProjectInfostd::function<bool()> runGamestd::function<bool()> stopGamestd::function<bool(float yaw, float pitch, float distance, float px, float py, float pz)> setEditorCameraclass EngineHttpServer 16
EngineHttpServer() = default~EngineHttpServer()EngineHttpServer(const EngineHttpServer&) = deleteEngineHttpServer& operator=(const EngineHttpServer&) = deleteEngineHttpServer(EngineHttpServer&&) = deleteEngineHttpServer& operator=(EngineHttpServer&&) = deletebool init(int port = 8090)void setCallbacks(const EngineCallbacks& callbacks)void setCommandSystem(CommandSystem* cmd) noexceptvoid setInputInjector(InputInjector* injector) noexceptvoid setFlags(std::map<std::string, std::string>* flags) noexceptvoid setConfig(const EngineConfig* config) noexceptvoid poll()void shutdown() noexcept[[nodiscard]] bool isRunning() const noexcept[[nodiscard]] int port() const noexceptenum IssueSeverity 2
WarningErrorenum IssueType 6
OutOfBoundsPartialOverflowZeroSizeInvalidColorTextOverflowOverlappingDrawstruct DrawIssue 3
std::string messageint frameNumber = 0std::string drawCallNamestruct FrameStats 6
int totalDrawCalls = 0int outOfBoundsCount = 0int overflowCount = 0int zeroSizeCount = 0int invalidColorCount = 0int textOverflowCount = 0class DrawCallValidator 21
void attach(Screen& screen)void setScreenBounds(int width, int height) noexceptvoid setMargin(float pixels) noexceptvoid setOverlapDetection(bool enabled) noexceptvoid beginFrame() noexceptvoid endFrame() noexceptvoid onDrawCall(const sgc::Rectf& bounds, const char* callName)void onColor(const sgc::Colorf& color, const char* callName, const sgc::Rectf& bounds)void onTextDraw(const sgc::Vec2f& position, float textWidth, float textHeight, const char* callName)void onTextOverflow(float availableWidth, float actualWidth, const char* callName, const sgc::Rectf& bounds)[[nodiscard]] const std::vector<DrawIssue>& getIssues() const noexcept[[nodiscard]] int getIssueCount() const noexcept[[nodiscard]] bool hasErrors() const noexcept[[nodiscard]] const FrameStats& stats() const noexcept[[nodiscard]] int frameNumber() const noexceptvoid suppress(IssueType type)void unsuppress(IssueType type)void clearSuppressions() noexceptvoid drawDebugOverlay(Screen& screen) constvoid printReport() const[[nodiscard]] std::string report() conststruct TestResult 4
std::string namebool passed = falsestd::string message[[nodiscard]] std::string toJson() conststruct GameTest 2
std::string namestd::function<bool(Engine&)> testFuncclass TestHarness 5
void addTest(GameTest test)[[nodiscard]] std::vector<TestResult> runAll(Engine& engine) const[[nodiscard]] std::string toJson(Engine& engine) const[[nodiscard]] std::size_t size() const noexceptvoid clear() noexceptSourced from docs/API_CATALOG.md, auto-generated by tools/generate_api_catalog.py.