< prev index next >

src/java.desktop/unix/native/common/java2d/opengl/J2D_GL/glx.h

Print this page




   5  * under the terms of the GNU General Public License version 2 only, as
   6  * published by the Free Software Foundation.  Oracle designates this
   7  * particular file as subject to the "Classpath" exception as provided
   8  * by Oracle in the LICENSE file that accompanied this code.
   9  *
  10  * This code is distributed in the hope that it will be useful, but WITHOUT
  11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  13  * version 2 for more details (a copy is included in the LICENSE file that
  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  */
  24 
  25 /* $Id: glx.h,v 1.38 2002/10/14 13:52:27 brianp Exp $ */
  26 
  27 /*
  28  * This file is available under and governed by the GNU General Public
  29  * License version 2 only, as published by the Free Software Foundation.
  30  * However, the following notice accompanied the original version of this
  31  * file:
  32  *
  33  * Mesa 3-D graphics library
  34  * Version:  4.1
  35  *
  36  * Copyright (C) 1999-2002  Brian Paul   All Rights Reserved.
  37  *
  38  * Permission is hereby granted, free of charge, to any person obtaining a
  39  * copy of this software and associated documentation files (the "Software"),
  40  * to deal in the Software without restriction, including without limitation
  41  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  42  * and/or sell copies of the Software, and to permit persons to whom the
  43  * Software is furnished to do so, subject to the following conditions:
  44  *
  45  * The above copyright notice and this permission notice shall be included
  46  * in all copies or substantial portions of the Software.
  47  *
  48  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  49  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  50  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
  51  * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  52  * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  53  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

  54  */
  55 
  56 
  57 #ifndef GLX_H
  58 #define GLX_H
  59 
  60 
  61 #ifdef __VMS
  62 #include <GL/vms_x_fix.h>
  63 # ifdef __cplusplus
  64 /* VMS Xlib.h gives problems with C++.
  65  * this avoids a bunch of trivial warnings */
  66 #pragma message disable nosimpint
  67 #endif
  68 #endif
  69 #include <X11/Xlib.h>
  70 #include <X11/Xutil.h>
  71 #ifdef __VMS
  72 # ifdef __cplusplus
  73 #pragma message enable nosimpint
  74 #endif
  75 #endif
  76 
  77 /* modified for inclusion in Java 2D source tree */
  78 /* #include <GL/gl.h> */
  79 #include "J2D_GL/gl.h"
  80 
  81 /*
  82 #if defined(USE_MGL_NAMESPACE)
  83 #include <GL/glx_mangle.h>
  84 #endif
  85 */
  86 
  87 
  88 #ifdef __cplusplus
  89 extern "C" {
  90 #endif
  91 
  92 
  93 #define GLX_VERSION_1_1         1
  94 #define GLX_VERSION_1_2         1
  95 #define GLX_VERSION_1_3         1
  96 #define GLX_VERSION_1_4         1
  97 
  98 #define GLX_EXTENSION_NAME   "GLX"
  99 
 100 
 101 
 102 /*
 103  * Tokens for glXChooseVisual and glXGetConfig:
 104  */
 105 #define GLX_USE_GL              1


 129 #define GLX_NO_EXTENSION        3
 130 #define GLX_BAD_VISUAL          4
 131 #define GLX_BAD_CONTEXT         5
 132 #define GLX_BAD_VALUE           6
 133 #define GLX_BAD_ENUM            7
 134 
 135 
 136 /*
 137  * GLX 1.1 and later:
 138  */
 139 #define GLX_VENDOR              1
 140 #define GLX_VERSION             2
 141 #define GLX_EXTENSIONS          3
 142 
 143 
 144 /*
 145  * GLX 1.3 and later:
 146  */
 147 #define GLX_CONFIG_CAVEAT               0x20
 148 #define GLX_DONT_CARE                   0xFFFFFFFF
 149 #define GLX_SLOW_CONFIG                 0x8001
 150 #define GLX_NON_CONFORMANT_CONFIG       0x800D
 151 #define GLX_X_VISUAL_TYPE               0x22
 152 #define GLX_TRANSPARENT_TYPE            0x23
 153 #define GLX_TRANSPARENT_INDEX_VALUE     0x24
 154 #define GLX_TRANSPARENT_RED_VALUE       0x25
 155 #define GLX_TRANSPARENT_GREEN_VALUE     0x26
 156 #define GLX_TRANSPARENT_BLUE_VALUE      0x27
 157 #define GLX_TRANSPARENT_ALPHA_VALUE     0x28
 158 #define GLX_MAX_PBUFFER_WIDTH           0x8016
 159 #define GLX_MAX_PBUFFER_HEIGHT          0x8017
 160 #define GLX_MAX_PBUFFER_PIXELS          0x8018
 161 #define GLX_PRESERVED_CONTENTS          0x801B
 162 #define GLX_LARGEST_PBUFFER             0x801C
 163 #define GLX_WIDTH                       0x801D
 164 #define GLX_HEIGHT                      0x801E
 165 #define GLX_EVENT_MASK                  0x801F
 166 #define GLX_DRAWABLE_TYPE               0x8010
 167 #define GLX_FBCONFIG_ID                 0x8013
 168 #define GLX_VISUAL_ID                   0x800B
 169 #define GLX_WINDOW_BIT                  0x00000001
 170 #define GLX_PIXMAP_BIT                  0x00000002
 171 #define GLX_PBUFFER_BIT                 0x00000004
 172 #define GLX_AUX_BUFFERS_BIT             0x00000010
 173 #define GLX_FRONT_LEFT_BUFFER_BIT       0x00000001
 174 #define GLX_FRONT_RIGHT_BUFFER_BIT      0x00000002
 175 #define GLX_BACK_LEFT_BUFFER_BIT        0x00000004
 176 #define GLX_BACK_RIGHT_BUFFER_BIT       0x00000008
 177 #define GLX_DEPTH_BUFFER_BIT            0x00000020
 178 #define GLX_STENCIL_BUFFER_BIT          0x00000040
 179 #define GLX_ACCUM_BUFFER_BIT            0x00000080
 180 #define GLX_DRAWABLE_TYPE               0x8010
 181 #define GLX_RENDER_TYPE                 0x8011
 182 #define GLX_X_RENDERABLE                0x8012
 183 #define GLX_NONE                        0x8000

 184 #define GLX_TRUE_COLOR                  0x8002
 185 #define GLX_DIRECT_COLOR                0x8003
 186 #define GLX_PSEUDO_COLOR                0x8004
 187 #define GLX_STATIC_COLOR                0x8005
 188 #define GLX_GRAY_SCALE                  0x8006
 189 #define GLX_STATIC_GRAY                 0x8007
 190 #define GLX_TRANSPARENT_RGB             0x8008
 191 #define GLX_TRANSPARENT_INDEX           0x8009







 192 #define GLX_RGBA_TYPE                   0x8014
 193 #define GLX_COLOR_INDEX_TYPE            0x8015
 194 #define GLX_COLOR_INDEX_BIT             0x00000002
 195 #define GLX_RGBA_BIT                    0x00000001
 196 #define GLX_SCREEN                      0x800C
 197 #define GLX_PBUFFER_CLOBBER_MASK        0x08000000




 198 #define GLX_DAMAGED                     0x8020
 199 #define GLX_SAVED                       0x8021
 200 #define GLX_WINDOW                      0x8022
 201 #define GLX_PBUFFER                     0x8023
 202 
 203 /**
 204  * REMIND: these values are backwards from Sun's OpenGL headers, so we
 205  *         swap them here if building on Solaris/Sparc
 206  */
 207 #ifdef __sparc
 208 #define GLX_PBUFFER_HEIGHT              0x8041
 209 #define GLX_PBUFFER_WIDTH               0x8040
 210 #else /* __sparc */
 211 #define GLX_PBUFFER_HEIGHT              0x8040
 212 #define GLX_PBUFFER_WIDTH               0x8041
 213 #endif /* __sparc */



 214 
 215 /*
 216  * GLX 1.4 and later:
 217  */
 218 #define GLX_SAMPLE_BUFFERS              0x186a0 /*100000*/
 219 #define GLX_SAMPLES                     0x186a1 /*100001*/
 220 
 221 
 222 
 223 typedef struct __GLXcontextRec *GLXContext;
 224 typedef XID GLXPixmap;
 225 typedef XID GLXDrawable;
 226 /* GLX 1.3 and later */
 227 typedef struct __GLXFBConfigRec *GLXFBConfig;
 228 typedef XID GLXFBConfigID;
 229 typedef XID GLXContextID;
 230 typedef XID GLXWindow;
 231 typedef XID GLXPbuffer;
 232 
 233 










 234 
 235 extern XVisualInfo* glXChooseVisual( Display *dpy, int screen,
 236                                      int *attribList );
 237 
 238 extern GLXContext glXCreateContext( Display *dpy, XVisualInfo *vis,
 239                                     GLXContext shareList, Bool direct );
 240 
 241 extern void glXDestroyContext( Display *dpy, GLXContext ctx );
 242 
 243 extern Bool glXMakeCurrent( Display *dpy, GLXDrawable drawable,
 244                             GLXContext ctx);
 245 
 246 extern void glXCopyContext( Display *dpy, GLXContext src, GLXContext dst,
 247                             unsigned long mask );
 248 
 249 extern void glXSwapBuffers( Display *dpy, GLXDrawable drawable );
 250 
 251 extern GLXPixmap glXCreateGLXPixmap( Display *dpy, XVisualInfo *visual,
 252                                      Pixmap pixmap );
 253 


 318                               unsigned int *value );
 319 
 320 extern GLXContext glXCreateNewContext( Display *dpy, GLXFBConfig config,
 321                                        int renderType, GLXContext shareList,
 322                                        Bool direct );
 323 
 324 extern Bool glXMakeContextCurrent( Display *dpy, GLXDrawable draw,
 325                                    GLXDrawable read, GLXContext ctx );
 326 
 327 extern GLXDrawable glXGetCurrentReadDrawable( void );
 328 
 329 extern int glXQueryContext( Display *dpy, GLXContext ctx, int attribute,
 330                             int *value );
 331 
 332 extern void glXSelectEvent( Display *dpy, GLXDrawable drawable,
 333                             unsigned long mask );
 334 
 335 extern void glXGetSelectedEvent( Display *dpy, GLXDrawable drawable,
 336                                  unsigned long *mask );
 337 
 338 
 339 /* GLX 1.4 and later */
 340 extern void (*glXGetProcAddress(const GLubyte *procname))();
 341 
 342 
 343 #ifndef GLX_GLXEXT_LEGACY
 344 
 345 /* modified for inclusion in Java 2D source tree */
 346 /* #include <GL/glxext.h> */
 347 #include "J2D_GL/glxext.h"
 348 
 349 #else







 350 
 351 
 352 /*
 353  * 28. GLX_EXT_visual_info extension
 354  */
 355 #ifndef GLX_EXT_visual_info
 356 #define GLX_EXT_visual_info             1
 357 
 358 #define GLX_X_VISUAL_TYPE_EXT           0x22
 359 #define GLX_TRANSPARENT_TYPE_EXT        0x23
 360 #define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24
 361 #define GLX_TRANSPARENT_RED_VALUE_EXT   0x25
 362 #define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26
 363 #define GLX_TRANSPARENT_BLUE_VALUE_EXT  0x27
 364 #define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28
 365 #define GLX_TRUE_COLOR_EXT              0x8002
 366 #define GLX_DIRECT_COLOR_EXT            0x8003
 367 #define GLX_PSEUDO_COLOR_EXT            0x8004
 368 #define GLX_STATIC_COLOR_EXT            0x8005
 369 #define GLX_GRAY_SCALE_EXT              0x8006
 370 #define GLX_STATIC_GRAY_EXT             0x8007
 371 #define GLX_NONE_EXT                    0x8000
 372 #define GLX_TRANSPARENT_RGB_EXT         0x8008
 373 #define GLX_TRANSPARENT_INDEX_EXT       0x8009
 374 
 375 #endif /* 28. GLX_EXT_visual_info extension */
 376 
 377 
 378 
 379 /*
 380  * 41. GLX_SGI_video_sync
 381  */
 382 #ifndef GLX_SGI_video_sync
 383 #define GLX_SGI_video_sync 1
 384 
 385 extern int glXGetVideoSyncSGI(unsigned int *count);
 386 extern int glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count);
 387 
 388 #endif /* GLX_SGI_video_sync */
 389 
 390 
 391 
 392 /*
 393  * 42. GLX_EXT_visual_rating
 394  */
 395 #ifndef GLX_EXT_visual_rating
 396 #define GLX_EXT_visual_rating           1
 397 
 398 #define GLX_VISUAL_CAVEAT_EXT           0x20
 399 /*#define GLX_NONE_EXT                  0x8000*/
 400 #define GLX_SLOW_VISUAL_EXT             0x8001
 401 #define GLX_NON_CONFORMANT_VISUAL_EXT   0x800D
 402 
 403 #endif /* GLX_EXT_visual_rating */
 404 
 405 
 406 
 407 /*
 408  * 47. GLX_EXT_import_context
 409  */
 410 #ifndef GLX_EXT_import_context
 411 #define GLX_EXT_import_context 1
 412 
 413 #define GLX_SHARE_CONTEXT_EXT           0x800A
 414 #define GLX_VISUAL_ID_EXT               0x800B
 415 #define GLX_SCREEN_EXT                  0x800C
 416 
 417 extern void glXFreeContextEXT(Display *dpy, GLXContext context);
 418 
 419 extern GLXContextID glXGetContextIDEXT(const GLXContext context);
 420 
 421 extern Display *glXGetCurrentDisplayEXT(void);
 422 
 423 extern GLXContext glXImportContextEXT(Display *dpy, GLXContextID contextID);
 424 
 425 extern int glXQueryContextInfoEXT(Display *dpy, GLXContext context,
 426                                   int attribute,int *value);
 427 
 428 #endif /* GLX_EXT_import_context */
 429 
 430 
 431 
 432 /*
 433  * 215. GLX_MESA_copy_sub_buffer
 434  */
 435 #ifndef GLX_MESA_copy_sub_buffer
 436 #define GLX_MESA_copy_sub_buffer 1
 437 
 438 extern void glXCopySubBufferMESA( Display *dpy, GLXDrawable drawable,
 439                                   int x, int y, int width, int height );
 440 
 441 #endif

 442 
 443 

 444 
 445 /*
 446  * 216. GLX_MESA_pixmap_colormap
 447  */
 448 #ifndef GLX_MESA_pixmap_colormap
 449 #define GLX_MESA_pixmap_colormap 1
 450 
 451 extern GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual,
 452                                          Pixmap pixmap, Colormap cmap );
 453 
 454 #endif /* GLX_MESA_pixmap_colormap */
 455 



 456 
 457 
 458 /*
 459  * 217. GLX_MESA_release_buffers
 460  */
 461 #ifndef GLX_MESA_release_buffers
 462 #define GLX_MESA_release_buffers 1
 463 
 464 extern Bool glXReleaseBuffersMESA( Display *dpy, GLXDrawable d );
 465 
 466 #endif /* GLX_MESA_release_buffers */



 467 

 468 
 469 
 470 /*
 471  * 218. GLX_MESA_set_3dfx_mode

 472  */
 473 #ifndef GLX_MESA_set_3dfx_mode
 474 #define GLX_MESA_set_3dfx_mode 1
 475 
 476 #define GLX_3DFX_WINDOW_MODE_MESA       0x1
 477 #define GLX_3DFX_FULLSCREEN_MODE_MESA   0x2
 478 
 479 extern Bool glXSet3DfxModeMESA( int mode );
 480 
 481 #endif /* GLX_MESA_set_3dfx_mode */
 482 

 483 
 484 
 485 /*
 486  * ARB 2. GLX_ARB_get_proc_address
 487  */
 488 #ifndef GLX_ARB_get_proc_address
 489 #define GLX_ARB_get_proc_address 1
 490 
 491 extern void (*glXGetProcAddressARB(const GLubyte *procName))();



 492 
 493 #endif /* GLX_ARB_get_proc_address */



 494 

 495 
 496 
 497 #endif /* GLX_GLXEXT_LEGACY */
 498 
 499 
 500 /**
 501  ** The following aren't in glxext.h yet.
 502  **/
 503 
 504 
 505 /*
 506  * ???. GLX_NV_vertex_array_range
 507  */
 508 #ifndef GLX_NV_vertex_array_range
 509 #define GLX_NV_vertex_array_range
 510 
 511 extern void *glXAllocateMemoryNV(GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
 512 extern void glXFreeMemoryNV(GLvoid *pointer);
 513 typedef void * ( * PFNGLXALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
 514 typedef void ( * PFNGLXFREEMEMORYNVPROC) (GLvoid *pointer);
 515 
 516 #endif /* GLX_NV_vertex_array_range */

 517 

 518 
 519 

 520 /*
 521  * ???. GLX_MESA_agp_offset
 522  */
 523 #ifndef GLX_MESA_agp_offset
 524 #define GLX_MESA_agp_offset 1
 525 
 526 extern GLuint glXGetAGPOffsetMESA(const GLvoid *pointer);
 527 typedef GLuint (* PFNGLXGETAGPOFFSETMESAPROC) (const GLvoid *pointer);
 528 
 529 #endif /* GLX_MESA_agp_offset */
 530 
 531 






















 532 
 533 #ifdef __cplusplus
 534 }
 535 #endif
 536 
 537 #endif


   5  * under the terms of the GNU General Public License version 2 only, as
   6  * published by the Free Software Foundation.  Oracle designates this
   7  * particular file as subject to the "Classpath" exception as provided
   8  * by Oracle in the LICENSE file that accompanied this code.
   9  *
  10  * This code is distributed in the hope that it will be useful, but WITHOUT
  11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  13  * version 2 for more details (a copy is included in the LICENSE file that
  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  21  * or visit www.oracle.com if you need additional information or have any
  22  * questions.
  23  */
  24 

  25 
  26 /*
  27  * This file is available under and governed by the GNU General Public
  28  * License version 2 only, as published by the Free Software Foundation.
  29  * However, the following notice accompanied the original version of this
  30  * file:
  31  *
  32  * Mesa 3-D graphics library

  33  *
  34  * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
  35  *
  36  * Permission is hereby granted, free of charge, to any person obtaining a
  37  * copy of this software and associated documentation files (the "Software"),
  38  * to deal in the Software without restriction, including without limitation
  39  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  40  * and/or sell copies of the Software, and to permit persons to whom the
  41  * Software is furnished to do so, subject to the following conditions:
  42  *
  43  * The above copyright notice and this permission notice shall be included
  44  * in all copies or substantial portions of the Software.
  45  *
  46  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  47  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  48  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
  49  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
  50  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  51  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  52  * OTHER DEALINGS IN THE SOFTWARE.
  53  */
  54 
  55 
  56 #ifndef GLX_H
  57 #define GLX_H
  58 
  59 








  60 #include <X11/Xlib.h>
  61 #include <X11/Xutil.h>
  62 /* JDK modification of include path to be sure to pick up the correct file */







  63 #include "J2D_GL/gl.h"
  64 
  65 
  66 #if defined(USE_MGL_NAMESPACE)
  67 #include "glx_mangle.h"
  68 #endif

  69 
  70 
  71 #ifdef __cplusplus
  72 extern "C" {
  73 #endif
  74 
  75 
  76 #define GLX_VERSION_1_1         1
  77 #define GLX_VERSION_1_2         1
  78 #define GLX_VERSION_1_3         1
  79 #define GLX_VERSION_1_4         1
  80 
  81 #define GLX_EXTENSION_NAME   "GLX"
  82 
  83 
  84 
  85 /*
  86  * Tokens for glXChooseVisual and glXGetConfig:
  87  */
  88 #define GLX_USE_GL              1


 112 #define GLX_NO_EXTENSION        3
 113 #define GLX_BAD_VISUAL          4
 114 #define GLX_BAD_CONTEXT         5
 115 #define GLX_BAD_VALUE           6
 116 #define GLX_BAD_ENUM            7
 117 
 118 
 119 /*
 120  * GLX 1.1 and later:
 121  */
 122 #define GLX_VENDOR              1
 123 #define GLX_VERSION             2
 124 #define GLX_EXTENSIONS          3
 125 
 126 
 127 /*
 128  * GLX 1.3 and later:
 129  */
 130 #define GLX_CONFIG_CAVEAT               0x20
 131 #define GLX_DONT_CARE                   0xFFFFFFFF


 132 #define GLX_X_VISUAL_TYPE               0x22
 133 #define GLX_TRANSPARENT_TYPE            0x23
 134 #define GLX_TRANSPARENT_INDEX_VALUE     0x24
 135 #define GLX_TRANSPARENT_RED_VALUE       0x25
 136 #define GLX_TRANSPARENT_GREEN_VALUE     0x26
 137 #define GLX_TRANSPARENT_BLUE_VALUE      0x27
 138 #define GLX_TRANSPARENT_ALPHA_VALUE     0x28











 139 #define GLX_WINDOW_BIT                  0x00000001
 140 #define GLX_PIXMAP_BIT                  0x00000002
 141 #define GLX_PBUFFER_BIT                 0x00000004
 142 #define GLX_AUX_BUFFERS_BIT             0x00000010
 143 #define GLX_FRONT_LEFT_BUFFER_BIT       0x00000001
 144 #define GLX_FRONT_RIGHT_BUFFER_BIT      0x00000002
 145 #define GLX_BACK_LEFT_BUFFER_BIT        0x00000004
 146 #define GLX_BACK_RIGHT_BUFFER_BIT       0x00000008
 147 #define GLX_DEPTH_BUFFER_BIT            0x00000020
 148 #define GLX_STENCIL_BUFFER_BIT          0x00000040
 149 #define GLX_ACCUM_BUFFER_BIT            0x00000080



 150 #define GLX_NONE                        0x8000
 151 #define GLX_SLOW_CONFIG                 0x8001
 152 #define GLX_TRUE_COLOR                  0x8002
 153 #define GLX_DIRECT_COLOR                0x8003
 154 #define GLX_PSEUDO_COLOR                0x8004
 155 #define GLX_STATIC_COLOR                0x8005
 156 #define GLX_GRAY_SCALE                  0x8006
 157 #define GLX_STATIC_GRAY                 0x8007
 158 #define GLX_TRANSPARENT_RGB             0x8008
 159 #define GLX_TRANSPARENT_INDEX           0x8009
 160 #define GLX_VISUAL_ID                   0x800B
 161 #define GLX_SCREEN                      0x800C
 162 #define GLX_NON_CONFORMANT_CONFIG       0x800D
 163 #define GLX_DRAWABLE_TYPE               0x8010
 164 #define GLX_RENDER_TYPE                 0x8011
 165 #define GLX_X_RENDERABLE                0x8012
 166 #define GLX_FBCONFIG_ID                 0x8013
 167 #define GLX_RGBA_TYPE                   0x8014
 168 #define GLX_COLOR_INDEX_TYPE            0x8015
 169 #define GLX_MAX_PBUFFER_WIDTH           0x8016
 170 #define GLX_MAX_PBUFFER_HEIGHT          0x8017
 171 #define GLX_MAX_PBUFFER_PIXELS          0x8018
 172 #define GLX_PRESERVED_CONTENTS          0x801B
 173 #define GLX_LARGEST_PBUFFER             0x801C
 174 #define GLX_WIDTH                       0x801D
 175 #define GLX_HEIGHT                      0x801E
 176 #define GLX_EVENT_MASK                  0x801F
 177 #define GLX_DAMAGED                     0x8020
 178 #define GLX_SAVED                       0x8021
 179 #define GLX_WINDOW                      0x8022
 180 #define GLX_PBUFFER                     0x8023









 181 #define GLX_PBUFFER_HEIGHT              0x8040
 182 #define GLX_PBUFFER_WIDTH               0x8041
 183 #define GLX_RGBA_BIT                    0x00000001
 184 #define GLX_COLOR_INDEX_BIT             0x00000002
 185 #define GLX_PBUFFER_CLOBBER_MASK        0x08000000
 186 
 187 
 188 /*
 189  * GLX 1.4 and later:
 190  */
 191 #define GLX_SAMPLE_BUFFERS              0x186a0 /*100000*/
 192 #define GLX_SAMPLES                     0x186a1 /*100001*/
 193 
 194 
 195 
 196 typedef struct __GLXcontextRec *GLXContext;
 197 typedef XID GLXPixmap;
 198 typedef XID GLXDrawable;
 199 /* GLX 1.3 and later */
 200 typedef struct __GLXFBConfigRec *GLXFBConfig;
 201 typedef XID GLXFBConfigID;
 202 typedef XID GLXContextID;
 203 typedef XID GLXWindow;
 204 typedef XID GLXPbuffer;
 205 
 206 
 207 /*
 208 ** Events.
 209 ** __GLX_NUMBER_EVENTS is set to 17 to account for the BufferClobberSGIX
 210 **  event - this helps initialization if the server supports the pbuffer
 211 **  extension and the client doesn't.
 212 */
 213 #define GLX_PbufferClobber      0
 214 #define GLX_BufferSwapComplete  1
 215 
 216 #define __GLX_NUMBER_EVENTS 17
 217 
 218 extern XVisualInfo* glXChooseVisual( Display *dpy, int screen,
 219                                      int *attribList );
 220 
 221 extern GLXContext glXCreateContext( Display *dpy, XVisualInfo *vis,
 222                                     GLXContext shareList, Bool direct );
 223 
 224 extern void glXDestroyContext( Display *dpy, GLXContext ctx );
 225 
 226 extern Bool glXMakeCurrent( Display *dpy, GLXDrawable drawable,
 227                             GLXContext ctx);
 228 
 229 extern void glXCopyContext( Display *dpy, GLXContext src, GLXContext dst,
 230                             unsigned long mask );
 231 
 232 extern void glXSwapBuffers( Display *dpy, GLXDrawable drawable );
 233 
 234 extern GLXPixmap glXCreateGLXPixmap( Display *dpy, XVisualInfo *visual,
 235                                      Pixmap pixmap );
 236 


 301                               unsigned int *value );
 302 
 303 extern GLXContext glXCreateNewContext( Display *dpy, GLXFBConfig config,
 304                                        int renderType, GLXContext shareList,
 305                                        Bool direct );
 306 
 307 extern Bool glXMakeContextCurrent( Display *dpy, GLXDrawable draw,
 308                                    GLXDrawable read, GLXContext ctx );
 309 
 310 extern GLXDrawable glXGetCurrentReadDrawable( void );
 311 
 312 extern int glXQueryContext( Display *dpy, GLXContext ctx, int attribute,
 313                             int *value );
 314 
 315 extern void glXSelectEvent( Display *dpy, GLXDrawable drawable,
 316                             unsigned long mask );
 317 
 318 extern void glXGetSelectedEvent( Display *dpy, GLXDrawable drawable,
 319                                  unsigned long *mask );
 320 
 321 /* GLX 1.3 function pointer typedefs */
 322 typedef GLXFBConfig * (* PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements);
 323 typedef GLXFBConfig * (* PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements);
 324 typedef int (* PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value);
 325 typedef XVisualInfo * (* PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config);
 326 typedef GLXWindow (* PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
 327 typedef void (* PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win);
 328 typedef GLXPixmap (* PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list);
 329 typedef void (* PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap);
 330 typedef GLXPbuffer (* PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list);
 331 typedef void (* PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf);
 332 typedef void (* PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
 333 typedef GLXContext (* PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
 334 typedef Bool (* PFNGLXMAKECONTEXTCURRENTPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
 335 typedef GLXDrawable (* PFNGLXGETCURRENTREADDRAWABLEPROC) (void);
 336 typedef Display * (* PFNGLXGETCURRENTDISPLAYPROC) (void);
 337 typedef int (* PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value);
 338 typedef void (* PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask);
 339 typedef void (* PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask);
 340 
 341 
 342 /*
 343  * ARB 2. GLX_ARB_get_proc_address























































 344  */
 345 #ifndef GLX_ARB_get_proc_address
 346 #define GLX_ARB_get_proc_address 1












 347 
 348 typedef void (*__GLXextFuncPtr)(void);
 349 extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *);
 350 
 351 #endif /* GLX_ARB_get_proc_address */
 352 
 353 
 354 
 355 /* GLX 1.4 and later */
 356 extern void (*glXGetProcAddress(const GLubyte *procname))( void );






 357 
 358 /* GLX 1.4 function pointer typedefs */
 359 typedef __GLXextFuncPtr (* PFNGLXGETPROCADDRESSPROC) (const GLubyte *procName);
 360 
 361 
 362 #ifndef GLX_GLXEXT_LEGACY
 363 
 364 /* JDK modification of include path to be sure to pick up the correct file */
 365 #include "J2D_GL/glxext.h"



 366 
 367 #endif /* GLX_GLXEXT_LEGACY */

 368 

 369 
 370 /**
 371  ** The following aren't in glxext.h yet.
 372  **/
 373 
 374 
 375 /*
 376  * ???. GLX_NV_vertex_array_range
 377  */
 378 #ifndef GLX_NV_vertex_array_range
 379 #define GLX_NV_vertex_array_range


 380 
 381 extern void *glXAllocateMemoryNV(GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
 382 extern void glXFreeMemoryNV(GLvoid *pointer);
 383 typedef void * ( * PFNGLXALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
 384 typedef void ( * PFNGLXFREEMEMORYNVPROC) (GLvoid *pointer);
 385 
 386 #endif /* GLX_NV_vertex_array_range */
 387 
 388 
 389 /*
 390  * ARB ?. GLX_ARB_render_texture
 391  * XXX This was never finalized!
 392  */
 393 #ifndef GLX_ARB_render_texture
 394 #define GLX_ARB_render_texture 1



 395 
 396 extern Bool glXBindTexImageARB(Display *dpy, GLXPbuffer pbuffer, int buffer);
 397 extern Bool glXReleaseTexImageARB(Display *dpy, GLXPbuffer pbuffer, int buffer);
 398 extern Bool glXDrawableAttribARB(Display *dpy, GLXDrawable draw, const int *attribList);
 399 
 400 #endif /* GLX_ARB_render_texture */
 401 
 402 
 403 /*
 404  * #?. GLX_MESA_swap_frame_usage
 405  */
 406 #ifndef GLX_MESA_swap_frame_usage
 407 #define GLX_MESA_swap_frame_usage 1
 408 
 409 extern int glXGetFrameUsageMESA(Display *dpy, GLXDrawable drawable, float *usage);
 410 extern int glXBeginFrameTrackingMESA(Display *dpy, GLXDrawable drawable);
 411 extern int glXEndFrameTrackingMESA(Display *dpy, GLXDrawable drawable);
 412 extern int glXQueryFrameTrackingMESA(Display *dpy, GLXDrawable drawable, int64_t *swapCount, int64_t *missedFrames, float *lastMissedUsage);
 413 
 414 typedef int (*PFNGLXGETFRAMEUSAGEMESAPROC) (Display *dpy, GLXDrawable drawable, float *usage);
 415 typedef int (*PFNGLXBEGINFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable);
 416 typedef int (*PFNGLXENDFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable);
 417 typedef int (*PFNGLXQUERYFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable, int64_t *swapCount, int64_t *missedFrames, float *lastMissedUsage);
 418 
 419 #endif /* GLX_MESA_swap_frame_usage */
 420 
 421 







 422 
 423 /*
 424  * #?. GLX_MESA_swap_control
 425  */
 426 #ifndef GLX_MESA_swap_control
 427 #define GLX_MESA_swap_control 1
 428 
 429 extern int glXSwapIntervalMESA(unsigned int interval);
 430 extern int glXGetSwapIntervalMESA(void);


 431 
 432 typedef int (*PFNGLXSWAPINTERVALMESAPROC)(unsigned int interval);
 433 typedef int (*PFNGLXGETSWAPINTERVALMESAPROC)(void);
 434 
 435 #endif /* GLX_MESA_swap_control */
 436 
 437 
 438 /*** Should these go here, or in another header? */
 439 /*
 440 ** GLX Events
 441 */
 442 typedef struct {
 443     int event_type;             /* GLX_DAMAGED or GLX_SAVED */
 444     int draw_type;              /* GLX_WINDOW or GLX_PBUFFER */
 445     unsigned long serial;       /* # of last request processed by server */
 446     Bool send_event;            /* true if this came for SendEvent request */
 447     Display *display;           /* display the event was read from */
 448     GLXDrawable drawable;       /* XID of Drawable */
 449     unsigned int buffer_mask;   /* mask indicating which buffers are affected */
 450     unsigned int aux_buffer;    /* which aux buffer was affected */
 451     int x, y;
 452     int width, height;
 453     int count;                  /* if nonzero, at least this many more */
 454 } GLXPbufferClobberEvent;
 455 
 456 typedef struct {
 457     int type;
 458     unsigned long serial;       /* # of last request processed by server */
 459     Bool send_event;            /* true if this came from a SendEvent request */
 460     Display *display;           /* Display the event was read from */
 461     Drawable drawable;  /* drawable on which event was requested in event mask */
 462     int event_type;
 463     int64_t ust;
 464     int64_t msc;
 465     int64_t sbc;
 466 } GLXBufferSwapComplete;
 467 
 468 typedef union __GLXEvent {
 469     GLXPbufferClobberEvent glxpbufferclobber;
 470     GLXBufferSwapComplete glxbufferswapcomplete;
 471     long pad[24];
 472 } GLXEvent;
 473 
 474 #ifdef __cplusplus
 475 }
 476 #endif
 477 
 478 #endif
< prev index next >