Menu

LoadTexture

UltraBas

LoadTexture ( file[,]flags )

Load a texture from an image file and returns the texture's handle. Supported file formats include: BMP, PNG, TGA and JPG. Only PNG and TGA support alpha.

The optional flags parameter allows you to apply certain effects to the texture. Flags can be added to combine two or more effects, e.g. 3 (1+2) = texture with colour and alpha maps.

See [CreateTexture] for more detailed descriptions of the texture flags.

Something to consider when applying texture flags to loaded textures is that the texture may have already had certain flags applied to it via the [TextureFilter] command. The default for the [TextureFilter] command is 9 (1+8), which is a coloured, mipmapped texture. This cannot be overridden via the flags parameter of the LoadTexture command - if you wish for the filters to be removed you will need to use the [ClearTextureFilters] command, which must be done after setting the graphics mode (setting the graphics mode restores the default texture filters).


Related

Wiki: Alphabetical-commands
Wiki: Category-commands
Wiki: CreateTexture

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.