#pragma once #include #include #include class MappedInputManager; class GfxRenderer; constexpr int CONTENT_START_Y = 60; constexpr int LINE_HEIGHT = 30; class Activity { protected: std::string name; GfxRenderer& renderer; MappedInputManager& mappedInput; int marginLeft = 0; int marginRight = 0; int marginTop = 0; int marginBottom = 0; public: explicit Activity(std::string name, GfxRenderer& renderer, MappedInputManager& mappedInput) : name(std::move(name)), renderer(renderer), mappedInput(mappedInput) {} virtual ~Activity() = default; virtual void onEnter(); virtual void onExit(); virtual void loop() {} virtual bool skipLoopDelay() { return false; } virtual bool preventAutoSleep() { return false; } void setMargins(); void setRendererOrientation(); int getPageItems() const; };