blaze
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Modules
Image loading

Allows to load textures from files and memory. More...

Enumerations

enum  BLZ_ImageChannels { AUTO, GRAYSCALE, GRAYSCALE_ALPHA, RGB, RGBA }
 Defines which channels should be used when loading a texture. More...
 
enum  BLZ_ImageFlags { POWER_OF_TWO, MIPMAPS, TEXTURE_REPEATS, MULTIPLY_ALPHA, INVERT_Y, COMPRESS_TO_DXT, DDS_LOAD_DIRECT, NTSC_SAFE_RGB, CoCg_Y, TEXTURE_RECTANGLE }
 Defines various options for image loading. More...
 
enum  BLZ_SaveImageFormat { TGA, BMP, DDS }
 Defines formats in which images can be saved. More...
 

Functions

BLZAPIENTRY int BLZAPICALL BLZ_FreeTexture (struct BLZ_Texture *texture)
 Frees the specified texture. More...
 
BLZAPIENTRY struct BLZ_Texture
*BLZAPICALL 
BLZ_LoadTextureFromFile (const char *filename, enum BLZ_ImageChannels channels, unsigned int texture_id, enum BLZ_ImageFlags flags)
 Loads a texture from file. More...
 
BLZAPIENTRY struct BLZ_Texture
*BLZAPICALL 
BLZ_LoadTextureFromMemory (const unsigned char *const buffer, int buffer_length, enum BLZ_ImageChannels force_channels, unsigned int texture_id, enum BLZ_ImageFlags flags)
 Loads a texture from memory. More...
 
BLZAPIENTRY int BLZAPICALL BLZ_SaveScreenshot (const char *filename, enum BLZ_SaveImageFormat format, int x, int y, int width, int height)
 Saves a screenshot to file. More...
 

Detailed Description

Allows to load textures from files and memory.

Powered by SOIL (Simple OpenGL Image Library).

Enumeration Type Documentation

Defines which channels should be used when loading a texture.

Enumerator
AUTO 
GRAYSCALE 
GRAYSCALE_ALPHA 
RGB 
RGBA 

Defines various options for image loading.

Enumerator
POWER_OF_TWO 
MIPMAPS 
TEXTURE_REPEATS 
MULTIPLY_ALPHA 
INVERT_Y 
COMPRESS_TO_DXT 
DDS_LOAD_DIRECT 
NTSC_SAFE_RGB 
CoCg_Y 
TEXTURE_RECTANGLE 

Defines formats in which images can be saved.

See also
BLZ_SaveScreenshot
Enumerator
TGA 
BMP 
DDS 

Function Documentation

BLZAPIENTRY int BLZAPICALL BLZ_FreeTexture ( struct BLZ_Texture texture)

Frees the specified texture.

BLZAPIENTRY struct BLZ_Texture* BLZAPICALL BLZ_LoadTextureFromFile ( const char *  filename,
enum BLZ_ImageChannels  channels,
unsigned int  texture_id,
enum BLZ_ImageFlags  flags 
)

Loads a texture from file.

Parameters
filenamePath to the texture
channelsChannels to load. Use AUTO to determine them automatically.
texture_idOpenGL texture ID to use. Pass 0 to create a new texture.
flagsAdditional flags
BLZAPIENTRY struct BLZ_Texture* BLZAPICALL BLZ_LoadTextureFromMemory ( const unsigned char *const  buffer,
int  buffer_length,
enum BLZ_ImageChannels  force_channels,
unsigned int  texture_id,
enum BLZ_ImageFlags  flags 
)

Loads a texture from memory.

Parameters
bufferMemory buffer pointer
buffer_lengthMemory buffer size
force_channelsChannels to load. Use AUTO to determine them automatically.
texture_idOpenGL texture ID to use. Pass 0 to create a new texture.
flagsAdditional flags
BLZAPIENTRY int BLZAPICALL BLZ_SaveScreenshot ( const char *  filename,
enum BLZ_SaveImageFormat  format,
int  x,
int  y,
int  width,
int  height 
)

Saves a screenshot to file.

Parameters
filenameA path to file
formatFormat to be used
xX coordinate of region (pass 0 to capture everything)
yY coordinage of region (pass 0 to capture everything)
widthWidth of region (pass window width to capture everything)
heightHeight of region (pass window height to capture everything)