wsp::Image Class Reference
Stores imagedata and is capable of loading pngs.
More...
#include <image.h>
List of all members.
Detailed Description
Stores imagedata and is capable of loading pngs.
Member Function Documentation
Loads an image from a file. Width and height have to be a multiple of 4, or it won't load. Once an Image is initialized, it can't be initialized again. Uses fopen(), so some basic filesystem initialization is required.
- Parameters:
-
| path | The path to the file. |
| loadtype | Set this to how you want to load this image. (This is probably a path) |
- Returns:
- An error code based on loading status.
- See also:
- Image - Loading from buffer
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
- Parameters:
-
| path | The path to the file. (This is probably a buffer) |
| loadtype | Set this to how you want to load this image. |
- See also:
- Image - Loading from buffer
u32 wsp::Image::GetWidth |
( |
|
) |
const |
Gets the width of this image.
- Returns:
- The width of the image. Returns 0 if no image is loaded.
u32 wsp::Image::GetHeight |
( |
|
) |
const |
Gets the height of this image.
- Returns:
- The height of the image. Returns 0 if no image is loaded.
bool wsp::Image::IsInitialized |
( |
|
) |
const |
Checks if the image is loaded.
- Returns:
- true if an image is stored, false if not.
void wsp::Image::BindTexture |
( |
bool |
bilinear = true |
) |
|
Used to select this image for the next texturing process. Most of the time you won't gonna use this.
- Parameters:
-
| bilinear | Turns on bilinear filtering. |
bool wsp::Image::_InitializeImage |
( |
u32 |
width, |
|
|
u32 |
height | |
|
) |
| | [protected] |
Initializes a clear image to draw on. It will be displayed as an RGBA8 texture, so its format should be ARGB. Don't mess with it if you don't know what you're doing. Once an Image is initialized, it can't be initialized again.
- Parameters:
-
| width | The new width of the image. |
| height | The new height of the image. |
- Returns:
- True if it was successfully initialized, false if not.
The documentation for this class was generated from the following file: