Load

This function loads a texture from a texture (*.tex) file.

Syntax

Parameters

Returns

Returns the loaded texture. If the texture cannot be loaded, NULL is returned.

Example

window = Window:Create()
context = Context:Create(window)

--Load a texture
texture = Texture:Load("Materials/Grass/grass01.tex")

while true do
if window:Closed() or window:KeyHit(Key.Escape) then return false end

context:SetColor(0,0,0)
context:Clear()

--Display the texture on screen
context:SetColor(1,1,1)
context:DrawImage(texture,0,0)

context:Sync()
end