On Fri, Aug 16, 2013 at 10:26 AM, Victor Bombi <son...@telefonica.net>wrote:

> solved replacing render:
> function render()
>  local dc = wx.wxPaintDC(canvas)
>  canvas:SetCurrent(context)
>

Yes you must use a wxPaintDC here, see below.

 canvas:SwapBuffers()
>  dc:delete()
> end
>

>
> > But in both cases it happens the same
> > application is not responsive you can only do ctrl-C and crash
> >
>


You must always create a wxPaintDC for the window you set a wxEVT_PAINT
callback for. This is because the wxPaintDC clears the "damaged" area set
by the OS, if you don't create a wxPaintDC the OS will call your paint
handler endlessly trying to get your app to repaint itself.

See here for a little more info.
http://docs.wxwidgets.org/trunk/classwx_paint_event.html


I believe that creating a wxPaintDC is not strictly required in Linux which
is perhaps why the original code worked for its author.
http://luagl.sourceforge.net/examples/glcanvas.wx.lua

Regards,
    John
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to