Ninja Library - Texture Structure

NJS_TEXSURFACE

Structure that is used to manage texture information loaded in the texture memory

DEFINITION

typedef struct{ 
        Uint32  Type; 
        Uint32  BitDepth; 
        Uint32  PixelFormat; 
        Uint32  nWidth; 
        Uint32  nHeight; 
        Uint32  TextureSize; 
        Uint32  fSurfaceFlags; 
        Uint32  *pSurface; 
        Uint32  *pVirtual; 
        Uint32  *pPhysical; 
}NJS_TEXSURFACE; 

MEMBER

 Type  Format color surface type 
 BitDepth  Color bit number of texture  
 PixelFormat  PixelFormat 
 nWidth  Texture width: 8 - 1024 
 nHeight  Texture height: 8 - 1024 
 TextureSize  Texture byte size 
 fSurfaceFlags  Surface flag 
 *pSurface  Texture address offset 
 *pVirtual  Fixed to "0" 
 *pPhysical  Fixed to "0" 

DESCRIPTION


EXAMPLE

Structure that is used to manage texture information loaded in the texture 
memory.  
The following shows meanings of member "type" of each bit.  

Bits 31 to 24: Texture format type

0x01******	Twiddled texture
0x02******	Twiddled mipmap texture
0x03******	VQ texture
0x04******	VQ mipmap texture
0x05******	4bpp palette texture
0x06******	4bpp palette mipmap texture
0x07******	8bpp palette texture
0x08******	8bpp palette mipmap texture
0x09******	Rectangle texture
0x0B******	Stride texture
0x0D******	Twiddled Rectangle texture
0x10******	SmallVQ texture
0x11******	SmallVQ mipmap texture

Bits 23 to 16: Texture color type

0x**00****	ARGB1555
0x**01****	RGB565
0x**02****	ARGB4444
0x**03****	YUV422
0x**04****	BUMP
0x**05****	RGB555
0x**06****	ARGB8888 or YUV420

Bits 0 to 15: Surface type

0x****0001	Frame buffer (This value is not used)
0x****0002	Non-small VQ texture
0x****0003	SmallVQ texture

The following shows the value taken by member "BitDepth" which indicates color 
bit number of texture.

0x00000001	16-bit texture
0x00000002	24-bit texture
0x00000003	32-bit texture

The following shows the value taken by member "PixelFormat" which indicates 
pixel format.

0x00000000	ARGB1555
0x08000000	RGB565
0x10000000	ARGB4444
0x18000000	YUV422
0x20000000	BUMP
0x28000000	PALETTIZED 4BPP
0x30000000	PALETTIZED 8BPP

The following shows the value taken by member "fSurfaceFlags" which indicates 
surface flag.

Bit 0	0 : No mipmap / 1 : Mipmap
Bit 1	0 : Bit 1 is fixed to "0"
Bit 2	0 : Rectangular texture / 1 : Twiddled texture
Bit 3	0 : Non-VQ texture / 1 : VQ texture
Bit 4	0 : Non-Stride texture / 1 : Stride texture
Bit 5	0 : Non-Palette texture / 1 : Palette texture


REFERENCE

njSetTextureParam()

NJS_TEXSURFACE
COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999