From: John L. <jla...@gm...> - 2013-08-16 19:44:53
|
On Fri, Aug 16, 2013 at 10:26 AM, Victor Bombi <so...@te...>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 |