GetClass

This command can be used to identify the class of an unknown Object. The class id returned will be that of the lowest-order derived class. However, classes that are a driver-specific extension will only return the last general class they are derived from. For example, the OpenGL2Buffer and OpenGLES2Buffer classes will both return Object::BufferClass.

Syntax

Returns

Returns the Object's class id.

Example

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

--Create a model
model = Model:Box()
model:SetPosition(0,0,3)

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

Time:Update()
world:Update()
world:Render()

--Display the object class
if(model:GetClass() == Object.ModelClass) then
context:SetBlendMode(Blend.Alpha)
context:DrawText("Class: Model",2,2)
context:SetBlendMode(Blend.Solid)
end

context:Sync()
end