From 965a2a2d791c9f966f7e0eae4f63eb931d83c176 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 15 Jun 2014 21:56:37 +0200 Subject: [PATCH] definition for model vertex buffer. --- src/gl/data/gl_vertexbuffer.h | 33 ++++++++++++++++++++++++++++++++- src/gl/models/gl_models.h | 2 ++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/gl/data/gl_vertexbuffer.h b/src/gl/data/gl_vertexbuffer.h index 50ddd7d130..f82172d08d 100644 --- a/src/gl/data/gl_vertexbuffer.h +++ b/src/gl/data/gl_vertexbuffer.h @@ -44,7 +44,6 @@ struct FFlatVertex class FFlatVertexBuffer : public FVertexBuffer { FFlatVertex *map; - FFlatVertex mDrawBuffer[1000]; unsigned int mIndex; unsigned int mCurIndex; @@ -170,5 +169,37 @@ public: #define VSO ((FSkyVertex*)NULL) +struct FModelVertex +{ + float x, y, z; // world position + float u, v; // texture coordinates + + void Set(float xx, float yy, float zz, float uu, float vv) + { + x = xx; + y = yy; + z = zz; + u = uu; + v = vv; + } +}; + + +class FModelVertexBuffer : public FVertexBuffer +{ + int mIndexFrame[2]; + +public: + TArray vbo_shadowdata; // this is kept around for interpolating on GL 2.0 + + FModelVertexBuffer(); + ~FModelVertexBuffer(); + + void BindVBO(); + void UpdateBufferPointers(int frame1, int frame2); +}; + +#define VMO ((FModelVertex*)NULL) + #endif \ No newline at end of file diff --git a/src/gl/models/gl_models.h b/src/gl/models/gl_models.h index ebfb8b8c5c..4ba2069838 100644 --- a/src/gl/models/gl_models.h +++ b/src/gl/models/gl_models.h @@ -2,9 +2,11 @@ #define __GL_MODELS_H_ #include "gl/utility/gl_geometric.h" +#include "gl/data/gl_vertexbuffer.h" #include "p_pspr.h" #include "r_data/voxels.h" + #define MAX_LODS 4 enum { VX, VZ, VY };