the usual triangle test with the shader pipeline

This commit is contained in:
Hartmut Seichter 2019-01-16 16:55:37 +01:00
parent 1f6ff8526b
commit 351d29cd54
10 changed files with 263 additions and 105 deletions

View file

@ -70,9 +70,18 @@ local w = pw.window.new()
-- set title
w.title = "pixwerx 0.1"
local pl = pw.pipeline.new()
if pl:create(pw.size.new(800,600)) then
print("pipeline ok")
else
print("pipeline failed")
end
-- setup a lua callback function
w.on_update = function(self)
print("test on update",w.position.x,w.position.y,pw.timer.now)
pl:draw()
-- print("test on update",w.position.x,w.position.y,pw.timer.now)
end
-- set size
@ -90,16 +99,16 @@ local t = pw.timer.new()
while w:update()
do
-- somehow works
if (pw.input.get().input_string == 'f') then
w.fullscreen = not w.fullscreen
end
if (pw.input.get().input_string == 'f') then
w.fullscreen = not w.fullscreen
end
-- just to check
if (pw.input:get().mouse_button == 1) then
print("elapsed",t.elapsed)
print("elapsed",t.elapsed)
t:reset()
print(pw.input:get().mouse_position.x,pw.input:get().mouse_position.y)
end
print(pw.input:get().mouse_position.x,pw.input:get().mouse_position.y)
end
-- print("update")
end