begin raylib
This commit is contained in:
@@ -2,8 +2,6 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <SDL3/SDL_keycode.h>
|
||||
#include <SDL3/SDL_video.h>
|
||||
#include <td/common/StateMachine.h>
|
||||
#include <td/misc/Signal.h>
|
||||
|
||||
@@ -11,17 +9,15 @@ namespace td {
|
||||
|
||||
class Display : public StateMachine<Display, void, float> {
|
||||
private:
|
||||
SDL_Window* m_Window;
|
||||
SDL_GLContext m_GLContext;
|
||||
|
||||
int m_LastWidth, m_LastHeight;
|
||||
int m_LastWidth;
|
||||
int m_LastHeight;
|
||||
float m_AspectRatio;
|
||||
|
||||
bool m_ShouldClose;
|
||||
|
||||
public:
|
||||
utils::Signal<float> OnAspectRatioChange;
|
||||
utils::Signal<SDL_Keycode> OnKeyDown;
|
||||
utils::Signal<int> OnKeyDown;
|
||||
|
||||
Display(int a_Width, int a_Height, const std::string& a_Title);
|
||||
~Display();
|
||||
|
||||
@@ -13,7 +13,7 @@ class DisplayState : public Display::State, private utils::SlotGuard {
|
||||
|
||||
protected:
|
||||
virtual void OnAspectRatioChange(float a_Ratio) {}
|
||||
virtual void OnKeyDown(SDL_Keycode a_Key) {}
|
||||
virtual void OnKeyDown(int a_Key) {}
|
||||
};
|
||||
|
||||
} // namespace td
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace td {
|
||||
class DebugWorldState : public DisplayState {
|
||||
private:
|
||||
render::RenderPipeline m_Renderer;
|
||||
render::Camera m_Camera;
|
||||
Camera m_Camera;
|
||||
std::unique_ptr<server::Server> m_Server;
|
||||
std::unique_ptr<client::Client> m_Client;
|
||||
client::GameState* m_ClientState;
|
||||
@@ -31,7 +31,7 @@ class DebugWorldState : public DisplayState {
|
||||
|
||||
protected:
|
||||
virtual void OnAspectRatioChange(float a_Ratio) override;
|
||||
virtual void OnKeyDown(SDL_Keycode a_Key) override;
|
||||
virtual void OnKeyDown(int a_Key) override;
|
||||
};
|
||||
|
||||
} // namespace td
|
||||
|
||||
@@ -21,7 +21,7 @@ class MainMenuState : public DisplayState, public MainMenuStateStack {
|
||||
void RenderBackButton();
|
||||
|
||||
protected:
|
||||
virtual void OnKeyDown(SDL_Keycode a_Key) override;
|
||||
virtual void OnKeyDown(int a_Key) override;
|
||||
};
|
||||
|
||||
} // namespace td
|
||||
|
||||
Reference in New Issue
Block a user