sync line added in cooperate mode
This commit is contained in:
33
src/graphics/renderers/SyncLineRenderer.h
Normal file
33
src/graphics/renderers/SyncLineRenderer.h
Normal file
@ -0,0 +1,33 @@
|
||||
#pragma once
|
||||
#include <SDL3/SDL.h>
|
||||
|
||||
enum class SyncState {
|
||||
Idle,
|
||||
LeftReady,
|
||||
RightReady,
|
||||
Synced,
|
||||
ClearFlash
|
||||
};
|
||||
|
||||
class SyncLineRenderer {
|
||||
public:
|
||||
SyncLineRenderer();
|
||||
|
||||
void SetRect(const SDL_FRect& rect);
|
||||
void SetState(SyncState state);
|
||||
void TriggerClearFlash();
|
||||
|
||||
void Update(float deltaTime);
|
||||
void Render(SDL_Renderer* renderer);
|
||||
|
||||
private:
|
||||
SDL_FRect m_rect{};
|
||||
SyncState m_state;
|
||||
|
||||
float m_flashTimer;
|
||||
float m_time;
|
||||
|
||||
static constexpr float FLASH_DURATION = 0.15f;
|
||||
|
||||
SDL_Color GetBaseColor() const;
|
||||
};
|
||||
Reference in New Issue
Block a user