ScummVM API documentation
tinygl.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 STARK_GFX_TINYGL_H
23 #define STARK_GFX_TINYGL_H
24 
25 #include "common/system.h"
26 
27 #include "math/vector3d.h"
28 
29 #include "engines/stark/gfx/driver.h"
30 #include "engines/stark/gfx/renderentry.h"
31 
32 #include "graphics/tinygl/tinygl.h"
33 
34 namespace Stark {
35 namespace Gfx {
36 
37 class TinyGLDriver : public Driver {
38 public:
39  TinyGLDriver();
40  ~TinyGLDriver();
41 
42  void init() override;
43 
44  void setScreenViewport(bool noScaling) override;
45  void setViewport(const Common::Rect &rect) override;
46 
47  void clearScreen() override;
48  void flipBuffer() override;
49 
50  Texture *createTexture() override;
51  Bitmap *createBitmap(const Graphics::Surface *surface = nullptr, const byte *palette = nullptr) override;
52  VisualActor *createActorRenderer() override;
53  VisualProp *createPropRenderer() override;
55  FadeRenderer *createFadeRenderer() override;
56 
57  void start2DMode();
58  void end2DMode();
59  void set3DMode() override;
60  bool computeLightsEnabled() override;
61 
62  Common::Rect getViewport() const;
63  Common::Rect getUnscaledViewport() const;
64  void setupLights(const LightEntryArray &lights);
65 
66  Graphics::Surface *getViewportScreenshot() const override;
67 
68  bool supportsModdedAssets() const override { return false; }
69 
70 private:
71  Common::Rect _viewport;
72  Common::Rect _unscaledViewport;
73 };
74 
75 } // End of namespace Gfx
76 } // End of namespace Stark
77 
78 #endif // STARK_GFX_TINYGL_H
VisualActor * createActorRenderer() override
VisualProp * createPropRenderer() override
Definition: surface.h:67
Definition: array.h:52
Texture * createTexture() override
Graphics::Surface * getViewportScreenshot() const override
Definition: rect.h:144
Definition: surfacerenderer.h:36
Definition: driver.h:44
Bitmap * createBitmap(const Graphics::Surface *surface=nullptr, const byte *palette=nullptr) override
Definition: texture.h:37
Definition: actor.h:50
Definition: console.h:27
Definition: bitmap.h:38
Definition: faderenderer.h:31
Definition: tinygl.h:37
SurfaceRenderer * createSurfaceRenderer() override
Definition: prop.h:42
FadeRenderer * createFadeRenderer() override