d976595879
Main / Build (BookPlayer) (push) Has been cancelled
Main / Build (Brainfuck) (push) Has been cancelled
Main / Build (Breakout) (push) Has been cancelled
Main / Build (Calculator) (push) Has been cancelled
Main / Build (Diceware) (push) Has been cancelled
Main / Build (EpubReader) (push) Has been cancelled
Main / Build (GPIO) (push) Has been cancelled
Main / Build (GraphicsDemo) (push) Has been cancelled
Main / Build (HelloWorld) (push) Has been cancelled
Main / Build (M5UnitTest) (push) Has been cancelled
Main / Build (Magic8Ball) (push) Has been cancelled
Main / Build (MediaKeys) (push) Has been cancelled
Main / Build (MystifyDemo) (push) Has been cancelled
Main / Build (SerialConsole) (push) Has been cancelled
Main / Build (Snake) (push) Has been cancelled
Main / Build (TamaTac) (push) Has been cancelled
Main / Build (TodoList) (push) Has been cancelled
Main / Build (TwoEleven) (push) Has been cancelled
Main / Bundle (push) Has been cancelled
25 lines
449 B
C++
25 lines
449 B
C++
#pragma once
|
|
|
|
#include "GameKitScene.h"
|
|
#include <lvgl.h>
|
|
#include <cstdint>
|
|
|
|
namespace GameKit {
|
|
|
|
class Loop {
|
|
lv_timer_t* timer = nullptr;
|
|
Scene* scene = nullptr;
|
|
uint32_t periodMs = 0;
|
|
uint32_t lastTickMs = 0;
|
|
|
|
static void onTimer(lv_timer_t* timer);
|
|
|
|
public:
|
|
~Loop();
|
|
bool start(uint32_t tickMs, Scene* targetScene);
|
|
void stop();
|
|
bool isRunning() const { return timer != nullptr; }
|
|
};
|
|
|
|
} // namespace GameKit
|