gl display lists
Posted: 16 Mar 2012, 06:55
So there isnt too much information on this on the web, however I did some research and what I have I think should work, however im not sure if I should be pushing and popping the stack. So what I am trying to do is create a list of display lists and then loop through them in DrawWorldPreUnit()
Here is an example of the display list I am creating. No errors are generated, however nothing is drawn. Any help is appreciated.
And here is where I call them:
Here is an example of the display list I am creating. No errors are generated, however nothing is drawn. Any help is appreciated.
Code: Select all
displayLists[source] = gl.CreateList( function()
gl.PushAttrib(GL.ALL_ATTRIB_BITS)
gl.Translate(x1 - 100*scale/2, 0, z1)
gl.Rotate(theta,0,0,0)
gl.Scale(scale,1,scale)
gl.Texture("LuaUI/Images/OrderTextures/MTO_"..source[1]..".png")
gl.TexRect(0,height,0,100,height,100)
gl.PushAttrib(GL.ALL_ATTRIB_BITS)
gl.PopAttrib()
end)
Code: Select all
function widget:DrawWorldPreUnit()
for t, o in pairs(displayLists) do
gl.CallList(o)
end
end