Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

glx.h

00001 #ifndef __glx_h__
00002 #define __glx_h__
00003 
00004 /*
00005 ** The contents of this file are subject to the GLX Public License Version 1.0
00006 ** (the "License"). You may not use this file except in compliance with the
00007 ** License. You may obtain a copy of the License at Silicon Graphics, Inc.,
00008 ** attn: Legal Services, 2011 N. Shoreline Blvd., Mountain View, CA 94043
00009 ** or at http://www.sgi.com/software/opensource/glx/license.html.
00010 **
00011 ** Software distributed under the License is distributed on an "AS IS"
00012 ** basis. ALL WARRANTIES ARE DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY
00013 ** IMPLIED WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR
00014 ** PURPOSE OR OF NON- INFRINGEMENT. See the License for the specific
00015 ** language governing rights and limitations under the License.
00016 **
00017 ** The Original Software is GLX version 1.2 source code, released February,
00018 ** 1999. The developer of the Original Software is Silicon Graphics, Inc.
00019 ** Those portions of the Subject Software created by Silicon Graphics, Inc.
00020 ** are Copyright (c) 1991-9 Silicon Graphics, Inc. All Rights Reserved.
00021 **
00022 ** $Header: //sw/OEM/nvr50_linux_986209/drivers/OpenGL/win/glx/include/glx.h#1 $
00023 */
00024 
00025 #include <X11/Xlib.h>
00026 #include <X11/Xutil.h>
00027 #include <X11/Xmd.h>
00028 #include <GL/gl.h>
00029 #include <GL/glxtokens.h>
00030 
00031 #ifdef __cplusplus
00032 extern "C" {
00033 #endif
00034 
00035 /*
00036  * GLX resources.
00037  */
00038 typedef XID GLXContextID;
00039 typedef XID GLXPixmap;
00040 typedef XID GLXDrawable;
00041 typedef XID GLXPbuffer;
00042 typedef XID GLXWindow;
00043 typedef XID GLXFBConfigID;
00044 
00045 /*
00046  * GLXContext is a pointer to opaque data.
00047  */
00048 typedef struct __GLXcontextRec *GLXContext;
00049 
00050 /*
00051  * GLXFBConfig is a pointer to opaque data.
00052  */
00053 typedef struct __GLXFBConfigRec *GLXFBConfig;
00054 typedef struct __GLXFBConfigRec *GLXFBConfigSGIX;
00055 
00056 
00057 /**********************************************************************/
00058 
00059 /*
00060  * GLX 1.0 functions.
00061  */
00062 extern XVisualInfo* glXChooseVisual(Display *dpy, int screen,
00063                                     int *attrib_list);
00064 
00065 extern void glXCopyContext(Display *dpy, GLXContext src,
00066                            GLXContext dst, unsigned long mask);
00067 
00068 extern GLXContext glXCreateContext(Display *dpy, XVisualInfo *vis,
00069                                    GLXContext share_list, Bool direct);
00070 
00071 extern GLXPixmap glXCreateGLXPixmap(Display *dpy, XVisualInfo *vis,
00072                                     Pixmap pixmap);
00073 
00074 extern void glXDestroyContext(Display *dpy, GLXContext ctx);
00075 
00076 extern void glXDestroyGLXPixmap(Display *dpy, GLXPixmap pix);
00077 
00078 extern int glXGetConfig(Display *dpy, XVisualInfo *vis,
00079                         int attrib, int *value);
00080 
00081 extern GLXContext glXGetCurrentContext(void);
00082 
00083 extern GLXDrawable glXGetCurrentDrawable(void);
00084 
00085 extern Bool glXIsDirect(Display *dpy, GLXContext ctx);
00086 
00087 extern Bool glXMakeCurrent(Display *dpy, GLXDrawable drawable,
00088                            GLXContext ctx);
00089 
00090 extern Bool glXQueryExtension(Display *dpy, int *error_base, int *event_base);
00091 
00092 extern Bool glXQueryVersion(Display *dpy, int *major, int *minor);
00093 
00094 extern void glXSwapBuffers(Display *dpy, GLXDrawable drawable);
00095 
00096 extern void glXUseXFont(Font font, int first, int count, int list_base);
00097 
00098 extern void glXWaitGL(void);
00099 
00100 extern void glXWaitX(void);
00101 
00102 
00103 /*
00104  * GLX 1.1 functions.
00105  */
00106 extern const char *glXGetClientString(Display *dpy, int name);
00107 
00108 extern const char *glXQueryServerString(Display *dpy, int screen, int name);
00109 
00110 extern const char *glXQueryExtensionsString(Display *dpy, int screen);
00111 
00112 
00113 /*
00114  * GLX 1.2 functions.
00115  */
00116 extern Display *glXGetCurrentDisplay(void);
00117 
00118 
00119 /*
00120  * GLX 1.3 functions.
00121  */
00122 extern GLXFBConfig *glXChooseFBConfig(Display *dpy, int screen,
00123                                       const int *attrib_list, int *nelements);
00124 
00125 extern GLXContext glXCreateNewContext(Display *dpy, GLXFBConfig config,
00126                                       int render_type, GLXContext share_list,
00127                                       Bool direct);
00128 
00129 extern GLXPbuffer glXCreatePbuffer(Display *dpy, GLXFBConfig config,
00130                                    const int *attrib_list);
00131 
00132 extern GLXPixmap glXCreatePixmap(Display *dpy, GLXFBConfig config,
00133                                  Pixmap pixmap, const int *attrib_list);
00134 
00135 extern GLXWindow glXCreateWindow(Display *dpy, GLXFBConfig config,
00136                                  Window win, const int *attrib_list);
00137 
00138 extern void glXDestroyPbuffer(Display *dpy, GLXPbuffer pbuf);
00139 
00140 extern void glXDestroyPixmap(Display *dpy, GLXPixmap pixmap);
00141 
00142 extern void glXDestroyWindow(Display *dpy, GLXWindow win);
00143 
00144 extern GLXDrawable glXGetCurrentReadDrawable(void);
00145 
00146 extern int glXGetFBConfigAttrib(Display *dpy, GLXFBConfig config,
00147                                 int attribute, int *value);
00148 
00149 extern GLXFBConfig *glXGetFBConfigs(Display *dpy, int screen, int *nelements);
00150 
00151 extern void glXGetSelectedEvent(Display *dpy, GLXDrawable draw,
00152                                 unsigned long *event_mask);
00153 
00154 extern XVisualInfo *glXGetVisualFromFBConfig(Display *dpy, GLXFBConfig config);
00155 
00156 extern Bool glXMakeContextCurrent(Display *display, GLXDrawable draw,
00157                                   GLXDrawable read, GLXContext ctx);
00158 
00159 extern int glXQueryContext(Display *dpy, GLXContext ctx,
00160                            int attribute, int *value);
00161 
00162 extern void glXQueryDrawable(Display *dpy, GLXDrawable draw,
00163                              int attribute, unsigned int *value);
00164 
00165 extern void glXSelectEvent(Display *dpy, GLXDrawable draw,
00166                            unsigned long event_mask);
00167 
00168 
00169 /**********************************************************************/
00170 
00171 /*
00172  * ARB_get_proc_address
00173  */
00174 extern void (*glXGetProcAddressARB(const GLubyte *procName))(void);
00175 
00176 /*
00177  * EXT_import_context
00178  */
00179 extern void glXFreeContextEXT(Display *dpy, GLXContext ctx);
00180 
00181 extern GLXContextID glXGetContextIDEXT(const GLXContext ctx);
00182 
00183 extern GLXDrawable glXGetCurrentDrawableEXT(void);
00184 
00185 extern GLXContext glXImportContextEXT(Display *dpy, GLXContextID contextID);
00186 
00187 extern int glXQueryContextInfoEXT(Display *dpy, GLXContext ctx,
00188                                   int attribute, int *value);
00189 
00190 /*
00191  * NV_vertex_array_range
00192  */
00193 extern void *glXAllocateMemoryNV(GLsizei size, GLfloat readfreq,
00194          GLfloat writefreq, GLfloat priority);
00195 
00196 extern void glXFreeMemoryNV(GLvoid *pointer);
00197 
00198 /*
00199  * SGI_video_sync
00200  */
00201 extern int glXGetVideoSyncSGI(unsigned int *count);
00202 
00203 extern int glXWaitVideoSyncSGI(int divisor, int remainder,
00204                                unsigned int *count);
00205 
00206 extern int glXGetRefreshRateSGI(unsigned int *rate);
00207 
00208 /*
00209  * SGI_swap_control
00210  */
00211 
00212 extern int glXSwapIntervalSGI(int interval);
00213 
00214 /*
00215  * NV_swap_group
00216  */
00217 
00218 extern Bool glXJoinSwapGroupNV(Display *dpy, GLXDrawable drawable,
00219                                GLuint group);
00220 
00221 extern Bool glXBindSwapBarrierNV(Display *dpy, GLuint group, GLuint barrier);
00222 
00223 extern Bool glXQuerySwapGroupNV(Display *dpy, GLXDrawable drawable,
00224                                 GLuint *group, GLuint *barrier);
00225 
00226 extern Bool glXQueryMaxSwapGroupsNV(Display *dpy, int screen,
00227                                     GLuint *maxGroups, GLuint *maxBarriers);
00228 
00229 extern Bool glXQueryFrameCountNV(Display *dpy, int screen, GLuint *count);
00230  
00231 extern Bool glXResetFrameCountNV(Display *dpy, int screen);
00232 
00233 
00234 /*
00235  * SGIX_fbconfig
00236  */
00237 
00238 extern int glXGetFBConfigAttribSGIX(Display *dpy, GLXFBConfigSGIX config,
00239                                     int attribute, int *value_return);
00240 
00241 extern GLXFBConfigSGIX *glXChooseFBConfigSGIX(Display *dpy, int screen,
00242                                               const int *attrib_list,
00243                                               int *nelements);
00244 
00245 extern GLXPixmap glXCreateGLXPixmapWithConfigSGIX(Display *dpy,
00246                                                   GLXFBConfigSGIX config,
00247                                                   Pixmap pixmap);
00248 
00249 extern GLXContext glXCreateContextWithConfigSGIX(Display *dpy,
00250                                                  GLXFBConfigSGIX config,
00251                                                  int render_type,
00252                                                  GLXContext share_list,
00253                                                  Bool direct);
00254 
00255 extern XVisualInfo *glXGetVisualFromFBConfigSGIX(Display *dpy,
00256                                                  GLXFBConfigSGIX config);
00257 
00258 extern GLXFBConfigSGIX glXGetFBConfigFromVisualSGIX(Display *dpy,
00259                                                     XVisualInfo *vis);
00260 
00261 /*
00262  * SGIX_pbuffer
00263  */
00264 extern GLXPbuffer glXCreateGLXPbufferSGIX(Display *dpy, GLXFBConfig config,
00265                                           unsigned int width,
00266                                           unsigned int height,
00267                                           const int *attrib_list);
00268 
00269 extern void glXDestroyGLXPbufferSGIX(Display *dpy, GLXPbuffer pbuf);
00270 
00271 extern void glXQueryGLXPbufferSGIX(Display *dpy, GLXPbuffer pbuf,
00272                                    int attribute, unsigned int *value);
00273 
00274 extern void glXSelectEventSGIX(Display *dpy, GLXDrawable drawable,
00275                                unsigned long mask);
00276 
00277 extern void glXGetSelectedEventSGIX(Display *dpy, GLXDrawable drawable,
00278                                     unsigned long *mask);
00279 
00280 
00281 /**********************************************************************/
00282 
00283 /*** Should these go here, or in another header? */
00284 /*
00285  * GLX Events
00286  */
00287 typedef struct {
00288     int event_type;             /* GLX_DAMAGED or GLX_SAVED */
00289     int draw_type;              /* GLX_WINDOW or GLX_PBUFFER */
00290     unsigned long serial;       /* # of last request processed by server */
00291     Bool send_event;            /* true if this came for SendEvent request */
00292     Display *display;           /* display the event was read from */
00293     GLXDrawable drawable;       /* XID of Drawable */
00294     unsigned int buffer_mask;   /* mask indicating which buffers are affected */
00295     unsigned int aux_buffer;    /* which aux buffer was affected */
00296     int x, y;
00297     int width, height;
00298     int count;                  /* if nonzero, at least this many more */
00299 } GLXPbufferClobberEvent;
00300 
00301 typedef union __GLXEvent {
00302     GLXPbufferClobberEvent glxpbufferclobber;
00303     long pad[24];
00304 } GLXEvent;
00305 
00306 #ifdef __cplusplus
00307 }
00308 #endif
00309 
00310 #endif /* !__glx_h__ */

Generated on Tue Mar 1 13:19:20 2005 for NVSGSDK by NVIDIA