ScummVM API documentation
gfx_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 GFX_TINYGL_H_
23#define GFX_TINYGL_H_
24
25#include "common/rect.h"
26#include "common/system.h"
27
28#include "math/vector3d.h"
29
30#include "engines/myst3/gfx.h"
31
32#include "graphics/tinygl/tinygl.h"
33
34namespace Myst3 {
35
36class TinyGLRenderer : public Renderer {
37public:
38 TinyGLRenderer(OSystem *_system);
39 virtual ~TinyGLRenderer();
40
41 void init() override;
42
43 void clear() override;
44 void selectTargetWindow(Window *window, bool is3D, bool scaled) override;
45
46 Texture *createTexture2D(const Graphics::Surface *surface) override;
47 Texture *createTexture3D(const Graphics::Surface *surface) override;
48
49 void drawRect2D(const Common::Rect &rect, uint8 a, uint8 r, uint8 g, uint8 b) override;
50 virtual void drawTexturedRect2D(const Common::Rect &screenRect, const Common::Rect &textureRect, Texture *texture,
51 float transparency = -1.0, bool additiveBlending = false) override;
52 virtual void drawTexturedRect3D(const Math::Vector3d &topLeft, const Math::Vector3d &bottomLeft,
53 const Math::Vector3d &topRight, const Math::Vector3d &bottomRight,
54 Texture *texture) override;
55
56 void drawCube(Texture **textures) override;
57 void draw2DText(const Common::String &text, const Common::Point &position) override;
58
59 Graphics::Surface *getScreenshot() override;
60
61 void flipBuffer() override;
62private:
63 void drawFace(uint face, Texture *texture);
64
65 Common::Rect _viewport;
66};
67
68} // End of namespace Myst3
69
70#endif // GFX_H_
Definition: str.h:59
Definition: gfx.h:107
Definition: gfx.h:93
Definition: gfx_tinygl.h:36
void selectTargetWindow(Window *window, bool is3D, bool scaled) override
void flipBuffer() override
Definition: gfx.h:65
Definition: system.h:166
Definition: rect.h:144
Definition: rect.h:536
Definition: surface.h:67