2004-06-30 22:06:56 +02:00
|
|
|
#ifndef _GLX_server_h_
|
|
|
|
#define _GLX_server_h_
|
|
|
|
|
|
|
|
/*
|
Update to SGI FreeB 2.0.
Under the terms of version 1.1, "once Covered Code has been published
under a particular version of the License, Recipient may, for the
duration of the License, continue to use it under the terms of that
version, or choose to use such Covered Code under the terms of any
subsequent version published by SGI."
FreeB 2.0 license refers to "dates of first publication". They are here
taken to be 1991-2000, as noted in the original license text:
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
Official FreeB 2.0 text:
http://oss.sgi.com/projects/FreeB/SGIFreeSWLicB.2.0.pdf
As always, this code has not been tested for conformance with the OpenGL
specification. OpenGL conformance testing is available from
http://khronos.org/ and is required for use of the OpenGL logo in
product advertising and promotion.
2008-09-19 18:02:28 +02:00
|
|
|
* SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
|
|
|
|
* Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
|
|
* to deal in the Software without restriction, including without limitation
|
|
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
* Software is furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice including the dates of first publication and
|
|
|
|
* either this permission notice or a reference to
|
|
|
|
* http://oss.sgi.com/projects/FreeB/
|
|
|
|
* shall be included in all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
|
|
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
* SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
|
|
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
|
|
|
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
* SOFTWARE.
|
|
|
|
*
|
|
|
|
* Except as contained in this notice, the name of Silicon Graphics, Inc.
|
|
|
|
* shall not be used in advertising or otherwise to promote the sale, use or
|
|
|
|
* other dealings in this Software without prior written authorization from
|
|
|
|
* Silicon Graphics, Inc.
|
|
|
|
*/
|
2004-06-30 22:06:56 +02:00
|
|
|
|
|
|
|
#include "dmx.h"
|
|
|
|
|
|
|
|
#include <misc.h>
|
|
|
|
#include <dixstruct.h>
|
|
|
|
#include <pixmapstr.h>
|
|
|
|
#include <gcstruct.h>
|
|
|
|
#include <extnsionst.h>
|
|
|
|
#include <resource.h>
|
|
|
|
#include <scrnintstr.h>
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
#define GL_GLEXT_PROTOTYPES /* we want prototypes */
|
2004-06-30 22:06:56 +02:00
|
|
|
#include <GL/gl.h>
|
|
|
|
#include <GL/glxproto.h>
|
|
|
|
#include <GL/glxint.h>
|
|
|
|
|
|
|
|
#include "glxscreens.h"
|
|
|
|
#include "glxdrawable.h"
|
|
|
|
#include "glxcontext.h"
|
|
|
|
#include "glxerror.h"
|
|
|
|
|
|
|
|
#define GLX_SERVER_MAJOR_VERSION 1
|
|
|
|
#define GLX_SERVER_MINOR_VERSION 3
|
|
|
|
|
|
|
|
#ifndef True
|
|
|
|
#define True 1
|
|
|
|
#endif
|
|
|
|
#ifndef False
|
|
|
|
#define False 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
|
|
** GLX resources.
|
|
|
|
typedef XID GLXContextID;
|
|
|
|
typedef XID GLXPixmap;
|
|
|
|
typedef XID GLXDrawable;
|
|
|
|
typedef XID GLXWindow;
|
|
|
|
typedef XID GLXPbuffer;
|
|
|
|
|
|
|
|
typedef struct __GLXcontextRec *GLXContext;
|
|
|
|
*/
|
|
|
|
typedef struct __GLXclientStateRec __GLXclientState;
|
|
|
|
|
|
|
|
extern __GLXscreenInfo *__glXActiveScreens;
|
|
|
|
extern GLint __glXNumActiveScreens;
|
|
|
|
|
|
|
|
/************************************************************************/
|
|
|
|
|
|
|
|
/*
|
|
|
|
** The last context used (from the server's persective) is cached.
|
|
|
|
*/
|
|
|
|
extern __GLXcontext *__glXLastContext;
|
2012-03-21 20:55:09 +01:00
|
|
|
extern __GLXcontext *__glXForceCurrent(__GLXclientState *, GLXContextTag,
|
|
|
|
int *);
|
2004-06-30 22:06:56 +02:00
|
|
|
|
|
|
|
/************************************************************************/
|
|
|
|
|
|
|
|
typedef struct {
|
2012-03-21 20:55:09 +01:00
|
|
|
int elem_size; /* element size in bytes */
|
|
|
|
int nelems; /* number of elements to swap */
|
|
|
|
void (*swapfunc) (GLbyte * pc);
|
2004-06-30 22:06:56 +02:00
|
|
|
} __GLXRenderSwapInfo;
|
|
|
|
|
|
|
|
/*
|
|
|
|
** State kept per client.
|
|
|
|
*/
|
|
|
|
struct __GLXclientStateRec {
|
|
|
|
/*
|
2012-03-21 20:55:09 +01:00
|
|
|
** Whether this structure is currently being used to support a client.
|
|
|
|
*/
|
2004-06-30 22:06:56 +02:00
|
|
|
Bool inUse;
|
|
|
|
|
|
|
|
/*
|
2012-03-21 20:55:09 +01:00
|
|
|
** Buffer for returned data.
|
|
|
|
*/
|
2004-06-30 22:06:56 +02:00
|
|
|
GLbyte *returnBuf;
|
|
|
|
GLint returnBufSize;
|
|
|
|
|
|
|
|
/*
|
2012-03-21 20:55:09 +01:00
|
|
|
** Keep a list of all the contexts that are current for this client's
|
|
|
|
** threads.
|
|
|
|
*/
|
2004-06-30 22:06:56 +02:00
|
|
|
__GLXcontext **currentContexts;
|
|
|
|
DrawablePtr *currentDrawables;
|
|
|
|
GLint numCurrentContexts;
|
|
|
|
|
|
|
|
/* Back pointer to X client record */
|
|
|
|
ClientPtr client;
|
|
|
|
|
|
|
|
int GLClientmajorVersion;
|
|
|
|
int GLClientminorVersion;
|
|
|
|
char *GLClientextensions;
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
GLXContextTag *be_currentCTag;
|
2004-06-30 22:06:56 +02:00
|
|
|
Display **be_displays;
|
|
|
|
|
|
|
|
/*
|
2012-03-21 20:55:09 +01:00
|
|
|
** Keep track of large rendering commands, which span multiple requests.
|
|
|
|
*/
|
|
|
|
GLint largeCmdBytesSoFar; /* bytes received so far */
|
|
|
|
GLint largeCmdBytesTotal; /* total bytes expected */
|
|
|
|
GLint largeCmdRequestsSoFar; /* requests received so far */
|
|
|
|
GLint largeCmdRequestsTotal; /* total requests expected */
|
|
|
|
void (*largeCmdRequestsSwapProc) (GLbyte *);
|
|
|
|
__GLXRenderSwapInfo *largeCmdRequestsSwap_info;
|
2004-06-30 22:06:56 +02:00
|
|
|
GLbyte *largeCmdBuf;
|
|
|
|
GLint largeCmdBufSize;
|
|
|
|
GLint largeCmdMaxReqDataSize;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
extern __GLXclientState *__glXClients[];
|
|
|
|
|
|
|
|
/************************************************************************/
|
|
|
|
|
|
|
|
/*
|
|
|
|
** Dispatch tables.
|
|
|
|
*/
|
2012-03-21 20:55:09 +01:00
|
|
|
typedef void (*__GLXdispatchRenderProcPtr) (GLbyte *);
|
|
|
|
typedef int (*__GLXdispatchSingleProcPtr) (__GLXclientState *, GLbyte *);
|
|
|
|
typedef int (*__GLXdispatchVendorPrivProcPtr) (__GLXclientState *, GLbyte *);
|
2004-06-30 22:06:56 +02:00
|
|
|
extern __GLXdispatchSingleProcPtr __glXSingleTable[];
|
|
|
|
extern __GLXdispatchVendorPrivProcPtr __glXVendorPrivTable_EXT[];
|
|
|
|
extern __GLXdispatchSingleProcPtr __glXSwapSingleTable[];
|
|
|
|
extern __GLXdispatchVendorPrivProcPtr __glXSwapVendorPrivTable_EXT[];
|
|
|
|
extern __GLXdispatchRenderProcPtr __glXSwapRenderTable[];
|
|
|
|
|
|
|
|
extern __GLXRenderSwapInfo __glXSwapRenderTable_EXT[];
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Dispatch for GLX commands.
|
|
|
|
*/
|
2012-03-21 20:55:09 +01:00
|
|
|
typedef int (*__GLXprocPtr) (__GLXclientState *, char *pc);
|
2004-06-30 22:06:56 +02:00
|
|
|
extern __GLXprocPtr __glXProcTable[];
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Tables for computing the size of each rendering command.
|
|
|
|
*/
|
|
|
|
typedef struct {
|
|
|
|
int bytes;
|
2012-03-21 20:55:09 +01:00
|
|
|
int (*varsize) (GLbyte * pc, Bool swap);
|
2004-06-30 22:06:56 +02:00
|
|
|
} __GLXrenderSizeData;
|
|
|
|
extern __GLXrenderSizeData __glXRenderSizeTable[];
|
|
|
|
extern __GLXrenderSizeData __glXRenderSizeTable_EXT[];
|
|
|
|
|
|
|
|
/************************************************************************/
|
|
|
|
|
|
|
|
/*
|
|
|
|
** X resources.
|
|
|
|
*/
|
|
|
|
extern RESTYPE __glXContextRes;
|
|
|
|
extern RESTYPE __glXClientRes;
|
|
|
|
extern RESTYPE __glXPixmapRes;
|
|
|
|
extern RESTYPE __glXDrawableRes;
|
|
|
|
extern RESTYPE __glXWindowRes;
|
|
|
|
extern RESTYPE __glXPbufferRes;
|
|
|
|
|
|
|
|
/************************************************************************/
|
|
|
|
|
|
|
|
/*
|
|
|
|
** Prototypes.
|
|
|
|
*/
|
|
|
|
|
|
|
|
extern char *__glXcombine_strings(const char *, const char *);
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
extern void __glXDisp_DrawArrays(GLbyte *);
|
|
|
|
extern void __glXDispSwap_DrawArrays(GLbyte *);
|
2004-06-30 22:06:56 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
** Routines for sending swapped replies.
|
|
|
|
*/
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
extern void __glXSwapMakeCurrentReply(ClientPtr client,
|
|
|
|
xGLXMakeCurrentReadSGIReply * reply);
|
2004-06-30 22:06:56 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
extern void __glXSwapIsDirectReply(ClientPtr client, xGLXIsDirectReply * reply);
|
2004-06-30 22:06:56 +02:00
|
|
|
extern void __glXSwapQueryVersionReply(ClientPtr client,
|
2012-03-21 20:55:09 +01:00
|
|
|
xGLXQueryVersionReply * reply);
|
2004-06-30 22:06:56 +02:00
|
|
|
extern void __glXSwapQueryContextInfoEXTReply(ClientPtr client,
|
2012-03-21 20:55:09 +01:00
|
|
|
xGLXQueryContextInfoEXTReply *
|
|
|
|
reply, int *buf);
|
2004-06-30 22:06:56 +02:00
|
|
|
extern void glxSwapQueryExtensionsStringReply(ClientPtr client,
|
2012-03-21 20:55:09 +01:00
|
|
|
xGLXQueryExtensionsStringReply *
|
|
|
|
reply, char *buf);
|
2004-06-30 22:06:56 +02:00
|
|
|
extern void glxSwapQueryServerStringReply(ClientPtr client,
|
2012-03-21 20:55:09 +01:00
|
|
|
xGLXQueryServerStringReply * reply,
|
|
|
|
char *buf);
|
2004-06-30 22:06:56 +02:00
|
|
|
extern void __glXSwapQueryContextReply(ClientPtr client,
|
2012-03-21 20:55:09 +01:00
|
|
|
xGLXQueryContextReply * reply, int *buf);
|
2004-06-30 22:06:56 +02:00
|
|
|
extern void __glXSwapGetDrawableAttributesReply(ClientPtr client,
|
2012-03-21 20:55:09 +01:00
|
|
|
xGLXGetDrawableAttributesReply *
|
|
|
|
reply, int *buf);
|
2004-06-30 22:06:56 +02:00
|
|
|
extern void __glXSwapQueryMaxSwapBarriersSGIXReply(ClientPtr client,
|
2012-03-21 20:55:09 +01:00
|
|
|
xGLXQueryMaxSwapBarriersSGIXReply
|
|
|
|
* reply);
|
2004-06-30 22:06:56 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Routines for computing the size of variably-sized rendering commands.
|
|
|
|
*/
|
|
|
|
|
|
|
|
extern int __glXTypeSize(GLenum enm);
|
|
|
|
extern int __glXImageSize(GLenum format, GLenum type, GLsizei w, GLsizei h,
|
2012-03-21 20:55:09 +01:00
|
|
|
GLint rowLength, GLint skipRows, GLint alignment);
|
2004-06-30 22:06:56 +02:00
|
|
|
extern int __glXImage3DSize(GLenum format, GLenum type,
|
2012-03-21 20:55:09 +01:00
|
|
|
GLsizei w, GLsizei h, GLsizei d,
|
|
|
|
GLint imageHeight, GLint rowLength,
|
|
|
|
GLint skipImages, GLint skipRows, GLint alignment);
|
|
|
|
|
|
|
|
extern int __glXCallListsReqSize(GLbyte * pc, Bool swap);
|
|
|
|
extern int __glXBitmapReqSize(GLbyte * pc, Bool swap);
|
|
|
|
extern int __glXFogfvReqSize(GLbyte * pc, Bool swap);
|
|
|
|
extern int __glXFogivReqSize(GLbyte * pc, Bool swap);
|
|
|
|
extern int __glXLightfvReqSize(GLbyte * pc, Bool swap);
|
|
|
|
extern int __glXLightivReqSize(GLbyte * pc, Bool swap);
|
|
|
|
extern int __glXLightModelfvReqSize(GLbyte * pc, Bool swap);
|
|
|
|
extern int __glXLightModelivReqSize(GLbyte * pc, Bool swap);
|
|
|
|
extern int __glXMaterialfvReqSize(GLbyte * pc, Bool swap);
|
|
|
|
extern int __glXMaterialivReqSize(GLbyte * pc, Bool swap);
|
|
|
|
extern int __glXTexParameterfvReqSize(GLbyte * pc, Bool swap);
|
|
|
|
extern int __glXTexParameterivReqSize(GLbyte * pc, Bool swap);
|
|
|
|
extern int __glXTexImage1DReqSize(GLbyte * pc, Bool swap);
|
|
|
|
extern int __glXTexImage2DReqSize(GLbyte * pc, Bool swap);
|
|
|
|
extern int __glXTexEnvfvReqSize(GLbyte * pc, Bool swap);
|
|
|
|
extern int __glXTexEnvivReqSize(GLbyte * pc, Bool swap);
|
|
|
|
extern int __glXTexGendvReqSize(GLbyte * pc, Bool swap);
|
|
|
|
extern int __glXTexGenfvReqSize(GLbyte * pc, Bool swap);
|
|
|
|
extern int __glXTexGenivReqSize(GLbyte * pc, Bool swap);
|
|
|
|
extern int __glXMap1dReqSize(GLbyte * pc, Bool swap);
|
|
|
|
extern int __glXMap1fReqSize(GLbyte * pc, Bool swap);
|
|
|
|
extern int __glXMap2dReqSize(GLbyte * pc, Bool swap);
|
|
|
|
extern int __glXMap2fReqSize(GLbyte * pc, Bool swap);
|
|
|
|
extern int __glXPixelMapfvReqSize(GLbyte * pc, Bool swap);
|
|
|
|
extern int __glXPixelMapuivReqSize(GLbyte * pc, Bool swap);
|
|
|
|
extern int __glXPixelMapusvReqSize(GLbyte * pc, Bool swap);
|
|
|
|
extern int __glXDrawPixelsReqSize(GLbyte * pc, Bool swap);
|
|
|
|
extern int __glXDrawArraysSize(GLbyte * pc, Bool swap);
|
|
|
|
extern int __glXPrioritizeTexturesReqSize(GLbyte * pc, Bool swap);
|
|
|
|
extern int __glXTexSubImage1DReqSize(GLbyte * pc, Bool swap);
|
|
|
|
extern int __glXTexSubImage2DReqSize(GLbyte * pc, Bool swap);
|
|
|
|
extern int __glXTexImage3DReqSize(GLbyte * pc, Bool swap);
|
|
|
|
extern int __glXTexSubImage3DReqSize(GLbyte * pc, Bool swap);
|
|
|
|
extern int __glXConvolutionFilter1DReqSize(GLbyte * pc, Bool swap);
|
|
|
|
extern int __glXConvolutionFilter2DReqSize(GLbyte * pc, Bool swap);
|
|
|
|
extern int __glXConvolutionParameterivReqSize(GLbyte * pc, Bool swap);
|
|
|
|
extern int __glXConvolutionParameterfvReqSize(GLbyte * pc, Bool swap);
|
|
|
|
extern int __glXSeparableFilter2DReqSize(GLbyte * pc, Bool swap);
|
|
|
|
extern int __glXColorTableReqSize(GLbyte * pc, Bool swap);
|
|
|
|
extern int __glXColorSubTableReqSize(GLbyte * pc, Bool swap);
|
|
|
|
extern int __glXColorTableParameterfvReqSize(GLbyte * pc, Bool swap);
|
|
|
|
extern int __glXColorTableParameterivReqSize(GLbyte * pc, Bool swap);
|
2004-06-30 22:06:56 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Routines for computing the size of returned data.
|
|
|
|
*/
|
|
|
|
extern int __glXConvolutionParameterivSize(GLenum pname);
|
|
|
|
extern int __glXConvolutionParameterfvSize(GLenum pname);
|
|
|
|
extern int __glXColorTableParameterfvSize(GLenum pname);
|
|
|
|
extern int __glXColorTableParameterivSize(GLenum pname);
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
extern void __glXFreeGLXWindow(__glXWindow * pGlxWindow);
|
|
|
|
extern void __glXFreeGLXPbuffer(__glXPbuffer * pGlxPbuffer);
|
2004-06-30 22:06:56 +02:00
|
|
|
|
|
|
|
extern int __glXVersionMajor;
|
|
|
|
extern int __glXVersionMinor;
|
|
|
|
|
|
|
|
#define __GLX_IS_VERSION_SUPPORTED(major,minor) \
|
|
|
|
( (__glXVersionMajor > (major)) || \
|
|
|
|
((__glXVersionMajor == (major)) && (__glXVersionMinor >= (minor))) )
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
#endif /* !__GLX_server_h__ */
|