further cleanup

This commit is contained in:
Hartmut Seichter 2019-01-16 23:45:44 +01:00
parent 075d18b4b8
commit 05dea19436
8 changed files with 54 additions and 25 deletions

View file

@ -66,6 +66,7 @@ end
--n_1:add_child()
local w = pw.window.new()
w.visible = false
-- set title
w.title = "pixwerx 0.1"
@ -75,6 +76,8 @@ w.size = pw.size.new(800,600)
-- move window
w.position = pw.point.new(100,100)
print("client size after resize: ",w.client_size.width,w.client_size.height)
local pl = pw.pipeline.new()
if pl:create(w.client_size) then
@ -83,12 +86,11 @@ else
print("pipeline failed")
end
-- setup a lua callback function
-- setup a lua callback function as callback
w.on_update = function(self)
pl:draw()
-- print("test on update",w.position.x,w.position.y,pw.timer.now)
end
local ds = pw.display:all()
@ -98,8 +100,9 @@ end
local t = pw.timer.new()
while w:update()
do
w.visible = true
while w:update() do
-- somehow works
if (pw.input.get().input_string == 'f') then
w.fullscreen = not w.fullscreen
@ -109,7 +112,7 @@ do
if (pw.input:get().mouse_button == 1) then
print("elapsed",t.elapsed)
t:reset()
print(pw.input:get().mouse_position.x,pw.input:get().mouse_position.y)
print(pw.input:get().mouse_position.x,pw.input:get().mouse_position.y,w.client_size.width,w.client_size.height)
end
-- print("update")