On Mon, Aug 24, 2009 at 11:57 AM, Tyson Roberts<wx...@cabbits.net> wrote:
> Hello, thanks for the feedback.  I discovered something as part of going
> through the example, notably that I was forgetting to setup the viewport in
> GL before trying to display.  I took the following lines from the cube demo
> and tried to use them:
>
> const wxSize ClientSize = GetClientSize();
> glViewport(0, 0, ClientSize.x, ClientSize.y);
>
> However, when implementing these in wxLua, I found that ClientSize ends up
> being (0, 0)!  I'm not sure what to make of this - it seems like the canvas
> is creating itself with a zero width/height.  But is this a direct problem,
> or a symptom of something else awry?  Any suggestions?

http://wxlua.sourceforge.net/docs/wxluaref.html#wxGLCanvas

The wxGLCanvas constructor takes a wxSize as an input. You probably
have to specify it, though if it is the first and only child of the
wxFrame it should take the client size of the frame and you should use
wxDefaultSize. However, sometimes you need to call
wxFrame::SendSizeEvent() before wxFrame::Show() to have it correctly
lay itself out. Either that or slightly resize the frame by hand while
printing wxGLCanvas::GetSize() in your wxEVT_PAINT handler to test
what the size is.

Hope this helps,
     John

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to