ScummVM API documentation
tinyglprop.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_RENDERED_H
23 #define STARK_GFX_TINYGL_RENDERED_H
24 
25 #include "engines/stark/model/model.h"
26 #include "engines/stark/visual/prop.h"
27 #include "engines/stark/gfx/tinygl.h"
28 
29 #include "graphics/tinygl/tinygl.h"
30 
31 #include "common/hashmap.h"
32 #include "common/hash-ptr.h"
33 
34 namespace Stark {
35 
36 namespace Gfx {
37 
38 class Driver;
39 
40 struct _PropVertex {
41  float x;
42  float y;
43  float z;
44  float nx;
45  float ny;
46  float nz;
47  float stexS;
48  float stexT;
49  float texS;
50  float texT;
51  float r;
52  float g;
53  float b;
54 };
55 typedef _PropVertex PropVertex;
56 
58 public:
59  explicit TinyGLPropRenderer(TinyGLDriver *gfx);
60  ~TinyGLPropRenderer() override;
61 
62  void render(const Math::Vector3d &position, float direction, const LightEntryArray &lights) override;
63 
64 protected:
66 
67  TinyGLDriver *_gfx;
68 
69  bool _modelIsDirty;
70  PropVertex *_faceVBO;
71  FaceBufferMap _faceEBO;
72 
73  void clearVertices();
74  void uploadVertices();
75  PropVertex *createFaceVBO();
76  uint32 *createFaceEBO(const Face *face);
77 };
78 
79 } // End of namespace Gfx
80 } // End of namespace Stark
81 
82 #endif // STARK_GFX_TINYGL_S_RENDERED_H
Definition: array.h:52
Definition: tinyglprop.h:40
Definition: tinyglprop.h:57
Definition: model.h:48
Definition: console.h:27
Definition: tinygl.h:37
Definition: prop.h:42