Regular API function

simApplyTexture

Description Applies a texture via texture coordinates to a shape. See also simSetShapeTexture.
C synopsis simInt simApplyTexture(simInt shapeHandle,const simFloat* textureCoordinates,simInt textCoordSize,const simUChar* texture,const simInt* textureResolution,simInt options)
C parameters
shapeHandle: The handle of the shape. See also simGetObjectHandle
textureCoordinates: The UV texture coordinates. For each of the shape's triangle, there should be exactly 3 UV texture coordinate pairs
textCoordSize: The size of the textureCoordinate array
texture: The RGB or RGBA texture
textureResolution: The X/Y resolution of the texture
options: bit-coded:
bit0: if set (1), then adjacent texture pixels are not interpolated
bit1: if set (2), then the texture is applied as a decal (its appearance won't be influenced by light conditions)
bit2: unused, keep unset
bit3: unused, keep unset
bit4: if set (16), then the texture is RGBA, otherwise it is RGB
bit5: if set (32), then the texture is horizontally flipped
bit6: if set (64), then the texture is vertically flipped
C return value
The ID of the texture, or -1 in case of an error
Lua synopsis
-
Lua parameters
-
Lua return values
-

All regular API functions on one page