OpenRaider  0.1.4-dev
Open Source Tomb Raider Game Engine implementation
RoomMesh.h
Go to the documentation of this file.
1 
8 #ifndef _ROOM_MESH_H_
9 #define _ROOM_MESH_H_
10 
11 #include <vector>
12 
13 #include "Mesh.h"
14 #include "system/Shader.h"
15 
16 struct RoomVertexTR2 {
17  int x, y, z; // Vertex coordinates, relative to x/zOffset
18  int light1, light2; // Almost always equal
19 
20  // Set of flags for special rendering effects
21  // 0x8000 - Something to do with water surface?
22  // 0x4000 - Underwater lighting modulation/movement if seen from above
23  // 0x2000 - Water/Quicksand surface movement
24  // 0x0010 - Normal?
25  unsigned int attributes;
26 };
27 
28 class RoomMesh {
29  public:
30  RoomMesh(const std::vector<RoomVertexTR2>& vertices,
31  const std::vector<IndexedRectangle>& rectangles,
32  const std::vector<IndexedRectangle>& triangles);
33  void prepare();
34  void display(glm::mat4 MVP);
35 
36  private:
37  std::vector<unsigned short> indicesBuff;
38  std::vector<glm::vec3> verticesBuff;
39  std::vector<unsigned int> texturesBuff;
41 };
42 
43 #endif
44 
OpenGL Shader Implementation.
std::vector< unsigned short > indicesBuff
Definition: RoomMesh.h:37
unsigned int attributes
Definition: RoomMesh.h:25
RoomMesh(const std::vector< RoomVertexTR2 > &vertices, const std::vector< IndexedRectangle > &rectangles, const std::vector< IndexedRectangle > &triangles)
Definition: RoomMesh.cpp:12
Textured/Colored Mesh.
void display(glm::mat4 MVP)
Definition: RoomMesh.cpp:72
ShaderBuffer vertices
Definition: RoomMesh.h:40
std::vector< glm::vec3 > verticesBuff
Definition: RoomMesh.h:38
std::vector< unsigned int > texturesBuff
Definition: RoomMesh.h:39
ShaderBuffer indices
Definition: RoomMesh.h:40
void prepare()
Definition: RoomMesh.cpp:33
ShaderBuffer uvs
Definition: RoomMesh.h:40