neltexture.h

Go to the documentation of this file.
00001 
00008 /* Copyright, 2004 Werewolf
00009  *
00010  * This file is part of Werewolf.
00011  * Werewolf is free software; you can redistribute it and/or modify
00012  * it under the terms of the GNU General Public License as published by
00013  * the Free Software Foundation; either version 2, or (at your option)
00014  * any later version.
00015 
00016  * Werewolf is distributed in the hope that it will be useful, but
00017  * WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00019  * General Public License for more details.
00020 
00021  * You should have received a copy of the GNU General Public License
00022  * along with Werewolf; see the file COPYING. If not, write to the
00023  * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
00024  * MA 02111-1307, USA.
00025  */
00026 /************************************************************************
00027     purpose:    Interface for main Nevrax Engine GUI texture class
00028 
00029     For use with GUI Library:
00030     Crazy Eddie's GUI System (http://crayzedsgui.sourceforge.net)
00031     Copyright (C)2004 Paul D Turner (crayzed@users.sourceforge.net)
00032 
00033     This file contains code that is specific to NeL (http://www.nevrax.org)
00034 *************************************************************************/
00035 
00036 #ifndef __NELTEXTURE_H__
00037 #define __NELTEXTURE_H__
00038 
00039 // cegui includes
00040 #include "CEGUIBase.h"
00041 #include "CEGUIRenderer.h"
00042 #include "CEGUITexture.h"
00043 
00044 // nelrenderer
00045 #include "nelrenderer.h"
00046 
00047 // standard includes
00048 #include <list>
00049 
00050 // nel includes
00051 #include <nel/misc/file.h>
00052 #include <nel/misc/path.h>
00053 #include <nel/misc/debug.h>
00054 #include <nel/misc/vector.h>
00055 #include <nel/misc/matrix.h>
00056 #include <nel/misc/common.h>
00057 #include <nel/misc/events.h>
00058 #include <nel/misc/fast_mem.h>
00059 #include <nel/misc/config_file.h>
00060 #include <nel/misc/system_info.h>
00061 #include <nel/misc/mem_displayer.h>
00062 
00063 #include <nel/3d/u_scene.h>
00064 #include <nel/3d/u_camera.h>
00065 #include <nel/3d/u_driver.h>
00066 #include <nel/3d/u_texture.h>
00067 #include <nel/3d/u_instance.h>
00068 #include <nel/3d/u_text_context.h>
00069 #include <nel/3d/u_particle_system_instance.h>
00070 #include <nel/3d/texture_mem.h>
00071 
00072 namespace CEGUI
00073 {
00074     class NeLTexture : public Texture
00075     {
00076     private:
00077         friend Texture *NeLRenderer::createTexture(void);
00078         friend Texture *NeLRenderer::createTexture(const String &filename, const String& resourceGroup);
00079         friend Texture *NeLRenderer::createTexture(float size);
00080         friend void NeLRenderer::destroyTexture(Texture *texture);
00081 
00082         NeLTexture(Renderer *owner);
00083         virtual ~NeLTexture(void);
00084 
00085     public:
00086         virtual ushort getWidth(void) const { return d_width; }
00087         virtual ushort getHeight(void) const { return d_height; }
00088         virtual void loadFromFile(const String &filename, const String& resourceGroup);
00089 
00099         virtual void loadFromMemory(const void *buffPtr, uint buffWidth, uint buffHeight, PixelFormat pixelFormat = CEGUI::Texture::PF_RGBA);
00100         NL3D::UMaterial getNeLTexture(void);
00101         void setNeLTextureSize(uint size);
00102 
00103     private:
00108         void freeNeLTexture(void);
00109         NL3D::UTextureFile  *m_TextureFile;
00110         NL3D::CTextureMem   *m_TextureMem;
00111         bool    m_UsingFile;
00112         bool    m_UsingMem;
00113         NL3D::UMaterial m_Material;
00114 
00115         NeLRenderer *m_Owner;
00116         ushort d_width;
00117         ushort d_height;
00118     };
00119 } // end namespace CEGUI
00120 
00121 #endif // __NELTEXTURE_H__
00122 

Generated on Thu Jan 7 08:26:22 2010 for NeL by  doxygen 1.6.1