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 defaultwhile(!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
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
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();