Low level drawing routines, nearer to the hardware and thus faster.
Disables texturing (the image will be drawn opaque using vertex colors).
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.).
Available values for oslSetTextureWrap.
Enumerator |
---|
OSL_TW_REPEAT |
Repeats the texture.
|
OSL_TW_CLAMP |
Clamps the texture (the last image pixel is repeated indefinitely).
|
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.
- Parameters
-
u,v | OSL_TW_CLAMP: Clamp (the same pixel is repeated indefinitely) OSL_TW_REPEAT: The image texture is tiled. |
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.
- Parameters
-
img | Texture to set |
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 whether texturing is currently enabled.