#pragma once #include "String.h" namespace Gedeng { class Application { public: Application(unsigned long ms_per_update, unsigned int window_size_x, unsigned int window_size_y, String window_name) : MS_PER_UPDATE(ms_per_update), WINDOW_SIZE_X(window_size_x), WINDOW_SIZE_Y(window_size_y), WINDOW_NAME(window_name) { } // Virtual since this class will be inherited by user-created applications virtual ~Application() = default; // Game Loop void run(); // Primarily for gameplay and physics // To be overridden by client applications virtual void fixed_update(double delta) = 0; // Primarily for rendering // To be overridden by client applications virtual void dynamic_update(double delta) = 0; // TODO: Write note for this: `undefined reference to vtable` can be caused by forgetting `= 0` for pure virtual // stuff private: // TODO: These will probably become a separate Settings struct const unsigned long MS_PER_UPDATE; const unsigned int WINDOW_SIZE_X; const unsigned int WINDOW_SIZE_Y; const String WINDOW_NAME; }; // To be defined in client applications Application *create_application(); } // namespace Gedeng