aboutsummaryrefslogtreecommitdiff
path: root/visualization/extrasmeltutils.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'visualization/extrasmeltutils.hpp')
-rw-r--r--visualization/extrasmeltutils.hpp30
1 files changed, 22 insertions, 8 deletions
diff --git a/visualization/extrasmeltutils.hpp b/visualization/extrasmeltutils.hpp
index 4b6c167..8a4a1bc 100644
--- a/visualization/extrasmeltutils.hpp
+++ b/visualization/extrasmeltutils.hpp
@@ -5,15 +5,29 @@
#include <smmath.hpp>
class smEntity3D
{
+ friend class smEntity3DBuffer;
private:
- std::vector<smQuad> surfaces;
- static SMELT *sm;
+ std::vector<smVertex> vertices;
+ std::vector<WORD> indices;
public:
- smEntity3D();
- ~smEntity3D(){surfaces.clear();sm->smRelease();}
- void pushSurface(smQuad q);
- void pushCube(smvec3d a,smvec3d b,DWORD color,DWORD mask);
- void drawAt(smvec3d p);
- void drawWithTransformation(smMatrix t,smvec3d p);
+ smEntity3D(){vertices.clear();indices.clear();}
+ ~smEntity3D(){vertices.clear();indices.clear();}
+ void addVerices(int n,...);
+ void addIndices(int n,...);
+ static smEntity3D cube(smvec3d tl,smvec3d br,DWORD color);
};
+class smEntity3DBuffer
+{
+ private:
+ std::vector<smVertex> vertices;
+ std::vector<WORD> indices;
+ static SMELT* sm;
+ public:
+ smEntity3DBuffer();
+ ~smEntity3DBuffer(){sm->smRelease();}
+ void addTransformedEntity(smEntity3D *entity,smMatrix t,smvec3d p);
+ void drawBatch();
+
+};
+extern smVertex makeVertex(float x,float y,float z,DWORD color,float tx,float ty);
#endif // EXTRASMELTUTILS_H