Modules | |
Basic documentation | |
Vertex types | |
Defines | |
#define | oslEnableTexturing() ({ if (!osl_textureEnabled) sceGuEnable(GU_TEXTURE_2D), osl_textureEnabled = 1; }) |
#define | oslDisableTexturing() ({ if (osl_textureEnabled) sceGuDisable(GU_TEXTURE_2D), osl_textureEnabled = 0; }) |
#define | OSL_SLICE_SIZE 64 |
Enumerations | |
enum | OSL_TEXWRAP_MODES { OSL_TW_REPEAT = GU_REPEAT, OSL_TW_CLAMP = GU_CLAMP } |
Functions | |
int | oslVerifyStripBlit (OSL_IMAGE *img) |
void | oslSetTextureWrap (int u, int v) |
void | oslSetTexture (OSL_IMAGE *img) |
void | oslSetTexturePart (OSL_IMAGE *img, int x, int y) |
OSL_COLOR | oslBlendColor (OSL_COLOR c) |
Variables | |
int | osl_currentTexWrapU |
int | osl_currentTexWrapV |
unsigned int * | osl_list |
int | osl_textureEnabled |
#define oslEnableTexturing | ( | ) | ({ if (!osl_textureEnabled) sceGuEnable(GU_TEXTURE_2D), osl_textureEnabled = 1; }) |
Disables texturing (the image will be drawn opaque using vertex colors).
#define oslDisableTexturing | ( | ) | ({ if (osl_textureEnabled) sceGuDisable(GU_TEXTURE_2D), osl_textureEnabled = 0; }) |
Enables texturing. You should not call this function by yourself, as oslSetTexture does it by itself.
#define OSL_SLICE_SIZE 64 |
Don't forget about stripping when you're drawing images by yourself, else it will be slower! The thing to know is: never draw an image wider than 64 pixels. If the image is, say, 256 pixels wide, you can draw it in 4 stripes of 64 each (setting u, v coordinates to 0, 64, 128, 192, etc.).
enum OSL_TEXWRAP_MODES |
Available values for oslSetTextureWrap.
int oslVerifyStripBlit | ( | OSL_IMAGE * | img | ) |
Don't use it! It's internally used by oslDrawImageSimple. Look at the source code for more information.
void oslSetTextureWrap | ( | int | u, | |
int | v | |||
) | [inline] |
Sets the behaviour of images when their bounds are reached. For example let's say you have a 128x128 image and you draw a 200x200 region. This is larger than the image itself and thus the part to the left or the right will be either repeated or clamped depending on the parameter.
u,v | OSL_TW_CLAMP: Clamp (the same pixel is repeated indefinitely) OSL_TW_REPEAT: The image texture is tiled. |
void oslSetTexture | ( | OSL_IMAGE * | img | ) |
Defines the current texture, useful for low level image drawing.
void oslSetTexturePart | ( | OSL_IMAGE * | img, | |
int | x, | |||
int | y | |||
) |
Same but also defines the beginning coordinate in the texture. Useful for tricks meant to display an image bigger than 512x512.
x,y | Beginning (top-left corner) of the image. Should be a multiple of 512. The (x, y) corner will become the (u, v) = (0, 0) coordinate when drawing a texture, and a 512x512 range (to the right and down) will be accessible. |
Applies the alpha parameters to a color, tinting it. This is needed as alpha is not applied to vertex color but only to textures.
Holds the current texture wrap state (see oslSetTextureWrap).
Same for the v state.
unsigned int* osl_list |
System display list.
Holds whether texturing is currently enabled.