Simp module

texture_load_from_file

procedure · 1 overloadSource

Reads an image file and uploads it as map. Returns false when it cannot read or decode the file.

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_load reads.
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

See also