Allows to load textures from files and memory.
More...
|
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...
|
|
|
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...
|
|
Allows to load textures from files and memory.
Powered by SOIL (Simple OpenGL Image Library).
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 |
|
BLZAPIENTRY int BLZAPICALL BLZ_FreeTexture |
( |
struct BLZ_Texture * |
texture | ) |
|
Frees the specified texture.
Loads a texture from file.
- Parameters
-
filename | Path to the texture |
channels | Channels to load. Use AUTO to determine them automatically. |
texture_id | OpenGL texture ID to use. Pass 0 to create a new texture. |
flags | Additional 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
-
buffer | Memory buffer pointer |
buffer_length | Memory buffer size |
force_channels | Channels to load. Use AUTO to determine them automatically. |
texture_id | OpenGL texture ID to use. Pass 0 to create a new texture. |
flags | Additional 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
-
filename | A path to file |
format | Format to be used |
x | X coordinate of region (pass 0 to capture everything) |
y | Y coordinage of region (pass 0 to capture everything) |
width | Width of region (pass window width to capture everything) |
height | Height of region (pass window height to capture everything) |