import std.stdio; import std.format; import std.conv; import gameengine.core.engine; import gameengine.math.types; import gameengine.renderer.renderer; import gameengine.logging.types; import gameengine.callback; import gameengine_rsdl; import core.thread; void logger(LoggingSeverity severity, string message) { writeln(format("[%s]: %s", to!string(severity), message)); } void main() { Renderer renderer = new RSDL("test", IntVec2(800, 600)); Engine engine = new Engine(renderer, &logger); ubyte red = 0; bool increase = true; while (true) { engine.runNodeProcesses(); // Colour changing background! if ((red == 255 && increase) || (red == 0 && !increase)) { increase = !increase; } if (increase) red += 1; else red -= 1; // Clear screen then sleep for ~16ms renderer.clearScreen(Color(red, 0, 0, 255)); engine.drawNodes(); renderer.renderCurrent(); Thread.sleep(16.msecs); } }