From: John L. <jla...@gm...> - 2009-08-24 15:13:12
|
On Sat, Aug 22, 2009 at 11:22 AM, Tyson Roberts<wx...@ca...> wrote: > > I'm using wxLua on OSX10.5 and attempting to get a "Hello world" type > program working on wxGLCanvas(). > > Basic problem: > - Have my own custom wxWindows program, running as an OSX app. Using a > wxLua interpreter. > - Used the wxLua binding system to create rudimentary OpenGL bindings > (I've tried other pre-made GL bindings, but those approaches but got crashes > when dynamic libraries were being loaded that I couldn't track down). > - Linked against the stock OSX OpenGL.framework. > - Created a window in lua, added a wxGLContext. > > Result: > - It shows up grey, no rendering. > I have never tried to use OpenGL with wxWidgets. You can look at the wxWidgets C++ samples to see if they do any special initialization of the GL canvas. http://svn.wxwidgets.org/viewvc/wx/wxWidgets/trunk/samples/opengl/ The cube.h/cpp looks simple enough, they create a TestGLCanvas which is a wxGLCanvas, but notice that they use a TestGLCanvas::OnPaint() connected to a wxEVT_PAINT to do the drawing. Also note MyApp::GetContext() which is odd to me, but I think it simplifies to wxGLContext.SetCurrent(wxGLCanvas) I hope this helps, John |