added ag::loadTexture() and ag::object::setTexture()

git-svn-id: svn://anubis/anaglym/trunk@149 99a6e188-d820-4881-8870-2d33a10e2619
This commit is contained in:
Josh Holtrop committed 2009-11-03 02:53:31 +00:00
1 parent 24d37092e2
commit b83e05218a
5 files changed
+99 -11

No files matched your search

+6 -4
View File
@@ -2,6 +2,7 @@
ground = ag.createStaticPlane(0, 0, 0, 0, 0, 0)
ground:setColor(0.2, 1.0, 0.2)
ag.setCamera(10, -10, 10, 0, 0, 0)
crate_texture = ag.loadTexture("crate.png")
if (ag.import("rot_camera") ~= true) then
ag.println("error importing rot_camera")
@@ -19,16 +20,17 @@ end
function key_down_event(key)
if (key == "b") then
box = ag.createBox(1, 1, 1)
local box = ag.createBox(1, 1, 1)
box:setTexture(crate_texture)
init(box)
elseif (key == "c") then
cyl = ag.createCylinder(0.5, 1)
local cyl = ag.createCylinder(0.5, 1)
init(cyl)
elseif (key == "a") then
ccyl = ag.createCapsule(0.5, 1)
local ccyl = ag.createCapsule(0.5, 1)
init(ccyl)
elseif (key == "s") then
sphere = ag.createSphere(0.8)
local sphere = ag.createSphere(0.8)
init(sphere)
elseif (key == "q") then
ag.exit()