GetTexture

This function gets a material texture. The function does not increment the texture's reference count.

Syntax

Parameters

Returns

Returns the material texture.

Example

window = Window:Create()
context = Context:Create(window)
world = World:Create()
camera = Camera:Create()
directionallight = DirectionalLight:Create()
directionallight:SetRotation(45,35,0)

--Load a material
local material = Material:Create()
material = Material:Load("Materials/Concrete/concrete_clean.mat")

--Retrieve the material teture
texture = material:GetTexture()

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

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

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

context:Sync()
end