mirror of
https://github.com/niellun/FastCarPlay.git
synced 2026-06-07 09:38:25 +02:00
Optimise and refactor protocol, better logging, optimise rendering, double buffering.
This commit is contained in:
+7
-7
@@ -3,11 +3,13 @@
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
|
||||
#include "helper/protocol_const.h"
|
||||
#include "protocol/protocol_const.h"
|
||||
|
||||
#include "protocol.h"
|
||||
#include "connector.h"
|
||||
#include "renderer.h"
|
||||
|
||||
#define REDRAW_REQUEST 5
|
||||
|
||||
class Application
|
||||
{
|
||||
public:
|
||||
@@ -19,28 +21,26 @@ public:
|
||||
private:
|
||||
struct State
|
||||
{
|
||||
bool connected = false;
|
||||
bool dirty = false;
|
||||
bool frameRendered = false;
|
||||
int requestFrame = 0;
|
||||
bool showVideo = true;
|
||||
bool fullscreen = false;
|
||||
bool mouseDown = false;
|
||||
int8_t deviceStatus = PROTOCOL_STATUS_INITIALISING;
|
||||
bool flushBuffers = false;
|
||||
int8_t previousdeviceStatus = PROTOCOL_STATUS_INITIALISING;
|
||||
atomic<int8_t> deviceStatus = PROTOCOL_STATUS_INITIALISING;
|
||||
};
|
||||
|
||||
bool setAudioDriver();
|
||||
int processKey(SDL_Keysym key);
|
||||
bool processSystemEvent(const SDL_Event &e);
|
||||
bool processFrameEvents(Protocol &protocol, Renderer &renderer);
|
||||
bool processFrameEvents(AtomicQueue<Message> &queue, Renderer &renderer);
|
||||
|
||||
void loop();
|
||||
|
||||
SDL_Window *_window;
|
||||
SDL_Renderer *_renderer;
|
||||
bool _active;
|
||||
Uint32 _evtBase;
|
||||
SDL_DisplayMode _displayMode;
|
||||
State _state;
|
||||
int _width;
|
||||
|
||||
Reference in New Issue
Block a user