MTek-GDL 0.100.4-muffintrap
Loading...
Searching...
No Matches
Data Structures | Enumerations | Functions
Texture Handling Module

Class module for handling and converting textures. More...

Data Structures

class  gdl::Texture
 Texture handling class. More...
 

Enumerations

enum  gdl::TextureFormatModes {
  gdl::I4 = GX_TF_I4 , gdl::I8 = GX_TF_I8 , gdl::IA4 = GX_TF_IA4 , gdl::IA8 = GX_TF_IA8 ,
  gdl::RGB565 = GX_TF_RGB565 , gdl::RGB5A3 = GX_TF_RGB5A3 , gdl::RGBA8 = GX_TF_RGBA8
}
 
enum  gdl::TextureAllocModes { gdl::MEM1 = 0 , gdl::MEM2 = 1 }
 

Functions

int gdl::MakeValuePOT (int value)
 Pads out a value to make it a power-of-two.
 
void gdl::wii::SetAutoFlush (bool flush)
 Texture flusing mode.
 
void gdl::wii::SetTexAllocMode (bool allocMode)
 Sets which memory area the next texture will be allocated in.
 

Detailed Description

Class module for handling and converting textures.

Enumeration Type Documentation

◆ TextureAllocModes

Texture allocation modes

Used internally by the gdl::Texture class and is used for gdl::wii::SetTexAllocMode().

Enumerator
MEM1 

Allocate texture in MEM1.

MEM2 

Allocate texture in MEM2.

◆ TextureFormatModes

Texture format options

Texture formats for gdl::Texture and gdl::Image creation and loading functions. Each texture format takes up memory differently being gdl::I4 being the smallest but could not handle color at all (monochrome) while gdl::RGBA8 has the best color definition but it takes up a lot of memory and at times is the slowest to render.

Note
To save as much MEM1 memory as possible, pick an appropriate texture format for certain images such as gdl::RGB5A3 for pixel art with transparency while gdl::RGBA8 is for displaying high quality illustrations of title screens and the like. It all depends on your project for the most part.
Enumerator
I4 

4-bit intensity (alpha) format (2 pixels per byte).

I8 

8-bit intensity (alpha) format (1 pixel per byte).

IA4 

8-bit intensity with alpha (monochrome) format (1 byte per pixel).

IA8 

16-bit intensity with alpha (monochrome) format (2 bytes per pixel).

RGB565 

16-bit RGB565 pixel format (2 bytes per pixel).

RGB5A3 

16-bit RGB5A3 pixel format (RGB5 if pixel is opaque, RGB4A3 if pixel is translucent, 2 bytes per pixel).

RGBA8 

32-bit RGBA8 pixel format (4 bytes per pixel).

Function Documentation

◆ MakeValuePOT()

int gdl::MakeValuePOT ( int  value)

Pads out a value to make it a power-of-two.

Parameters
[in]valueValue to pad into a power-of-two value.
Returns
Power-of-two result.

◆ SetAutoFlush()

void gdl::wii::SetAutoFlush ( bool  flush)

Texture flusing mode.

Sets whether or not to flush the texture whenever gdl::Texture::PokePixel() is used. For performance reasons, it is best to turn it off when doing a lot of texture modifications and then flush it with gdl::Texture::Flush() right after.

Parameters
[in]flushfalse to disable auto-flushing, true to enable.

◆ SetTexAllocMode()

void gdl::wii::SetTexAllocMode ( bool  allocMode)

Sets which memory area the next texture will be allocated in.

Sets where the next texture to be created will be allocated on either MEM1 or MEM2.

Note
Using MEM2 to store texture data will result to a HUGE (I mean 20-50% performance loss) speed penalty especially with large textures since MEM2 is completely separate from the graphics package so only use MEM2 for texture storage when absolutely necessary.
Parameters
[in]allocModeAllocation mode (see gdl::TextureAllocModes).