Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

area.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                     area.h  -  Object with background material
00003                              -------------------
00004     begin                : Sun Nov 17 2002
00005     copyright            : (C) 2002 by Reality Rift Studios
00006     email                : mattias@realityrift.com
00007  ***************************************************************************
00008 
00009  The contents of this file are subject to the Mozilla Public License Version
00010  1.1 (the "License"); you may not use this file except in compliance with
00011  the License. You may obtain a copy of the License at 
00012  http://www.mozilla.org/MPL/
00013 
00014  Software distributed under the License is distributed on an "AS IS" basis,
00015  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00016  for the specific language governing rights and limitations under the
00017  License.
00018 
00019  The Original Code is the NeoEngine, NeoWTK, area.h
00020 
00021  The Initial Developer of the Original Code is Mattias Jansson.
00022  Portions created by Mattias Jansson are Copyright (C) 2002
00023  Reality Rift Studios. All Rights Reserved.
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 // External classes
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

Generated on Wed Jan 21 14:21:20 2004 for NeoWTK by doxygen 1.3.5