ScummVM API documentation
playground3d.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_H
23 #define PLAYGROUND3D_H
24 
25 #include "common/array.h"
26 
27 #include "graphics/framelimiter.h"
28 
29 #include "engines/engine.h"
30 
31 #include "engines/playground3d/gfx.h"
32 
33 namespace Playground3d {
34 
35 enum Actions {
36  kActionSwitchTest,
37  kActionEnableFog,
38  kActionEnableScissor
39 };
40 
41 class Playground3dEngine : public Engine {
42 public:
44  ~Playground3dEngine() override;
45 
46  Common::Error run() override;
47 
48  bool hasFeature(EngineFeature f) const override;
49 
50  void genTextures();
51 
52  void processInput();
53 
54  void drawFrame();
55 
56 private:
57  OSystem *_system;
58  Renderer *_gfx;
59  Graphics::FrameLimiter *_frameLimiter;
60  Math::Vector4d _clearColor;
61  Math::Vector4d _fogColor;
62  int _testId;
63  float _fade;
64  bool _fadeIn;
65  bool _fogEnable;
66  bool _scissorEnable;
67  Graphics::Surface *_rgbaTexture;
68  Graphics::Surface *_rgbTexture;
69  Graphics::Surface *_rgb565Texture;
70  Graphics::Surface *_rgba5551Texture;
71  Graphics::Surface *_rgba4444Texture;
72 
73  float _rotateAngleX, _rotateAngleY, _rotateAngleZ;
74 
75  Graphics::Surface *generateRgbaTexture(int width, int height, Graphics::PixelFormat format);
76  void drawAndRotateCube();
77  void drawPolyOffsetTest();
78  void dimRegionInOut();
79  void drawInViewport();
80  void drawRgbaTexture();
81 };
82 
83 } // End of namespace Playground3d
84 
85 #endif // PLAYGROUND3D_H
Definition: framelimiter.h:40
Definition: gfx.h:35
Definition: surface.h:67
EngineFeature
Definition: engine.h:260
Definition: error.h:81
Common::Error run() override
Definition: pixelformat.h:138
bool hasFeature(EngineFeature f) const override
Definition: gfx.h:48
Definition: playground3d.h:41
Definition: system.h:163
Definition: engine.h:146