Opened 21 months ago

#14831 new optimization

wxOSX::wxGLCanvas makes app unresponsible

Reported by: gyand Owned by:
Priority: normal Milestone:
Component: OpenGL Version: 2.9.4
Keywords: OSX wxGLCanvas Cc:
Blocked By: Blocking:
Patch: no

Description

If I add a few wxGLCanvas to the same frame and each canvas has its own timer for refresh, the whole application became unresponsive, even clicking on the red x to close the app.
I have modified the cube sample, just to add 5 TestGLCanvas similar to the code below:

MyFrame::MyFrame(): wxFrame(NULL, wxID_ANY, wxT("wxWidgets OpenGL Cube Sample"))

wxBoxSizer *bs = new wxBoxSizer(wxHORIZONTAL);
SetSizer(bs);
for(int i = 0; i < 5; i++) {

TestGLCanvas* tglc = new TestGLCanvas(this);
bs->Add(tglc, 1, wxEXPAND, 1);

}
Layout();

...

then start the cubes with space then the app start to lagging.
This effect is even more radical if I use AUI and put a few panels around.
Tried on win32 (on Windows7) and on that platform everything is OK.
I'm just analyzed in XCode and the analyzer reported that the bottleneck is in the TestGLContext& MyApp::GetContext(wxGLCanvas *canvas) m_glContext->SetCurrent(*canvas); call.

Change History (0)

Note: See TracTickets for help on using tickets.