NiTexture
: public NiObjectNet
<NiTexture.h>
Description
NiTexture 是纹理数据的基类吗。其任何子类都要有部分纹理操作。该类没有定义纹理数据怎样存放,如何更新或创建,这都由它的子类进行定义实现。
Constructors
抽象类没有构造函数提供。
Static Member Functions
static bool GetMipmapByDefault()
static void SetMipmapByDefault(bool bMipmap)
设置和获得全局的mipmapping flag.当NiTexture 的子类用MIP_DEFAULT 作为创建纹理的mipmapping 模式时,这个标志就用到了。如果它是True纹理就是mipmapped,反之则不是mipmapped的。
Supported Member Functions
virtual unsigned int GetWidth() const = 0
virtual unsigned int GetHeight() const = 0
获得宽和高
const FormatPrefs& GetFormatPreferences() const
返回在创建纹理时所选的格式项。这些格式选项要求渲染器找到一个最匹配该设置的选项或者被忽略。记住这个函数只有Get,,,没有Set。。因为纹理在创建时就被指定了格式,后期不能改变的。
Nested Classes
NiTexture::FormatPrefs
class FormatPrefs : public NiMemObject
{
public:
// Creates a format preferences instance with DEFAULT values
// for all data members
FormatPrefs();
PixelLayout m_ePixelLayout;
MipFlag m_eMipMapped;
AlphaFormat m_eAlphaFmt;
};
The FormatPrefs class represents a set of application preferences for texture formats. These preferences are not direct texture format requests, but are only requests for general levels of pixel accuracy. The format enumerations and their meanings are as follows:
PixelLayout Enum |
Meaning |
PALETTIZED_8 |
Texture prefers an 8 bit palettized format (with or without alpha). |
HIGH_COLOR_16 |
Texture prefers a 16-bit per pixel RGB(A) format. |
TRUE_COLOR_32 |
Texture prefers a 24/32-bit per pixel RGB(A) format. |
COMPRESSED |
Texture prefers a compressed format. |
BUMPMAP |
Texture prefers a Bump-map format. |
PALETTIZED_4 |
Texture prefers an 4 bit palettized format (with or without alpha). |
PIX_DEFAULT |
Texture can use whatever format best matches the source data. |
SINGLE_COLOR_8 |
Single 8-bit channel format |
SINGLE_COLOR_16 |
Single 16-bit channel format. |
SINGLE_COLOR_32 |
Single 32-bit channel format |
DOUBLE_COLOR_32 |
Two channel format summing to 32 bits. |
DOUBLE_COLOR_64 |
Two channel format summing to 64 bits. |
FLOAT_COLOR_32 |
Floating point format summing to 32 bits. |
FLOAT_COLOR_64 |
Floating point format summing to 64 bits. |
FLOAT_COLOR_128 |
Floating point format summing to 128 bits. |
MipFlag Enum |
Meaning |
NO |
Texture prefers no mipmapping ("flat" image). |
YES |
Texture prefers mipmapping. |
MIP_DEFAULT |
Texture can use the default setting from NiTexture. |