Make Lua functions for internal CHDK drawing functions - Feature Requests - CHDK Forum supplierdeeply

Make Lua functions for internal CHDK drawing functions

  • 1 Replies
  • 4816 Views
Make Lua functions for internal CHDK drawing functions
« on: 03 / August / 2010, 17:51:40 »
Advertisements
I think the functions like draw_filled_rect, draw_line, draw_ellipse (you know, in core/gui_draw.h) should be put in Lua, so you can write scripts that can draw to the screen. Maybe you can also add the gui_fselect functions.

Yes, I know you can use call_func_ptr, but that doesn't work if native function calls are turned off, and it's also more convenient.

*

Offline reyalp

  • ******
  • 14080
Re: Make Lua functions for internal CHDK drawing functions
« Reply #1 on: 03 / August / 2010, 18:00:37 »
Unfortunately, this won't work well, because lua is called from the physw task, while the gui stuff expects to be run from spytask. Your drawing would be wiped out the next time the gui updated. You can see what it would be like by drawing directly to the bitmap buffers with poke (which does not require native calls).

In the long term, I'd definitely like to do something like this, but to do it well requires some work.

One way to do it would be to allow lua to add widgets that are drawn by the gui code every update until they are removed. This should be pretty straightforward.
« Last Edit: 03 / August / 2010, 18:25:14 by reyalp »
Don't forget what the H stands for.

 

Related Topics