forked from electronicarts/CnC_Generals_Zero_Hour
-
Notifications
You must be signed in to change notification settings - Fork 199
Expand file tree
/
Copy pathSDL3GameEngine.h
More file actions
95 lines (83 loc) · 2.83 KB
/
SDL3GameEngine.h
File metadata and controls
95 lines (83 loc) · 2.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/*
** Command & Conquer Generals Zero Hour(tm)
** Copyright 2026 TheSuperHackers
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
** Derived from the GeneralsX branch by fbraz3
*/
#pragma once
#include "Lib/BaseType.h"
#include "Common/GameEngine.h"
#include <SDL3/SDL.h>
// EXTERNALS
// SDL3 window typically provided by WinMain integration
extern SDL_Window* TheSDL3Window;
// Forward declarations for base classes
class AudioManager;
class Mouse;
class Keyboard;
class GameWindow;
class LocalFileSystem;
class ArchiveFileSystem;
class ThingFactory;
class ModuleFactory;
class FunctionLexicon;
class Radar;
class WebBrowser;
class ParticleSystemManager;
/**
* SDL3GameEngine
*
* GameEngine subclass that uses SDL3 for windowing and input.
* Replaces or supplements Win32-specific window handling with SDL3.
*/
class SDL3GameEngine : public GameEngine
{
public:
SDL3GameEngine();
virtual ~SDL3GameEngine();
// GameEngine interface
virtual void init(void) override;
virtual void reset(void) override;
virtual void update(void) override;
virtual void serviceWindowsOS(void) override;
virtual Bool isActive(void) override;
virtual void setIsActive(Bool isActive) override;
// Factory methods (override GameEngine)
virtual LocalFileSystem *createLocalFileSystem(void) override;
virtual ArchiveFileSystem *createArchiveFileSystem(void) override;
virtual GameLogic *createGameLogic(void) override;
virtual GameClient *createGameClient(void) override;
virtual ModuleFactory *createModuleFactory(void) override;
virtual ThingFactory *createThingFactory(void) override;
virtual FunctionLexicon *createFunctionLexicon(void) override;
virtual Radar *createRadar(Bool dummy) override;
virtual WebBrowser *createWebBrowser(void) override;
virtual ParticleSystemManager* createParticleSystemManager(Bool dummy) override;
virtual AudioManager *createAudioManager(Bool dummy) override;
// SDL3 specific
virtual SDL_Window* getSDLWindow(void) const { return m_SDLWindow; }
virtual void forwardTextInputEvent(const char* utf8Text);
protected:
SDL_Window* m_SDLWindow;
Bool m_IsInitialized;
Bool m_IsActive;
Bool m_IsTextInputActive;
GameWindow* m_TextInputFocusWindow;
// Event processing
void pollSDL3Events(void);
void updateTextInputState(void);
};