ScummVM API documentation
gfx_opengl.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 PLAYGROUND3D_GFX_OPENGL_H
23 #define PLAYGROUND3D_GFX_OPENGL_H
24 
25 #include "common/rect.h"
26 #include "common/system.h"
27 
28 #include "math/vector3d.h"
29 
30 #include "graphics/opengl/system_headers.h"
31 
32 #include "engines/playground3d/gfx.h"
33 
34 namespace Playground3d {
35 
36 class OpenGLRenderer : public Renderer {
37 public:
38  OpenGLRenderer(OSystem *_system);
39  virtual ~OpenGLRenderer();
40 
41  void init() override;
42  void deinit() override;
43 
44  void clear(const Math::Vector4d &clearColor) override;
45  void loadTextureRGBA(Graphics::Surface *texture) override;
46  void loadTextureRGB(Graphics::Surface *texture) override;
47  void loadTextureRGB565(Graphics::Surface *texture) override;
48  void loadTextureRGBA5551(Graphics::Surface *texture) override;
49  void loadTextureRGBA4444(Graphics::Surface *texture) override;
50 
51  void setupViewport(int x, int y, int width, int height) override;
52  void drawCube(const Math::Vector3d &pos, const Math::Vector3d &roll) override;
53  void drawPolyOffsetTest(const Math::Vector3d &pos, const Math::Vector3d &roll) override;
54  void dimRegionInOut(float fade) override;
55  void drawInViewport() override;
56  void drawRgbaTexture() override;
57 
58  void enableFog(const Math::Vector4d &fogColor) override;
59 
60 private:
61  Math::Vector3d _pos;
62  GLuint _textureRgbaId[5];
63  GLuint _textureRgbId[5];
64  GLuint _textureRgb565Id[2];
65  GLuint _textureRgba5551Id[2];
66  GLuint _textureRgba4444Id[2];
67 
68  void drawFace(uint face);
69 };
70 
71 } // End of namespace Playground3d
72 
73 #endif // PLAYGROUND3D_GFX_OPENGL_H
Definition: gfx.h:35
Definition: surface.h:67
Definition: gfx_opengl.h:36
Definition: gfx.h:37
Definition: system.h:161