2 #include "TextureEntity.h" 21 virtual HRESULT InitDeviceObjects();
22 virtual HRESULT RestoreDeviceObjects();
23 virtual HRESULT InvalidateDeviceObjects();
24 virtual HRESULT DeleteDeviceObjects();
31 virtual bool LoadFromImage(
ImageEntity * image, D3DFORMAT dwTextureFormat = D3DFMT_UNKNOWN, UINT nMipLevels = 0,
void** ppTexture = NULL);
36 virtual HRESULT
LoadFromMemory(
const char* buffer, DWORD nFileSize, UINT nMipLevels, D3DFORMAT dwTextureFormat = D3DFMT_UNKNOWN,
void** ppTexture = NULL);
40 virtual bool IsSamplerStateBlocky();
42 virtual int32 GetWidth();
43 virtual int32 GetHeight();
48 virtual bool SaveToFile(
const char* filename, D3DFORMAT dwFormat,
int width,
int height, UINT MipLevels = 1, DWORD Filter = D3DX_DEFAULT,
Color ColorKey = 0);
50 void SetAliasTexParameters();
52 void SetInnerTexture(GLWrapper::Texture2D* texture);
56 GLWrapper::Texture2D* CreateTextureFromFile_Serial(
const std::string& sFileName);
71 static void LoadImage(
char *sBufMemFile,
int sizeBuf,
int &width,
int &height, byte ** ppBuffer,
bool bAlpha);
76 static bool LoadImageOfFormat(
const std::string& sTextureFileName,
char *sBufMemFile,
int sizeBuf,
int &width,
int &height, byte ** ppBuffer,
int* pBytesPerPixel = NULL,
int nFormat = -1);
79 static TextureEntity*
CreateTexture(
const uint8 * pTexels,
int width,
int height,
int rowLength,
int bytesPerPixel, uint32 nMipLevels = 0, D3DPOOL dwCreatePool = D3DPOOL_MANAGED, DWORD nFormat = 0);
85 GLWrapper::Texture2D* m_texture;
86 GLWrapper::Texture2D** m_pTextureSequence;
Which DXT Compression to Use? Obviously, there are some trade-offs between the different formats whic...
Definition: TextureEntity.h:29
virtual DeviceTexturePtr_type GetTexture()
Get the texture for rendering.
virtual bool IsFlipY()
in most cases this is false, where the image origin is at left, top.
static bool LoadImageOfFormat(const std::string &sTextureFileName, char *sBufMemFile, int sizeBuf, int &width, int &height, byte **ppBuffer, int *pBytesPerPixel=NULL, int nFormat=-1)
this function uses FreeImage lib and support more formats.
virtual HRESULT RendererRecreated()
callback of listening the event that renderer was recreated on Android/WP8 all opengl related id has ...
virtual void SetSamplerStateBlocky(bool bIsBlocky)
whether we will use blocky or non-blocky (anti-aliased) texture
AssetType
each asset type has a unique asset type number
Definition: AssetEntity.h:82
a render target scene object.
Definition: RenderTarget.h:16
basic texture information
Definition: TextureEntity.h:83
different physics engine has different winding order.
Definition: EventBinding.h:32
uint32 m_nSamplerState
0 for anti-aliased, 1 for blocky texture.
Definition: TextureEntityOpenGL.h:89
virtual const TextureInfo * GetTextureInfo()
get texture info.
virtual bool LoadFromImage(ImageEntity *image, D3DFORMAT dwTextureFormat=D3DFMT_UNKNOWN, UINT nMipLevels=0, void **ppTexture=NULL)
Initializes a texture from an ImageEntity object.
AssetManager manages a set of asset entities of a certain type.
Definition: AssetManager.h:13
static void LoadImage(char *sBufMemFile, int sizeBuf, int &width, int &height, byte **ppBuffer, bool bAlpha)
load image of any format to buffer.
virtual bool SaveToFile(const char *filename, D3DFORMAT dwFormat, int width, int height, UINT MipLevels=1, DWORD Filter=D3DX_DEFAULT, Color ColorKey=0)
save any texture to a different texture file format and save with full mipmapping to disk...
static TextureEntity * CreateTexture(const uint8 *pTexels, int width, int height, int rowLength, int bytesPerPixel, uint32 nMipLevels=0, D3DPOOL dwCreatePool=D3DPOOL_MANAGED, DWORD nFormat=0)
create a texture entity from memory buffer.
texture entity.
Definition: TextureEntityOpenGL.h:10
std::string AssetKey
the unique key object for asset entity.
Definition: AssetEntity.h:13
Definition: ParaColor.h:275
Unlike TextureEntity, ImageEntity is a device independent entity in memory.
Definition: ImageEntity.h:9
virtual HRESULT LoadFromMemory(const char *buffer, DWORD nFileSize, UINT nMipLevels, D3DFORMAT dwTextureFormat=D3DFMT_UNKNOWN, void **ppTexture=NULL)
load from memory buffer.