src/java.desktop/unix/native/common/java2d/opengl/GLXGraphicsConfig.c

Print this page




 381         return 0;
 382     }
 383 
 384     visualid = xvi->visualid;
 385     XFree(xvi);
 386 
 387     J2dRlsTraceLn2(J2D_TRACE_INFO,
 388         "GLXGC_FindBestVisual: chose 0x%x as the best visual for screen %d",
 389                    visualid, screen);
 390 
 391     return visualid;
 392 }
 393 
 394 /**
 395  * Creates a scratch pbuffer, which can be used to make a context current
 396  * for extension queries, etc.
 397  */
 398 static GLXPbuffer
 399 GLXGC_InitScratchPbuffer(GLXFBConfig fbconfig)
 400 {
 401     int pbattrlist[] = {GLX_PBUFFER_WIDTH, 1,
 402                         GLX_PBUFFER_HEIGHT, 1,
 403                         GLX_PRESERVED_CONTENTS, GL_FALSE,
 404                         0};
 405 
 406     J2dTraceLn(J2D_TRACE_INFO, "GLXGC_InitScratchPbuffer");
 407 
 408     return j2d_glXCreatePbuffer(awt_display, fbconfig, pbattrlist);
 409 }
 410 
 411 /**
 412  * Initializes a new OGLContext, which includes the native GLXContext handle
 413  * and some other important information such as the associated GLXFBConfig.
 414  */
 415 static OGLContext *
 416 GLXGC_InitOGLContext(GLXFBConfig fbconfig, GLXContext context,
 417                      GLXPbuffer scratch, jint caps)
 418 {
 419     OGLContext *oglc;
 420     GLXCtxInfo *ctxinfo;
 421 
 422     J2dTraceLn(J2D_TRACE_INFO, "GLXGC_InitOGLContext");




 381         return 0;
 382     }
 383 
 384     visualid = xvi->visualid;
 385     XFree(xvi);
 386 
 387     J2dRlsTraceLn2(J2D_TRACE_INFO,
 388         "GLXGC_FindBestVisual: chose 0x%x as the best visual for screen %d",
 389                    visualid, screen);
 390 
 391     return visualid;
 392 }
 393 
 394 /**
 395  * Creates a scratch pbuffer, which can be used to make a context current
 396  * for extension queries, etc.
 397  */
 398 static GLXPbuffer
 399 GLXGC_InitScratchPbuffer(GLXFBConfig fbconfig)
 400 {
 401     int pbattrlist[] = {GLX_PBUFFER_WIDTH, 4,
 402                         GLX_PBUFFER_HEIGHT, 4,
 403                         GLX_PRESERVED_CONTENTS, GL_FALSE,
 404                         0};
 405 
 406     J2dTraceLn(J2D_TRACE_INFO, "GLXGC_InitScratchPbuffer");
 407 
 408     return j2d_glXCreatePbuffer(awt_display, fbconfig, pbattrlist);
 409 }
 410 
 411 /**
 412  * Initializes a new OGLContext, which includes the native GLXContext handle
 413  * and some other important information such as the associated GLXFBConfig.
 414  */
 415 static OGLContext *
 416 GLXGC_InitOGLContext(GLXFBConfig fbconfig, GLXContext context,
 417                      GLXPbuffer scratch, jint caps)
 418 {
 419     OGLContext *oglc;
 420     GLXCtxInfo *ctxinfo;
 421 
 422     J2dTraceLn(J2D_TRACE_INFO, "GLXGC_InitOGLContext");