C++#include <darkmoon/graphics.hpp>

int main() {
    DarkMoonEngine dm{};

    Window win = Window(800, 600, "Hello World");

    while(!win.ShouldClose()){
        win.BeginDrawing(BLACK);
        win.EndDrawing();
    }
}

Windows Windows
Linux Linux

Window

GLFW #include <darkmoon/managers/monitor.hpp>

C++#include <darkmoon/graphics.hpp>

int main(){
    DarkMoonEngine dm{};

    Monitor primary = dm.GetPrimaryMonitor();
    std::cout << "Primary monitor: " << primary.getName() << "\n";

    Window win = Window(800, 600, "Monitor Example");
    win.SetFullscreen(primary); // Monitor::getPrimary() is also the default

    while(!win.ShouldClose()){
        win.BeginDrawing(BLACK);
        win.EndDrawing();
    }
}

Monitor::initCallback() void
Monitor::wasConnected() bool
Monitor::wasDisconnected() bool

getGammaRamp() GammaRamp
setGammaRamp(ramp) void
setGamma(gamma) void

Monitor(handle = nullptr) -
isValid() bool
operator bool() bool
handle() GLFWmonitor*
operator==(other) / operator!=(other) bool

Monitor::getAll() std::vector<Monitor>
Monitor::getPrimary() Monitor

getVideoModes() std::vector<VideoMode>
getCurrentVideoMode() VideoMode

getPhysicalSize() PhysicalSize
getContentScale() ContentScale
getPosition() VirtualPosition
getWorkArea() WorkArea

getName() std::string
setUserPointer(ptr) void
getUserPointer() void*

GetPrimaryMonitor() Monitor
GetMonitors() std::vector<Monitor>
MonitorConnected() bool
MonitorDisconnected() bool

VideoMode
PhysicalSize
ContentScale
VirtualPosition
WorkArea
GammaRamp
C++struct VideoMode {
    int width, height;
    int redBits, greenBits, blueBits;
    int refreshRate;
};

struct PhysicalSize    { int widthMM, heightMM; };
struct ContentScale   { float x, y; };
struct VirtualPosition{ int x, y; };
struct WorkArea       { int x, y, width, height; };

struct GammaRamp {
    std::vector<unsigned short> red, green, blue;
    unsigned int size() const;
};

C++ #include <darkmoon/managers/camera.hpp>

C++struct Camera2D {
    Vector2Df target   {};        // World point the camera is looking at
    Vector2Df offset   {};        // Where target appears on screen (px)
    float     zoom     { 1.0f };
    float     rotation { 0.0f }; // In degrees
};
target Vector2Df
offset Vector2Df
zoom float
rotation float

WorldToScreen(worldPos) Vector2Df
ScreenToWorld(screenPos) Vector2Df

textDraw()
    │
    └── vertices are treated as already being in screen/pixel space
        (e.g. UI elements, HUD) the camera is never consulted

Draw(camera)
    │
    ├── for each vertex: screenPos = camera.WorldToScreen(worldPos)
    ├── converts each screenPos to NDC
    └── uploads a temporary VAO/VBO/EBO for this single draw call,
        then deletes it immediately afterwards

Pixel(position, color, size, window, shader = nullptr)-
SetPosition(position)void
SetColor(color)void
SetSize(size)void
SetShader(shader)void
GetPosition() / GetColor() / GetSize() / GetShader()...
Draw() / Draw(camera)void
Delete()void
C++Pixel dot({ 100, 100 }, RED, 4, &win);
dot.Draw();

Line(startPosition, endPosition, color, width, window, shader = nullptr)-
SetPosition(start, end)void
SetColor(color)void
SetWidth(width)void
SetShader(shader)void
GetStartPosition() / GetEndPosition() / GetColor() / GetWidth() / GetShader()...
Draw() / Draw(camera)void
Delete()void
C++Line edge({ 0, 0 }, { 200, 100 }, WHITE, 2, &win);
edge.Draw();

Triangle

Triangle(vertexA, vertexB, vertexC, color, window, shader = nullptr)-
SetPosition(position)void
SetVertexA(v) / SetVertexB(v) / SetVertexC(v)void
SetColor(color)void
GetVertexA() / GetVertexB() / GetVertexC() / GetColor()...
Draw() / Draw(camera)void
Delete()void

TriangleLines

TriangleLines(vertexA, vertexB, vertexC, color, width, window, shader = nullptr)-
GetEdgeAB() / GetEdgeBC() / GetEdgeCA()Line*
SetColor(color)void
Draw() / Draw(camera)void
Delete()void
C++Triangle tri({ 100,200 }, { 150,100 }, { 200,200 }, YELLOW, &win);
tri.Draw();

