00001
#ifndef TEXTURE_H
00002
#define TEXTURE_H
00003
00004
#include "XMLResource.h"
00005
#include "FreeImage.h"
00006
#include "Color.h"
00007
00008
#pragma once
00009
#ifdef _DEBUG
00010
#pragma comment (lib, "FreeImageD.lib")
00011
#endif
00012
00013
#ifdef _RELEASE
00014
#pragma comment (lib, "FreeImage.lib")
00015
#endif
00016
00018
00022 class CTexture :
public CXMLResource
00023 {
00024
public:
00025
CTexture();
00026
virtual ~
CTexture();
00027
00028
virtual int LoadImage(CString strFilename);
00029
00035
virtual int LoadXML(
TiXmlNode *pDataNode, CString strFilename);
00041
virtual int SaveXML(
TiXmlNode *pDataNode, CString strFilename);
00046
virtual void Bind();
00051
void Destroy();
00056
virtual void Release();
00057
public:
00062 UINT
GetDepth();
00067 UINT
GetWidth();
00072 UINT
GetHeight();
00077 FIBITMAP *
GetBitmap();
00083
void GetPixel(tRGBA *pPixel, UINT x, UINT y);
00089
void SetPixel(UINT x, UINT y, tRGBA color);
00094 CString&
GetTextureFilename();
00099
bool IsMasked();
00104 tRGBA&
GetMask();
00109
void SetMask(tRGBA color);
00114
virtual UINT
Create();
00119
virtual bool IsOfType(eEntityType eType);
00120
00121
protected:
00122
00123 tRGBA
m_Mask;
00124 FIBITMAP *
m_pBitmap;
00125 CString
m_strTextureFilename;
00126 };
00127
00128
#endif
00129