[wxruby-users] paint_buffered
Anton Hörnquist
lists at ruby-forum.com
Mon Nov 3 18:38:03 EST 2008
Alex Fenton wrote:
> It would be good to see some code that we can actually run, and more
> information about the app - eg is the refreshing event-driven (the user
> doees something, the display changes) or time-driven? To what extent can
> future drawing be predicted? Is the drawing itself complex, or is there
> a lot of computationally intensive non-drawing code in paint? Does
> everything change at once?
>
> Depending on this different things might help - eg preparing drawing in
> idle time, only updating voided parts of the canvas, etc
Sure! Find memu.rb attached. It's a little hack, a monome emulator. You
will need rosc by hans fugal for it to work - hans.fugal.net/src/rosc/.
See www.monome.org for details about the actual device.
The MemuWindow is refreshed when a user presses or releases one of the
buttons on the virtual device (mouse cursor and
evt_left_down/evt_left_up). The box around the button is thickened.
Also, when certain osc parameters are received, the leds within the
buttons are lit up!
There is really no complex drawing going on, just a bunch of rectangles
:), but it's rather important that the stuff is updated in realtime.
Perhaps Ruby aint the ideal language for this.
/Anton
Attachments:
http://www.ruby-forum.com/attachment/2890/memu.rb
--
Posted via http://www.ruby-forum.com/.
More information about the wxruby-users
mailing list