diff options
author | Chris Xiong <chirs241097@gmail.com> | 2015-10-06 21:28:40 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2015-10-06 21:28:40 +0800 |
commit | 038b31f0158a0018dbf2eceb71026cc4e665faa9 (patch) | |
tree | a373ddab7bc162e477e28a780b0d729660ff8634 /include/smentity.hpp | |
parent | a8077292d5d9118866f7358c11a90c855e1b1b02 (diff) | |
download | SMELT-038b31f0158a0018dbf2eceb71026cc4e665faa9.tar.xz |
Add the SMELT files...
Please, do not laugh too loudly.
Diffstat (limited to 'include/smentity.hpp')
-rw-r--r-- | include/smentity.hpp | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/include/smentity.hpp b/include/smentity.hpp new file mode 100644 index 0000000..54fb3fb --- /dev/null +++ b/include/smentity.hpp @@ -0,0 +1,65 @@ +// -*- C++ -*- +/* + * Simple MultimEdia LiTerator(SMELT) + * by Chris Xiong 2015 + * Entity header + * + * WARNING: This library is in development and interfaces would be very + * unstable. + * + */ +#ifndef SMENTITY_H +#define SMENTITY_H +#include "smelt.hpp" +class smEntity2D +{ +private: + smEntity2D(); + static SMELT *sm; + smQuad quad; + float tx,ty,w,h,texw,texh; + float ctrx,ctry; +public: + smEntity2D(SMTEX tex,float _x,float _y,float _w,float _h); + smEntity2D(SMTEX tex,smTexRect rect); + smEntity2D(const smEntity2D ©); + ~smEntity2D(){sm->smRelease();} + void render(float x,float y,float rot=0,float wsc=1.,float hsc=0.); + + void setTexture(SMTEX tex); + void setTextureRect4f(float _x,float _y,float _w,float _h); + void setTextureRectv(smTexRect rect); + void setColor(DWORD col,int v=-1); + void setZ(float z,int v=-1); + void setBlend(int blend); + void setCentre(float x,float y); + float _w(){return w;} + float _h(){return h;} +}; + +class smEntity3D +{ +private: + smEntity3D(); + static SMELT *sm; + smQuad quad; + float tx,ty,w,h,texw,texh; + float ctrx,ctry; +public: + smEntity3D(SMTEX tex,float _x,float _y,float _w,float _h); + smEntity3D(SMTEX tex,smTexRect rect); + smEntity3D(const smEntity3D ©); + ~smEntity3D(){sm->smRelease();} + void render9f(float x,float y,float z,float ra=.0,float rx=.0,float ry=.0,float rz=.0,float wsc=1.,float hsc=0.); + void renderfv(float* pos,float* rot,float* scale); + + void setTexture(SMTEX tex); + void setTextureRect4f(float _x,float _y,float _w,float _h); + void setTextureRectv(smTexRect rect); + void setColor(DWORD col,int v=-1); + void setBlend(int blend); + void setCentre(float x,float y); + float _w(){return w;} + float _h(){return h;} +}; +#endif |