From 92f17580846c88108aab023092c23e6bcdcf2f75 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Fri, 14 Aug 2015 23:45:02 +0800 Subject: SMELT is finally finished! Add the SMELT library for future use. Add .gitignore. --- include/smentity.hpp | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 include/smentity.hpp (limited to 'include/smentity.hpp') diff --git a/include/smentity.hpp b/include/smentity.hpp new file mode 100644 index 0000000..7ecb8ee --- /dev/null +++ b/include/smentity.hpp @@ -0,0 +1,66 @@ +// -*- C++ -*- +/* + * Simple MultimEdia LiTerator(SMELT) + * by Chris Xiong 2015 + * api level 1 + * 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 -- cgit v1.2.3