diff options
author | Chris Xiong <chirs241097@gmail.com> | 2016-05-06 00:07:27 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2016-05-06 00:07:27 +0800 |
commit | 8da0f5c82fb91c2731cd2e90a875fe92c6557407 (patch) | |
tree | f8ef262d66bd8fdc4b455da3fcceaed58d2b4d80 /visualization/extrasmeltutils.hpp | |
parent | 56eaa27d4daca9264dac2e822b1126cf6eb8cbf4 (diff) | |
download | QMidiPlayer-8da0f5c82fb91c2731cd2e90a875fe92c6557407.tar.xz |
Use the new SMELT rendering API.
Diffstat (limited to 'visualization/extrasmeltutils.hpp')
-rw-r--r-- | visualization/extrasmeltutils.hpp | 30 |
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 |