From 09a96abe4d6933eb473b0dd8a7027cc0cb04ac63 Mon Sep 17 00:00:00 2001 From: sanine-a Date: Sat, 5 Dec 2020 16:59:28 -0600 Subject: change textures to use metamethods --- demo/ScreenQuad.lua | 4 ++-- demo/SpatialShader.lua | 2 +- demo/main.lua | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'demo') diff --git a/demo/ScreenQuad.lua b/demo/ScreenQuad.lua index 4cc247f..73cce46 100644 --- a/demo/ScreenQuad.lua +++ b/demo/ScreenQuad.lua @@ -35,8 +35,8 @@ ScreenQuad.shader = honey.shader(vertexShader, fragmentShader) ScreenQuad.tex = honey.texture.new() ScreenQuad.depth = honey.texture.new() -honey.texture.create(ScreenQuad.tex, 'rgb', 640, 480); -honey.texture.create(ScreenQuad.depth, 'depth', 640, 480); +ScreenQuad.tex:create('rgb', 640, 480) +ScreenQuad.depth:create('depth', 640, 480) --honey.texture.load(ScreenQuad.texture, 'checkerboard.png', false) ScreenQuad.fb = honey.texture.new_framebuffer(ScreenQuad.tex, ScreenQuad.depth, 640, 480) diff --git a/demo/SpatialShader.lua b/demo/SpatialShader.lua index 5f83e59..699cff2 100644 --- a/demo/SpatialShader.lua +++ b/demo/SpatialShader.lua @@ -76,7 +76,7 @@ end SpatialShader.prototype.drawMesh = function(self, mesh) self.shader:setMat4('model', mesh.transform) - honey.texture.use(self.albedo, 0) + self.albedo:use(0) honey.mesh.draw(mesh.mesh, self.shader) end diff --git a/demo/main.lua b/demo/main.lua index 231af10..5b19166 100644 --- a/demo/main.lua +++ b/demo/main.lua @@ -11,7 +11,7 @@ local buffer = false honey.input.key.bind(honey.input.key.f, function(action) if action == 1 then buffer = not buffer end end) local tex = honey.texture.new() -honey.texture.load(tex, 'checkerboard.png', false) +tex:load('checkerboard.png', false) local sceneRoot = Node.new() -- cgit v1.2.1