Reads an image file and uploads it as map. Returns false when it cannot read or decode the file.
- map: gets the pixels.
- filename: an image file in a format
bitmap_loadreads. - srgb: says the pixels are sRGB-encoded, which is what most image files hold, so they are converted to linear when sampled.
- build_mipmaps: also makes the half-size levels, so the image looks smooth when drawn small.
texture_load_from_file :: (
map: *Texture,
filename: string,
srgb := false,
build_mipmaps := false
) -> bool
Reads an image file and uploads it as map. Returns false when it cannot read or decode the file.
Parameters
- map: *Texture
- gets the pixels.
- filename: string
- an image file in a format
bitmap_loadreads. - srgb := false
- says the pixels are sRGB-encoded, which is what most image files hold, so they are converted to linear when sampled.
- build_mipmaps := false
- also makes the half-size levels, so the image looks smooth when drawn small.
Returns
- bool