22 #ifndef BACKENDS_GRAPHICS_SDL_SDLGRAPHICS_H 23 #define BACKENDS_GRAPHICS_SDL_SDLGRAPHICS_H 25 #include "backends/graphics/windowed.h" 26 #include "backends/platform/sdl/sdl-window.h" 28 #include "common/events.h" 29 #include "common/rect.h" 94 virtual bool showMouse(
bool visible)
override;
95 bool lockMouse(
bool lock)
override;
97 virtual bool saveScreenshot(
const Common::Path &filename)
const {
return false; }
98 void saveScreenshot()
override;
110 int screenWidth, screenHeight;
142 enum CustomEventAction {
143 kActionToggleFullscreen = 100,
144 kActionToggleMouseCapture,
145 kActionToggleResizableWindow,
146 kActionSaveScreenshot,
147 kActionToggleAspectRatioCorrection,
148 kActionToggleFilteredScaling,
149 kActionCycleStretchMode,
150 kActionIncreaseScaleFactor,
151 kActionDecreaseScaleFactor,
152 kActionNextScaleFilter,
153 kActionPreviousScaleFilter
159 bool defaultGraphicsModeConfig()
const;
166 #if SDL_VERSION_ATLEAST(3, 0, 0) 168 SDL_GetWindowSizeInPixels(_window->getSDLWindow(), width, height);
169 #elif SDL_VERSION_ATLEAST(2, 0, 0) 171 SDL_GL_GetDrawableSize(_window->getSDLWindow(), width, height);
176 *width = _hwScreen->w;
180 *height = _hwScreen->h;
185 virtual void showSystemMouseCursor(
bool visible);
193 #if SDL_VERSION_ATLEAST(2, 0, 0) 195 void unlockWindowSize() {
196 _allowWindowSizeReset =
true;
202 virtual void destroyingWindow() {}
206 bool _allowWindowSizeReset;
207 int _hintedWidth, _hintedHeight;
209 bool createOrUpdateWindow(
const int width,
const int height,
const Uint32 flags);
212 SDL_Surface *_hwScreen;
222 void toggleFullScreen();
224 #if defined(USE_IMGUI) && SDL_VERSION_ATLEAST(2, 0, 0) 226 void setImGuiCallbacks(
const ImGuiCallbacks &callbacks)
override;
229 ImGuiCallbacks _imGuiCallbacks;
230 bool _imGuiReady =
false;
231 bool _imGuiInited =
false;
232 SDL_Renderer *_imGuiSDLRenderer =
nullptr;
234 void initImGui(SDL_Renderer *renderer,
void *glContext);
virtual void activateManager()
virtual bool notifyMousePosition(Common::Point &mouse)
void setSystemMousePosition(const int x, const int y) override
Definition: sdl-events.h:40
Common::Rect getPreferredFullscreenResolution()
bool notifyEvent(const Common::Event &event) override
Definition: sdl-graphics.h:38
virtual void deactivateManager()
SdlWindow * getWindow() const
Definition: sdl-graphics.h:135
virtual void notifyVideoExpose()=0
void getWindowSizeFromSdl(int *width, int *height) const
Definition: sdl-graphics.h:165
void handleResizeImpl(const int width, const int height) override
Definition: windowed.h:52
Common::RotationMode _rotationMode
Definition: windowed.h:467
Definition: sdl-graphics.h:109
bool setState(const State &state)
virtual bool canSwitchFullscreen() const
Definition: sdl-graphics.h:219
void notifyActiveAreaChanged() override
RotationMode
Definition: rotationmode.h:44
Definition: sdl-window.h:30
virtual void notifyResize(const int width, const int height)
Definition: sdl-graphics.h:77