#include <stdio.h>
#include <string.h>
#include "main/glheader.h"
-#include "main/compiler.h"
#include "glapi/glapi.h"
#include "glxapi.h"
/*** GLX_VERSION_1_2 ***/
+/* declare here to avoid including xmesa.h */
+extern Display *XMesaGetCurrentDisplay(void);
+
Display PUBLIC *
glXGetCurrentDisplay(void)
{
- /* Same code as in libGL's glxext.c */
- __GLXcontext *gc = (__GLXcontext *) glXGetCurrentContext();
- if (NULL == gc) return NULL;
- return gc->currentDpy;
+ return XMesaGetCurrentDisplay();
}
t->DestroyGLXPbufferSGIX(dpy, pbuf);
}
-int PUBLIC
+void PUBLIC
glXQueryGLXPbufferSGIX(Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value)
{
struct _glxapi_table *t;
GET_DISPATCH(dpy, t);
if (!t)
- return 0;
- return t->QueryGLXPbufferSGIX(dpy, pbuf, attribute, value);
+ return;
+ t->QueryGLXPbufferSGIX(dpy, pbuf, attribute, value);
}
void PUBLIC
#endif
-/*** GLX_SGIX_swap_group ***/
-
-void PUBLIC
-glXJoinSwapGroupSGIX(Display *dpy, GLXDrawable drawable, GLXDrawable member)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return;
- t->JoinSwapGroupSGIX(dpy, drawable, member);
-}
-
-
-/*** GLX_SGIX_swap_barrier ***/
-
-void PUBLIC
-glXBindSwapBarrierSGIX(Display *dpy, GLXDrawable drawable, int barrier)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return;
- t->BindSwapBarrierSGIX(dpy, drawable, barrier);
-}
-
-Bool PUBLIC
-glXQueryMaxSwapBarriersSGIX(Display *dpy, int screen, int *max)
-{
- struct _glxapi_table *t;
- GET_DISPATCH(dpy, t);
- if (!t)
- return False;
- return t->QueryMaxSwapBarriersSGIX(dpy, screen, max);
-}
-
-
-
/*** GLX_SUN_get_transparent_index ***/
Status PUBLIC
-glXGetTransparentIndexSUN(Display *dpy, Window overlay, Window underlay, long *pTransparent)
+glXGetTransparentIndexSUN(Display *dpy, Window overlay, Window underlay, unsigned long *pTransparent)
{
struct _glxapi_table *t;
GET_DISPATCH(dpy, t);
-/*** GLX_MESA_set_3dfx_mode ***/
-
-Bool PUBLIC
-glXSet3DfxModeMESA(int mode)
-{
- struct _glxapi_table *t;
- Display *dpy = glXGetCurrentDisplay();
- GET_DISPATCH(dpy, t);
- if (!t)
- return False;
- return t->Set3DfxModeMESA(mode);
-}
-
-
-
-/*** GLX_NV_vertex_array_range ***/
-
-void PUBLIC *
-glXAllocateMemoryNV( GLsizei size,
- GLfloat readFrequency,
- GLfloat writeFrequency,
- GLfloat priority )
-{
- struct _glxapi_table *t;
- Display *dpy = glXGetCurrentDisplay();
- GET_DISPATCH(dpy, t);
- if (!t)
- return NULL;
- return t->AllocateMemoryNV(size, readFrequency, writeFrequency, priority);
-}
-
-
-void PUBLIC
-glXFreeMemoryNV( GLvoid *pointer )
-{
- struct _glxapi_table *t;
- Display *dpy = glXGetCurrentDisplay();
- GET_DISPATCH(dpy, t);
- if (!t)
- return;
- t->FreeMemoryNV(pointer);
-}
-
-
-
-
-/*** GLX_MESA_agp_offset */
-
-GLuint PUBLIC
-glXGetAGPOffsetMESA( const GLvoid *pointer )
-{
- struct _glxapi_table *t;
- Display *dpy = glXGetCurrentDisplay();
- GET_DISPATCH(dpy, t);
- if (!t)
- return ~0;
- return t->GetAGPOffsetMESA(pointer);
-}
-
-
/*** GLX_EXT_texture_from_pixmap */
void PUBLIC
_glxapi_get_extensions(void)
{
static const char *extensions[] = {
-#ifdef GLX_EXT_import_context
"GLX_EXT_import_context",
-#endif
-#ifdef GLX_SGI_video_sync
"GLX_SGI_video_sync",
-#endif
-#ifdef GLX_MESA_copy_sub_buffer
"GLX_MESA_copy_sub_buffer",
-#endif
-#ifdef GLX_MESA_release_buffers
"GLX_MESA_release_buffers",
-#endif
-#ifdef GLX_MESA_pixmap_colormap
"GLX_MESA_pixmap_colormap",
-#endif
-#ifdef GLX_MESA_set_3dfx_mode
- "GLX_MESA_set_3dfx_mode",
-#endif
-#ifdef GLX_SGIX_fbconfig
"GLX_SGIX_fbconfig",
-#endif
-#ifdef GLX_SGIX_pbuffer
"GLX_SGIX_pbuffer",
-#endif
-#ifdef GLX_EXT_texture_from_pixmap
"GLX_EXT_texture_from_pixmap",
-#endif
-#ifdef GLX_INTEL_swap_event
"GLX_INTEL_swap_event",
-#endif
NULL
};
return extensions;
{ "glXAssociateDMPbufferSGIX", (__GLXextFuncPtr) glXAssociateDMPbufferSGIX },
#endif
- /*** GLX_SGIX_swap_group ***/
- { "glXJoinSwapGroupSGIX", (__GLXextFuncPtr) glXJoinSwapGroupSGIX },
-
- /*** GLX_SGIX_swap_barrier ***/
- { "glXBindSwapBarrierSGIX", (__GLXextFuncPtr) glXBindSwapBarrierSGIX },
- { "glXQueryMaxSwapBarriersSGIX", (__GLXextFuncPtr) glXQueryMaxSwapBarriersSGIX },
-
/*** GLX_SUN_get_transparent_index ***/
{ "glXGetTransparentIndexSUN", (__GLXextFuncPtr) glXGetTransparentIndexSUN },
/*** GLX_MESA_release_buffers ***/
{ "glXReleaseBuffersMESA", (__GLXextFuncPtr) glXReleaseBuffersMESA },
- /*** GLX_MESA_set_3dfx_mode ***/
- { "glXSet3DfxModeMESA", (__GLXextFuncPtr) glXSet3DfxModeMESA },
-
/*** GLX_ARB_get_proc_address ***/
{ "glXGetProcAddressARB", (__GLXextFuncPtr) glXGetProcAddressARB },
- /*** GLX_NV_vertex_array_range ***/
- { "glXAllocateMemoryNV", (__GLXextFuncPtr) glXAllocateMemoryNV },
- { "glXFreeMemoryNV", (__GLXextFuncPtr) glXFreeMemoryNV },
-
- /*** GLX_MESA_agp_offset ***/
- { "glXGetAGPOffsetMESA", (__GLXextFuncPtr) glXGetAGPOffsetMESA },
-
/*** GLX_EXT_texture_from_pixmap ***/
{ "glXBindTexImageEXT", (__GLXextFuncPtr) glXBindTexImageEXT },
{ "glXReleaseTexImageEXT", (__GLXextFuncPtr) glXReleaseTexImageEXT },