Rectangle

textA --- B
|     |
C --- D
Rectangle(position, width, height, color, window, shader = nullptr)-
Rectangle(vertexA, vertexB, vertexC, vertexD, color, window, shader = nullptr)-
SetPosition(position)void
SetVertexA(v) / B(v) / C(v) / D(v)void
SetWidth(w) / SetHeight(h) / SetSize(w,h)void
SetColor(color)void
GetVertexA..D() / GetPosition() / GetWidth() / GetHeight() / GetSize() / GetColor()...
Draw() / Draw(camera)void
Delete()void

RectangleLines

RectangleLines(position, width, height, color, lineWidth, window, shader = nullptr)-
GetEdgeAB() / GetEdgeBD() / GetEdgeCD() / GetEdgeCA()Line*
SetColor(color)void
Draw() / Draw(camera)void
Delete()void
C++Rectangle box({ 50, 50 }, 120, 80, BLUE, &win);
box.Draw();

Circle

Circle(center, radius, color, window, segments = 64, shader = nullptr)-
SetCenter(center) / SetRadius(radius) / SetSegments(segments)void
SetColor(color)void
GetCenter() / GetRadius() / GetSegments() / GetColor()...
Draw() / Draw(camera)void
Delete()void

CircleLines

CircleLines(center, radius, color, window, segments = 64, lineWidth = 1.0f, shader = nullptr)-
SetCenter / SetRadius / SetSegments / SetLineWidthvoid
Draw() / Draw(camera)void
Delete()void
C++Circle sun({ 400, 300 }, 50.0f, ORANGE, &win);
sun.Draw();

RegularPolygon

RegularPolygon(center, radius, sides, color, window, rotation = -1000.0f, shader = nullptr)-
SetCenter / SetRadius / SetSides / SetRotationvoid
SetColor(color)void
GetCenter() / GetRadius() / GetSides() / GetRotation() / GetColor()...
Draw() / Draw(camera)void
Delete()void

RegularPolygonLines

RegularPolygonLines(center, radius, sides, color, window, rotation = -1000.0f, lineWidth = 1.0f, shader = nullptr)-
SetCenter / SetRadius / SetSides / SetRotation / SetLineWidthvoid
Draw() / Draw(camera)void
Delete()void
C++RegularPolygon hex({ 300, 300 }, 60.0f, 6, GREEN, &win, 0.0f); // explicit rotation, avoids the -1000 sentinel
hex.Draw();

C++ #include <darkmoon/managers/resource_manager.hpp>

C++struct Resource {
protected:
    std::size_t m_idResource { 0 };
    std::size_t m_fileType   {};
    std::string m_filePath   {};
    bool        m_isLoaded  { false };

    Resource(std::size_t idResource, std::size_t fileType, const char* filePath);
    virtual void setup() {};

public:
    virtual ~Resource() {};
    virtual void unload() {};
    bool        isLoaded();
    std::size_t getIDResource();
    std::string getFilePath();
    std::size_t getFileType();
};
isLoaded() bool
getIDResource() std::size_t
getFilePath() std::string
getFileType() std::size_t
unload() void

ResourceManager::getInstance() ResourceManager&
loadResource<T>(filePath, args...) T*
getResource<T>(id) T*
unloadResource(id) void
unloadAllResources() void

textloadResource<T>(filePath, args...)
    │
    ├── scans every loaded resource for a MATCH:
    │       filePath equal   AND   stored type == typeid(T)
    │
    ├── match found   → returns the EXISTING T*  (args... are ignored!)
    │
    └── no match       → constructs a new T(nextID, typeid(T), filePath, args...)
            ├── isLoaded() == true  → stores it, returns the new T*
            └── isLoaded() == false → discards it, returns nullptr

Text(position, text, fontPath, window, pixelHeight = 32.f, shader = nullptr)-
SetPosition(position)void
SetColor(color)void
SetText(text)void
SetScale(scale)void
GetPosition() / GetColor() / GetText() / GetScale()...
Draw() / Draw(camera)void
Unload()void
MeasureText() / MeasureText(camera)float
GetTextHeight() / GetTextHeight(camera)float
C++Text label({ 50, 50 }, "Hello DarkMoon", "assets/fonts/arial.ttf", &win, 24.f);
label.Draw();

Texture(position, scale, rotation, texturePath, window, shader = nullptr)-
SetPosition(position)void
SetScale(scale)void
SetRotation(rotation)void
SetColor(color)void
SetTexture(texturePath)void
SetOpacity(opacity)void
GetPosition() / GetScale() / GetRotation() / GetColor()...
GetWidth() / GetHeight() / GetSize()...
GetTextureWidth() / GetTextureHeight()int
GetOpacity()float
Draw() / Draw(camera)void
Delete()void
C++Texture sprite({ 100, 100 }, { 1.f, 1.f }, 0.f, "assets/sprite.png", &win);
sprite.Draw();

