LoadTexture()

Syntax

Result = LoadTexture(#Texture, Filename$)
Description
Loads a new #Texture from the disk. If #PB_Any is used as '#Texture' parameter, the new texture number will be returned as 'Result'. Before loading a texture, an archive has to be specified with Add3DArchive().

Texture format can be in PNG, TGA or JPG. It's strongly recommended to make the texture dimension square and with power of 2 width/height: 64x64, 128x128, 256x256... Old GFX cards can have limitation, so if possible limit the texture size to 256x256. The 2DDrawing commands can be used to draw on the texture with the help of TextureOutput().

If the 'Result' is 0, the texture can't be loaded. If the #Texture was already created, it is automatically freed and replaced by the new one.

Supported OS

Windows, Linux

<- IsTexture() - Texture Index - TextureHeight() ->