initial commit

This commit is contained in:
NeilClack
2026-08-07 14:51:41 -05:00
commit 9251b3a196
604 changed files with 464448 additions and 0 deletions
+58
View File
@@ -0,0 +1,58 @@
#include "../src/page.h"
#include <string>
#include <vector>
struct LifecycleEvent {
std::string type;
int pageId;
bool operator==(const LifecycleEvent& other) const
{
return type == other.type && pageId == other.pageId;
}
bool operator!=(const LifecycleEvent& other) const
{
return !(*this == other);
}
};
inline std::vector<LifecycleEvent>& lifecycle_log()
{
static std::vector<LifecycleEvent> log;
return log;
}
inline void clear_log()
{
lifecycle_log().clear();
}
class TestPage : public Page {
public:
explicit TestPage(int id) : id_(id) {}
int id() const { return id_; }
void onPush(AppState& state) override
{
lifecycle_log().push_back({"onPush", id_});
}
void onResume(AppState& state) override
{
lifecycle_log().push_back({"onResume", id_});
}
void onPause(AppState& state) override
{
lifecycle_log().push_back({"onPause", id_});
}
void onPop(AppState& state) override
{
lifecycle_log().push_back({"onPop", id_});
}
void handleEvent(const SDL_Event& event) override {}
void update(float dt) override {}
void render(SDL_Renderer* renderer) override {}
private:
int id_;
};