summaryrefslogtreecommitdiffstats
path: root/src/graphics/engine/engine.h
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2012-12-14 21:30:35 +0100
committerPiotr Dziwinski <piotrdz@gmail.com>2012-12-14 21:30:35 +0100
commit4811defca2eeea69e40346be6b1647f276db8c76 (patch)
tree52204202603817d09d93ed8a863b69f93ada74b2 /src/graphics/engine/engine.h
parent39ac36efda1f7c7b446886cf2508518f06e132ba (diff)
downloadcolobot-4811defca2eeea69e40346be6b1647f276db8c76.tar.gz
colobot-4811defca2eeea69e40346be6b1647f276db8c76.tar.bz2
colobot-4811defca2eeea69e40346be6b1647f276db8c76.zip
Static objects using OpenGL VBOs and display lists
Diffstat (limited to 'src/graphics/engine/engine.h')
-rw-r--r--src/graphics/engine/engine.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/graphics/engine/engine.h b/src/graphics/engine/engine.h
index d127e74..de57e4d 100644
--- a/src/graphics/engine/engine.h
+++ b/src/graphics/engine/engine.h
@@ -195,7 +195,9 @@ struct EngineObject
//! Number of triangles
int totalTriangles;
//! Type of object
- EngineObjectType type;
+ EngineObjectType type;
+ //! Whether the object is stored and rendered as static buffer
+ bool staticBuffer;
//! Transformation matrix
Math::Matrix transform;
//! Distance to object from eye point
@@ -225,6 +227,7 @@ struct EngineObject
drawWorld = false;
drawFront = false;
totalTriangles = 0;
+ staticBuffer = false;
type = ENG_OBJTYPE_NULL;
transform.LoadIdentity();
bboxMax.LoadZero();
@@ -252,6 +255,7 @@ struct EngineObjLevel4
Material material;
int state;
std::vector<VertexTex2> vertices;
+ unsigned int staticBufferId;
EngineObjLevel4(bool used = false,
EngineTriangleType type = ENG_TRIANGLE_TYPE_TRIANGLES,
@@ -760,6 +764,12 @@ public:
bool GetObjectTransform(int objRank, Math::Matrix& transform);
//@}
+ //@{
+ //! Management of object static drawing flag
+ void SetObjectStatic(int objRank, bool staticBuffer);
+ bool GetObjectStatic(int objRank);
+ //@}
+
//! Sets drawWorld for given object
bool SetObjectDrawWorld(int objRank, bool draw);
//! Sets drawFront for given object
@@ -1151,6 +1161,8 @@ public:
protected:
//! Prepares the interface for 3D scene
void Draw3DScene();
+ //! Draw 3D object
+ void DrawObject(const EngineObjLevel4& obj, bool staticBuffer);
//! Draws the user interface over the scene
void DrawInterface();
@@ -1215,6 +1227,9 @@ protected:
//! Updates geometric parameters of objects (bounding box and radius)
void UpdateGeometry();
+ //! Updates static buffers of changed objects
+ void UpdateStaticObjects();
+
protected:
CInstanceManager* m_iMan;
CApplication* m_app;
@@ -1293,6 +1308,7 @@ protected:
Color m_waterAddColor;
int m_statisticTriangle;
bool m_updateGeometry;
+ bool m_updateStaticObjects;
int m_alphaMode;
bool m_groundSpotVisible;
bool m_shadowVisible;