| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/drivers/GL/glx.h
Go to the documentation of this file.

    00001 /*
    00002  * Mesa 3-D graphics library
    00003  * Version:  6.5
    00004  *
    00005  * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
    00006  *
    00007  * Permission is hereby granted, free of charge, to any person obtaining a
    00008  * copy of this software and associated documentation files (the "Software"),
    00009  * to deal in the Software without restriction, including without limitation
    00010  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
    00011  * and/or sell copies of the Software, and to permit persons to whom the
    00012  * Software is furnished to do so, subject to the following conditions:
    00013  *
    00014  * The above copyright notice and this permission notice shall be included
    00015  * in all copies or substantial portions of the Software.
    00016  *
    00017  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
    00018  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    00019  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
    00020  * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
    00021  * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
    00022  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    00023  */
    00024
    00025
    00026 #ifndef GLX_H
    00027 #define GLX_H
    00028
    00029
    00030 #ifdef __VMS
    00031 #include <GL/vms_x_fix.h>
    00032 # ifdef __cplusplus
    00033 /* VMS Xlib.h gives problems with C++.
    00034  * this avoids a bunch of trivial warnings */
    00035 #pragma message disable nosimpint
    00036 #endif
    00037 #endif
    00038 #include <X11/Xlib.h>
    00039 #include <X11/Xutil.h>
    00040 #ifdef __VMS
    00041 # ifdef __cplusplus
    00042 #pragma message enable nosimpint
    00043 #endif
    00044 #endif
    00045 #include <GL/gl.h>
    00046
    00047
    00048 #if defined(USE_MGL_NAMESPACE)
    00049 #include "glx_mangle.h"
    00050 #endif
    00051
    00052
    00053 #ifdef __cplusplus
    00054 extern "C" {
    00055 #endif
    00056
    00057
    00058 #define GLX_VERSION_1_1                     1
    00059 #define GLX_VERSION_1_2                     1
    00060 #define GLX_VERSION_1_3                     1
    00061 #define GLX_VERSION_1_4                     1
    00062
    00063 #define GLX_EXTENSION_NAME   "GLX"
    00064
    00065
    00066
    00067 /*
    00068  * Tokens for glXChooseVisual and glXGetConfig:
    00069  */
    00070 #define GLX_USE_GL               1
    00071 #define GLX_BUFFER_SIZE                     2
    00072 #define GLX_LEVEL                3
    00073 #define GLX_RGBA                 4
    00074 #define GLX_DOUBLEBUFFER         5
    00075 #define GLX_STEREO               6
    00076 #define GLX_AUX_BUFFERS                     7
    00077 #define GLX_RED_SIZE             8
    00078 #define GLX_GREEN_SIZE                      9
    00079 #define GLX_BLUE_SIZE            10
    00080 #define GLX_ALPHA_SIZE                      11
    00081 #define GLX_DEPTH_SIZE                      12
    00082 #define GLX_STENCIL_SIZE         13
    00083 #define GLX_ACCUM_RED_SIZE       14
    00084 #define GLX_ACCUM_GREEN_SIZE     15
    00085 #define GLX_ACCUM_BLUE_SIZE      16
    00086 #define GLX_ACCUM_ALPHA_SIZE     17
    00087
    00088
    00089 /*
    00090  * Error codes returned by glXGetConfig:
    00091  */
    00092 #define GLX_BAD_SCREEN                      1
    00093 #define GLX_BAD_ATTRIBUTE        2
    00094 #define GLX_NO_EXTENSION         3
    00095 #define GLX_BAD_VISUAL                      4
    00096 #define GLX_BAD_CONTEXT                     5
    00097 #define GLX_BAD_VALUE            6
    00098 #define GLX_BAD_ENUM             7
    00099
    00100
    00101 /*
    00102  * GLX 1.1 and later:
    00103  */
    00104 #define GLX_VENDOR               1
    00105 #define GLX_VERSION              2
    00106 #define GLX_EXTENSIONS                      3
    00107
    00108
    00109 /*
    00110  * GLX 1.3 and later:
    00111  */
    00112 #define GLX_CONFIG_CAVEAT                   0x20
    00113 #define GLX_DONT_CARE                       0xFFFFFFFF
    00114 #define GLX_X_VISUAL_TYPE                   0x22
    00115 #define GLX_TRANSPARENT_TYPE                0x23
    00116 #define GLX_TRANSPARENT_INDEX_VALUE         0x24
    00117 #define GLX_TRANSPARENT_RED_VALUE           0x25
    00118 #define GLX_TRANSPARENT_GREEN_VALUE         0x26
    00119 #define GLX_TRANSPARENT_BLUE_VALUE          0x27
    00120 #define GLX_TRANSPARENT_ALPHA_VALUE         0x28
    00121 #define GLX_WINDOW_BIT                                 0x00000001
    00122 #define GLX_PIXMAP_BIT                                 0x00000002
    00123 #define GLX_PBUFFER_BIT                                0x00000004
    00124 #define GLX_AUX_BUFFERS_BIT                 0x00000010
    00125 #define GLX_FRONT_LEFT_BUFFER_BIT           0x00000001
    00126 #define GLX_FRONT_RIGHT_BUFFER_BIT          0x00000002
    00127 #define GLX_BACK_LEFT_BUFFER_BIT 0x00000004
    00128 #define GLX_BACK_RIGHT_BUFFER_BIT           0x00000008
    00129 #define GLX_DEPTH_BUFFER_BIT                0x00000020
    00130 #define GLX_STENCIL_BUFFER_BIT              0x00000040
    00131 #define GLX_ACCUM_BUFFER_BIT                0x00000080
    00132 #define GLX_NONE                            0x8000
    00133 #define GLX_SLOW_CONFIG                                0x8001
    00134 #define GLX_TRUE_COLOR                                 0x8002
    00135 #define GLX_DIRECT_COLOR                    0x8003
    00136 #define GLX_PSEUDO_COLOR                    0x8004
    00137 #define GLX_STATIC_COLOR                    0x8005
    00138 #define GLX_GRAY_SCALE                                 0x8006
    00139 #define GLX_STATIC_GRAY                                0x8007
    00140 #define GLX_TRANSPARENT_RGB                 0x8008
    00141 #define GLX_TRANSPARENT_INDEX               0x8009
    00142 #define GLX_VISUAL_ID                       0x800B
    00143 #define GLX_SCREEN                          0x800C
    00144 #define GLX_NON_CONFORMANT_CONFIG           0x800D
    00145 #define GLX_DRAWABLE_TYPE                   0x8010
    00146 #define GLX_RENDER_TYPE                                0x8011
    00147 #define GLX_X_RENDERABLE                    0x8012
    00148 #define GLX_FBCONFIG_ID                                0x8013
    00149 #define GLX_RGBA_TYPE                       0x8014
    00150 #define GLX_COLOR_INDEX_TYPE                0x8015
    00151 #define GLX_MAX_PBUFFER_WIDTH               0x8016
    00152 #define GLX_MAX_PBUFFER_HEIGHT              0x8017
    00153 #define GLX_MAX_PBUFFER_PIXELS              0x8018
    00154 #define GLX_PRESERVED_CONTENTS              0x801B
    00155 #define GLX_LARGEST_PBUFFER                 0x801C
    00156 #define GLX_WIDTH                           0x801D
    00157 #define GLX_HEIGHT                          0x801E
    00158 #define GLX_EVENT_MASK                                 0x801F
    00159 #define GLX_DAMAGED                         0x8020
    00160 #define GLX_SAVED                           0x8021
    00161 #define GLX_WINDOW                          0x8022
    00162 #define GLX_PBUFFER                         0x8023
    00163 #define GLX_PBUFFER_HEIGHT              0x8040
    00164 #define GLX_PBUFFER_WIDTH               0x8041
    00165 #define GLX_RGBA_BIT                        0x00000001
    00166 #define GLX_COLOR_INDEX_BIT                 0x00000002
    00167 #define GLX_PBUFFER_CLOBBER_MASK 0x08000000
    00168
    00169
    00170 /*
    00171  * GLX 1.4 and later:
    00172  */
    00173 #define GLX_SAMPLE_BUFFERS              0x186a0 /*100000*/
    00174 #define GLX_SAMPLES                     0x186a1 /*100001*/
    00175
    00176
    00177
    00178 typedef struct __GLXcontextRec *GLXContext;
    00179 typedef XID GLXPixmap;
    00180 typedef XID GLXDrawable;
    00181 /* GLX 1.3 and later */
    00182 typedef struct __GLXFBConfigRec *GLXFBConfig;
    00183 typedef XID GLXFBConfigID;
    00184 typedef XID GLXContextID;
    00185 typedef XID GLXWindow;
    00186 typedef XID GLXPbuffer;
    00187
    00188
    00189
    00190 extern XVisualInfo* glXChooseVisual( Display *dpy, int screen,
    00191                                                  int *attribList );
    00192
    00193 extern GLXContext glXCreateContext( Display *dpy, XVisualInfo *vis,
    00194                                                 GLXContext shareList, Bool direct );
    00195
    00196 extern void glXDestroyContext( Display *dpy, GLXContext ctx );
    00197
    00198 extern Bool glXMakeCurrent( Display *dpy, GLXDrawable drawable,
    00199                                      GLXContext ctx);
    00200
    00201 extern void glXCopyContext( Display *dpy, GLXContext src, GLXContext dst,
    00202                                      unsigned long mask );
    00203
    00204 extern void glXSwapBuffers( Display *dpy, GLXDrawable drawable );
    00205
    00206 extern GLXPixmap glXCreateGLXPixmap( Display *dpy, XVisualInfo *visual,
    00207                                                  Pixmap pixmap );
    00208
    00209 extern void glXDestroyGLXPixmap( Display *dpy, GLXPixmap pixmap );
    00210
    00211 extern Bool glXQueryExtension( Display *dpy, int *errorb, int *event );
    00212
    00213 extern Bool glXQueryVersion( Display *dpy, int *maj, int *min );
    00214
    00215 extern Bool glXIsDirect( Display *dpy, GLXContext ctx );
    00216
    00217 extern int glXGetConfig( Display *dpy, XVisualInfo *visual,
    00218                                   int attrib, int *value );
    00219
    00220 extern GLXContext glXGetCurrentContext( void );
    00221
    00222 extern GLXDrawable glXGetCurrentDrawable( void );
    00223
    00224 extern void glXWaitGL( void );
    00225
    00226 extern void glXWaitX( void );
    00227
    00228 extern void glXUseXFont( Font font, int first, int count, int list );
    00229
    00230
    00231
    00232 /* GLX 1.1 and later */
    00233 extern const char *glXQueryExtensionsString( Display *dpy, int screen );
    00234
    00235 extern const char *glXQueryServerString( Display *dpy, int screen, int name );
    00236
    00237 extern const char *glXGetClientString( Display *dpy, int name );
    00238
    00239
    00240 /* GLX 1.2 and later */
    00241 extern Display *glXGetCurrentDisplay( void );
    00242
    00243
    00244 /* GLX 1.3 and later */
    00245 extern GLXFBConfig *glXChooseFBConfig( Display *dpy, int screen,
    00246                                        const int *attribList, int *nitems );
    00247
    00248 extern int glXGetFBConfigAttrib( Display *dpy, GLXFBConfig config,
    00249                                  int attribute, int *value );
    00250
    00251 extern GLXFBConfig *glXGetFBConfigs( Display *dpy, int screen,
    00252                                      int *nelements );
    00253
    00254 extern XVisualInfo *glXGetVisualFromFBConfig( Display *dpy,
    00255                                               GLXFBConfig config );
    00256
    00257 extern GLXWindow glXCreateWindow( Display *dpy, GLXFBConfig config,
    00258                                   Window win, const int *attribList );
    00259
    00260 extern void glXDestroyWindow( Display *dpy, GLXWindow window );
    00261
    00262 extern GLXPixmap glXCreatePixmap( Display *dpy, GLXFBConfig config,
    00263                                   Pixmap pixmap, const int *attribList );
    00264
    00265 extern void glXDestroyPixmap( Display *dpy, GLXPixmap pixmap );
    00266
    00267 extern GLXPbuffer glXCreatePbuffer( Display *dpy, GLXFBConfig config,
    00268                                     const int *attribList );
    00269
    00270 extern void glXDestroyPbuffer( Display *dpy, GLXPbuffer pbuf );
    00271
    00272 extern void glXQueryDrawable( Display *dpy, GLXDrawable draw, int attribute,
    00273                               unsigned int *value );
    00274
    00275 extern GLXContext glXCreateNewContext( Display *dpy, GLXFBConfig config,
    00276                                        int renderType, GLXContext shareList,
    00277                                        Bool direct );
    00278
    00279 extern Bool glXMakeContextCurrent( Display *dpy, GLXDrawable draw,
    00280                                    GLXDrawable read, GLXContext ctx );
    00281
    00282 extern GLXDrawable glXGetCurrentReadDrawable( void );
    00283
    00284 extern int glXQueryContext( Display *dpy, GLXContext ctx, int attribute,
    00285                             int *value );
    00286
    00287 extern void glXSelectEvent( Display *dpy, GLXDrawable drawable,
    00288                             unsigned long mask );
    00289
    00290 extern void glXGetSelectedEvent( Display *dpy, GLXDrawable drawable,
    00291                                  unsigned long *mask );
    00292
    00293
    00294 /* GLX 1.4 and later */
    00295 extern void (*glXGetProcAddress(const GLubyte *procname))( void );
    00296
    00297
    00298 #ifndef GLX_GLXEXT_LEGACY
    00299
    00300 #include <GL/glxext.h>
    00301
    00302 #else
    00303
    00304
    00305
    00306 /*
    00307  * ARB 2. GLX_ARB_get_proc_address
    00308  */
    00309 #ifndef GLX_ARB_get_proc_address
    00310 #define GLX_ARB_get_proc_address 1
    00311
    00312 typedef void (*__GLXextFuncPtr)(void);
    00313 extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *);
    00314
    00315 #endif /* GLX_ARB_get_proc_address */
    00316
    00317
    00318
    00319 #endif /* GLX_GLXEXT_LEGACY */
    00320
    00321
    00327 /*
    00328  * ???. GLX_NV_vertex_array_range
    00329  */
    00330 #ifndef GLX_NV_vertex_array_range
    00331 #define GLX_NV_vertex_array_range
    00332
    00333 extern void *glXAllocateMemoryNV(GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
    00334 extern void glXFreeMemoryNV(GLvoid *pointer);
    00335 typedef void * ( * PFNGLXALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
    00336 typedef void ( * PFNGLXFREEMEMORYNVPROC) (GLvoid *pointer);
    00337
    00338 #endif /* GLX_NV_vertex_array_range */
    00339
    00340
    00341 /*
    00342  * ???. GLX_MESA_allocate_memory
    00343  */
    00344 #ifndef GLX_MESA_allocate_memory
    00345 #define GLX_MESA_allocate_memory 1
    00346
    00347 extern void *glXAllocateMemoryMESA(Display *dpy, int scrn, size_t size, float readfreq, float writefreq, float priority);
    00348 extern void glXFreeMemoryMESA(Display *dpy, int scrn, void *pointer);
    00349 extern GLuint glXGetMemoryOffsetMESA(Display *dpy, int scrn, const void *pointer);
    00350 typedef void * ( * PFNGLXALLOCATEMEMORYMESAPROC) (Display *dpy, int scrn, size_t size, float readfreq, float writefreq, float priority);
    00351 typedef void ( * PFNGLXFREEMEMORYMESAPROC) (Display *dpy, int scrn, void *pointer);
    00352 typedef GLuint (* PFNGLXGETMEMORYOFFSETMESAPROC) (Display *dpy, int scrn, const void *pointer);
    00353
    00354 #endif /* GLX_MESA_allocate_memory */
    00355
    00356
    00357 /*
    00358  * Remove this when glxext.h is updated.
    00359  */
    00360 #ifndef GLX_NV_float_buffer
    00361 #define GLX_NV_float_buffer 1
    00362
    00363 #define GLX_FLOAT_COMPONENTS_NV         0x20B0
    00364
    00365 #endif /* GLX_NV_float_buffer */
    00366
    00367
    00368
    00369 /*
    00370  * #?. GLX_MESA_swap_frame_usage
    00371  */
    00372 #ifndef GLX_MESA_swap_frame_usage
    00373 #define GLX_MESA_swap_frame_usage 1
    00374
    00375 extern int glXGetFrameUsageMESA(Display *dpy, GLXDrawable drawable, float *usage);
    00376 extern int glXBeginFrameTrackingMESA(Display *dpy, GLXDrawable drawable);
    00377 extern int glXEndFrameTrackingMESA(Display *dpy, GLXDrawable drawable);
    00378 extern int glXQueryFrameTrackingMESA(Display *dpy, GLXDrawable drawable, int64_t *swapCount, int64_t *missedFrames, float *lastMissedUsage);
    00379
    00380 typedef int (*PFNGLXGETFRAMEUSAGEMESAPROC) (Display *dpy, GLXDrawable drawable, float *usage);
    00381 typedef int (*PFNGLXBEGINFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable);
    00382 typedef int (*PFNGLXENDFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable);
    00383 typedef int (*PFNGLXQUERYFRAMETRACKINGMESAPROC)(Display *dpy, GLXDrawable drawable, int64_t *swapCount, int64_t *missedFrames, float *lastMissedUsage);
    00384
    00385 #endif /* GLX_MESA_swap_frame_usage */
    00386
    00387
    00388
    00389 /*
    00390  * #?. GLX_MESA_swap_control
    00391  */
    00392 #ifndef GLX_MESA_swap_control
    00393 #define GLX_MESA_swap_control 1
    00394
    00395 extern int glXSwapIntervalMESA(unsigned int interval);
    00396 extern int glXGetSwapIntervalMESA(void);
    00397
    00398 typedef int (*PFNGLXSWAPINTERVALMESAPROC)(unsigned int interval);
    00399 typedef int (*PFNGLXGETSWAPINTERVALMESAPROC)(void);
    00400
    00401 #endif /* GLX_MESA_swap_control */
    00402
    00403
    00404
    00405 /*
    00406  * #?. GLX_EXT_texture_from_pixmap
    00407  * XXX not finished?
    00408  */
    00409 #ifndef GLX_EXT_texture_from_pixmap
    00410 #define GLX_EXT_texture_from_pixmap 1
    00411
    00412 #define GLX_BIND_TO_TEXTURE_RGB_EXT        0x20D0
    00413 #define GLX_BIND_TO_TEXTURE_RGBA_EXT       0x20D1
    00414 #define GLX_BIND_TO_MIPMAP_TEXTURE_EXT     0x20D2
    00415 #define GLX_BIND_TO_TEXTURE_TARGETS_EXT    0x20D3
    00416 #define GLX_Y_INVERTED_EXT                 0x20D4
    00417
    00418 #define GLX_TEXTURE_FORMAT_EXT             0x20D5
    00419 #define GLX_TEXTURE_TARGET_EXT             0x20D6
    00420 #define GLX_MIPMAP_TEXTURE_EXT             0x20D7
    00421
    00422 #define GLX_TEXTURE_FORMAT_NONE_EXT        0x20D8
    00423 #define GLX_TEXTURE_FORMAT_RGB_EXT         0x20D9
    00424 #define GLX_TEXTURE_FORMAT_RGBA_EXT        0x20DA
    00425
    00426 #define GLX_TEXTURE_1D_BIT_EXT             0x00000001
    00427 #define GLX_TEXTURE_2D_BIT_EXT             0x00000002
    00428 #define GLX_TEXTURE_RECTANGLE_BIT_EXT      0x00000004
    00429
    00430 #define GLX_TEXTURE_1D_EXT                 0x20DB
    00431 #define GLX_TEXTURE_2D_EXT                 0x20DC
    00432 #define GLX_TEXTURE_RECTANGLE_EXT          0x20DD
    00433
    00434 #define GLX_FRONT_LEFT_EXT                 0x20DE
    00435 #define GLX_FRONT_RIGHT_EXT                0x20DF
    00436 #define GLX_BACK_LEFT_EXT                  0x20E0
    00437 #define GLX_BACK_RIGHT_EXT                 0x20E1
    00438 #define GLX_FRONT_EXT                      GLX_FRONT_LEFT_EXT
    00439 #define GLX_BACK_EXT                       GLX_BACK_LEFT_EXT
    00440 #define GLX_AUX0_EXT                       0x20E2
    00441 #define GLX_AUX1_EXT                       0x20E3
    00442 #define GLX_AUX2_EXT                       0x20E4
    00443 #define GLX_AUX3_EXT                       0x20E5
    00444 #define GLX_AUX4_EXT                       0x20E6
    00445 #define GLX_AUX5_EXT                       0x20E7
    00446 #define GLX_AUX6_EXT                       0x20E8
    00447 #define GLX_AUX7_EXT                       0x20E9
    00448 #define GLX_AUX8_EXT                       0x20EA
    00449 #define GLX_AUX9_EXT                       0x20EB
    00450
    00451 extern void glXBindTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list);
    00452 extern void glXReleaseTexImageEXT(Display *dpy, GLXDrawable drawable, int buffer);
    00453
    00454 #endif /* GLX_EXT_texture_from_pixmap */
    00455
    00456
    00457
    00458
    00459 /*** Should these go here, or in another header? */
    00460 /*
    00461 ** GLX Events
    00462 */
    00463 typedef struct {
    00464     int event_type;              /* GLX_DAMAGED or GLX_SAVED */
    00465     int draw_type;               /* GLX_WINDOW or GLX_PBUFFER */
    00466     unsigned long serial;        /* # of last request processed by server */
    00467     Bool send_event;             /* true if this came for SendEvent request */
    00468     Display *display;            /* display the event was read from */
    00469     GLXDrawable drawable;        /* XID of Drawable */
    00470     unsigned int buffer_mask;    /* mask indicating which buffers are affected */
    00471     unsigned int aux_buffer;     /* which aux buffer was affected */
    00472     int x, y;
    00473     int width, height;
    00474     int count;                              /* if nonzero, at least this many more */
    00475 } GLXPbufferClobberEvent;
    00476
    00477 typedef union __GLXEvent {
    00478     GLXPbufferClobberEvent glxpbufferclobber;
    00479     long pad[24];
    00480 } GLXEvent;
    00481
    00482 #ifdef __cplusplus
    00483 }
    00484 #endif
    00485
    00486 #endif

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines