Skip to content

Commit

Permalink
removed onframeend to improve performance
Browse files Browse the repository at this point in the history
  • Loading branch information
antogerva committed Mar 22, 2015
1 parent b2bc047 commit f84205f
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions dk_canvas.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
package.cpath = ";?51.dll;..package.cpath"
package.cpath = ";?51.dll;"..package.cpath

local iuplua_open = package.loadlib("iuplua51.dll", "iuplua_open");
local iuplua_close = package.loadlib("iuplua51.dll", "iuplua_close");

require "cdlua"
require "iuplua"
Expand All @@ -13,7 +16,7 @@ function get_mem()
gui.text(10,10,string.format("Xpos: %d",pos_x))
gui.text(10,20,string.format("Ypos: %d",pos_y))
end
event.onframeend(get_mem)
--event.onframeend(get_mem)

-- Initialize some IUP component for the UI
label_counter = iup.label{title="1", size="20x20"}
Expand All @@ -29,15 +32,14 @@ function close_cb()
return iup.IGNORE -- because we destroy the dialog
end

timer1 = iup.timer{time=40}
timer1 = iup.timer{time=10}
isInit = false
function timer1:action_cb()
if(isInit==false) then
isInit=true
--print("init timer")
return iup.CLOSE
end
print("")
--print("")
--print("timer1 called")

isInit=false;
Expand Down Expand Up @@ -92,6 +94,7 @@ dlg:show()


function idle_cb()
get_mem();
label_counter.title = tonumber(label_counter.title) + 1;
label_x.title = "x: "..pos_x;
label_y.title = "y: "..pos_y;
Expand Down

0 comments on commit f84205f

Please sign in to comment.