2010-12-04 16:14:34 +00:00
|
|
|
|
/********************************************************
|
|
|
|
|
* Texture.h *
|
|
|
|
|
* *
|
|
|
|
|
* XFX Texture definition file *
|
|
|
|
|
* Copyright <EFBFBD> XFX Team. All Rights Reserved *
|
|
|
|
|
********************************************************/
|
|
|
|
|
#ifndef _XFX_GRAPHICS_TEXTURE_
|
|
|
|
|
#define _XFX_GRAPHICS_TEXTURE_
|
|
|
|
|
|
|
|
|
|
#include <System/Types.h>
|
|
|
|
|
#include <System/IO/Stream.h>
|
|
|
|
|
#include "GraphicsResource.h"
|
|
|
|
|
|
|
|
|
|
using namespace System::IO;
|
|
|
|
|
|
|
|
|
|
namespace XFX
|
|
|
|
|
{
|
|
|
|
|
namespace Graphics
|
|
|
|
|
{
|
|
|
|
|
struct TextureCreationParameters;
|
|
|
|
|
struct TextureInformation;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Represents a texture resource.
|
|
|
|
|
/// </summary>
|
2011-03-10 22:55:43 +00:00
|
|
|
|
class Texture : public GraphicsResource, virtual Object
|
2010-12-04 16:14:34 +00:00
|
|
|
|
{
|
2010-12-27 01:01:25 +00:00
|
|
|
|
private:
|
|
|
|
|
static ImageFileFormat_t ILimageformat2XNAimageformat(int ILFormat);
|
2010-12-04 16:14:34 +00:00
|
|
|
|
|
2010-12-27 01:01:25 +00:00
|
|
|
|
protected:
|
|
|
|
|
void Dispose(bool disposing);
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
int LevelCount();
|
|
|
|
|
int LevelOfDetail;
|
2011-03-10 22:55:43 +00:00
|
|
|
|
|
|
|
|
|
Texture();
|
|
|
|
|
~Texture();
|
2010-12-27 01:01:25 +00:00
|
|
|
|
|
2011-03-10 22:55:43 +00:00
|
|
|
|
static Texture FromFile(GraphicsDevice graphicsDevice, Stream* textureStream);
|
2010-12-27 01:01:25 +00:00
|
|
|
|
static Texture FromFile(GraphicsDevice graphicsDevice, char* filename);
|
2011-03-10 22:55:43 +00:00
|
|
|
|
static Texture FromFile(GraphicsDevice graphicsDevice, Stream* textureStream, int numberBytes);
|
|
|
|
|
static Texture FromFile(GraphicsDevice graphicsDevice, Stream* textureStream, TextureCreationParameters creationParameters);
|
2010-12-27 01:01:25 +00:00
|
|
|
|
static Texture FromFile(GraphicsDevice graphicsDevice, char* filename, TextureCreationParameters creationParameters);
|
2011-03-10 22:55:43 +00:00
|
|
|
|
static Texture FromFile(GraphicsDevice graphicsDevice, Stream* textureStream, int numberBytes, TextureCreationParameters creationParameters);
|
2010-12-27 01:01:25 +00:00
|
|
|
|
static Texture FromFile(GraphicsDevice graphicsDevice, char* filename, int width, int height, int depth);
|
|
|
|
|
|
|
|
|
|
void GenerateMipMaps(TextureFilter_t filterType);
|
2011-03-10 22:55:43 +00:00
|
|
|
|
static TextureCreationParameters GetCreationParameters(GraphicsDevice graphicsDevice, Stream* textureStream);
|
2010-12-27 01:01:25 +00:00
|
|
|
|
static TextureCreationParameters GetCreationParameters(GraphicsDevice graphicsDevice, char* filename);
|
2011-03-10 22:55:43 +00:00
|
|
|
|
static TextureCreationParameters GetCreationParameters(GraphicsDevice graphicsDevice, Stream* textureStream, int numberBytes);
|
|
|
|
|
static TextureInformation GetTextureInformation(Stream* textureStream);
|
2010-12-27 01:01:25 +00:00
|
|
|
|
static TextureInformation GetTextureInformation(char* filename);
|
2011-03-10 22:55:43 +00:00
|
|
|
|
static TextureInformation GetTextureInformation(Stream* textureStream, int numberBytes);
|
2010-12-27 01:01:25 +00:00
|
|
|
|
void Save(char* filename, ImageFileFormat_t format);
|
2010-12-04 16:14:34 +00:00
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif //_XFX_GRAPHICS_TEXTURE_
|