summaryrefslogtreecommitdiff
path: root/demo/bouncing_ball
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2022-10-04 14:53:08 -0500
committersanine <sanine.not@pm.me>2022-10-04 14:53:08 -0500
commit6d96b0e7ea1d98e44647d0bbbba232701a7d557e (patch)
tree15fa9d310f1db5767b662fb0bb4cad8a560d3650 /demo/bouncing_ball
parent0c55c0e1b48de55fea401ea1b2b3f2280ef0f93c (diff)
add first person demo
Diffstat (limited to 'demo/bouncing_ball')
-rw-r--r--demo/bouncing_ball/main.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/demo/bouncing_ball/main.lua b/demo/bouncing_ball/main.lua
index f98a032..8315bb1 100644
--- a/demo/bouncing_ball/main.lua
+++ b/demo/bouncing_ball/main.lua
@@ -20,9 +20,13 @@ window.makeContextCurrent(w)
gl.InitGlad()
gl.Enable(gl.DEPTH_TEST)
+
+local projection = honey.glm.mat4()
+honey.glm.perspective(math.rad(45), 800/600, 0.1, 1000, projection)
window.setFramebufferSizeCallback(w, function(_, width, height)
print(string.format("resize: (%d, %d)", width, height))
- gl.setViewport(0, 0, width, height)
+ gl.Viewport(0, 0, width, height)
+ honey.glm.perspective(math.rad(45), width/height, 0.1, 1000, projection)
end)
@@ -84,8 +88,6 @@ local translation = honey.glm.vec3()
setVector(translation, 0, -1, -6)
honey.glm.translate(view, translation)
-local projection = honey.glm.mat4()
-honey.glm.perspective(math.rad(45), 800/600, 0.1, 1000, projection)
--====== main loop ======--