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" 96 virtual bool showMouse(
bool visible)
override;
97 bool lockMouse(
bool lock)
override;
99 virtual bool saveScreenshot(
const Common::Path &filename)
const {
return false; }
100 void saveScreenshot()
override;
110 int screenWidth, screenHeight;
141 enum CustomEventAction {
142 kActionToggleFullscreen = 100,
143 kActionToggleMouseCapture,
144 kActionToggleResizableWindow,
145 kActionSaveScreenshot,
146 kActionToggleAspectRatioCorrection,
147 kActionToggleFilteredScaling,
148 kActionCycleStretchMode,
149 kActionIncreaseScaleFactor,
150 kActionDecreaseScaleFactor,
151 kActionNextScaleFilter,
152 kActionPreviousScaleFilter
158 bool defaultGraphicsModeConfig()
const;
165 #if SDL_VERSION_ATLEAST(3, 0, 0) 167 SDL_GetWindowSizeInPixels(_window->getSDLWindow(), width, height);
168 #elif SDL_VERSION_ATLEAST(2, 0, 0) 170 SDL_GL_GetDrawableSize(_window->getSDLWindow(), width, height);
175 *width = _hwScreen->w;
179 *height = _hwScreen->h;
184 virtual void showSystemMouseCursor(
bool visible);
192 #if SDL_VERSION_ATLEAST(2, 0, 0) 194 void unlockWindowSize() {
195 _allowWindowSizeReset =
true;
202 bool _allowWindowSizeReset;
203 int _hintedWidth, _hintedHeight;
205 bool createOrUpdateWindow(
const int width,
const int height,
const Uint32 flags);
208 SDL_Surface *_hwScreen;
213 void toggleFullScreen();
215 #if defined(USE_IMGUI) && SDL_VERSION_ATLEAST(2, 0, 0) 217 void setImGuiCallbacks(
const ImGuiCallbacks &callbacks)
override;
220 ImGuiCallbacks _imGuiCallbacks;
221 bool _imGuiReady =
false;
222 bool _imGuiInited =
false;
223 SDL_Renderer *_imGuiSDLRenderer =
nullptr;
225 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:134
virtual void notifyVideoExpose()=0
void getWindowSizeFromSdl(int *width, int *height) const
Definition: sdl-graphics.h:164
void handleResizeImpl(const int width, const int height) override
Definition: windowed.h:52
Definition: sdl-graphics.h:109
bool setState(const State &state)
RotationMode
Definition: rotationmode.h:44
void notifyActiveAreaChanged() override
Definition: sdl-window.h:30
virtual void notifyResize(const int width, const int height)
Definition: sdl-graphics.h:77