ScummVM API documentation
modular-backend.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef BACKENDS_MODULAR_BACKEND_H
23#define BACKENDS_MODULAR_BACKEND_H
24
25#include "backends/base-backend.h"
26
27class GraphicsManager;
28class MixerManager;
29
48class ModularGraphicsBackend : virtual public BaseBackend {
49public:
52
55
56 bool hasFeature(Feature f) override;
57 void setFeatureState(Feature f, bool enable) override;
58 bool getFeatureState(Feature f) override;
59
61
64
65 GraphicsManager *getGraphicsManager() { return _graphicsManager; }
66 const GraphicsMode *getSupportedGraphicsModes() const override;
67 int getDefaultGraphicsMode() const override;
68 bool setGraphicsMode(int mode, uint flags = kGfxModeNoFlags) override;
69 int getGraphicsMode() const override;
70#if defined(USE_IMGUI)
71 void setImGuiCallbacks(const ImGuiCallbacks &callbacks) override final;
72 void *getImGuiTexture(const Graphics::Surface &image, const byte *palette, int palCount) override final;
73 void freeImGuiTexture(void *texture) override final;
74#endif
75 bool setShader(const Common::Path &name) override final;
76 const GraphicsMode *getSupportedStretchModes() const override final;
77 int getDefaultStretchMode() const override final;
78 bool setStretchMode(int mode) override final;
79 int getStretchMode() const override final;
80 bool setRotationMode(Common::RotationMode rotation) override final;
81 uint getDefaultScaler() const override final;
82 uint getDefaultScaleFactor() const override final;
84 bool setScaler(uint mode, int factor) override final;
85 uint getScaler() const override final;
86 uint getScaleFactor() const override final;
87#ifdef USE_RGB_COLOR
88 Graphics::PixelFormat getScreenFormat() const override final;
89 Common::List<Graphics::PixelFormat> getSupportedFormats() const override final;
90#endif
91 void initSize(uint width, uint height, const Graphics::PixelFormat *format = NULL) override final;
92 void initSizeHint(const Graphics::ModeList &modes) override final;
93 int getScreenChangeID() const override final;
94
95 void beginGFXTransaction() override final;
97
98 int16 getHeight() override final;
99 int16 getWidth() override final;
101 void copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h) override final;
102 Graphics::Surface *lockScreen() override final;
103 void unlockScreen() override final;
104 void fillScreen(uint32 col) override final;
105 void fillScreen(const Common::Rect &r, uint32 col) override final;
106 void updateScreen() override final;
107 void presentBuffer() override final;
108 void setShakePos(int shakeXOffset, int shakeYOffset) override final;
109 void setFocusRectangle(const Common::Rect& rect) override final;
110 void clearFocusRectangle() override final;
111
112 void showOverlay(bool inGUI) override final;
113 void hideOverlay() override final;
114 bool isOverlayVisible() const override final;
115 Graphics::PixelFormat getOverlayFormat() const override final;
116 void clearOverlay() override final;
117 void grabOverlay(Graphics::Surface &surface) override final;
118 void copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h) override final;
119 int16 getOverlayHeight() const override final;
120 int16 getOverlayWidth() const override final;
121 Common::Rect getSafeOverlayArea(int16 *width, int16 *height) const override final;
122
123 float getHiDPIScreenFactor() const override final;
124
125 bool showMouse(bool visible) override final;
126 void warpMouse(int x, int y) override final;
127 void setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, const Graphics::PixelFormat *format, const byte *mask, frac_t scaleX, frac_t scaleY) override final;
128 void setCursorPalette(const byte *colors, uint start, uint num) override final;
129 bool lockMouse(bool lock) override final;
130
132
135
136 void displayMessageOnOSD(const Common::U32String &msg) override final;
137 void displayActivityIconOnOSD(const Graphics::Surface *icon) override final;
138
139 void saveScreenshot() override final;
140
142
143protected:
146
147 GraphicsManager *_graphicsManager;
148
150};
151
152class ModularMixerBackend : virtual public BaseBackend {
153public:
155 virtual ~ModularMixerBackend();
156
159
160 virtual MixerManager *getMixerManager();
161 Audio::Mixer *getMixer() override final;
162
164
165protected:
168
169 MixerManager *_mixerManager;
170
172};
173
174#endif
Definition: mixer.h:70
Definition: base-backend.h:31
Definition: array.h:52
Definition: path.h:52
Definition: graphics.h:38
Definition: mixer.h:31
Definition: modular-backend.h:48
PaletteManager * getPaletteManager() override final
int16 getOverlayHeight() const override final
uint getScaler() const override final
bool showMouse(bool visible) override final
void saveScreenshot() override final
int getDefaultGraphicsMode() const override
uint getDefaultScaleFactor() const override final
void unlockScreen() override final
void setCursorPalette(const byte *colors, uint start, uint num) override final
int getStretchMode() const override final
bool isOverlayVisible() const override final
void fillScreen(uint32 col) override final
OSystem::TransactionError endGFXTransaction() override final
const GraphicsMode * getSupportedStretchModes() const override final
int getScreenChangeID() const override final
void showOverlay(bool inGUI) override final
void setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, const Graphics::PixelFormat *format, const byte *mask, frac_t scaleX, frac_t scaleY) override final
void hideOverlay() override final
void initSize(uint width, uint height, const Graphics::PixelFormat *format=NULL) override final
bool setStretchMode(int mode) override final
float getHiDPIScreenFactor() const override final
int16 getOverlayWidth() const override final
void setFeatureState(Feature f, bool enable) override
bool setGraphicsMode(int mode, uint flags=kGfxModeNoFlags) override
void presentBuffer() override final
void clearFocusRectangle() override final
int getGraphicsMode() const override
Common::Rect getSafeOverlayArea(int16 *width, int16 *height) const override final
void initSizeHint(const Graphics::ModeList &modes) override final
void beginGFXTransaction() override final
int getDefaultStretchMode() const override final
void displayActivityIconOnOSD(const Graphics::Surface *icon) override final
uint getScaleFactor() const override final
bool getFeatureState(Feature f) override
void setShakePos(int shakeXOffset, int shakeYOffset) override final
uint getDefaultScaler() const override final
void displayMessageOnOSD(const Common::U32String &msg) override final
bool setShader(const Common::Path &name) override final
int16 getWidth() override final
void copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h) override final
bool lockMouse(bool lock) override final
const GraphicsMode * getSupportedGraphicsModes() const override
void warpMouse(int x, int y) override final
void copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h) override final
void grabOverlay(Graphics::Surface &surface) override final
bool setRotationMode(Common::RotationMode rotation) override final
int16 getHeight() override final
Graphics::Surface * lockScreen() override final
bool setScaler(uint mode, int factor) override final
void clearOverlay() override final
Graphics::PixelFormat getOverlayFormat() const override final
void setFocusRectangle(const Common::Rect &rect) override final
void updateScreen() override final
bool hasFeature(Feature f) override
Definition: modular-backend.h:152
Audio::Mixer * getMixer() override final
Definition: system.h:166
Definition: paletteman.h:47
int32 frac_t
Definition: frac.h:52
RotationMode
Definition: rotationmode.h:44
Feature
Definition: system.h:415
TransactionError
Definition: system.h:1188
@ kGfxModeNoFlags
Definition: system.h:790
Definition: algorithm.h:29
Definition: formatinfo.h:28
Definition: pixelformat.h:138
Definition: surface.h:67
Definition: system.h:741