# To subscribers of the xforms list from spl@ncmir.ucsd.edu :
> Hi. I am new to xforms and pthread, I admit, and I am having some
> problems. This should be a simple situation for you experts out there.
You must initialize the X library for threadedness with the function
XInitThreads(). It must be called before any Xlib functions,
including fl_initialize(). Here's what I do to set up a multithreaded
OpenGL/XForms application:
void preinitialize_forms( int *argc, char **argv )
{
CONCURRENCY( 4 );
XInitThreads(); /* Initialize X for threads */
#ifdef GLX_SUN_init_threads
if ( strstr( glXGetClientString( fl_get_display(), GLX_EXTENSIONS ),
"GLX_SUN_init_threads" ) ) {
if ( !glXInitThreadsSUN() )
abend( "Unable to init GL for multithreaded rendering" );
}
#endif
fl_set_border_width( -1 );
fl_initialize( argc, argv, argv[0], NULL, 0 );
}
This application renders to four separate GLCanvases.
spl
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuhs.mil or see
http://bob.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://world.std.com/~xforms
List Archive: http://bob.usuhs.mil/mailserv/list-archives/
This archive was generated by hypermail 2b29 : Mon Sep 09 2002 - 00:18:08 EDT