12 #include <SDL2/SDL_ttf.h> 13 #include <SDL2/SDL_image.h> 19 #include <sys/ioctl.h> 49 Application(
int width,
int height, SDL_Color bgColor, std::string touchInputDevice, std::string ttyDevice,
int FPS_LIMIT);
125 void DisableTTYCursor();
126 void EnableTTYCursor();
132 std::string touchInputDevice, ttyDevice;
134 SDL_Renderer *renderer;
135 uint32_t lastTouchEvent;
136 std::unique_ptr<TouchEventDispatcher> touchEventDispatcher;
137 std::unique_ptr<Window> mainWindow;
138 std::unique_ptr<TouchInput> touchInput;
144 static constexpr
int TOUCH_DEBOUNCE_MS = 250;
145 static constexpr
int SAMPLES = 5;
146 static constexpr
int SLOTS = 1;
148 unsigned int FRAMETIME = 1000 / FPS;
void exit()
Exit the application.
Definition: Application.cpp:216
void run()
Start the application.
Definition: Application.cpp:113
static void runOnCurrentMainThread(Task *task)
Runs the given task on the main thread. It will be deleted when done (static shortcut) ...
Definition: Application.cpp:210
bool isRunning()
Definition: Application.cpp:159
void runOnMainThread(Task *task)
Runs the given task on the main thread. It will be deleted when done.
Definition: Application.cpp:184
static void runOnCurrentWorkerThread(Task *task)
Runs the given task on the worker thread. It will be deleted when done (static shortcut) ...
Definition: Application.cpp:204
Definition: MainThreadTaskRunner.h:17
A class that takes care of dispatching the touch events to the right objects of the displayed scene...
Definition: TouchEventDispatcher.h:24
SDL_Window * getWindow()
Get the SDL window object.
Definition: Application.cpp:164
static SDL_Renderer * getCurrentRenderer()
Get the SDL renderer object (static shortcut)
Definition: Application.cpp:194
Application operator=(const Application ©)=delete
The main application class. You can only initialize one instance. Typically, you instanciate it in ma...
Definition: Application.h:37
The scene manager controls which scene is currently displayed, in addition to enumerating the scenes ...
Definition: SceneManager.h:22
static SceneManager * getCurrentSceneManager()
Get the scene manager, needed to change the currently displayed scene (static shortcut) ...
Definition: Application.cpp:199
void runOnWorkerThread(Task *task)
Runs the given task on the worker thread. It will be deleted when done.
Definition: Application.cpp:179
SceneManager * getSceneManager()
Get the scene manager, needed to change the currently displayed scene.
Definition: Application.cpp:174
Application(int width, int height, SDL_Color bgColor, std::string touchInputDevice, std::string ttyDevice, int FPS_LIMIT)
Create an application.
Definition: Application.cpp:5
static Application * getCurrent()
Get the currently running application, or null if none is available.
Definition: Application.cpp:221
SDL_Renderer * getRenderer()
Get the SDL renderer object.
Definition: Application.cpp:169
A class that spawns an Executor Thread (or worker thread). The thread is used for handling intensive ...
Definition: WorkerThread.h:25
A task is an object that wraps the code to run on an thread.
Definition: Task.h:18
~Application()
Definition: Application.cpp:46
static SDL_Window * getCurrentWindow()
Get the SDL window object (static shortcut)
Definition: Application.cpp:189