Skip to content

Commit 5a52609

Browse files
committed
fixed build error
1 parent 18b2f1a commit 5a52609

3 files changed

Lines changed: 10 additions & 7 deletions

File tree

Core/GameEngineDevice/Include/SDL3Device/GameClient/SDL3Input.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class SDL3Keyboard : public Keyboard
143143
class SDL3InputManager
144144
{
145145
public:
146-
SDL3InputManager();
146+
SDL3InputManager(SDL_Window* window);
147147
virtual ~SDL3InputManager();
148148

149149
void update();
@@ -180,6 +180,9 @@ class SDL3InputManager
180180
// Gamepad management
181181
void openFirstGamepad();
182182
void closeGamepad();
183+
184+
SDL_Window* m_window;
185+
SDL_Gamepad* m_gamepad;
183186
void processGamepadInput();
184187
void handleGamepadButton(SDL_GamepadButton button, bool& currentState, bool isDown, std::function<void(bool)> action);
185188

@@ -200,7 +203,6 @@ class SDL3InputManager
200203
UnsignedInt m_keyNextGet;
201204

202205
// Gamepad state
203-
SDL_Gamepad* m_gamepad;
204206
GamepadState m_state;
205207

206208
Bool m_precisionMode;

Core/GameEngineDevice/Source/SDL3Device/GameClient/SDL3Input.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -853,8 +853,9 @@ KeyVal SDL3Keyboard::translateScanCodeToKeyVal(unsigned char scan)
853853
/**
854854
* Lifecycle
855855
*/
856-
SDL3InputManager::SDL3InputManager()
857-
: m_mouseNextFree(0),
856+
SDL3InputManager::SDL3InputManager(SDL_Window* window)
857+
: m_window(window),
858+
m_mouseNextFree(0),
858859
m_mouseNextGet(0),
859860
m_keyNextFree(0),
860861
m_keyNextGet(0),
@@ -1098,9 +1099,9 @@ void SDL3InputManager::processGamepadInput()
10981099
motionEvent.motion.x = mx + motionEvent.motion.xrel;
10991100
motionEvent.motion.y = my + motionEvent.motion.yrel;
11001101

1101-
if (m_SDLWindow)
1102+
if (m_window)
11021103
{
1103-
motionEvent.motion.windowID = SDL_GetWindowID(m_SDLWindow);
1104+
motionEvent.motion.windowID = SDL_GetWindowID(m_window);
11041105
}
11051106

11061107
addMouseSDLEvent(motionEvent);

Core/GameEngineDevice/Source/SDL3GameEngine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ void SDL3GameEngine::init(void)
161161

162162
// Initialize the unified input manager
163163
if (!TheSDL3InputManager) {
164-
NEW SDL3InputManager();
164+
TheSDL3InputManager = new SDL3InputManager(m_SDLWindow);
165165
}
166166

167167
// Call parent init to initialize game subsystems

0 commit comments

Comments
 (0)