search for: update_window

Displaying 3 results from an estimated 3 matches for "update_window".

2007 Dec 30
4
Drawing thread not getting enough time from scheduler?
...aw do |surface| surface.pen = Wx::Pen.new( Wx::Colour.new(128, 255, 128), 3 ) surface.pen.cap = Wx::CAP_ROUND surface.draw_line(x, 0, x+100, 100) end end #Update screen. update_window(window, buffer) end end end def update_window(window, buffer) window.paint do |dc| #Copy the buffer to the viewable window. dc.draw_bitmap(buffer, 0, 0, false) end end end app = MyApp.new app.main_loop I ran it through ruby-prof......
2008 Jan 19
5
No joy from Wx::App.dispatch, Wx::App.yield...
...#Containing frame. frame = Wx::Frame.new(nil, :size => [300, 300]) frame.show #Offscreen drawing buffer. buffer = Wx::Bitmap.new(300, 300) #Displays drawing. window = Wx::Window.new(frame, :size => [300, 300]) window.evt_paint do |event| update_window(window, buffer) end #Initialize drawing loop counter. @i = 0 #Animate periodically. timer_id = Wx::ID_HIGHEST + 1 t = Wx::Timer.new(self, timer_id) evt_timer(timer_id) do animate(window, buffer) #No effect. #self.dispatch #...
2007 Dec 01
5
Tearing in my buffered animation test script...
OK, I have a basic blit demo working (thanks to Alex Fenton for his reply, which I finally saw). However, there''s a great deal of "tearing" on the screen - flickering grey lines in the black background. It looks like the blit isn''t always complete when the screen refreshes. Can anyone look at this and tell me what I might be doing wrong? Any help would be most