00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef __NESPRITE_H
00028 #define __NESPRITE_H
00029
00030
00031 #include "base.h"
00032 #include "sceneentity.h"
00033 #include "material.h"
00034 #include "vertexbuffer.h"
00035 #include "polygonbuffer.h"
00036 #include "vertex.h"
00037
00038
00045 namespace NeoEngine
00046 {
00047
00048
00049
00050 class PolygonBuffer;
00051
00052
00053
00054
00055
00061 class NEOENGINE_API Sprite : public SceneEntity
00062 {
00063 public:
00064
00065 DefineVisitable();
00066
00067 protected:
00068
00070 float m_afSize[2];
00071
00073 float m_fRotation;
00074
00075
00076 public:
00077
00079 VertexBufferPtr m_pkVertexBuffer;
00080
00082 PolygonStripBufferPtr m_pkPolygonBuffer;
00083
00085 MaterialPtr m_pkMaterial;
00086
00087
00088
00096 Sprite( const MaterialPtr &pkMaterial, float fSizeX = 0.0f, float fSizeY = 0.0f, const VertexDeclaration *pkFormat = &TexVertex::s_kDecl );
00097
00100 virtual ~Sprite();
00101
00102
00108 virtual bool Render( Frustum *pkFrustum = 0, bool bForce = false );
00109
00116 void SetSize( float fSizeX, float fSizeY, bool bSetDefaultTexCoords = false );
00117
00122 void SetRotation( float fRot ) { m_fRotation = fRot; }
00123
00128 void Rotate( float fRot ) { m_fRotation += fRot; }
00129 };
00130
00131
00132 };
00133
00134
00135 #endif