AnimatedTexture(position, scale, rotation, texturePath, window, shader = nullptr)-
Update(dt)void
Play() / Pause() / Reset()void
SetFrame(index)void
SetPosition(position)void
SetScale(scale)void
SetRotation(rotation)void
SetColor(color)void
SetLooping(loop)void
SetSpeed(speed)void
SetTexture(texturePath)void
GetPosition() / GetScale() / GetRotation() / GetColor()...
GetWidth() / GetHeight() / GetSize()...
GetTextureWidth() / GetTextureHeight()int
GetFrameCount() / GetCurrentFrame() / IsPlaying() / IsLooping() / GetSpeed()...
Draw() / Draw(camera)void
Delete()void
C++AnimatedTexture anim({ 200, 200 }, { 2.f, 2.f }, 0.f, "assets/walk.gif", &win);

// En el bucle principal:
anim.Update(deltaTime);
anim.Draw();

TileSet(tileW, tileH, cols, rows, texturePath, window, shader = nullptr)-
SetScale(scale)void
SetRotation(rotation)void
SetColor(color)void
SetTexture(texturePath)void
GetTileW() / GetTileH() / GetCols() / GetRows() / GetCount()int
GetScale() / GetRotation() / GetColor()...
GetTileWidth() / GetTileHeight()float
Draw(col, row, pos) / Draw(index, pos)void
Draw(col, row, pos, camera) / Draw(index, pos, camera)void
C++TileSet tileset(32, 32, 8, 8, "assets/tileset.png", &win);
tileset.Draw(3, 2, { 64, 64 }); // por columna/fila
tileset.Draw(19, { 96, 64 });   // por índice lineal

Math #include <darkmoon/utils/math.hpp>

C++struct Vector2D {
    int x, y;
};
Vector2D() -
Vector2D(x, y) -
operator+(other) Vector2D
operator-(other) Vector2D
operator*(scalar) Vector2D
operator/(scalar) Vector2D
operator-() Vector2D
operator+=(other) Vector2D&
operator-=(other) Vector2D&
operator*=(other) Vector2D&
operator*=(scalar) Vector2D&
operator/=(scalar) Vector2D&
operator==(other) bool
operator!=(other) bool
magnitude() float
dot(other) int
operator[](i) int&
toFloat() Vector2Df
scalar * Vector2D Vector2D

C++struct Vector2Df {
    float x, y;
};
Vector2Df() -
Vector2Df(x, y) -
Vector2Df(Vector2D) -
operator+(other) Vector2Df
operator-(other) Vector2Df
operator*(scalar) Vector2Df
operator/(scalar) Vector2Df
operator-() Vector2Df
operator+=(other) Vector2Df&
operator-=(other) Vector2Df&
operator*=(other) Vector2Df&
operator*=(scalar) Vector2Df&
operator/=(scalar) Vector2Df&
operator==(other) bool
operator!=(other) bool
magnitude() float
dot(other) float
normalized() Vector2Df
operator[](i) float&
toInt() Vector2D
scalar * Vector2Df Vector2Df

C++#include <darkmoon/utils/math.hpp>

Vector2D  gridPos  { 3, 4 };
Vector2Df worldPos = gridPos.toFloat() * 32.0f;

Vector2Df dir = (target - worldPos).normalized();
worldPos += dir * speed * win.GetDeltaTime();

// Back to integer tile coordinates (truncates)
Vector2D tile = worldPos.toInt() / 32;

Debug #include <darkmoon/utils/memviewer.hpp>

C++struct MemoryViewer {
    template <typename T>
    MemoryViewer(T const& obj_or_ptr);

    void printMemory();
};
MemoryViewer(obj) -
MemoryViewer(ptr) -
printMemory() void

text##### MOSTRANDO OBJETO. Size: 8 bytes #####
||   DIRECCIONES   || 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F ||    CARACTERES    ||
============================================================================================
||  0x7ffe1a2b3c40 || 40 E2 01 00 00 00 00 00 -- -- -- -- -- -- -- -- ||    @........     ||
============================================================================================
C++#include <darkmoon/utils/memory.hpp>

// Inspecting a value directly
Vector2Df pos { 3.5f, 7.2f };
MemoryViewer(pos).printMemory();

// Inspecting through a pointer: dumps the pointee, not the pointer itself
Vector2Df* posPtr = &pos;
MemoryViewer(posPtr).printMemory();

DarkMoonEngine github.com/juliosalag/prototype-dm
DarkMoon Prototype - gameplay and debug menu