I added a call to XInitThreads() in wxApp::OnInit() before the wxFrame is created. It returns '1' indicating success but the app still hangs.
Running the wxGLContext constructor code (I can't yet seem to step into the code) shows that the glCCreateNewContext is failing:
Code: Select all
GLXFBConfig *fbc = canvas->GetGLXFBConfig(); // returns fbc = 0x833360 which looks ok to me
_XDisplay* display = wxGetX11Display();
GLXContext m_glContext = glXCreateNewContext( display, fbc[0], GLX_RGBA_TYPE, None, GL_TRUE ); // hangs in linux
Code: Select all
void* ThreadEntry (void* ptr)
{
Thread_Params* params = (Thread_Params*)(ptr);
Display* display = params->display;
Window x_window = params->x_window;
GLXFBConfig fb_config = params->fb_config;
GLXContext context = glXCreateNewContext (display,
fb_config,
GLX_RGBA_TYPE,
NULL,
True);
// Create a GLX window to associate the frame buffer configuration with the created X window
GLXWindow glx_window = glXCreateWindow (display, fb_config, x_window, NULL);
glXMakeContextCurrent (display, glx_window, glx_window, context);
/* OpenGL rendering ... */
glClearColor( 1.0, 1.0, 0.0, 1.0 );
glClear( GL_COLOR_BUFFER_BIT );
glFlush();
glXSwapBuffers (display, glx_window);
}
In the original wx app, moving the GL initialization into the main thread also works ok. I have a few GL apps running in wx on Ubuntu no problem.
The Ubuntu graphics is GL4.1 on an Nvidia GT430 card. wx is 2.9.2 (both windows and linux)