ScummVM API documentation
ios-graphics.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_GRAPHICS_IOS_IOS_GRAPHICS_H
23 #define BACKENDS_GRAPHICS_IOS_IOS_GRAPHICS_H
24 
25 #include "common/scummsys.h"
26 #include <OpenGLES/ES2/gl.h>
27 
28 #include "backends/graphics/opengl/opengl-graphics.h"
29 
31 public:
32  virtual ~iOSCommonGraphics() {}
33 
34  virtual void initSurface() = 0;
35  virtual void deinitSurface() = 0;
36 
41  virtual void notifyResize(const int width, const int height) = 0;
42 
43  virtual Common::Point getMousePosition() = 0;
44  virtual bool notifyMousePosition(Common::Point &mouse) = 0;
45 
50  struct State {
51  int screenWidth, screenHeight;
52  bool aspectRatio;
53  bool cursorPalette;
54 
55 #ifdef USE_RGB_COLOR
56  Graphics::PixelFormat pixelFormat;
57 #endif
58  };
59 
63  virtual State getState() const = 0;
64 
68  virtual bool setState(const State &state) = 0;
69 
70 protected:
71  int _old_touch_mode;
72 };
73 
76 public:
78  virtual ~iOSGraphicsManager();
79 
80  void initSurface() override;
81  void deinitSurface() override;
82 
83  void notifyResize(const int width, const int height) override;
84 
85  virtual iOSCommonGraphics::State getState() const override;
86  virtual bool setState(const iOSCommonGraphics::State &state) override;
87 
88  bool notifyMousePosition(Common::Point &mouse) override;
89  Common::Point getMousePosition() override { return Common::Point(_cursorX, _cursorY); }
90 
91  float getHiDPIScreenFactor() const override;
92 
93 protected:
94  void setSystemMousePosition(const int x, const int y) override {}
95 
96  bool loadVideoMode(uint requestedWidth, uint requestedHeight, const Graphics::PixelFormat &format) override;
97  void showOverlay(bool inGUI) override;
98  void hideOverlay() override;
99 
100  void refreshScreen() override;
101 };
102 
103 #endif
Definition: ios-graphics.h:30
Definition: ios-graphics.h:74
virtual State getState() const =0
Definition: pixelformat.h:138
Definition: ios-graphics.h:50
Definition: opengl-graphics.h:57
Definition: rect.h:45
virtual bool setState(const State &state)=0
void setSystemMousePosition(const int x, const int y) override
Definition: ios-graphics.h:94
virtual void notifyResize(const int width, const int height)=0