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 __NEOWTKAREA_H
00028 #define __NEOWTKAREA_H
00029
00030
00031 #include "base.h"
00032 #include "object.h"
00033
00034 #include <neoengine/vertexbuffer.h>
00035 #include <neoengine/polygonbuffer.h>
00036 #include <neoengine/material.h>
00037
00038 #ifdef HAVE_NEOCHUNKIO
00039 # include <neochunkio/complex.h>
00040 # include "chunktype.h"
00041 #endif
00042
00043
00050
00051 namespace NeoEngine
00052 {
00053 class RenderPrimitive;
00054 };
00055
00056
00057 namespace NeoWTK
00058 {
00059
00060
00066 class NEOWTK_API Area : public Object
00067 {
00068 public:
00069
00074 enum TILINGMODE
00075 {
00076 STRETCH = 0
00077 };
00078
00079
00080 protected:
00081
00083 NeoEngine::MaterialPtr m_pkBackground;
00084
00086 NeoEngine::VertexBufferPtr m_pkVertexBuffer;
00087
00089 NeoEngine::PolygonBufferPtr m_pkPolygonBuffer;
00090
00092 NeoEngine::RenderPrimitive *m_pkRenderPrim;
00093
00095 TILINGMODE m_eTilingMode;
00096
00098 int m_aiNumTiles[2];
00099
00101 Coord m_akUV[3];
00102
00103
00107 void SetVertexBuffer();
00108
00112 void SetPolygonBuffer();
00113
00114
00115
00116 public:
00117
00118
00119
00124 Area( Object *pkParent, Area *pkObject = 0 );
00125
00128 virtual ~Area();
00129
00135 virtual const Coord &SetSize( const Coord &rkSize );
00136
00142 unsigned int ProcessMsg( Msg *pkMsg );
00143
00150 virtual bool Render( NeoEngine::Frustum *pkFrustum = 0, bool bForce = false );
00151
00156 virtual void SetBackground( const NeoEngine::MaterialPtr &pkMat );
00157
00164 virtual void SetTilingMode( TILINGMODE eMode, int iX = 1, int iY = 1 );
00165
00172 virtual void SetUVs( const Coord &rkOrigin, const Coord &rkRight, const Coord &rkBottom );
00173
00177 virtual NeoEngine::MaterialPtr &GetBackground() { return m_pkBackground; }
00178
00185 virtual Object *Duplicate( Object *pkParent = 0, Object *pkObject = 0 );
00186 };
00187
00188
00189 #ifdef HAVE_NEOCHUNKIO
00190
00191
00197 class NEOWTK_API AreaChunk : public ObjectChunk
00198 {
00199 public:
00200
00207 AreaChunk( unsigned short usType, const NeoEngine::HashString &rstrType, const NeoEngine::HashString &rstrID = "" ) : ObjectChunk( usType, rstrType, rstrID ) {}
00208
00212 virtual ~AreaChunk() {}
00213
00220 virtual int ParseData( unsigned int uiFlags, NeoEngine::FileManager *pkFileManager );
00221
00229 static NeoChunkIO::Chunk *Allocator( unsigned short usType, const NeoEngine::HashString &rstrType, const NeoEngine::HashString &rstrID ) { return new AreaChunk( usType, rstrType, rstrID ); }
00230 };
00231
00232
00233 #endif
00236 };
00239 #endif