wxerlang

how to animate picture without making it flicker using wxWidgets in erlang?

╄→尐↘猪︶ㄣ 提交于 2019-12-10 11:38:56
问题 I am trying to make images seems like moving. I clear the screen and put the images back on it, but the screen is flickering a lot. Is there a way to make it seems like moving without flicker that much? the "draw_asteroids" is called every 100 ms since I want the movement of the image to be as much as continuous as possible, plus i have many other elements that move on screen as well (the code is similar to the spaceship). my code: start-> Wx = wx:new(), Frame = wxFrame:new(Wx, -1, "Main Game

how to animate picture without making it flicker using wxWidgets in erlang?

萝らか妹 提交于 2019-12-09 04:34:30
I am trying to make images seems like moving. I clear the screen and put the images back on it, but the screen is flickering a lot. Is there a way to make it seems like moving without flicker that much? the "draw_asteroids" is called every 100 ms since I want the movement of the image to be as much as continuous as possible, plus i have many other elements that move on screen as well (the code is similar to the spaceship). my code: start-> Wx = wx:new(), Frame = wxFrame:new(Wx, -1, "Main Game Frame", [{size, {?max_x, ?max_y}}]), MenuBar = wxMenuBar:new(), wxFrame:setMenuBar(Frame, MenuBar),