ScummVM API documentation
tinyglsurface.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_SURFACE_H
23 #define STARK_GFX_TINYGL_SURFACE_H
24 
25 #include "engines/stark/gfx/surfacerenderer.h"
26 #include "engines/stark/gfx/tinygl.h"
27 
28 #include "graphics/tinygl/tinygl.h"
29 
30 #include "math/vector2d.h"
31 
32 namespace Stark {
33 namespace Gfx {
34 
35 class TinyGLDriver;
36 class Bitmap;
37 
42 public:
44  virtual ~TinyGLSurfaceRenderer();
45 
46  // SurfaceRenderer API
47  void render(const Bitmap *bitmap, const Common::Point &dest) override;
48  void render(const Bitmap *bitmap, const Common::Point &dest, uint width, uint height) override;
49  void fill(const Color &color, const Common::Point &dest, uint width, uint height) override;
50 
51 private:
52  struct SurfaceVertex {
53  float x;
54  float y;
55  };
56 
57  Math::Vector2d normalizeOriginalCoordinates(int x, int y) const;
58  Math::Vector2d normalizeCurrentCoordinates(int x, int y) const;
59  void convertToVertices(SurfaceVertex *vertices, const Common::Point &dest, uint width, uint height) const;
60 
61  TinyGLDriver *_gfx;
62 };
63 
64 } // End of namespace Gfx
65 } // End of namespace Stark
66 
67 #endif // STARK_GFX_TINYGL_SURFACE_H
Definition: surfacerenderer.h:36
Definition: console.h:27
Definition: bitmap.h:38
Definition: tinyglsurface.h:41
Definition: rect.h:45
Definition: tinygl.h:37
Definition: color.h:30
void fill(const Color &color, const Common::Point &dest, uint width, uint height) override
void render(const Bitmap *bitmap, const Common::Point &dest) override