Skip to content

Commit 5a1cc58

Browse files
Redo #52
1 parent 28146df commit 5a1cc58

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Util/Input.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "Util/Input.hpp"
22

33
#include <SDL_events.h> // for SDL_Event
4+
#include "config.hpp"
45

56
namespace Util {
67

@@ -52,6 +53,9 @@ void Input::Update() {
5253
s_CursorPosition.x = static_cast<float>(x);
5354
s_CursorPosition.y = static_cast<float>(y);
5455

56+
s_CursorPosition.x -= static_cast<float>(WINDOW_WIDTH) / 2;
57+
s_CursorPosition.y = -(s_CursorPosition.y - static_cast<float>(WINDOW_HEIGHT) / 2);
58+
5559
s_LBPressed = s_RBPressed = s_MBPressed = s_Scroll = s_MouseMoving = false;
5660

5761
while (SDL_PollEvent(&s_Event) != 0) {

0 commit comments

Comments
 (0)