New upstream version 3.5.99.27
This commit is contained in:
178
nx-X11/programs/Xserver/GL/glx/Imakefile
Normal file
178
nx-X11/programs/Xserver/GL/glx/Imakefile
Normal file
@@ -0,0 +1,178 @@
|
||||
NULL =
|
||||
|
||||
|
||||
/* Large PIC tables needed for SPARC builds */
|
||||
#if defined(sparc) || defined(SparcArchitecture)
|
||||
# define LargePICTable YES
|
||||
PICFLAGS = LargePositionIndependentCFlags
|
||||
#endif
|
||||
|
||||
#include <Server.tmpl>
|
||||
|
||||
LinkSourceFile(glcontextmodes.c, $(MESASRCDIR)/src/mesa/drivers/dri/common)
|
||||
LinkSourceFile(glcontextmodes.h, $(MESASRCDIR)/src/mesa/drivers/dri/common)
|
||||
LinkSourceFile(indirect_size.c, $(MESASRCDIR)/src/glx/x11)
|
||||
LinkSourceFile(indirect_size.h, $(MESASRCDIR)/src/glx/x11)
|
||||
|
||||
#if (!(defined(NXAgentServer) && NXAgentServer))
|
||||
NXAGENT_SKIP_SRCS = \
|
||||
glxext.c \
|
||||
$(NULL)
|
||||
NXAGENT_SKIP_OBJS = \
|
||||
glxext.o \
|
||||
$(NULL)
|
||||
#else
|
||||
NX_DEFINES = -DNXAGENT_SERVER
|
||||
#endif
|
||||
|
||||
SRCS = global.c \
|
||||
glxbuf.c \
|
||||
glxcmds.c \
|
||||
glxcmdsswap.c \
|
||||
glxfb.c \
|
||||
glximports.c \
|
||||
glxmem.c \
|
||||
glxpix.c \
|
||||
glxscreens.c \
|
||||
glxutil.c \
|
||||
render2.c \
|
||||
render2swap.c \
|
||||
renderpix.c \
|
||||
renderpixswap.c \
|
||||
rensize.c \
|
||||
rensizetab.c \
|
||||
single2.c \
|
||||
single2swap.c \
|
||||
singlepix.c \
|
||||
singlepixswap.c \
|
||||
singlesize.c \
|
||||
xfont.c \
|
||||
g_disptab.c \
|
||||
g_disptab_EXT.c \
|
||||
g_render.c \
|
||||
g_renderswap.c \
|
||||
g_single.c \
|
||||
g_singleswap.c \
|
||||
glcontextmodes.c \
|
||||
indirect_size.c \
|
||||
$(MSRCS) \
|
||||
$(NXAGENT_SKIP_SRCS) \
|
||||
$(NULL)
|
||||
|
||||
OBJS = global.o \
|
||||
glxbuf.o \
|
||||
glxcmds.o \
|
||||
glxcmdsswap.o \
|
||||
glxfb.o \
|
||||
glximports.o \
|
||||
glxmem.o \
|
||||
glxpix.o \
|
||||
glxscreens.o \
|
||||
glxutil.o \
|
||||
render2.o \
|
||||
render2swap.o \
|
||||
renderpix.o \
|
||||
renderpixswap.o \
|
||||
rensize.o \
|
||||
rensizetab.o \
|
||||
single2.o \
|
||||
single2swap.o \
|
||||
singlepix.o \
|
||||
singlepixswap.o \
|
||||
singlesize.o \
|
||||
xfont.o \
|
||||
g_disptab.o \
|
||||
g_disptab_EXT.o \
|
||||
g_render.o \
|
||||
g_renderswap.o \
|
||||
g_single.o \
|
||||
g_singleswap.o \
|
||||
glcontextmodes.o \
|
||||
indirect_size.o \
|
||||
$(MOBJS) \
|
||||
$(NXAGENT_SKIP_OBJS) \
|
||||
$(NULL)
|
||||
|
||||
INCLUDES = -I$(SERVERSRC)/GL/glx \
|
||||
-I$(SERVERSRC)/GL/include \
|
||||
-I$(SERVERSRC)/include \
|
||||
-I$(INCLUDESRC) \
|
||||
-I$(MESASRCDIR)/include \
|
||||
-I$(XINCLUDESRC) \
|
||||
-I$(SERVERSRC)/mi \
|
||||
-I$(EXTINCSRC) \
|
||||
-I$(LIBSRC)/GL/include \
|
||||
-I$(XF86SRC) \
|
||||
`pkg-config --cflags-only-I pixman-1` \
|
||||
$(NULL)
|
||||
|
||||
#if defined(DarwinArchitecture) && ((OSMajorVersion == 6 && OSMinorVersion < 3) || OSMajorVersion < 6)
|
||||
NO_EXT_DEFS = -DMISSING_GL_EXTS
|
||||
#endif
|
||||
#if defined(Win32Architecture)
|
||||
# undef __stdcall
|
||||
APIENTRY_DEFS = -DAPIENTRY=__stdcall
|
||||
#endif
|
||||
|
||||
XCOMM If you add "-DDEBUG" in DEFINES, then make sure you also
|
||||
XCOMM add DEBUG to the define in ../mesa/src/X/xf86glx.c
|
||||
DEFINES = \
|
||||
$(GLX_DEFINES) \
|
||||
$(NO_EXT_DEFS) \
|
||||
$(APIENTRY_DEFS) \
|
||||
$(NX_DEFINES) \
|
||||
$(NULL)
|
||||
|
||||
NormalLibraryObjectRule()
|
||||
NormalLibraryTarget(glx,$(OBJS))
|
||||
#if defined(GlxUseWindows) && GlxUseWindows
|
||||
clean::
|
||||
RemoveFiles($(foreach obj,$(OBJS), stdcall/$(obj)))
|
||||
includes::
|
||||
MakeDir(stdcall)
|
||||
SpecialObjectRule(stdcall/%.o,%.c,-DUSE_OPENGL32 -o $@)
|
||||
NormalLibraryTarget(glx_stdcall,$(foreach obj,$(OBJS), stdcall/$(obj)))
|
||||
#endif
|
||||
SubdirLibraryRule($(OBJS))
|
||||
|
||||
LintLibraryTarget(glx,$(SRCS))
|
||||
NormalLintTarget($(SRCS))
|
||||
|
||||
DependTarget()
|
||||
|
||||
#ifdef IHaveSubdirs
|
||||
MakeSubdirs($(SUBDIRS))
|
||||
DependSubdirs($(SUBDIRS))
|
||||
#endif
|
||||
|
||||
#ifdef LinkDirectory
|
||||
LinkSourceFile(global.c,LinkDirectory)
|
||||
LinkSourceFile(glxbuf.c,LinkDirectory)
|
||||
LinkSourceFile(glxcmds.c,LinkDirectory)
|
||||
LinkSourceFile(glxcmdsswap.c,LinkDirectory)
|
||||
LinkSourceFile(glxext.c,LinkDirectory)
|
||||
LinkSourceFile(glxfb.c,LinkDirectory)
|
||||
LinkSourceFile(glximports.c,LinkDirectory)
|
||||
LinkSourceFile(glxmem.c,LinkDirectory)
|
||||
LinkSourceFile(glxpix.c,LinkDirectory)
|
||||
LinkSourceFile(glxscreens.c,LinkDirectory)
|
||||
LinkSourceFile(glxutil.c,LinkDirectory)
|
||||
LinkSourceFile(render2.c,LinkDirectory)
|
||||
LinkSourceFile(render2swap.c,LinkDirectory)
|
||||
LinkSourceFile(renderpix.c,LinkDirectory)
|
||||
LinkSourceFile(renderpixswap.c,LinkDirectory)
|
||||
LinkSourceFile(rensize.c,LinkDirectory)
|
||||
LinkSourceFile(rensizetab.c,LinkDirectory)
|
||||
LinkSourceFile(single2.c,LinkDirectory)
|
||||
LinkSourceFile(single2swap.c,LinkDirectory)
|
||||
LinkSourceFile(singlepix.c,LinkDirectory)
|
||||
LinkSourceFile(singlepixswap.c,LinkDirectory)
|
||||
LinkSourceFile(singlesize.c,LinkDirectory)
|
||||
LinkSourceFile(xfont.c,LinkDirectory)
|
||||
LinkSourceFile(g_disptab.c,LinkDirectory)
|
||||
LinkSourceFile(g_disptab_EXT.c,LinkDirectory)
|
||||
LinkSourceFile(g_render.c,LinkDirectory)
|
||||
LinkSourceFile(g_renderswap.c,LinkDirectory)
|
||||
LinkSourceFile(g_single.c,LinkDirectory)
|
||||
LinkSourceFile(g_singleswap.c,LinkDirectory)
|
||||
#endif
|
||||
838
nx-X11/programs/Xserver/GL/glx/g_disptab.c
Normal file
838
nx-X11/programs/Xserver/GL/glx/g_disptab.c
Normal file
@@ -0,0 +1,838 @@
|
||||
/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED */
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
** Additional Notice Provisions: This software was created using the
|
||||
** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
|
||||
** not been independently verified as being compliant with the OpenGL(R)
|
||||
** version 1.2.1 Specification.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include "glxserver.h"
|
||||
#include "glxext.h"
|
||||
#include "g_disptab.h"
|
||||
__GLXdispatchSingleProcPtr __glXSingleTable[__GLX_SINGLE_TABLE_SIZE] = {
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXRender,
|
||||
__glXRenderLarge,
|
||||
__glXCreateContext,
|
||||
__glXDestroyContext,
|
||||
__glXMakeCurrent,
|
||||
__glXIsDirect,
|
||||
__glXQueryVersion,
|
||||
__glXWaitGL,
|
||||
__glXWaitX,
|
||||
__glXCopyContext,
|
||||
__glXSwapBuffers,
|
||||
__glXUseXFont,
|
||||
__glXCreateGLXPixmap,
|
||||
__glXGetVisualConfigs,
|
||||
__glXDestroyGLXPixmap,
|
||||
__glXVendorPrivate,
|
||||
__glXVendorPrivateWithReply,
|
||||
__glXQueryExtensionsString,
|
||||
__glXQueryServerString,
|
||||
__glXClientInfo,
|
||||
__glXGetFBConfigs,
|
||||
__glXCreatePixmap,
|
||||
__glXDestroyGLXPixmap, /* glXDestroyPixmap */
|
||||
__glXCreateNewContext,
|
||||
__glXNoSuchSingleOpcode, /* glXQueryContext */
|
||||
__glXMakeContextCurrent,
|
||||
__glXNoSuchSingleOpcode, /* glXCreatePbuffer */
|
||||
__glXNoSuchSingleOpcode, /* glXDestroyPbuffer */
|
||||
__glXNoSuchSingleOpcode, /* glXGetDrawableAttributes */
|
||||
__glXNoSuchSingleOpcode, /* glXChangeDrawableAttributes */
|
||||
__glXNoSuchSingleOpcode, /* glXCreateWindow */
|
||||
__glXNoSuchSingleOpcode, /* glXDestroyWindow */
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXDisp_NewList,
|
||||
__glXDisp_EndList,
|
||||
__glXDisp_DeleteLists,
|
||||
__glXDisp_GenLists,
|
||||
__glXDisp_FeedbackBuffer,
|
||||
__glXDisp_SelectBuffer,
|
||||
__glXDisp_RenderMode,
|
||||
__glXDisp_Finish,
|
||||
__glXDisp_PixelStoref,
|
||||
__glXDisp_PixelStorei,
|
||||
__glXDisp_ReadPixels,
|
||||
__glXDisp_GetBooleanv,
|
||||
__glXDisp_GetClipPlane,
|
||||
__glXDisp_GetDoublev,
|
||||
__glXDisp_GetError,
|
||||
__glXDisp_GetFloatv,
|
||||
__glXDisp_GetIntegerv,
|
||||
__glXDisp_GetLightfv,
|
||||
__glXDisp_GetLightiv,
|
||||
__glXDisp_GetMapdv,
|
||||
__glXDisp_GetMapfv,
|
||||
__glXDisp_GetMapiv,
|
||||
__glXDisp_GetMaterialfv,
|
||||
__glXDisp_GetMaterialiv,
|
||||
__glXDisp_GetPixelMapfv,
|
||||
__glXDisp_GetPixelMapuiv,
|
||||
__glXDisp_GetPixelMapusv,
|
||||
__glXDisp_GetPolygonStipple,
|
||||
__glXDisp_GetString,
|
||||
__glXDisp_GetTexEnvfv,
|
||||
__glXDisp_GetTexEnviv,
|
||||
__glXDisp_GetTexGendv,
|
||||
__glXDisp_GetTexGenfv,
|
||||
__glXDisp_GetTexGeniv,
|
||||
__glXDisp_GetTexImage,
|
||||
__glXDisp_GetTexParameterfv,
|
||||
__glXDisp_GetTexParameteriv,
|
||||
__glXDisp_GetTexLevelParameterfv,
|
||||
__glXDisp_GetTexLevelParameteriv,
|
||||
__glXDisp_IsEnabled,
|
||||
__glXDisp_IsList,
|
||||
__glXDisp_Flush,
|
||||
__glXDisp_AreTexturesResident,
|
||||
__glXDisp_DeleteTextures,
|
||||
__glXDisp_GenTextures,
|
||||
__glXDisp_IsTexture,
|
||||
__glXDisp_GetColorTable,
|
||||
__glXDisp_GetColorTableParameterfv,
|
||||
__glXDisp_GetColorTableParameteriv,
|
||||
__glXDisp_GetConvolutionFilter,
|
||||
__glXDisp_GetConvolutionParameterfv,
|
||||
__glXDisp_GetConvolutionParameteriv,
|
||||
__glXDisp_GetSeparableFilter,
|
||||
__glXDisp_GetHistogram,
|
||||
__glXDisp_GetHistogramParameterfv,
|
||||
__glXDisp_GetHistogramParameteriv,
|
||||
__glXDisp_GetMinmax,
|
||||
__glXDisp_GetMinmaxParameterfv,
|
||||
__glXDisp_GetMinmaxParameteriv,
|
||||
};
|
||||
|
||||
__GLXdispatchRenderProcPtr __glXRenderTable[] = {
|
||||
__glXNoSuchRenderOpcode,
|
||||
__glXDisp_CallList,
|
||||
__glXDisp_CallLists,
|
||||
__glXDisp_ListBase,
|
||||
__glXDisp_Begin,
|
||||
__glXDisp_Bitmap,
|
||||
__glXDisp_Color3bv,
|
||||
__glXDisp_Color3dv,
|
||||
__glXDisp_Color3fv,
|
||||
__glXDisp_Color3iv,
|
||||
__glXDisp_Color3sv,
|
||||
__glXDisp_Color3ubv,
|
||||
__glXDisp_Color3uiv,
|
||||
__glXDisp_Color3usv,
|
||||
__glXDisp_Color4bv,
|
||||
__glXDisp_Color4dv,
|
||||
__glXDisp_Color4fv,
|
||||
__glXDisp_Color4iv,
|
||||
__glXDisp_Color4sv,
|
||||
__glXDisp_Color4ubv,
|
||||
__glXDisp_Color4uiv,
|
||||
__glXDisp_Color4usv,
|
||||
__glXDisp_EdgeFlagv,
|
||||
__glXDisp_End,
|
||||
__glXDisp_Indexdv,
|
||||
__glXDisp_Indexfv,
|
||||
__glXDisp_Indexiv,
|
||||
__glXDisp_Indexsv,
|
||||
__glXDisp_Normal3bv,
|
||||
__glXDisp_Normal3dv,
|
||||
__glXDisp_Normal3fv,
|
||||
__glXDisp_Normal3iv,
|
||||
__glXDisp_Normal3sv,
|
||||
__glXDisp_RasterPos2dv,
|
||||
__glXDisp_RasterPos2fv,
|
||||
__glXDisp_RasterPos2iv,
|
||||
__glXDisp_RasterPos2sv,
|
||||
__glXDisp_RasterPos3dv,
|
||||
__glXDisp_RasterPos3fv,
|
||||
__glXDisp_RasterPos3iv,
|
||||
__glXDisp_RasterPos3sv,
|
||||
__glXDisp_RasterPos4dv,
|
||||
__glXDisp_RasterPos4fv,
|
||||
__glXDisp_RasterPos4iv,
|
||||
__glXDisp_RasterPos4sv,
|
||||
__glXDisp_Rectdv,
|
||||
__glXDisp_Rectfv,
|
||||
__glXDisp_Rectiv,
|
||||
__glXDisp_Rectsv,
|
||||
__glXDisp_TexCoord1dv,
|
||||
__glXDisp_TexCoord1fv,
|
||||
__glXDisp_TexCoord1iv,
|
||||
__glXDisp_TexCoord1sv,
|
||||
__glXDisp_TexCoord2dv,
|
||||
__glXDisp_TexCoord2fv,
|
||||
__glXDisp_TexCoord2iv,
|
||||
__glXDisp_TexCoord2sv,
|
||||
__glXDisp_TexCoord3dv,
|
||||
__glXDisp_TexCoord3fv,
|
||||
__glXDisp_TexCoord3iv,
|
||||
__glXDisp_TexCoord3sv,
|
||||
__glXDisp_TexCoord4dv,
|
||||
__glXDisp_TexCoord4fv,
|
||||
__glXDisp_TexCoord4iv,
|
||||
__glXDisp_TexCoord4sv,
|
||||
__glXDisp_Vertex2dv,
|
||||
__glXDisp_Vertex2fv,
|
||||
__glXDisp_Vertex2iv,
|
||||
__glXDisp_Vertex2sv,
|
||||
__glXDisp_Vertex3dv,
|
||||
__glXDisp_Vertex3fv,
|
||||
__glXDisp_Vertex3iv,
|
||||
__glXDisp_Vertex3sv,
|
||||
__glXDisp_Vertex4dv,
|
||||
__glXDisp_Vertex4fv,
|
||||
__glXDisp_Vertex4iv,
|
||||
__glXDisp_Vertex4sv,
|
||||
__glXDisp_ClipPlane,
|
||||
__glXDisp_ColorMaterial,
|
||||
__glXDisp_CullFace,
|
||||
__glXDisp_Fogf,
|
||||
__glXDisp_Fogfv,
|
||||
__glXDisp_Fogi,
|
||||
__glXDisp_Fogiv,
|
||||
__glXDisp_FrontFace,
|
||||
__glXDisp_Hint,
|
||||
__glXDisp_Lightf,
|
||||
__glXDisp_Lightfv,
|
||||
__glXDisp_Lighti,
|
||||
__glXDisp_Lightiv,
|
||||
__glXDisp_LightModelf,
|
||||
__glXDisp_LightModelfv,
|
||||
__glXDisp_LightModeli,
|
||||
__glXDisp_LightModeliv,
|
||||
__glXDisp_LineStipple,
|
||||
__glXDisp_LineWidth,
|
||||
__glXDisp_Materialf,
|
||||
__glXDisp_Materialfv,
|
||||
__glXDisp_Materiali,
|
||||
__glXDisp_Materialiv,
|
||||
__glXDisp_PointSize,
|
||||
__glXDisp_PolygonMode,
|
||||
__glXDisp_PolygonStipple,
|
||||
__glXDisp_Scissor,
|
||||
__glXDisp_ShadeModel,
|
||||
__glXDisp_TexParameterf,
|
||||
__glXDisp_TexParameterfv,
|
||||
__glXDisp_TexParameteri,
|
||||
__glXDisp_TexParameteriv,
|
||||
__glXDisp_TexImage1D,
|
||||
__glXDisp_TexImage2D,
|
||||
__glXDisp_TexEnvf,
|
||||
__glXDisp_TexEnvfv,
|
||||
__glXDisp_TexEnvi,
|
||||
__glXDisp_TexEnviv,
|
||||
__glXDisp_TexGend,
|
||||
__glXDisp_TexGendv,
|
||||
__glXDisp_TexGenf,
|
||||
__glXDisp_TexGenfv,
|
||||
__glXDisp_TexGeni,
|
||||
__glXDisp_TexGeniv,
|
||||
__glXDisp_InitNames,
|
||||
__glXDisp_LoadName,
|
||||
__glXDisp_PassThrough,
|
||||
__glXDisp_PopName,
|
||||
__glXDisp_PushName,
|
||||
__glXDisp_DrawBuffer,
|
||||
__glXDisp_Clear,
|
||||
__glXDisp_ClearAccum,
|
||||
__glXDisp_ClearIndex,
|
||||
__glXDisp_ClearColor,
|
||||
__glXDisp_ClearStencil,
|
||||
__glXDisp_ClearDepth,
|
||||
__glXDisp_StencilMask,
|
||||
__glXDisp_ColorMask,
|
||||
__glXDisp_DepthMask,
|
||||
__glXDisp_IndexMask,
|
||||
__glXDisp_Accum,
|
||||
__glXDisp_Disable,
|
||||
__glXDisp_Enable,
|
||||
__glXNoSuchRenderOpcode,
|
||||
__glXDisp_PopAttrib,
|
||||
__glXDisp_PushAttrib,
|
||||
__glXDisp_Map1d,
|
||||
__glXDisp_Map1f,
|
||||
__glXDisp_Map2d,
|
||||
__glXDisp_Map2f,
|
||||
__glXDisp_MapGrid1d,
|
||||
__glXDisp_MapGrid1f,
|
||||
__glXDisp_MapGrid2d,
|
||||
__glXDisp_MapGrid2f,
|
||||
__glXDisp_EvalCoord1dv,
|
||||
__glXDisp_EvalCoord1fv,
|
||||
__glXDisp_EvalCoord2dv,
|
||||
__glXDisp_EvalCoord2fv,
|
||||
__glXDisp_EvalMesh1,
|
||||
__glXDisp_EvalPoint1,
|
||||
__glXDisp_EvalMesh2,
|
||||
__glXDisp_EvalPoint2,
|
||||
__glXDisp_AlphaFunc,
|
||||
__glXDisp_BlendFunc,
|
||||
__glXDisp_LogicOp,
|
||||
__glXDisp_StencilFunc,
|
||||
__glXDisp_StencilOp,
|
||||
__glXDisp_DepthFunc,
|
||||
__glXDisp_PixelZoom,
|
||||
__glXDisp_PixelTransferf,
|
||||
__glXDisp_PixelTransferi,
|
||||
__glXDisp_PixelMapfv,
|
||||
__glXDisp_PixelMapuiv,
|
||||
__glXDisp_PixelMapusv,
|
||||
__glXDisp_ReadBuffer,
|
||||
__glXDisp_CopyPixels,
|
||||
__glXDisp_DrawPixels,
|
||||
__glXDisp_DepthRange,
|
||||
__glXDisp_Frustum,
|
||||
__glXDisp_LoadIdentity,
|
||||
__glXDisp_LoadMatrixf,
|
||||
__glXDisp_LoadMatrixd,
|
||||
__glXDisp_MatrixMode,
|
||||
__glXDisp_MultMatrixf,
|
||||
__glXDisp_MultMatrixd,
|
||||
__glXDisp_Ortho,
|
||||
__glXDisp_PopMatrix,
|
||||
__glXDisp_PushMatrix,
|
||||
__glXDisp_Rotated,
|
||||
__glXDisp_Rotatef,
|
||||
__glXDisp_Scaled,
|
||||
__glXDisp_Scalef,
|
||||
__glXDisp_Translated,
|
||||
__glXDisp_Translatef,
|
||||
__glXDisp_Viewport,
|
||||
__glXDisp_PolygonOffset,
|
||||
__glXDisp_DrawArrays,
|
||||
__glXDisp_Indexubv,
|
||||
__glXDisp_ColorSubTable,
|
||||
__glXDisp_CopyColorSubTable,
|
||||
__glXDisp_ActiveTextureARB,
|
||||
__glXDisp_MultiTexCoord1dvARB,
|
||||
__glXDisp_MultiTexCoord1fvARB,
|
||||
__glXDisp_MultiTexCoord1ivARB,
|
||||
__glXDisp_MultiTexCoord1svARB,
|
||||
__glXDisp_MultiTexCoord2dvARB,
|
||||
__glXDisp_MultiTexCoord2fvARB,
|
||||
__glXDisp_MultiTexCoord2ivARB,
|
||||
__glXDisp_MultiTexCoord2svARB,
|
||||
__glXDisp_MultiTexCoord3dvARB,
|
||||
__glXDisp_MultiTexCoord3fvARB,
|
||||
__glXDisp_MultiTexCoord3ivARB,
|
||||
__glXDisp_MultiTexCoord3svARB,
|
||||
__glXDisp_MultiTexCoord4dvARB,
|
||||
__glXDisp_MultiTexCoord4fvARB,
|
||||
__glXDisp_MultiTexCoord4ivARB,
|
||||
__glXDisp_MultiTexCoord4svARB, /* 213 */
|
||||
__glXNoSuchRenderOpcode,
|
||||
__glXNoSuchRenderOpcode,
|
||||
__glXNoSuchRenderOpcode,
|
||||
__glXNoSuchRenderOpcode,
|
||||
__glXNoSuchRenderOpcode,
|
||||
__glXNoSuchRenderOpcode,
|
||||
__glXNoSuchRenderOpcode, /* 220 */
|
||||
__glXNoSuchRenderOpcode,
|
||||
__glXNoSuchRenderOpcode,
|
||||
__glXNoSuchRenderOpcode,
|
||||
__glXNoSuchRenderOpcode,
|
||||
__glXNoSuchRenderOpcode,
|
||||
__glXNoSuchRenderOpcode,
|
||||
__glXNoSuchRenderOpcode,
|
||||
__glXNoSuchRenderOpcode,
|
||||
__glXDisp_SampleCoverageARB,
|
||||
#ifndef MISSING_GL_EXTS
|
||||
__glXDisp_WindowPos3fARB /* 230 */
|
||||
#else
|
||||
__glXNoSuchRenderOpcode
|
||||
#endif
|
||||
};
|
||||
|
||||
__GLXdispatchSingleProcPtr __glXSwapSingleTable[__GLX_SINGLE_TABLE_SIZE] = {
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXSwapRender,
|
||||
__glXSwapRenderLarge,
|
||||
__glXSwapCreateContext,
|
||||
__glXSwapDestroyContext,
|
||||
__glXSwapMakeCurrent,
|
||||
__glXSwapIsDirect,
|
||||
__glXSwapQueryVersion,
|
||||
__glXSwapWaitGL,
|
||||
__glXSwapWaitX,
|
||||
__glXSwapCopyContext,
|
||||
__glXSwapSwapBuffers,
|
||||
__glXSwapUseXFont,
|
||||
__glXSwapCreateGLXPixmap,
|
||||
__glXSwapGetVisualConfigs,
|
||||
__glXSwapDestroyGLXPixmap,
|
||||
__glXSwapVendorPrivate,
|
||||
__glXSwapVendorPrivateWithReply,
|
||||
__glXSwapQueryExtensionsString,
|
||||
__glXSwapQueryServerString,
|
||||
__glXSwapClientInfo,
|
||||
__glXSwapGetFBConfigs,
|
||||
__glXSwapCreatePixmap,
|
||||
__glXSwapDestroyGLXPixmap, /* glXDestroyPixmap */
|
||||
__glXSwapCreateNewContext,
|
||||
__glXNoSuchSingleOpcode, /* glXQueryContext */
|
||||
__glXSwapMakeContextCurrent,
|
||||
__glXNoSuchSingleOpcode, /* glXCreatePbuffer */
|
||||
__glXNoSuchSingleOpcode, /* glXDestroyPbuffer */
|
||||
__glXNoSuchSingleOpcode, /* glXGetDrawableAttributes */
|
||||
__glXNoSuchSingleOpcode, /* glXChangeDrawableAttributes */
|
||||
__glXNoSuchSingleOpcode, /* glXCreateWindow */
|
||||
__glXNoSuchSingleOpcode, /* glXDestroyWindow */
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXNoSuchSingleOpcode,
|
||||
__glXDispSwap_NewList,
|
||||
__glXDispSwap_EndList,
|
||||
__glXDispSwap_DeleteLists,
|
||||
__glXDispSwap_GenLists,
|
||||
__glXDispSwap_FeedbackBuffer,
|
||||
__glXDispSwap_SelectBuffer,
|
||||
__glXDispSwap_RenderMode,
|
||||
__glXDispSwap_Finish,
|
||||
__glXDispSwap_PixelStoref,
|
||||
__glXDispSwap_PixelStorei,
|
||||
__glXDispSwap_ReadPixels,
|
||||
__glXDispSwap_GetBooleanv,
|
||||
__glXDispSwap_GetClipPlane,
|
||||
__glXDispSwap_GetDoublev,
|
||||
__glXDispSwap_GetError,
|
||||
__glXDispSwap_GetFloatv,
|
||||
__glXDispSwap_GetIntegerv,
|
||||
__glXDispSwap_GetLightfv,
|
||||
__glXDispSwap_GetLightiv,
|
||||
__glXDispSwap_GetMapdv,
|
||||
__glXDispSwap_GetMapfv,
|
||||
__glXDispSwap_GetMapiv,
|
||||
__glXDispSwap_GetMaterialfv,
|
||||
__glXDispSwap_GetMaterialiv,
|
||||
__glXDispSwap_GetPixelMapfv,
|
||||
__glXDispSwap_GetPixelMapuiv,
|
||||
__glXDispSwap_GetPixelMapusv,
|
||||
__glXDispSwap_GetPolygonStipple,
|
||||
__glXDispSwap_GetString,
|
||||
__glXDispSwap_GetTexEnvfv,
|
||||
__glXDispSwap_GetTexEnviv,
|
||||
__glXDispSwap_GetTexGendv,
|
||||
__glXDispSwap_GetTexGenfv,
|
||||
__glXDispSwap_GetTexGeniv,
|
||||
__glXDispSwap_GetTexImage,
|
||||
__glXDispSwap_GetTexParameterfv,
|
||||
__glXDispSwap_GetTexParameteriv,
|
||||
__glXDispSwap_GetTexLevelParameterfv,
|
||||
__glXDispSwap_GetTexLevelParameteriv,
|
||||
__glXDispSwap_IsEnabled,
|
||||
__glXDispSwap_IsList,
|
||||
__glXDispSwap_Flush,
|
||||
__glXDispSwap_AreTexturesResident,
|
||||
__glXDispSwap_DeleteTextures,
|
||||
__glXDispSwap_GenTextures,
|
||||
__glXDispSwap_IsTexture,
|
||||
__glXDispSwap_GetColorTable,
|
||||
__glXDispSwap_GetColorTableParameterfv,
|
||||
__glXDispSwap_GetColorTableParameteriv,
|
||||
__glXDispSwap_GetConvolutionFilter,
|
||||
__glXDispSwap_GetConvolutionParameterfv,
|
||||
__glXDispSwap_GetConvolutionParameteriv,
|
||||
__glXDispSwap_GetSeparableFilter,
|
||||
__glXDispSwap_GetHistogram,
|
||||
__glXDispSwap_GetHistogramParameterfv,
|
||||
__glXDispSwap_GetHistogramParameteriv,
|
||||
__glXDispSwap_GetMinmax,
|
||||
__glXDispSwap_GetMinmaxParameterfv,
|
||||
__glXDispSwap_GetMinmaxParameteriv,
|
||||
};
|
||||
|
||||
__GLXdispatchRenderProcPtr __glXSwapRenderTable[__GLX_RENDER_TABLE_SIZE] = {
|
||||
__glXNoSuchRenderOpcode,
|
||||
__glXDispSwap_CallList,
|
||||
__glXDispSwap_CallLists,
|
||||
__glXDispSwap_ListBase,
|
||||
__glXDispSwap_Begin,
|
||||
__glXDispSwap_Bitmap,
|
||||
__glXDispSwap_Color3bv,
|
||||
__glXDispSwap_Color3dv,
|
||||
__glXDispSwap_Color3fv,
|
||||
__glXDispSwap_Color3iv,
|
||||
__glXDispSwap_Color3sv,
|
||||
__glXDispSwap_Color3ubv,
|
||||
__glXDispSwap_Color3uiv,
|
||||
__glXDispSwap_Color3usv,
|
||||
__glXDispSwap_Color4bv,
|
||||
__glXDispSwap_Color4dv,
|
||||
__glXDispSwap_Color4fv,
|
||||
__glXDispSwap_Color4iv,
|
||||
__glXDispSwap_Color4sv,
|
||||
__glXDispSwap_Color4ubv,
|
||||
__glXDispSwap_Color4uiv,
|
||||
__glXDispSwap_Color4usv,
|
||||
__glXDispSwap_EdgeFlagv,
|
||||
__glXDispSwap_End,
|
||||
__glXDispSwap_Indexdv,
|
||||
__glXDispSwap_Indexfv,
|
||||
__glXDispSwap_Indexiv,
|
||||
__glXDispSwap_Indexsv,
|
||||
__glXDispSwap_Normal3bv,
|
||||
__glXDispSwap_Normal3dv,
|
||||
__glXDispSwap_Normal3fv,
|
||||
__glXDispSwap_Normal3iv,
|
||||
__glXDispSwap_Normal3sv,
|
||||
__glXDispSwap_RasterPos2dv,
|
||||
__glXDispSwap_RasterPos2fv,
|
||||
__glXDispSwap_RasterPos2iv,
|
||||
__glXDispSwap_RasterPos2sv,
|
||||
__glXDispSwap_RasterPos3dv,
|
||||
__glXDispSwap_RasterPos3fv,
|
||||
__glXDispSwap_RasterPos3iv,
|
||||
__glXDispSwap_RasterPos3sv,
|
||||
__glXDispSwap_RasterPos4dv,
|
||||
__glXDispSwap_RasterPos4fv,
|
||||
__glXDispSwap_RasterPos4iv,
|
||||
__glXDispSwap_RasterPos4sv,
|
||||
__glXDispSwap_Rectdv,
|
||||
__glXDispSwap_Rectfv,
|
||||
__glXDispSwap_Rectiv,
|
||||
__glXDispSwap_Rectsv,
|
||||
__glXDispSwap_TexCoord1dv,
|
||||
__glXDispSwap_TexCoord1fv,
|
||||
__glXDispSwap_TexCoord1iv,
|
||||
__glXDispSwap_TexCoord1sv,
|
||||
__glXDispSwap_TexCoord2dv,
|
||||
__glXDispSwap_TexCoord2fv,
|
||||
__glXDispSwap_TexCoord2iv,
|
||||
__glXDispSwap_TexCoord2sv,
|
||||
__glXDispSwap_TexCoord3dv,
|
||||
__glXDispSwap_TexCoord3fv,
|
||||
__glXDispSwap_TexCoord3iv,
|
||||
__glXDispSwap_TexCoord3sv,
|
||||
__glXDispSwap_TexCoord4dv,
|
||||
__glXDispSwap_TexCoord4fv,
|
||||
__glXDispSwap_TexCoord4iv,
|
||||
__glXDispSwap_TexCoord4sv,
|
||||
__glXDispSwap_Vertex2dv,
|
||||
__glXDispSwap_Vertex2fv,
|
||||
__glXDispSwap_Vertex2iv,
|
||||
__glXDispSwap_Vertex2sv,
|
||||
__glXDispSwap_Vertex3dv,
|
||||
__glXDispSwap_Vertex3fv,
|
||||
__glXDispSwap_Vertex3iv,
|
||||
__glXDispSwap_Vertex3sv,
|
||||
__glXDispSwap_Vertex4dv,
|
||||
__glXDispSwap_Vertex4fv,
|
||||
__glXDispSwap_Vertex4iv,
|
||||
__glXDispSwap_Vertex4sv,
|
||||
__glXDispSwap_ClipPlane,
|
||||
__glXDispSwap_ColorMaterial,
|
||||
__glXDispSwap_CullFace,
|
||||
__glXDispSwap_Fogf,
|
||||
__glXDispSwap_Fogfv,
|
||||
__glXDispSwap_Fogi,
|
||||
__glXDispSwap_Fogiv,
|
||||
__glXDispSwap_FrontFace,
|
||||
__glXDispSwap_Hint,
|
||||
__glXDispSwap_Lightf,
|
||||
__glXDispSwap_Lightfv,
|
||||
__glXDispSwap_Lighti,
|
||||
__glXDispSwap_Lightiv,
|
||||
__glXDispSwap_LightModelf,
|
||||
__glXDispSwap_LightModelfv,
|
||||
__glXDispSwap_LightModeli,
|
||||
__glXDispSwap_LightModeliv,
|
||||
__glXDispSwap_LineStipple,
|
||||
__glXDispSwap_LineWidth,
|
||||
__glXDispSwap_Materialf,
|
||||
__glXDispSwap_Materialfv,
|
||||
__glXDispSwap_Materiali,
|
||||
__glXDispSwap_Materialiv,
|
||||
__glXDispSwap_PointSize,
|
||||
__glXDispSwap_PolygonMode,
|
||||
__glXDispSwap_PolygonStipple,
|
||||
__glXDispSwap_Scissor,
|
||||
__glXDispSwap_ShadeModel,
|
||||
__glXDispSwap_TexParameterf,
|
||||
__glXDispSwap_TexParameterfv,
|
||||
__glXDispSwap_TexParameteri,
|
||||
__glXDispSwap_TexParameteriv,
|
||||
__glXDispSwap_TexImage1D,
|
||||
__glXDispSwap_TexImage2D,
|
||||
__glXDispSwap_TexEnvf,
|
||||
__glXDispSwap_TexEnvfv,
|
||||
__glXDispSwap_TexEnvi,
|
||||
__glXDispSwap_TexEnviv,
|
||||
__glXDispSwap_TexGend,
|
||||
__glXDispSwap_TexGendv,
|
||||
__glXDispSwap_TexGenf,
|
||||
__glXDispSwap_TexGenfv,
|
||||
__glXDispSwap_TexGeni,
|
||||
__glXDispSwap_TexGeniv,
|
||||
__glXDispSwap_InitNames,
|
||||
__glXDispSwap_LoadName,
|
||||
__glXDispSwap_PassThrough,
|
||||
__glXDispSwap_PopName,
|
||||
__glXDispSwap_PushName,
|
||||
__glXDispSwap_DrawBuffer,
|
||||
__glXDispSwap_Clear,
|
||||
__glXDispSwap_ClearAccum,
|
||||
__glXDispSwap_ClearIndex,
|
||||
__glXDispSwap_ClearColor,
|
||||
__glXDispSwap_ClearStencil,
|
||||
__glXDispSwap_ClearDepth,
|
||||
__glXDispSwap_StencilMask,
|
||||
__glXDispSwap_ColorMask,
|
||||
__glXDispSwap_DepthMask,
|
||||
__glXDispSwap_IndexMask,
|
||||
__glXDispSwap_Accum,
|
||||
__glXDispSwap_Disable,
|
||||
__glXDispSwap_Enable,
|
||||
__glXNoSuchRenderOpcode,
|
||||
__glXDispSwap_PopAttrib,
|
||||
__glXDispSwap_PushAttrib,
|
||||
__glXDispSwap_Map1d,
|
||||
__glXDispSwap_Map1f,
|
||||
__glXDispSwap_Map2d,
|
||||
__glXDispSwap_Map2f,
|
||||
__glXDispSwap_MapGrid1d,
|
||||
__glXDispSwap_MapGrid1f,
|
||||
__glXDispSwap_MapGrid2d,
|
||||
__glXDispSwap_MapGrid2f,
|
||||
__glXDispSwap_EvalCoord1dv,
|
||||
__glXDispSwap_EvalCoord1fv,
|
||||
__glXDispSwap_EvalCoord2dv,
|
||||
__glXDispSwap_EvalCoord2fv,
|
||||
__glXDispSwap_EvalMesh1,
|
||||
__glXDispSwap_EvalPoint1,
|
||||
__glXDispSwap_EvalMesh2,
|
||||
__glXDispSwap_EvalPoint2,
|
||||
__glXDispSwap_AlphaFunc,
|
||||
__glXDispSwap_BlendFunc,
|
||||
__glXDispSwap_LogicOp,
|
||||
__glXDispSwap_StencilFunc,
|
||||
__glXDispSwap_StencilOp,
|
||||
__glXDispSwap_DepthFunc,
|
||||
__glXDispSwap_PixelZoom,
|
||||
__glXDispSwap_PixelTransferf,
|
||||
__glXDispSwap_PixelTransferi,
|
||||
__glXDispSwap_PixelMapfv,
|
||||
__glXDispSwap_PixelMapuiv,
|
||||
__glXDispSwap_PixelMapusv,
|
||||
__glXDispSwap_ReadBuffer,
|
||||
__glXDispSwap_CopyPixels,
|
||||
__glXDispSwap_DrawPixels,
|
||||
__glXDispSwap_DepthRange,
|
||||
__glXDispSwap_Frustum,
|
||||
__glXDispSwap_LoadIdentity,
|
||||
__glXDispSwap_LoadMatrixf,
|
||||
__glXDispSwap_LoadMatrixd,
|
||||
__glXDispSwap_MatrixMode,
|
||||
__glXDispSwap_MultMatrixf,
|
||||
__glXDispSwap_MultMatrixd,
|
||||
__glXDispSwap_Ortho,
|
||||
__glXDispSwap_PopMatrix,
|
||||
__glXDispSwap_PushMatrix,
|
||||
__glXDispSwap_Rotated,
|
||||
__glXDispSwap_Rotatef,
|
||||
__glXDispSwap_Scaled,
|
||||
__glXDispSwap_Scalef,
|
||||
__glXDispSwap_Translated,
|
||||
__glXDispSwap_Translatef,
|
||||
__glXDispSwap_Viewport,
|
||||
__glXDispSwap_PolygonOffset,
|
||||
__glXDispSwap_DrawArrays,
|
||||
__glXDispSwap_Indexubv,
|
||||
__glXDispSwap_ColorSubTable,
|
||||
__glXDispSwap_CopyColorSubTable,
|
||||
__glXDispSwap_ActiveTextureARB,
|
||||
__glXDispSwap_MultiTexCoord1dvARB,
|
||||
__glXDispSwap_MultiTexCoord1fvARB,
|
||||
__glXDispSwap_MultiTexCoord1ivARB,
|
||||
__glXDispSwap_MultiTexCoord1svARB,
|
||||
__glXDispSwap_MultiTexCoord2dvARB,
|
||||
__glXDispSwap_MultiTexCoord2fvARB,
|
||||
__glXDispSwap_MultiTexCoord2ivARB,
|
||||
__glXDispSwap_MultiTexCoord2svARB,
|
||||
__glXDispSwap_MultiTexCoord3dvARB,
|
||||
__glXDispSwap_MultiTexCoord3fvARB,
|
||||
__glXDispSwap_MultiTexCoord3ivARB,
|
||||
__glXDispSwap_MultiTexCoord3svARB,
|
||||
__glXDispSwap_MultiTexCoord4dvARB,
|
||||
__glXDispSwap_MultiTexCoord4fvARB,
|
||||
__glXDispSwap_MultiTexCoord4ivARB,
|
||||
__glXDispSwap_MultiTexCoord4svARB, /* 213 */
|
||||
__glXNoSuchRenderOpcode,
|
||||
__glXNoSuchRenderOpcode,
|
||||
__glXNoSuchRenderOpcode,
|
||||
__glXNoSuchRenderOpcode,
|
||||
__glXNoSuchRenderOpcode,
|
||||
__glXNoSuchRenderOpcode,
|
||||
__glXNoSuchRenderOpcode, /* 220 */
|
||||
__glXNoSuchRenderOpcode,
|
||||
__glXNoSuchRenderOpcode,
|
||||
__glXNoSuchRenderOpcode,
|
||||
__glXNoSuchRenderOpcode,
|
||||
__glXNoSuchRenderOpcode,
|
||||
__glXNoSuchRenderOpcode,
|
||||
__glXNoSuchRenderOpcode,
|
||||
__glXNoSuchRenderOpcode,
|
||||
__glXDispSwap_SampleCoverageARB,
|
||||
#ifndef MISSING_GL_EXTS
|
||||
__glXDispSwap_WindowPos3fARB /* 230 */
|
||||
#else
|
||||
__glXNoSuchRenderOpcode
|
||||
#endif
|
||||
};
|
||||
651
nx-X11/programs/Xserver/GL/glx/g_disptab.h
Normal file
651
nx-X11/programs/Xserver/GL/glx/g_disptab.h
Normal file
@@ -0,0 +1,651 @@
|
||||
/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED */
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#ifndef _GLX_g_disptab_h_
|
||||
#define _GLX_g_disptab_h_
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
** Additional Notice Provisions: This software was created using the
|
||||
** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
|
||||
** not been independently verified as being compliant with the OpenGL(R)
|
||||
** version 1.2.1 Specification.
|
||||
*/
|
||||
|
||||
extern int __glXRender(__GLXclientState*, GLbyte*);
|
||||
extern int __glXRenderLarge(__GLXclientState*, GLbyte*);
|
||||
extern int __glXCreateContext(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDestroyContext(__GLXclientState*, GLbyte*);
|
||||
extern int __glXMakeCurrent(__GLXclientState*, GLbyte*);
|
||||
extern int __glXIsDirect(__GLXclientState*, GLbyte*);
|
||||
extern int __glXQueryVersion(__GLXclientState*, GLbyte*);
|
||||
extern int __glXWaitGL(__GLXclientState*, GLbyte*);
|
||||
extern int __glXWaitX(__GLXclientState*, GLbyte*);
|
||||
extern int __glXCopyContext(__GLXclientState*, GLbyte*);
|
||||
extern int __glXSwapBuffers(__GLXclientState*, GLbyte*);
|
||||
extern int __glXUseXFont(__GLXclientState*, GLbyte*);
|
||||
extern int __glXCreateGLXPixmap(__GLXclientState*, GLbyte*);
|
||||
extern int __glXGetVisualConfigs(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDestroyGLXPixmap(__GLXclientState*, GLbyte*);
|
||||
extern int __glXVendorPrivate(__GLXclientState*, GLbyte*);
|
||||
extern int __glXVendorPrivateWithReply(__GLXclientState*, GLbyte*);
|
||||
extern int __glXQueryExtensionsString(__GLXclientState*, GLbyte*);
|
||||
extern int __glXQueryServerString(__GLXclientState*, GLbyte*);
|
||||
extern int __glXClientInfo(__GLXclientState*, GLbyte*);
|
||||
extern int __glXMakeContextCurrent(__GLXclientState*, GLbyte*);
|
||||
extern int __glXGetFBConfigs(__GLXclientState*, GLbyte*);
|
||||
extern int __glXCreateNewContext(__GLXclientState*, GLbyte*);
|
||||
extern int __glXCreatePixmap(__GLXclientState*, GLbyte*);
|
||||
|
||||
extern int __glXDisp_NewList(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_EndList(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_DeleteLists(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GenLists(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_FeedbackBuffer(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_SelectBuffer(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_RenderMode(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_Finish(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_PixelStoref(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_PixelStorei(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_ReadPixels(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GetBooleanv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GetClipPlane(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GetDoublev(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GetError(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GetFloatv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GetIntegerv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GetLightfv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GetLightiv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GetMapdv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GetMapfv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GetMapiv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GetMaterialfv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GetMaterialiv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GetPixelMapfv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GetPixelMapuiv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GetPixelMapusv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GetPolygonStipple(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GetString(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GetTexEnvfv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GetTexEnviv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GetTexGendv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GetTexGenfv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GetTexGeniv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GetTexImage(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GetTexParameterfv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GetTexParameteriv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GetTexLevelParameterfv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GetTexLevelParameteriv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_IsEnabled(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_IsList(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_Flush(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_AreTexturesResident(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_DeleteTextures(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GenTextures(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_IsTexture(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GetColorTable(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GetColorTableParameterfv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GetColorTableParameteriv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GetConvolutionFilter(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GetConvolutionParameterfv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GetConvolutionParameteriv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GetSeparableFilter(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GetHistogram(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GetHistogramParameterfv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GetHistogramParameteriv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GetMinmax(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GetMinmaxParameterfv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GetMinmaxParameteriv(__GLXclientState*, GLbyte*);
|
||||
|
||||
extern void __glXDisp_CallList(GLbyte*);
|
||||
extern void __glXDisp_CallLists(GLbyte*);
|
||||
extern void __glXDisp_ListBase(GLbyte*);
|
||||
extern void __glXDisp_Begin(GLbyte*);
|
||||
extern void __glXDisp_Bitmap(GLbyte*);
|
||||
extern void __glXDisp_Color3bv(GLbyte*);
|
||||
extern void __glXDisp_Color3dv(GLbyte*);
|
||||
extern void __glXDisp_Color3fv(GLbyte*);
|
||||
extern void __glXDisp_Color3iv(GLbyte*);
|
||||
extern void __glXDisp_Color3sv(GLbyte*);
|
||||
extern void __glXDisp_Color3ubv(GLbyte*);
|
||||
extern void __glXDisp_Color3uiv(GLbyte*);
|
||||
extern void __glXDisp_Color3usv(GLbyte*);
|
||||
extern void __glXDisp_Color4bv(GLbyte*);
|
||||
extern void __glXDisp_Color4dv(GLbyte*);
|
||||
extern void __glXDisp_Color4fv(GLbyte*);
|
||||
extern void __glXDisp_Color4iv(GLbyte*);
|
||||
extern void __glXDisp_Color4sv(GLbyte*);
|
||||
extern void __glXDisp_Color4ubv(GLbyte*);
|
||||
extern void __glXDisp_Color4uiv(GLbyte*);
|
||||
extern void __glXDisp_Color4usv(GLbyte*);
|
||||
extern void __glXDisp_EdgeFlagv(GLbyte*);
|
||||
extern void __glXDisp_End(GLbyte*);
|
||||
extern void __glXDisp_Indexdv(GLbyte*);
|
||||
extern void __glXDisp_Indexfv(GLbyte*);
|
||||
extern void __glXDisp_Indexiv(GLbyte*);
|
||||
extern void __glXDisp_Indexsv(GLbyte*);
|
||||
extern void __glXDisp_Normal3bv(GLbyte*);
|
||||
extern void __glXDisp_Normal3dv(GLbyte*);
|
||||
extern void __glXDisp_Normal3fv(GLbyte*);
|
||||
extern void __glXDisp_Normal3iv(GLbyte*);
|
||||
extern void __glXDisp_Normal3sv(GLbyte*);
|
||||
extern void __glXDisp_RasterPos2dv(GLbyte*);
|
||||
extern void __glXDisp_RasterPos2fv(GLbyte*);
|
||||
extern void __glXDisp_RasterPos2iv(GLbyte*);
|
||||
extern void __glXDisp_RasterPos2sv(GLbyte*);
|
||||
extern void __glXDisp_RasterPos3dv(GLbyte*);
|
||||
extern void __glXDisp_RasterPos3fv(GLbyte*);
|
||||
extern void __glXDisp_RasterPos3iv(GLbyte*);
|
||||
extern void __glXDisp_RasterPos3sv(GLbyte*);
|
||||
extern void __glXDisp_RasterPos4dv(GLbyte*);
|
||||
extern void __glXDisp_RasterPos4fv(GLbyte*);
|
||||
extern void __glXDisp_RasterPos4iv(GLbyte*);
|
||||
extern void __glXDisp_RasterPos4sv(GLbyte*);
|
||||
extern void __glXDisp_Rectdv(GLbyte*);
|
||||
extern void __glXDisp_Rectfv(GLbyte*);
|
||||
extern void __glXDisp_Rectiv(GLbyte*);
|
||||
extern void __glXDisp_Rectsv(GLbyte*);
|
||||
extern void __glXDisp_TexCoord1dv(GLbyte*);
|
||||
extern void __glXDisp_TexCoord1fv(GLbyte*);
|
||||
extern void __glXDisp_TexCoord1iv(GLbyte*);
|
||||
extern void __glXDisp_TexCoord1sv(GLbyte*);
|
||||
extern void __glXDisp_TexCoord2dv(GLbyte*);
|
||||
extern void __glXDisp_TexCoord2fv(GLbyte*);
|
||||
extern void __glXDisp_TexCoord2iv(GLbyte*);
|
||||
extern void __glXDisp_TexCoord2sv(GLbyte*);
|
||||
extern void __glXDisp_TexCoord3dv(GLbyte*);
|
||||
extern void __glXDisp_TexCoord3fv(GLbyte*);
|
||||
extern void __glXDisp_TexCoord3iv(GLbyte*);
|
||||
extern void __glXDisp_TexCoord3sv(GLbyte*);
|
||||
extern void __glXDisp_TexCoord4dv(GLbyte*);
|
||||
extern void __glXDisp_TexCoord4fv(GLbyte*);
|
||||
extern void __glXDisp_TexCoord4iv(GLbyte*);
|
||||
extern void __glXDisp_TexCoord4sv(GLbyte*);
|
||||
extern void __glXDisp_Vertex2dv(GLbyte*);
|
||||
extern void __glXDisp_Vertex2fv(GLbyte*);
|
||||
extern void __glXDisp_Vertex2iv(GLbyte*);
|
||||
extern void __glXDisp_Vertex2sv(GLbyte*);
|
||||
extern void __glXDisp_Vertex3dv(GLbyte*);
|
||||
extern void __glXDisp_Vertex3fv(GLbyte*);
|
||||
extern void __glXDisp_Vertex3iv(GLbyte*);
|
||||
extern void __glXDisp_Vertex3sv(GLbyte*);
|
||||
extern void __glXDisp_Vertex4dv(GLbyte*);
|
||||
extern void __glXDisp_Vertex4fv(GLbyte*);
|
||||
extern void __glXDisp_Vertex4iv(GLbyte*);
|
||||
extern void __glXDisp_Vertex4sv(GLbyte*);
|
||||
extern void __glXDisp_ClipPlane(GLbyte*);
|
||||
extern void __glXDisp_ColorMaterial(GLbyte*);
|
||||
extern void __glXDisp_CullFace(GLbyte*);
|
||||
extern void __glXDisp_Fogf(GLbyte*);
|
||||
extern void __glXDisp_Fogfv(GLbyte*);
|
||||
extern void __glXDisp_Fogi(GLbyte*);
|
||||
extern void __glXDisp_Fogiv(GLbyte*);
|
||||
extern void __glXDisp_FrontFace(GLbyte*);
|
||||
extern void __glXDisp_Hint(GLbyte*);
|
||||
extern void __glXDisp_Lightf(GLbyte*);
|
||||
extern void __glXDisp_Lightfv(GLbyte*);
|
||||
extern void __glXDisp_Lighti(GLbyte*);
|
||||
extern void __glXDisp_Lightiv(GLbyte*);
|
||||
extern void __glXDisp_LightModelf(GLbyte*);
|
||||
extern void __glXDisp_LightModelfv(GLbyte*);
|
||||
extern void __glXDisp_LightModeli(GLbyte*);
|
||||
extern void __glXDisp_LightModeliv(GLbyte*);
|
||||
extern void __glXDisp_LineStipple(GLbyte*);
|
||||
extern void __glXDisp_LineWidth(GLbyte*);
|
||||
extern void __glXDisp_Materialf(GLbyte*);
|
||||
extern void __glXDisp_Materialfv(GLbyte*);
|
||||
extern void __glXDisp_Materiali(GLbyte*);
|
||||
extern void __glXDisp_Materialiv(GLbyte*);
|
||||
extern void __glXDisp_PointSize(GLbyte*);
|
||||
extern void __glXDisp_PolygonMode(GLbyte*);
|
||||
extern void __glXDisp_PolygonStipple(GLbyte*);
|
||||
extern void __glXDisp_Scissor(GLbyte*);
|
||||
extern void __glXDisp_ShadeModel(GLbyte*);
|
||||
extern void __glXDisp_TexParameterf(GLbyte*);
|
||||
extern void __glXDisp_TexParameterfv(GLbyte*);
|
||||
extern void __glXDisp_TexParameteri(GLbyte*);
|
||||
extern void __glXDisp_TexParameteriv(GLbyte*);
|
||||
extern void __glXDisp_TexImage1D(GLbyte*);
|
||||
extern void __glXDisp_TexImage2D(GLbyte*);
|
||||
extern void __glXDisp_TexEnvf(GLbyte*);
|
||||
extern void __glXDisp_TexEnvfv(GLbyte*);
|
||||
extern void __glXDisp_TexEnvi(GLbyte*);
|
||||
extern void __glXDisp_TexEnviv(GLbyte*);
|
||||
extern void __glXDisp_TexGend(GLbyte*);
|
||||
extern void __glXDisp_TexGendv(GLbyte*);
|
||||
extern void __glXDisp_TexGenf(GLbyte*);
|
||||
extern void __glXDisp_TexGenfv(GLbyte*);
|
||||
extern void __glXDisp_TexGeni(GLbyte*);
|
||||
extern void __glXDisp_TexGeniv(GLbyte*);
|
||||
extern void __glXDisp_InitNames(GLbyte*);
|
||||
extern void __glXDisp_LoadName(GLbyte*);
|
||||
extern void __glXDisp_PassThrough(GLbyte*);
|
||||
extern void __glXDisp_PopName(GLbyte*);
|
||||
extern void __glXDisp_PushName(GLbyte*);
|
||||
extern void __glXDisp_DrawBuffer(GLbyte*);
|
||||
extern void __glXDisp_Clear(GLbyte*);
|
||||
extern void __glXDisp_ClearAccum(GLbyte*);
|
||||
extern void __glXDisp_ClearIndex(GLbyte*);
|
||||
extern void __glXDisp_ClearColor(GLbyte*);
|
||||
extern void __glXDisp_ClearStencil(GLbyte*);
|
||||
extern void __glXDisp_ClearDepth(GLbyte*);
|
||||
extern void __glXDisp_StencilMask(GLbyte*);
|
||||
extern void __glXDisp_ColorMask(GLbyte*);
|
||||
extern void __glXDisp_DepthMask(GLbyte*);
|
||||
extern void __glXDisp_IndexMask(GLbyte*);
|
||||
extern void __glXDisp_Accum(GLbyte*);
|
||||
extern void __glXDisp_Disable(GLbyte*);
|
||||
extern void __glXDisp_Enable(GLbyte*);
|
||||
extern void __glXDisp_PopAttrib(GLbyte*);
|
||||
extern void __glXDisp_PushAttrib(GLbyte*);
|
||||
extern void __glXDisp_Map1d(GLbyte*);
|
||||
extern void __glXDisp_Map1f(GLbyte*);
|
||||
extern void __glXDisp_Map2d(GLbyte*);
|
||||
extern void __glXDisp_Map2f(GLbyte*);
|
||||
extern void __glXDisp_MapGrid1d(GLbyte*);
|
||||
extern void __glXDisp_MapGrid1f(GLbyte*);
|
||||
extern void __glXDisp_MapGrid2d(GLbyte*);
|
||||
extern void __glXDisp_MapGrid2f(GLbyte*);
|
||||
extern void __glXDisp_EvalCoord1dv(GLbyte*);
|
||||
extern void __glXDisp_EvalCoord1fv(GLbyte*);
|
||||
extern void __glXDisp_EvalCoord2dv(GLbyte*);
|
||||
extern void __glXDisp_EvalCoord2fv(GLbyte*);
|
||||
extern void __glXDisp_EvalMesh1(GLbyte*);
|
||||
extern void __glXDisp_EvalPoint1(GLbyte*);
|
||||
extern void __glXDisp_EvalMesh2(GLbyte*);
|
||||
extern void __glXDisp_EvalPoint2(GLbyte*);
|
||||
extern void __glXDisp_AlphaFunc(GLbyte*);
|
||||
extern void __glXDisp_BlendFunc(GLbyte*);
|
||||
extern void __glXDisp_LogicOp(GLbyte*);
|
||||
extern void __glXDisp_StencilFunc(GLbyte*);
|
||||
extern void __glXDisp_StencilOp(GLbyte*);
|
||||
extern void __glXDisp_DepthFunc(GLbyte*);
|
||||
extern void __glXDisp_PixelZoom(GLbyte*);
|
||||
extern void __glXDisp_PixelTransferf(GLbyte*);
|
||||
extern void __glXDisp_PixelTransferi(GLbyte*);
|
||||
extern void __glXDisp_PixelMapfv(GLbyte*);
|
||||
extern void __glXDisp_PixelMapuiv(GLbyte*);
|
||||
extern void __glXDisp_PixelMapusv(GLbyte*);
|
||||
extern void __glXDisp_ReadBuffer(GLbyte*);
|
||||
extern void __glXDisp_CopyPixels(GLbyte*);
|
||||
extern void __glXDisp_DrawPixels(GLbyte*);
|
||||
extern void __glXDisp_DepthRange(GLbyte*);
|
||||
extern void __glXDisp_Frustum(GLbyte*);
|
||||
extern void __glXDisp_LoadIdentity(GLbyte*);
|
||||
extern void __glXDisp_LoadMatrixf(GLbyte*);
|
||||
extern void __glXDisp_LoadMatrixd(GLbyte*);
|
||||
extern void __glXDisp_MatrixMode(GLbyte*);
|
||||
extern void __glXDisp_MultMatrixf(GLbyte*);
|
||||
extern void __glXDisp_MultMatrixd(GLbyte*);
|
||||
extern void __glXDisp_Ortho(GLbyte*);
|
||||
extern void __glXDisp_PopMatrix(GLbyte*);
|
||||
extern void __glXDisp_PushMatrix(GLbyte*);
|
||||
extern void __glXDisp_Rotated(GLbyte*);
|
||||
extern void __glXDisp_Rotatef(GLbyte*);
|
||||
extern void __glXDisp_Scaled(GLbyte*);
|
||||
extern void __glXDisp_Scalef(GLbyte*);
|
||||
extern void __glXDisp_Translated(GLbyte*);
|
||||
extern void __glXDisp_Translatef(GLbyte*);
|
||||
extern void __glXDisp_Viewport(GLbyte*);
|
||||
extern void __glXDisp_PolygonOffset(GLbyte*);
|
||||
extern void __glXDisp_DrawArrays(GLbyte*);
|
||||
extern void __glXDisp_Indexubv(GLbyte*);
|
||||
extern void __glXDisp_ColorSubTable(GLbyte*);
|
||||
extern void __glXDisp_CopyColorSubTable(GLbyte*);
|
||||
extern void __glXDisp_ActiveTextureARB(GLbyte*);
|
||||
extern void __glXDisp_MultiTexCoord1dvARB(GLbyte*);
|
||||
extern void __glXDisp_MultiTexCoord1fvARB(GLbyte*);
|
||||
extern void __glXDisp_MultiTexCoord1ivARB(GLbyte*);
|
||||
extern void __glXDisp_MultiTexCoord1svARB(GLbyte*);
|
||||
extern void __glXDisp_MultiTexCoord2dvARB(GLbyte*);
|
||||
extern void __glXDisp_MultiTexCoord2fvARB(GLbyte*);
|
||||
extern void __glXDisp_MultiTexCoord2ivARB(GLbyte*);
|
||||
extern void __glXDisp_MultiTexCoord2svARB(GLbyte*);
|
||||
extern void __glXDisp_MultiTexCoord3dvARB(GLbyte*);
|
||||
extern void __glXDisp_MultiTexCoord3fvARB(GLbyte*);
|
||||
extern void __glXDisp_MultiTexCoord3ivARB(GLbyte*);
|
||||
extern void __glXDisp_MultiTexCoord3svARB(GLbyte*);
|
||||
extern void __glXDisp_MultiTexCoord4dvARB(GLbyte*);
|
||||
extern void __glXDisp_MultiTexCoord4fvARB(GLbyte*);
|
||||
extern void __glXDisp_MultiTexCoord4ivARB(GLbyte*);
|
||||
extern void __glXDisp_MultiTexCoord4svARB(GLbyte*);
|
||||
extern void __glXDisp_SampleCoverageARB(GLbyte *);
|
||||
extern void __glXDisp_WindowPos3fARB(GLbyte *);
|
||||
|
||||
extern int __glXSwapRender(__GLXclientState*, GLbyte*);
|
||||
extern int __glXSwapRenderLarge(__GLXclientState*, GLbyte*);
|
||||
extern int __glXSwapCreateContext(__GLXclientState*, GLbyte*);
|
||||
extern int __glXSwapDestroyContext(__GLXclientState*, GLbyte*);
|
||||
extern int __glXSwapMakeCurrent(__GLXclientState*, GLbyte*);
|
||||
extern int __glXSwapIsDirect(__GLXclientState*, GLbyte*);
|
||||
extern int __glXSwapQueryVersion(__GLXclientState*, GLbyte*);
|
||||
extern int __glXSwapWaitGL(__GLXclientState*, GLbyte*);
|
||||
extern int __glXSwapWaitX(__GLXclientState*, GLbyte*);
|
||||
extern int __glXSwapCopyContext(__GLXclientState*, GLbyte*);
|
||||
extern int __glXSwapSwapBuffers(__GLXclientState*, GLbyte*);
|
||||
extern int __glXSwapUseXFont(__GLXclientState*, GLbyte*);
|
||||
extern int __glXSwapCreateGLXPixmap(__GLXclientState*, GLbyte*);
|
||||
extern int __glXSwapGetVisualConfigs(__GLXclientState*, GLbyte*);
|
||||
extern int __glXSwapDestroyGLXPixmap(__GLXclientState*, GLbyte*);
|
||||
extern int __glXSwapVendorPrivate(__GLXclientState*, GLbyte*);
|
||||
extern int __glXSwapVendorPrivateWithReply(__GLXclientState*, GLbyte*);
|
||||
extern int __glXSwapQueryExtensionsString(__GLXclientState*, GLbyte*);
|
||||
extern int __glXSwapQueryServerString(__GLXclientState*, GLbyte*);
|
||||
extern int __glXSwapClientInfo(__GLXclientState*, GLbyte*);
|
||||
extern int __glXSwapMakeContextCurrent(__GLXclientState*, GLbyte*);
|
||||
extern int __glXSwapGetFBConfigs(__GLXclientState*, GLbyte*);
|
||||
extern int __glXSwapCreateNewContext(__GLXclientState*, GLbyte*);
|
||||
extern int __glXSwapCreatePixmap(__GLXclientState*, GLbyte*);
|
||||
|
||||
extern int __glXDispSwap_NewList(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_EndList(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_DeleteLists(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GenLists(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_FeedbackBuffer(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_SelectBuffer(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_RenderMode(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_Finish(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_PixelStoref(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_PixelStorei(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_ReadPixels(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GetBooleanv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GetClipPlane(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GetDoublev(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GetError(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GetFloatv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GetIntegerv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GetLightfv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GetLightiv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GetMapdv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GetMapfv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GetMapiv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GetMaterialfv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GetMaterialiv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GetPixelMapfv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GetPixelMapuiv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GetPixelMapusv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GetPolygonStipple(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GetString(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GetTexEnvfv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GetTexEnviv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GetTexGendv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GetTexGenfv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GetTexGeniv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GetTexImage(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GetTexParameterfv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GetTexParameteriv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GetTexLevelParameterfv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GetTexLevelParameteriv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_IsEnabled(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_IsList(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_Flush(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_AreTexturesResident(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_DeleteTextures(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GenTextures(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_IsTexture(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GetColorTable(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GetColorTableParameterfv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GetColorTableParameteriv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GetConvolutionFilter(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GetConvolutionParameterfv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GetConvolutionParameteriv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GetSeparableFilter(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GetHistogram(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GetHistogramParameterfv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GetHistogramParameteriv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GetMinmax(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GetMinmaxParameterfv(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GetMinmaxParameteriv(__GLXclientState*, GLbyte*);
|
||||
|
||||
extern void __glXDispSwap_CallList(GLbyte*);
|
||||
extern void __glXDispSwap_CallLists(GLbyte*);
|
||||
extern void __glXDispSwap_ListBase(GLbyte*);
|
||||
extern void __glXDispSwap_Begin(GLbyte*);
|
||||
extern void __glXDispSwap_Bitmap(GLbyte*);
|
||||
extern void __glXDispSwap_Color3bv(GLbyte*);
|
||||
extern void __glXDispSwap_Color3dv(GLbyte*);
|
||||
extern void __glXDispSwap_Color3fv(GLbyte*);
|
||||
extern void __glXDispSwap_Color3iv(GLbyte*);
|
||||
extern void __glXDispSwap_Color3sv(GLbyte*);
|
||||
extern void __glXDispSwap_Color3ubv(GLbyte*);
|
||||
extern void __glXDispSwap_Color3uiv(GLbyte*);
|
||||
extern void __glXDispSwap_Color3usv(GLbyte*);
|
||||
extern void __glXDispSwap_Color4bv(GLbyte*);
|
||||
extern void __glXDispSwap_Color4dv(GLbyte*);
|
||||
extern void __glXDispSwap_Color4fv(GLbyte*);
|
||||
extern void __glXDispSwap_Color4iv(GLbyte*);
|
||||
extern void __glXDispSwap_Color4sv(GLbyte*);
|
||||
extern void __glXDispSwap_Color4ubv(GLbyte*);
|
||||
extern void __glXDispSwap_Color4uiv(GLbyte*);
|
||||
extern void __glXDispSwap_Color4usv(GLbyte*);
|
||||
extern void __glXDispSwap_EdgeFlagv(GLbyte*);
|
||||
extern void __glXDispSwap_End(GLbyte*);
|
||||
extern void __glXDispSwap_Indexdv(GLbyte*);
|
||||
extern void __glXDispSwap_Indexfv(GLbyte*);
|
||||
extern void __glXDispSwap_Indexiv(GLbyte*);
|
||||
extern void __glXDispSwap_Indexsv(GLbyte*);
|
||||
extern void __glXDispSwap_Normal3bv(GLbyte*);
|
||||
extern void __glXDispSwap_Normal3dv(GLbyte*);
|
||||
extern void __glXDispSwap_Normal3fv(GLbyte*);
|
||||
extern void __glXDispSwap_Normal3iv(GLbyte*);
|
||||
extern void __glXDispSwap_Normal3sv(GLbyte*);
|
||||
extern void __glXDispSwap_RasterPos2dv(GLbyte*);
|
||||
extern void __glXDispSwap_RasterPos2fv(GLbyte*);
|
||||
extern void __glXDispSwap_RasterPos2iv(GLbyte*);
|
||||
extern void __glXDispSwap_RasterPos2sv(GLbyte*);
|
||||
extern void __glXDispSwap_RasterPos3dv(GLbyte*);
|
||||
extern void __glXDispSwap_RasterPos3fv(GLbyte*);
|
||||
extern void __glXDispSwap_RasterPos3iv(GLbyte*);
|
||||
extern void __glXDispSwap_RasterPos3sv(GLbyte*);
|
||||
extern void __glXDispSwap_RasterPos4dv(GLbyte*);
|
||||
extern void __glXDispSwap_RasterPos4fv(GLbyte*);
|
||||
extern void __glXDispSwap_RasterPos4iv(GLbyte*);
|
||||
extern void __glXDispSwap_RasterPos4sv(GLbyte*);
|
||||
extern void __glXDispSwap_Rectdv(GLbyte*);
|
||||
extern void __glXDispSwap_Rectfv(GLbyte*);
|
||||
extern void __glXDispSwap_Rectiv(GLbyte*);
|
||||
extern void __glXDispSwap_Rectsv(GLbyte*);
|
||||
extern void __glXDispSwap_TexCoord1dv(GLbyte*);
|
||||
extern void __glXDispSwap_TexCoord1fv(GLbyte*);
|
||||
extern void __glXDispSwap_TexCoord1iv(GLbyte*);
|
||||
extern void __glXDispSwap_TexCoord1sv(GLbyte*);
|
||||
extern void __glXDispSwap_TexCoord2dv(GLbyte*);
|
||||
extern void __glXDispSwap_TexCoord2fv(GLbyte*);
|
||||
extern void __glXDispSwap_TexCoord2iv(GLbyte*);
|
||||
extern void __glXDispSwap_TexCoord2sv(GLbyte*);
|
||||
extern void __glXDispSwap_TexCoord3dv(GLbyte*);
|
||||
extern void __glXDispSwap_TexCoord3fv(GLbyte*);
|
||||
extern void __glXDispSwap_TexCoord3iv(GLbyte*);
|
||||
extern void __glXDispSwap_TexCoord3sv(GLbyte*);
|
||||
extern void __glXDispSwap_TexCoord4dv(GLbyte*);
|
||||
extern void __glXDispSwap_TexCoord4fv(GLbyte*);
|
||||
extern void __glXDispSwap_TexCoord4iv(GLbyte*);
|
||||
extern void __glXDispSwap_TexCoord4sv(GLbyte*);
|
||||
extern void __glXDispSwap_Vertex2dv(GLbyte*);
|
||||
extern void __glXDispSwap_Vertex2fv(GLbyte*);
|
||||
extern void __glXDispSwap_Vertex2iv(GLbyte*);
|
||||
extern void __glXDispSwap_Vertex2sv(GLbyte*);
|
||||
extern void __glXDispSwap_Vertex3dv(GLbyte*);
|
||||
extern void __glXDispSwap_Vertex3fv(GLbyte*);
|
||||
extern void __glXDispSwap_Vertex3iv(GLbyte*);
|
||||
extern void __glXDispSwap_Vertex3sv(GLbyte*);
|
||||
extern void __glXDispSwap_Vertex4dv(GLbyte*);
|
||||
extern void __glXDispSwap_Vertex4fv(GLbyte*);
|
||||
extern void __glXDispSwap_Vertex4iv(GLbyte*);
|
||||
extern void __glXDispSwap_Vertex4sv(GLbyte*);
|
||||
extern void __glXDispSwap_ClipPlane(GLbyte*);
|
||||
extern void __glXDispSwap_ColorMaterial(GLbyte*);
|
||||
extern void __glXDispSwap_CullFace(GLbyte*);
|
||||
extern void __glXDispSwap_Fogf(GLbyte*);
|
||||
extern void __glXDispSwap_Fogfv(GLbyte*);
|
||||
extern void __glXDispSwap_Fogi(GLbyte*);
|
||||
extern void __glXDispSwap_Fogiv(GLbyte*);
|
||||
extern void __glXDispSwap_FrontFace(GLbyte*);
|
||||
extern void __glXDispSwap_Hint(GLbyte*);
|
||||
extern void __glXDispSwap_Lightf(GLbyte*);
|
||||
extern void __glXDispSwap_Lightfv(GLbyte*);
|
||||
extern void __glXDispSwap_Lighti(GLbyte*);
|
||||
extern void __glXDispSwap_Lightiv(GLbyte*);
|
||||
extern void __glXDispSwap_LightModelf(GLbyte*);
|
||||
extern void __glXDispSwap_LightModelfv(GLbyte*);
|
||||
extern void __glXDispSwap_LightModeli(GLbyte*);
|
||||
extern void __glXDispSwap_LightModeliv(GLbyte*);
|
||||
extern void __glXDispSwap_LineStipple(GLbyte*);
|
||||
extern void __glXDispSwap_LineWidth(GLbyte*);
|
||||
extern void __glXDispSwap_Materialf(GLbyte*);
|
||||
extern void __glXDispSwap_Materialfv(GLbyte*);
|
||||
extern void __glXDispSwap_Materiali(GLbyte*);
|
||||
extern void __glXDispSwap_Materialiv(GLbyte*);
|
||||
extern void __glXDispSwap_PointSize(GLbyte*);
|
||||
extern void __glXDispSwap_PolygonMode(GLbyte*);
|
||||
extern void __glXDispSwap_PolygonStipple(GLbyte*);
|
||||
extern void __glXDispSwap_Scissor(GLbyte*);
|
||||
extern void __glXDispSwap_ShadeModel(GLbyte*);
|
||||
extern void __glXDispSwap_TexParameterf(GLbyte*);
|
||||
extern void __glXDispSwap_TexParameterfv(GLbyte*);
|
||||
extern void __glXDispSwap_TexParameteri(GLbyte*);
|
||||
extern void __glXDispSwap_TexParameteriv(GLbyte*);
|
||||
extern void __glXDispSwap_TexImage1D(GLbyte*);
|
||||
extern void __glXDispSwap_TexImage2D(GLbyte*);
|
||||
extern void __glXDispSwap_TexEnvf(GLbyte*);
|
||||
extern void __glXDispSwap_TexEnvfv(GLbyte*);
|
||||
extern void __glXDispSwap_TexEnvi(GLbyte*);
|
||||
extern void __glXDispSwap_TexEnviv(GLbyte*);
|
||||
extern void __glXDispSwap_TexGend(GLbyte*);
|
||||
extern void __glXDispSwap_TexGendv(GLbyte*);
|
||||
extern void __glXDispSwap_TexGenf(GLbyte*);
|
||||
extern void __glXDispSwap_TexGenfv(GLbyte*);
|
||||
extern void __glXDispSwap_TexGeni(GLbyte*);
|
||||
extern void __glXDispSwap_TexGeniv(GLbyte*);
|
||||
extern void __glXDispSwap_InitNames(GLbyte*);
|
||||
extern void __glXDispSwap_LoadName(GLbyte*);
|
||||
extern void __glXDispSwap_PassThrough(GLbyte*);
|
||||
extern void __glXDispSwap_PopName(GLbyte*);
|
||||
extern void __glXDispSwap_PushName(GLbyte*);
|
||||
extern void __glXDispSwap_DrawBuffer(GLbyte*);
|
||||
extern void __glXDispSwap_Clear(GLbyte*);
|
||||
extern void __glXDispSwap_ClearAccum(GLbyte*);
|
||||
extern void __glXDispSwap_ClearIndex(GLbyte*);
|
||||
extern void __glXDispSwap_ClearColor(GLbyte*);
|
||||
extern void __glXDispSwap_ClearStencil(GLbyte*);
|
||||
extern void __glXDispSwap_ClearDepth(GLbyte*);
|
||||
extern void __glXDispSwap_StencilMask(GLbyte*);
|
||||
extern void __glXDispSwap_ColorMask(GLbyte*);
|
||||
extern void __glXDispSwap_DepthMask(GLbyte*);
|
||||
extern void __glXDispSwap_IndexMask(GLbyte*);
|
||||
extern void __glXDispSwap_Accum(GLbyte*);
|
||||
extern void __glXDispSwap_Disable(GLbyte*);
|
||||
extern void __glXDispSwap_Enable(GLbyte*);
|
||||
extern void __glXDispSwap_PopAttrib(GLbyte*);
|
||||
extern void __glXDispSwap_PushAttrib(GLbyte*);
|
||||
extern void __glXDispSwap_Map1d(GLbyte*);
|
||||
extern void __glXDispSwap_Map1f(GLbyte*);
|
||||
extern void __glXDispSwap_Map2d(GLbyte*);
|
||||
extern void __glXDispSwap_Map2f(GLbyte*);
|
||||
extern void __glXDispSwap_MapGrid1d(GLbyte*);
|
||||
extern void __glXDispSwap_MapGrid1f(GLbyte*);
|
||||
extern void __glXDispSwap_MapGrid2d(GLbyte*);
|
||||
extern void __glXDispSwap_MapGrid2f(GLbyte*);
|
||||
extern void __glXDispSwap_EvalCoord1dv(GLbyte*);
|
||||
extern void __glXDispSwap_EvalCoord1fv(GLbyte*);
|
||||
extern void __glXDispSwap_EvalCoord2dv(GLbyte*);
|
||||
extern void __glXDispSwap_EvalCoord2fv(GLbyte*);
|
||||
extern void __glXDispSwap_EvalMesh1(GLbyte*);
|
||||
extern void __glXDispSwap_EvalPoint1(GLbyte*);
|
||||
extern void __glXDispSwap_EvalMesh2(GLbyte*);
|
||||
extern void __glXDispSwap_EvalPoint2(GLbyte*);
|
||||
extern void __glXDispSwap_AlphaFunc(GLbyte*);
|
||||
extern void __glXDispSwap_BlendFunc(GLbyte*);
|
||||
extern void __glXDispSwap_LogicOp(GLbyte*);
|
||||
extern void __glXDispSwap_StencilFunc(GLbyte*);
|
||||
extern void __glXDispSwap_StencilOp(GLbyte*);
|
||||
extern void __glXDispSwap_DepthFunc(GLbyte*);
|
||||
extern void __glXDispSwap_PixelZoom(GLbyte*);
|
||||
extern void __glXDispSwap_PixelTransferf(GLbyte*);
|
||||
extern void __glXDispSwap_PixelTransferi(GLbyte*);
|
||||
extern void __glXDispSwap_PixelMapfv(GLbyte*);
|
||||
extern void __glXDispSwap_PixelMapuiv(GLbyte*);
|
||||
extern void __glXDispSwap_PixelMapusv(GLbyte*);
|
||||
extern void __glXDispSwap_ReadBuffer(GLbyte*);
|
||||
extern void __glXDispSwap_CopyPixels(GLbyte*);
|
||||
extern void __glXDispSwap_DrawPixels(GLbyte*);
|
||||
extern void __glXDispSwap_DepthRange(GLbyte*);
|
||||
extern void __glXDispSwap_Frustum(GLbyte*);
|
||||
extern void __glXDispSwap_LoadIdentity(GLbyte*);
|
||||
extern void __glXDispSwap_LoadMatrixf(GLbyte*);
|
||||
extern void __glXDispSwap_LoadMatrixd(GLbyte*);
|
||||
extern void __glXDispSwap_MatrixMode(GLbyte*);
|
||||
extern void __glXDispSwap_MultMatrixf(GLbyte*);
|
||||
extern void __glXDispSwap_MultMatrixd(GLbyte*);
|
||||
extern void __glXDispSwap_Ortho(GLbyte*);
|
||||
extern void __glXDispSwap_PopMatrix(GLbyte*);
|
||||
extern void __glXDispSwap_PushMatrix(GLbyte*);
|
||||
extern void __glXDispSwap_Rotated(GLbyte*);
|
||||
extern void __glXDispSwap_Rotatef(GLbyte*);
|
||||
extern void __glXDispSwap_Scaled(GLbyte*);
|
||||
extern void __glXDispSwap_Scalef(GLbyte*);
|
||||
extern void __glXDispSwap_Translated(GLbyte*);
|
||||
extern void __glXDispSwap_Translatef(GLbyte*);
|
||||
extern void __glXDispSwap_Viewport(GLbyte*);
|
||||
extern void __glXDispSwap_PolygonOffset(GLbyte*);
|
||||
extern void __glXDispSwap_DrawArrays(GLbyte*);
|
||||
extern void __glXDispSwap_Indexubv(GLbyte*);
|
||||
extern void __glXDispSwap_ColorSubTable(GLbyte*);
|
||||
extern void __glXDispSwap_CopyColorSubTable(GLbyte*);
|
||||
extern void __glXDispSwap_ActiveTextureARB(GLbyte*);
|
||||
extern void __glXDispSwap_MultiTexCoord1dvARB(GLbyte*);
|
||||
extern void __glXDispSwap_MultiTexCoord1fvARB(GLbyte*);
|
||||
extern void __glXDispSwap_MultiTexCoord1ivARB(GLbyte*);
|
||||
extern void __glXDispSwap_MultiTexCoord1svARB(GLbyte*);
|
||||
extern void __glXDispSwap_MultiTexCoord2dvARB(GLbyte*);
|
||||
extern void __glXDispSwap_MultiTexCoord2fvARB(GLbyte*);
|
||||
extern void __glXDispSwap_MultiTexCoord2ivARB(GLbyte*);
|
||||
extern void __glXDispSwap_MultiTexCoord2svARB(GLbyte*);
|
||||
extern void __glXDispSwap_MultiTexCoord3dvARB(GLbyte*);
|
||||
extern void __glXDispSwap_MultiTexCoord3fvARB(GLbyte*);
|
||||
extern void __glXDispSwap_MultiTexCoord3ivARB(GLbyte*);
|
||||
extern void __glXDispSwap_MultiTexCoord3svARB(GLbyte*);
|
||||
extern void __glXDispSwap_MultiTexCoord4dvARB(GLbyte*);
|
||||
extern void __glXDispSwap_MultiTexCoord4fvARB(GLbyte*);
|
||||
extern void __glXDispSwap_MultiTexCoord4ivARB(GLbyte*);
|
||||
extern void __glXDispSwap_MultiTexCoord4svARB(GLbyte*);
|
||||
extern void __glXDispSwap_SampleCoverageARB(GLbyte *);
|
||||
extern void __glXDispSwap_WindowPos3fARB(GLbyte *);
|
||||
|
||||
#define __GLX_MIN_GLXCMD_OPCODE 1
|
||||
#define __GLX_MAX_GLXCMD_OPCODE 20
|
||||
#define __GLX_MIN_RENDER_OPCODE 1
|
||||
/*#define __GLX_MAX_RENDER_OPCODE 213*/
|
||||
#define __GLX_MAX_RENDER_OPCODE 230
|
||||
#define __GLX_MIN_SINGLE_OPCODE 1
|
||||
#define __GLX_MAX_SINGLE_OPCODE 159
|
||||
#define __GLX_SINGLE_TABLE_SIZE 160
|
||||
/*#define __GLX_RENDER_TABLE_SIZE 214*/
|
||||
#define __GLX_RENDER_TABLE_SIZE 231
|
||||
extern __GLXdispatchRenderProcPtr __glXRenderTable[__GLX_RENDER_TABLE_SIZE];
|
||||
extern __GLXdispatchSingleProcPtr __glXSingleTable[__GLX_SINGLE_TABLE_SIZE];
|
||||
extern __GLXdispatchRenderProcPtr __glXSwapRenderTable[__GLX_RENDER_TABLE_SIZE];
|
||||
extern __GLXdispatchSingleProcPtr __glXSwapSingleTable[__GLX_SINGLE_TABLE_SIZE];
|
||||
#endif /* _GLX_g_disptab_h_ */
|
||||
4446
nx-X11/programs/Xserver/GL/glx/g_disptab_EXT.c
Normal file
4446
nx-X11/programs/Xserver/GL/glx/g_disptab_EXT.c
Normal file
File diff suppressed because it is too large
Load Diff
158
nx-X11/programs/Xserver/GL/glx/g_disptab_EXT.h
Normal file
158
nx-X11/programs/Xserver/GL/glx/g_disptab_EXT.h
Normal file
@@ -0,0 +1,158 @@
|
||||
/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED */
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#ifndef _GLX_g_disptab_EXT_h_
|
||||
#define _GLX_g_disptab_EXT_h_
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
** Additional Notice Provisions: This software was created using the
|
||||
** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
|
||||
** not been independently verified as being compliant with the OpenGL(R)
|
||||
** version 1.2.1 Specification.
|
||||
*/
|
||||
|
||||
extern int __glXDisp_AreTexturesResidentEXT(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_DeleteTexturesEXT(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_GenTexturesEXT(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDisp_IsTextureEXT(__GLXclientState*, GLbyte*);
|
||||
|
||||
extern void __glXDisp_ColorTable(GLbyte*);
|
||||
extern void __glXDisp_ColorTableParameterfv(GLbyte*);
|
||||
extern void __glXDisp_ColorTableParameteriv(GLbyte*);
|
||||
extern void __glXDisp_CopyColorTable(GLbyte*);
|
||||
extern void __glXDisp_BlendColor(GLbyte*);
|
||||
extern void __glXDisp_BlendEquation(GLbyte*);
|
||||
extern void __glXDisp_TexSubImage1D(GLbyte*);
|
||||
extern void __glXDisp_TexSubImage2D(GLbyte*);
|
||||
extern void __glXDisp_ConvolutionFilter1D(GLbyte*);
|
||||
extern void __glXDisp_ConvolutionFilter2D(GLbyte*);
|
||||
extern void __glXDisp_ConvolutionParameterf(GLbyte*);
|
||||
extern void __glXDisp_ConvolutionParameterfv(GLbyte*);
|
||||
extern void __glXDisp_ConvolutionParameteri(GLbyte*);
|
||||
extern void __glXDisp_ConvolutionParameteriv(GLbyte*);
|
||||
extern void __glXDisp_CopyConvolutionFilter1D(GLbyte*);
|
||||
extern void __glXDisp_CopyConvolutionFilter2D(GLbyte*);
|
||||
extern void __glXDisp_SeparableFilter2D(GLbyte*);
|
||||
extern void __glXDisp_Histogram(GLbyte*);
|
||||
extern void __glXDisp_Minmax(GLbyte*);
|
||||
extern void __glXDisp_ResetHistogram(GLbyte*);
|
||||
extern void __glXDisp_ResetMinmax(GLbyte*);
|
||||
extern void __glXDisp_TexImage3D(GLbyte*);
|
||||
extern void __glXDisp_TexSubImage3D(GLbyte*);
|
||||
extern void __glXDisp_DrawArraysEXT(GLbyte*);
|
||||
extern void __glXDisp_BindTexture(GLbyte*);
|
||||
extern void __glXDisp_PrioritizeTextures(GLbyte*);
|
||||
extern void __glXDisp_CopyTexImage1D(GLbyte*);
|
||||
extern void __glXDisp_CopyTexImage2D(GLbyte*);
|
||||
extern void __glXDisp_CopyTexSubImage1D(GLbyte*);
|
||||
extern void __glXDisp_CopyTexSubImage2D(GLbyte*);
|
||||
extern void __glXDisp_CopyTexSubImage3D(GLbyte*);
|
||||
extern void __glXDisp_PointParameterfARB(GLbyte*);
|
||||
extern void __glXDisp_PointParameterfvARB(GLbyte*);
|
||||
|
||||
extern void __glXDisp_FogCoordfv(GLbyte *);
|
||||
extern void __glXDisp_FogCoorddv(GLbyte *);
|
||||
extern void __glXDispSwap_FogCoordfv(GLbyte *);
|
||||
extern void __glXDispSwap_FogCoorddv(GLbyte *);
|
||||
|
||||
extern void __glXDisp_SecondaryColor3bv(GLbyte *);
|
||||
extern void __glXDisp_SecondaryColor3sv(GLbyte *);
|
||||
extern void __glXDisp_SecondaryColor3iv(GLbyte *);
|
||||
extern void __glXDisp_SecondaryColor3ubv(GLbyte *);
|
||||
extern void __glXDisp_SecondaryColor3usv(GLbyte *);
|
||||
extern void __glXDisp_SecondaryColor3uiv(GLbyte *);
|
||||
extern void __glXDisp_SecondaryColor3fv(GLbyte *);
|
||||
extern void __glXDisp_SecondaryColor3dv(GLbyte *);
|
||||
extern void __glXDispSwap_SecondaryColor3bv(GLbyte *);
|
||||
extern void __glXDispSwap_SecondaryColor3sv(GLbyte *);
|
||||
extern void __glXDispSwap_SecondaryColor3iv(GLbyte *);
|
||||
extern void __glXDispSwap_SecondaryColor3ubv(GLbyte *);
|
||||
extern void __glXDispSwap_SecondaryColor3usv(GLbyte *);
|
||||
extern void __glXDispSwap_SecondaryColor3uiv(GLbyte *);
|
||||
extern void __glXDispSwap_SecondaryColor3fv(GLbyte *);
|
||||
extern void __glXDispSwap_SecondaryColor3dv(GLbyte *);
|
||||
|
||||
extern void __glXDisp_BlendFuncSeparate(GLbyte *);
|
||||
extern void __glXDispSwap_BlendFuncSeparate(GLbyte *);
|
||||
|
||||
extern void __glXDisp_PointParameteriNV(GLbyte *);
|
||||
extern void __glXDisp_PointParameterivNV(GLbyte *);
|
||||
extern void __glXDispSwap_PointParameteriNV(GLbyte *);
|
||||
extern void __glXDispSwap_PointParameterivNV(GLbyte *);
|
||||
|
||||
extern void __glXDisp_ActiveStencilFaceEXT(GLbyte*);
|
||||
|
||||
extern int __glXDispSwap_AreTexturesResidentEXT(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_DeleteTexturesEXT(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_GenTexturesEXT(__GLXclientState*, GLbyte*);
|
||||
extern int __glXDispSwap_IsTextureEXT(__GLXclientState*, GLbyte*);
|
||||
|
||||
extern void __glXDispSwap_ColorTable(GLbyte*);
|
||||
extern void __glXDispSwap_ColorTableParameterfv(GLbyte*);
|
||||
extern void __glXDispSwap_ColorTableParameteriv(GLbyte*);
|
||||
extern void __glXDispSwap_CopyColorTable(GLbyte*);
|
||||
extern void __glXDispSwap_BlendColor(GLbyte*);
|
||||
extern void __glXDispSwap_BlendEquation(GLbyte*);
|
||||
extern void __glXDispSwap_TexSubImage1D(GLbyte*);
|
||||
extern void __glXDispSwap_TexSubImage2D(GLbyte*);
|
||||
extern void __glXDispSwap_ConvolutionFilter1D(GLbyte*);
|
||||
extern void __glXDispSwap_ConvolutionFilter2D(GLbyte*);
|
||||
extern void __glXDispSwap_ConvolutionParameterf(GLbyte*);
|
||||
extern void __glXDispSwap_ConvolutionParameterfv(GLbyte*);
|
||||
extern void __glXDispSwap_ConvolutionParameteri(GLbyte*);
|
||||
extern void __glXDispSwap_ConvolutionParameteriv(GLbyte*);
|
||||
extern void __glXDispSwap_CopyConvolutionFilter1D(GLbyte*);
|
||||
extern void __glXDispSwap_CopyConvolutionFilter2D(GLbyte*);
|
||||
extern void __glXDispSwap_SeparableFilter2D(GLbyte*);
|
||||
extern void __glXDispSwap_Histogram(GLbyte*);
|
||||
extern void __glXDispSwap_Minmax(GLbyte*);
|
||||
extern void __glXDispSwap_ResetHistogram(GLbyte*);
|
||||
extern void __glXDispSwap_ResetMinmax(GLbyte*);
|
||||
extern void __glXDispSwap_TexImage3D(GLbyte*);
|
||||
extern void __glXDispSwap_TexSubImage3D(GLbyte*);
|
||||
extern void __glXDispSwap_DrawArraysEXT(GLbyte*);
|
||||
extern void __glXDispSwap_BindTexture(GLbyte*);
|
||||
extern void __glXDispSwap_PrioritizeTextures(GLbyte*);
|
||||
extern void __glXDispSwap_CopyTexImage1D(GLbyte*);
|
||||
extern void __glXDispSwap_CopyTexImage2D(GLbyte*);
|
||||
extern void __glXDispSwap_CopyTexSubImage1D(GLbyte*);
|
||||
extern void __glXDispSwap_CopyTexSubImage2D(GLbyte*);
|
||||
extern void __glXDispSwap_CopyTexSubImage3D(GLbyte*);
|
||||
extern void __glXDispSwap_PointParameterfARB(GLbyte*);
|
||||
extern void __glXDispSwap_PointParameterfvARB(GLbyte*);
|
||||
extern void __glXDispSwap_ActiveStencilFaceEXT(GLbyte*);
|
||||
|
||||
#define __GLX_MIN_RENDER_OPCODE_EXT 2053
|
||||
#define __GLX_MAX_RENDER_OPCODE_EXT 4222
|
||||
#define __GLX_MIN_VENDPRIV_OPCODE_EXT 11
|
||||
#define __GLX_MAX_VENDPRIV_OPCODE_EXT 14
|
||||
#define __GLX_VENDPRIV_TABLE_SIZE_EXT (__GLX_MAX_VENDPRIV_OPCODE_EXT - __GLX_MIN_VENDPRIV_OPCODE_EXT + 1)
|
||||
#define __GLX_RENDER_TABLE_SIZE_EXT (__GLX_MAX_RENDER_OPCODE_EXT - __GLX_MIN_RENDER_OPCODE_EXT + 1)
|
||||
extern __GLXdispatchRenderProcPtr __glXRenderTable_EXT[__GLX_RENDER_TABLE_SIZE_EXT];
|
||||
extern __GLXdispatchVendorPrivProcPtr __glXVendorPrivTable_EXT[__GLX_VENDPRIV_TABLE_SIZE_EXT];
|
||||
extern __GLXdispatchRenderProcPtr __glXSwapRenderTable_EXT[__GLX_RENDER_TABLE_SIZE_EXT];
|
||||
extern __GLXdispatchVendorPrivProcPtr __glXSwapVendorPrivTable_EXT[__GLX_VENDPRIV_TABLE_SIZE_EXT];
|
||||
#endif /* _GLX_g_disptab_EXT_h_ */
|
||||
2280
nx-X11/programs/Xserver/GL/glx/g_render.c
Normal file
2280
nx-X11/programs/Xserver/GL/glx/g_render.c
Normal file
File diff suppressed because it is too large
Load Diff
3385
nx-X11/programs/Xserver/GL/glx/g_renderswap.c
Normal file
3385
nx-X11/programs/Xserver/GL/glx/g_renderswap.c
Normal file
File diff suppressed because it is too large
Load Diff
1785
nx-X11/programs/Xserver/GL/glx/g_single.c
Normal file
1785
nx-X11/programs/Xserver/GL/glx/g_single.c
Normal file
File diff suppressed because it is too large
Load Diff
2206
nx-X11/programs/Xserver/GL/glx/g_singleswap.c
Normal file
2206
nx-X11/programs/Xserver/GL/glx/g_singleswap.c
Normal file
File diff suppressed because it is too large
Load Diff
74
nx-X11/programs/Xserver/GL/glx/global.c
Normal file
74
nx-X11/programs/Xserver/GL/glx/global.c
Normal file
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
** Additional Notice Provisions: The application programming interfaces
|
||||
** established by SGI in conjunction with the Original Code are The
|
||||
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
|
||||
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
|
||||
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
|
||||
** Window System(R) (Version 1.3), released October 19, 1998. This software
|
||||
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include "glxserver.h"
|
||||
|
||||
/*
|
||||
** The last context used by the server. It is the context that is current
|
||||
** from the server's perspective.
|
||||
*/
|
||||
__GLXcontext *__glXLastContext;
|
||||
|
||||
/*
|
||||
** X resources.
|
||||
*/
|
||||
RESTYPE __glXContextRes;
|
||||
RESTYPE __glXClientRes;
|
||||
RESTYPE __glXPixmapRes;
|
||||
RESTYPE __glXSwapBarrierRes;
|
||||
|
||||
/*
|
||||
** Error codes with the extension error base already added in.
|
||||
*/
|
||||
int __glXBadContext, __glXBadContextState, __glXBadDrawable, __glXBadPixmap;
|
||||
int __glXBadContextTag, __glXBadCurrentWindow;
|
||||
int __glXBadRenderRequest, __glXBadLargeRequest;
|
||||
int __glXUnsupportedPrivateRequest;
|
||||
|
||||
/*
|
||||
** Reply for most singles.
|
||||
*/
|
||||
xGLXSingleReply __glXReply;
|
||||
|
||||
/*
|
||||
** A set of state for each client. The 0th one is unused because client
|
||||
** indices start at 1, not 0.
|
||||
*/
|
||||
__GLXclientState *__glXClients[MAXCLIENTS+1];
|
||||
|
||||
295
nx-X11/programs/Xserver/GL/glx/glxbuf.c
Normal file
295
nx-X11/programs/Xserver/GL/glx/glxbuf.c
Normal file
@@ -0,0 +1,295 @@
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
** Additional Notice Provisions: The application programming interfaces
|
||||
** established by SGI in conjunction with the Original Code are The
|
||||
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
|
||||
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
|
||||
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
|
||||
** Window System(R) (Version 1.3), released October 19, 1998. This software
|
||||
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include "glxserver.h"
|
||||
#include "glxutil.h"
|
||||
#include "glxbuf.h"
|
||||
#include "glxfb.h"
|
||||
#include "glxmem.h"
|
||||
#include "glxpix.h"
|
||||
|
||||
void
|
||||
__glXFBInitDrawable(__GLXdrawablePrivate *glxPriv, __GLcontextModes *modes)
|
||||
{
|
||||
__GLdrawablePrivate *glPriv;
|
||||
GLint rgbBits;
|
||||
GLint accumBits;
|
||||
|
||||
glPriv = &glxPriv->glPriv;
|
||||
rgbBits = modes->rgbBits;
|
||||
accumBits = modes->accumRedBits + modes->accumGreenBits +
|
||||
modes->accumBlueBits + modes->accumAlphaBits;
|
||||
|
||||
#if defined(__GL_ALIGNED_BUFFERS)
|
||||
/* initialize pixel alignments (for more details see context.h) */
|
||||
glPriv->xAlignment = 1;
|
||||
glPriv->yAlignment = 1;
|
||||
#endif
|
||||
|
||||
glxPriv->swapBuffers = __glXFBMemSwapBuffers;
|
||||
|
||||
glPriv->yInverted = GL_TRUE; /* Y is upside-down */
|
||||
|
||||
if (modes->doubleBufferMode) {
|
||||
if (modes->colorIndexMode) {
|
||||
__glXInitFB(&glPriv->frontBuffer, glPriv, modes->indexBits);
|
||||
__glXInitMem(&glPriv->backBuffer, glPriv, modes->indexBits);
|
||||
} else {
|
||||
__glXInitFB(&glPriv->frontBuffer, glPriv, rgbBits);
|
||||
__glXInitMem(&glPriv->backBuffer, glPriv, rgbBits);
|
||||
}
|
||||
} else {
|
||||
if (modes->colorIndexMode) {
|
||||
__glXInitFB(&glPriv->frontBuffer, glPriv, modes->indexBits);
|
||||
} else {
|
||||
__glXInitFB(&glPriv->frontBuffer, glPriv, rgbBits);
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(__GL_MAX_AUXBUFFERS) && (__GL_MAX_AUXBUFFERS > 0)
|
||||
if (modes->maxAuxBuffers > 0) {
|
||||
GLint i;
|
||||
|
||||
for (i=0; i < modes->maxAuxBuffers; i++) {
|
||||
if (modes->colorIndexMode) {
|
||||
__glXInitMem(&glPriv->auxBuffer[i], glPriv, modes->indexBits);
|
||||
} else {
|
||||
__glXInitMem(&glPriv->auxBuffer[i], glPriv, rgbBits);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (modes->haveAccumBuffer) {
|
||||
__glXInitMem(&glPriv->accumBuffer, glPriv, accumBits);
|
||||
}
|
||||
if (modes->haveDepthBuffer) {
|
||||
__glXInitMem(&glPriv->depthBuffer, glPriv, modes->depthBits);
|
||||
}
|
||||
if (modes->haveStencilBuffer) {
|
||||
__glXInitMem(&glPriv->stencilBuffer, glPriv, modes->stencilBits);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
__glXPixInitDrawable(__GLXdrawablePrivate *glxPriv, __GLcontextModes *modes)
|
||||
{
|
||||
__GLdrawablePrivate *glPriv;
|
||||
GLint rgbBits;
|
||||
GLint accumBits;
|
||||
|
||||
assert(glxPriv->pGlxPixmap);
|
||||
|
||||
glPriv = &glxPriv->glPriv;
|
||||
rgbBits = modes->rgbBits;
|
||||
accumBits = modes->accumRedBits + modes->accumGreenBits +
|
||||
modes->accumBlueBits + modes->accumAlphaBits;
|
||||
|
||||
#if defined(__GL_ALIGNED_BUFFERS)
|
||||
/* initialize pixel alignments (for more details see context.h) */
|
||||
glPriv->xAlignment = 1;
|
||||
glPriv->yAlignment = 1;
|
||||
#endif
|
||||
|
||||
glxPriv->swapBuffers = (GLboolean (*)(__GLXdrawablePrivate *))__glXNop;
|
||||
|
||||
glPriv->yInverted = GL_FALSE;
|
||||
|
||||
if (modes->doubleBufferMode) {
|
||||
if (modes->colorIndexMode) {
|
||||
__glXInitPix(&glPriv->frontBuffer, glPriv, rgbBits,
|
||||
glxPriv->drawId, glxPriv->pGlxPixmap);
|
||||
__glXInitMem(&glPriv->backBuffer, glPriv, modes->indexBits);
|
||||
} else {
|
||||
__glXInitPix(&glPriv->frontBuffer, glPriv, rgbBits,
|
||||
glxPriv->drawId, glxPriv->pGlxPixmap);
|
||||
__glXInitMem(&glPriv->backBuffer, glPriv, rgbBits);
|
||||
}
|
||||
} else {
|
||||
if (modes->colorIndexMode) {
|
||||
__glXInitPix(&glPriv->frontBuffer, glPriv, rgbBits,
|
||||
glxPriv->drawId, glxPriv->pGlxPixmap);
|
||||
} else {
|
||||
__glXInitPix(&glPriv->frontBuffer, glPriv, rgbBits,
|
||||
glxPriv->drawId, glxPriv->pGlxPixmap);
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(__GL_MAX_AUXBUFFERS) && (__GL_MAX_AUXBUFFERS > 0)
|
||||
if (modes->maxAuxBuffers > 0) {
|
||||
GLint i;
|
||||
|
||||
for (i=0; i < modes->maxAuxBuffers; i++) {
|
||||
if (modes->colorIndexMode) {
|
||||
__glXInitMem(&glPriv->auxBuffer[i], glPriv, modes->indexBits);
|
||||
} else {
|
||||
__glXInitMem(&glPriv->auxBuffer[i], glPriv, rgbBits);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (modes->haveAccumBuffer) {
|
||||
__glXInitMem(&glPriv->accumBuffer, glPriv, accumBits);
|
||||
}
|
||||
if (modes->haveDepthBuffer) {
|
||||
__glXInitMem(&glPriv->depthBuffer, glPriv, modes->depthBits);
|
||||
}
|
||||
if (modes->haveStencilBuffer) {
|
||||
__glXInitMem(&glPriv->stencilBuffer, glPriv, modes->stencilBits);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#define __GLX_SET_ACCEL_BUFFER_MASK(bm) \
|
||||
if (status == GL_FALSE) return GL_FALSE; \
|
||||
if (status == GL_TRUE) accelBufferMask |= bm; \
|
||||
/* for __GL_BUFFER_FALLBACK don't do anything */
|
||||
|
||||
GLboolean
|
||||
__glXResizeBuffers(__GLdrawablePrivate *glPriv,
|
||||
GLint x, GLint y, GLuint width, GLuint height)
|
||||
{
|
||||
__GLcontextModes *modes;
|
||||
__GLdrawableRegion *glRegion;
|
||||
GLboolean status;
|
||||
GLuint accelBufferMask;
|
||||
|
||||
modes = glPriv->modes;
|
||||
accelBufferMask = 0;
|
||||
|
||||
status = (*glPriv->frontBuffer.resize)(&glPriv->frontBuffer,
|
||||
x, y, width, height, glPriv,
|
||||
__GL_FRONT_BUFFER_MASK);
|
||||
__GLX_SET_ACCEL_BUFFER_MASK(__GL_FRONT_BUFFER_MASK);
|
||||
|
||||
if (modes->doubleBufferMode) {
|
||||
status = (*glPriv->backBuffer.resize)(&glPriv->backBuffer,
|
||||
x, y, width, height, glPriv,
|
||||
__GL_BACK_BUFFER_MASK);
|
||||
__GLX_SET_ACCEL_BUFFER_MASK(__GL_BACK_BUFFER_MASK);
|
||||
}
|
||||
|
||||
#if defined(__GL_MAX_AUXBUFFERS) && (__GL_MAX_AUXBUFFERS > 0)
|
||||
if (modes->maxAuxBuffers > 0) {
|
||||
GLint i;
|
||||
|
||||
for (i=0; i < modes->maxAuxBuffers; i++) {
|
||||
status = (*glPriv->auxBuffers[i].resize)(&glPriv->auxBuffer[i],
|
||||
x, y, width, height,
|
||||
glPriv,
|
||||
__GL_AUX_BUFFER_MASK(i));
|
||||
__GLX_SET_ACCEL_BUFFER_MASK(__GL_AUX_BUFFER_MASK(i));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (modes->haveAccumBuffer) {
|
||||
status = (*glPriv->accumBuffer.resize)(&glPriv->accumBuffer,
|
||||
x, y, width, height, glPriv,
|
||||
__GL_ACCUM_BUFFER_MASK);
|
||||
__GLX_SET_ACCEL_BUFFER_MASK(__GL_ACCUM_BUFFER_MASK);
|
||||
}
|
||||
|
||||
if (modes->haveDepthBuffer) {
|
||||
status = (*glPriv->depthBuffer.resize)(&glPriv->depthBuffer,
|
||||
x, y, width, height, glPriv,
|
||||
__GL_DEPTH_BUFFER_MASK);
|
||||
__GLX_SET_ACCEL_BUFFER_MASK(__GL_DEPTH_BUFFER_MASK);
|
||||
}
|
||||
|
||||
if (modes->haveStencilBuffer) {
|
||||
status = (*glPriv->stencilBuffer.resize)(&glPriv->stencilBuffer,
|
||||
x, y, width, height, glPriv,
|
||||
__GL_STENCIL_BUFFER_MASK);
|
||||
__GLX_SET_ACCEL_BUFFER_MASK(__GL_STENCIL_BUFFER_MASK);
|
||||
}
|
||||
|
||||
glPriv->accelBufferMask = accelBufferMask;
|
||||
|
||||
/* finally, update the ownership region */
|
||||
glRegion = &glPriv->ownershipRegion;
|
||||
glRegion->numRects = 1;
|
||||
glRegion->rects[0].x0 = 0;
|
||||
glRegion->rects[0].y0 = 0;
|
||||
glRegion->rects[0].x1 = width;
|
||||
glRegion->rects[0].y1 = height;
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
__glXFreeBuffers(__GLXdrawablePrivate *glxPriv)
|
||||
{
|
||||
__GLdrawablePrivate *glPriv = &glxPriv->glPriv;
|
||||
#if defined(__GL_MAX_AUXBUFFERS) && (__GL_MAX_AUXBUFFERS > 0)
|
||||
__GLcontextModes *modes = glPriv->modes;
|
||||
#endif
|
||||
|
||||
if (glPriv->frontBuffer.free) {
|
||||
(*glPriv->frontBuffer.free)(&glPriv->frontBuffer, glPriv);
|
||||
}
|
||||
if (glPriv->backBuffer.free) {
|
||||
(*glPriv->backBuffer.free)(&glPriv->backBuffer, glPriv);
|
||||
}
|
||||
|
||||
#if defined(__GL_MAX_AUXBUFFERS) && (__GL_MAX_AUXBUFFERS > 0)
|
||||
if (modes->maxAuxBuffers > 0) {
|
||||
GLint i;
|
||||
|
||||
for (i=0; i < modes->maxAuxBuffers; i++) {
|
||||
if (glPriv->auxBuffer[i].free) {
|
||||
(*glPriv->auxBuffer[i].free)(&glPriv->auxBuffer[i], glPriv);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (glPriv->accumBuffer.free) {
|
||||
(*glPriv->accumBuffer.free)(&glPriv->accumBuffer, glPriv);
|
||||
}
|
||||
|
||||
if (glPriv->depthBuffer.free) {
|
||||
(*glPriv->depthBuffer.free)(&glPriv->depthBuffer, glPriv);
|
||||
}
|
||||
|
||||
if (glPriv->stencilBuffer.free) {
|
||||
(*glPriv->stencilBuffer.free)(&glPriv->stencilBuffer, glPriv);
|
||||
}
|
||||
}
|
||||
56
nx-X11/programs/Xserver/GL/glx/glxbuf.h
Normal file
56
nx-X11/programs/Xserver/GL/glx/glxbuf.h
Normal file
@@ -0,0 +1,56 @@
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#ifndef _glxbuf_h_
|
||||
#define _glxbuf_h_
|
||||
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
** Additional Notice Provisions: The application programming interfaces
|
||||
** established by SGI in conjunction with the Original Code are The
|
||||
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
|
||||
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
|
||||
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
|
||||
** Window System(R) (Version 1.3), released October 19, 1998. This software
|
||||
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
*/
|
||||
|
||||
extern void __glXFBInitDrawable(__GLXdrawablePrivate *glxPriv,
|
||||
__GLcontextModes *modes);
|
||||
extern void __glXPixInitDrawable(__GLXdrawablePrivate *glxPriv,
|
||||
__GLcontextModes *modes);
|
||||
|
||||
extern GLboolean __glXResizeBuffers(__GLdrawablePrivate *glPriv,
|
||||
GLint x, GLint y,
|
||||
GLuint width, GLuint height);
|
||||
|
||||
extern void __glXFreeBuffers(__GLXdrawablePrivate *glxPriv);
|
||||
extern void __glXUpdatePalette(__GLXdrawablePrivate *);
|
||||
|
||||
#endif /* _glxbuf_h_ */
|
||||
|
||||
2174
nx-X11/programs/Xserver/GL/glx/glxcmds.c
Normal file
2174
nx-X11/programs/Xserver/GL/glx/glxcmds.c
Normal file
File diff suppressed because it is too large
Load Diff
888
nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c
Normal file
888
nx-X11/programs/Xserver/GL/glx/glxcmdsswap.c
Normal file
@@ -0,0 +1,888 @@
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
** Additional Notice Provisions: The application programming interfaces
|
||||
** established by SGI in conjunction with the Original Code are The
|
||||
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
|
||||
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
|
||||
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
|
||||
** Window System(R) (Version 1.3), released October 19, 1998. This software
|
||||
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
*/
|
||||
|
||||
#define FONT_PCF
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include "glxserver.h"
|
||||
#include "glxutil.h"
|
||||
#include <GL/glxtokens.h>
|
||||
#include <unpack.h>
|
||||
#include <g_disptab.h>
|
||||
#include <g_disptab_EXT.h>
|
||||
#include <pixmapstr.h>
|
||||
#include <windowstr.h>
|
||||
#include "glxext.h"
|
||||
|
||||
static int __glXSwapGetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc);
|
||||
static int __glXSwapCreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc);
|
||||
static int __glXSwapCreateGLXPixmapWithConfigSGIX(__GLXclientState *cl, GLbyte *pc);
|
||||
static int __glXSwapMakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc);
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
/*
|
||||
** Byteswapping versions of GLX commands. In most cases they just swap
|
||||
** the incoming arguments and then call the unswapped routine. For commands
|
||||
** that have replies, a separate swapping routine for the reply is provided;
|
||||
** it is called at the end of the unswapped routine.
|
||||
*/
|
||||
|
||||
int __glXSwapCreateContext(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
xGLXCreateContextReq *req = (xGLXCreateContextReq *) pc;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
__GLX_SWAP_SHORT(&req->length);
|
||||
__GLX_SWAP_INT(&req->context);
|
||||
__GLX_SWAP_INT(&req->visual);
|
||||
__GLX_SWAP_INT(&req->screen);
|
||||
__GLX_SWAP_INT(&req->shareList);
|
||||
|
||||
return DoCreateContext( cl, req->context, req->shareList, req->visual,
|
||||
req->screen, req->isDirect );
|
||||
}
|
||||
|
||||
int __glXSwapCreateNewContext(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
xGLXCreateNewContextReq *req = (xGLXCreateNewContextReq *) pc;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
__GLX_SWAP_SHORT(&req->length);
|
||||
__GLX_SWAP_INT(&req->context);
|
||||
__GLX_SWAP_INT(&req->fbconfig);
|
||||
__GLX_SWAP_INT(&req->screen);
|
||||
__GLX_SWAP_INT(&req->renderType);
|
||||
__GLX_SWAP_INT(&req->shareList);
|
||||
|
||||
return DoCreateContext( cl, req->context, req->shareList, req->fbconfig,
|
||||
req->screen, req->isDirect );
|
||||
}
|
||||
|
||||
int __glXSwapCreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
xGLXCreateContextWithConfigSGIXReq *req =
|
||||
(xGLXCreateContextWithConfigSGIXReq *) pc;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
__GLX_SWAP_SHORT(&req->length);
|
||||
__GLX_SWAP_INT(&req->context);
|
||||
__GLX_SWAP_INT(&req->fbconfig);
|
||||
__GLX_SWAP_INT(&req->screen);
|
||||
__GLX_SWAP_INT(&req->renderType);
|
||||
__GLX_SWAP_INT(&req->shareList);
|
||||
|
||||
return DoCreateContext( cl, req->context, req->shareList, req->fbconfig,
|
||||
req->screen, req->isDirect );
|
||||
}
|
||||
|
||||
int __glXSwapDestroyContext(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
xGLXDestroyContextReq *req = (xGLXDestroyContextReq *) pc;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
__GLX_SWAP_SHORT(&req->length);
|
||||
__GLX_SWAP_INT(&req->context);
|
||||
|
||||
return __glXDestroyContext(cl, pc);
|
||||
}
|
||||
|
||||
int __glXSwapMakeCurrent(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) pc;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
__GLX_SWAP_SHORT(&req->length);
|
||||
__GLX_SWAP_INT(&req->drawable);
|
||||
__GLX_SWAP_INT(&req->context);
|
||||
__GLX_SWAP_INT(&req->oldContextTag);
|
||||
|
||||
return DoMakeCurrent( cl, req->drawable, req->drawable,
|
||||
req->context, req->oldContextTag );
|
||||
}
|
||||
|
||||
int __glXSwapMakeContextCurrent(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
xGLXMakeContextCurrentReq *req = (xGLXMakeContextCurrentReq *) pc;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
__GLX_SWAP_SHORT(&req->length);
|
||||
__GLX_SWAP_INT(&req->drawable);
|
||||
__GLX_SWAP_INT(&req->readdrawable);
|
||||
__GLX_SWAP_INT(&req->context);
|
||||
__GLX_SWAP_INT(&req->oldContextTag);
|
||||
|
||||
return DoMakeCurrent( cl, req->drawable, req->readdrawable,
|
||||
req->context, req->oldContextTag );
|
||||
}
|
||||
|
||||
int __glXSwapMakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
xGLXMakeCurrentReadSGIReq *req = (xGLXMakeCurrentReadSGIReq *) pc;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
__GLX_SWAP_SHORT(&req->length);
|
||||
__GLX_SWAP_INT(&req->drawable);
|
||||
__GLX_SWAP_INT(&req->readable);
|
||||
__GLX_SWAP_INT(&req->context);
|
||||
__GLX_SWAP_INT(&req->oldContextTag);
|
||||
|
||||
return DoMakeCurrent( cl, req->drawable, req->readable,
|
||||
req->context, req->oldContextTag );
|
||||
}
|
||||
|
||||
int __glXSwapIsDirect(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
xGLXIsDirectReq *req = (xGLXIsDirectReq *) pc;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
__GLX_SWAP_SHORT(&req->length);
|
||||
__GLX_SWAP_INT(&req->context);
|
||||
|
||||
return __glXIsDirect(cl, pc);
|
||||
}
|
||||
|
||||
int __glXSwapQueryVersion(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) pc;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
__GLX_SWAP_SHORT(&req->length);
|
||||
__GLX_SWAP_INT(&req->majorVersion);
|
||||
__GLX_SWAP_INT(&req->minorVersion);
|
||||
|
||||
return __glXQueryVersion(cl, pc);
|
||||
}
|
||||
|
||||
int __glXSwapWaitGL(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
xGLXWaitGLReq *req = (xGLXWaitGLReq *) pc;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
__GLX_SWAP_SHORT(&req->length);
|
||||
__GLX_SWAP_INT(&req->contextTag);
|
||||
|
||||
return __glXWaitGL(cl, pc);
|
||||
}
|
||||
|
||||
int __glXSwapWaitX(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
xGLXWaitXReq *req = (xGLXWaitXReq *) pc;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
__GLX_SWAP_SHORT(&req->length);
|
||||
__GLX_SWAP_INT(&req->contextTag);
|
||||
|
||||
return __glXWaitX(cl, pc);
|
||||
}
|
||||
|
||||
int __glXSwapCopyContext(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
xGLXCopyContextReq *req = (xGLXCopyContextReq *) pc;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
__GLX_SWAP_SHORT(&req->length);
|
||||
__GLX_SWAP_INT(&req->source);
|
||||
__GLX_SWAP_INT(&req->dest);
|
||||
__GLX_SWAP_INT(&req->mask);
|
||||
|
||||
return __glXCopyContext(cl, pc);
|
||||
}
|
||||
|
||||
int __glXSwapGetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
xGLXGetVisualConfigsReq *req = (xGLXGetVisualConfigsReq *) pc;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
__GLX_SWAP_INT(&req->screen);
|
||||
return DoGetVisualConfigs( cl, req->screen, GL_TRUE );
|
||||
}
|
||||
|
||||
int __glXSwapGetFBConfigs(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
xGLXGetFBConfigsReq *req = (xGLXGetFBConfigsReq *) pc;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
__GLX_SWAP_INT(&req->screen);
|
||||
return DoGetFBConfigs( cl, req->screen, GL_TRUE );
|
||||
}
|
||||
|
||||
int __glXSwapGetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
xGLXGetFBConfigsSGIXReq *req = (xGLXGetFBConfigsSGIXReq *) pc;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
__GLX_SWAP_INT(&req->screen);
|
||||
return DoGetFBConfigs( cl, req->screen, GL_TRUE );
|
||||
}
|
||||
|
||||
int __glXSwapCreateGLXPixmap(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
xGLXCreateGLXPixmapReq *req = (xGLXCreateGLXPixmapReq *) pc;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
__GLX_SWAP_SHORT(&req->length);
|
||||
__GLX_SWAP_INT(&req->screen);
|
||||
__GLX_SWAP_INT(&req->visual);
|
||||
__GLX_SWAP_INT(&req->pixmap);
|
||||
__GLX_SWAP_INT(&req->glxpixmap);
|
||||
|
||||
return DoCreateGLXPixmap( cl, req->visual, req->screen,
|
||||
req->pixmap, req->glxpixmap );
|
||||
}
|
||||
|
||||
int __glXSwapCreatePixmap(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
xGLXCreatePixmapReq *req = (xGLXCreatePixmapReq *) pc;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
__GLX_SWAP_SHORT(&req->length);
|
||||
__GLX_SWAP_INT(&req->screen);
|
||||
__GLX_SWAP_INT(&req->fbconfig);
|
||||
__GLX_SWAP_INT(&req->pixmap);
|
||||
__GLX_SWAP_INT(&req->glxpixmap);
|
||||
|
||||
return DoCreateGLXPixmap( cl, req->fbconfig, req->screen,
|
||||
req->pixmap, req->glxpixmap );
|
||||
}
|
||||
|
||||
int __glXSwapCreateGLXPixmapWithConfigSGIX(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
xGLXCreateGLXPixmapWithConfigSGIXReq *req =
|
||||
(xGLXCreateGLXPixmapWithConfigSGIXReq *) pc;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
__GLX_SWAP_SHORT(&req->length);
|
||||
__GLX_SWAP_INT(&req->screen);
|
||||
__GLX_SWAP_INT(&req->fbconfig);
|
||||
__GLX_SWAP_INT(&req->pixmap);
|
||||
__GLX_SWAP_INT(&req->glxpixmap);
|
||||
|
||||
return DoCreateGLXPixmap( cl, req->fbconfig, req->screen,
|
||||
req->pixmap, req->glxpixmap );
|
||||
}
|
||||
|
||||
int __glXSwapDestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
__GLX_SWAP_SHORT(&req->length);
|
||||
__GLX_SWAP_INT(&req->glxpixmap);
|
||||
|
||||
return __glXDestroyGLXPixmap(cl, pc);
|
||||
}
|
||||
|
||||
int __glXSwapSwapBuffers(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
xGLXSwapBuffersReq *req = (xGLXSwapBuffersReq *) pc;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
__GLX_SWAP_SHORT(&req->length);
|
||||
__GLX_SWAP_INT(&req->contextTag);
|
||||
__GLX_SWAP_INT(&req->drawable);
|
||||
|
||||
return __glXSwapBuffers(cl, pc);
|
||||
}
|
||||
|
||||
int __glXSwapUseXFont(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
xGLXUseXFontReq *req = (xGLXUseXFontReq *) pc;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
__GLX_SWAP_SHORT(&req->length);
|
||||
__GLX_SWAP_INT(&req->contextTag);
|
||||
__GLX_SWAP_INT(&req->font);
|
||||
__GLX_SWAP_INT(&req->first);
|
||||
__GLX_SWAP_INT(&req->count);
|
||||
__GLX_SWAP_INT(&req->listBase);
|
||||
|
||||
return __glXUseXFont(cl, pc);
|
||||
}
|
||||
|
||||
|
||||
int __glXSwapQueryExtensionsString(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
xGLXQueryExtensionsStringReq *req = NULL;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
__GLX_SWAP_SHORT(&req->length);
|
||||
__GLX_SWAP_INT(&req->screen);
|
||||
|
||||
return __glXQueryExtensionsString(cl, pc);
|
||||
}
|
||||
|
||||
int __glXSwapQueryServerString(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
xGLXQueryServerStringReq *req = (xGLXQueryServerStringReq *)pc;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
__GLX_SWAP_SHORT(&req->length);
|
||||
__GLX_SWAP_INT(&req->screen);
|
||||
__GLX_SWAP_INT(&req->name);
|
||||
|
||||
return __glXQueryServerString(cl, pc);
|
||||
}
|
||||
|
||||
int __glXSwapClientInfo(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
xGLXClientInfoReq *req = (xGLXClientInfoReq *)pc;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
__GLX_SWAP_SHORT(&req->length);
|
||||
__GLX_SWAP_INT(&req->major);
|
||||
__GLX_SWAP_INT(&req->minor);
|
||||
__GLX_SWAP_INT(&req->numbytes);
|
||||
|
||||
return __glXClientInfo(cl, pc);
|
||||
}
|
||||
|
||||
int __glXSwapQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
xGLXQueryContextInfoEXTReq *req = (xGLXQueryContextInfoEXTReq *) pc;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
__GLX_SWAP_SHORT(&req->length);
|
||||
__GLX_SWAP_INT(&req->context);
|
||||
|
||||
return __glXQueryContextInfoEXT(cl, pc);
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
/*
|
||||
** Swap replies.
|
||||
*/
|
||||
|
||||
void __glXSwapMakeCurrentReply(ClientPtr client, xGLXMakeCurrentReply *reply)
|
||||
{
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
__GLX_SWAP_SHORT(&reply->sequenceNumber);
|
||||
__GLX_SWAP_INT(&reply->length);
|
||||
__GLX_SWAP_INT(&reply->contextTag);
|
||||
WriteToClient(client, sz_xGLXMakeCurrentReply, reply);
|
||||
}
|
||||
|
||||
void __glXSwapIsDirectReply(ClientPtr client, xGLXIsDirectReply *reply)
|
||||
{
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
__GLX_SWAP_SHORT(&reply->sequenceNumber);
|
||||
__GLX_SWAP_INT(&reply->length);
|
||||
WriteToClient(client, sz_xGLXIsDirectReply, reply);
|
||||
}
|
||||
|
||||
void __glXSwapQueryVersionReply(ClientPtr client, xGLXQueryVersionReply *reply)
|
||||
{
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
__GLX_SWAP_SHORT(&reply->sequenceNumber);
|
||||
__GLX_SWAP_INT(&reply->length);
|
||||
__GLX_SWAP_INT(&reply->majorVersion);
|
||||
__GLX_SWAP_INT(&reply->minorVersion);
|
||||
WriteToClient(client, sz_xGLXQueryVersionReply, reply);
|
||||
}
|
||||
|
||||
void glxSwapQueryExtensionsStringReply(ClientPtr client,
|
||||
xGLXQueryExtensionsStringReply *reply, char *buf)
|
||||
{
|
||||
int length = reply->length;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
|
||||
__GLX_SWAP_SHORT(&reply->sequenceNumber);
|
||||
__GLX_SWAP_INT(&reply->length);
|
||||
__GLX_SWAP_INT(&reply->n);
|
||||
WriteToClient(client, sz_xGLXQueryExtensionsStringReply, reply);
|
||||
__GLX_SWAP_INT_ARRAY((int *)buf, length);
|
||||
WriteToClient(client, length << 2, buf);
|
||||
}
|
||||
|
||||
void glxSwapQueryServerStringReply(ClientPtr client,
|
||||
xGLXQueryServerStringReply *reply, char *buf)
|
||||
{
|
||||
int length = reply->length;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
__GLX_SWAP_SHORT(&reply->sequenceNumber);
|
||||
__GLX_SWAP_INT(&reply->length);
|
||||
__GLX_SWAP_INT(&reply->n);
|
||||
WriteToClient(client, sz_xGLXQueryServerStringReply, reply);
|
||||
/** no swap is needed for an array of chars **/
|
||||
/* __GLX_SWAP_INT_ARRAY((int *)buf, length); */
|
||||
WriteToClient(client, length << 2, buf);
|
||||
}
|
||||
|
||||
void __glXSwapQueryContextInfoEXTReply(ClientPtr client, xGLXQueryContextInfoEXTReply *reply, int *buf)
|
||||
{
|
||||
int length = reply->length;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
|
||||
__GLX_SWAP_SHORT(&reply->sequenceNumber);
|
||||
__GLX_SWAP_INT(&reply->length);
|
||||
__GLX_SWAP_INT(&reply->n);
|
||||
WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, reply);
|
||||
__GLX_SWAP_INT_ARRAY((int *)buf, length);
|
||||
WriteToClient(client, length << 2, buf);
|
||||
}
|
||||
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
/*
|
||||
** Render and Renderlarge are not in the GLX API. They are used by the GLX
|
||||
** client library to send batches of GL rendering commands.
|
||||
*/
|
||||
|
||||
int __glXSwapRender(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
xGLXRenderReq *req;
|
||||
ClientPtr client= cl->client;
|
||||
int left, cmdlen, error;
|
||||
int commandsDone;
|
||||
CARD16 opcode;
|
||||
__GLXrenderHeader *hdr;
|
||||
__GLXcontext *cx;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
/*
|
||||
** NOTE: much of this code also appears in the nonswapping version of this
|
||||
** routine, __glXRender(). Any changes made here should also be
|
||||
** duplicated there.
|
||||
*/
|
||||
|
||||
req = (xGLXRenderReq *) pc;
|
||||
__GLX_SWAP_SHORT(&req->length);
|
||||
__GLX_SWAP_INT(&req->contextTag);
|
||||
|
||||
cx = __glXForceCurrent(cl, req->contextTag, &error);
|
||||
if (!cx) {
|
||||
return error;
|
||||
}
|
||||
|
||||
commandsDone = 0;
|
||||
pc += sz_xGLXRenderReq;
|
||||
left = (req->length << 2) - sz_xGLXRenderReq;
|
||||
while (left > 0) {
|
||||
__GLXrenderSizeData *entry;
|
||||
int extra = 0;
|
||||
void (* proc)(GLbyte *);
|
||||
|
||||
/*
|
||||
** Verify that the header length and the overall length agree.
|
||||
** Also, each command must be word aligned.
|
||||
*/
|
||||
hdr = (__GLXrenderHeader *) pc;
|
||||
__GLX_SWAP_SHORT(&hdr->length);
|
||||
__GLX_SWAP_SHORT(&hdr->opcode);
|
||||
cmdlen = hdr->length;
|
||||
opcode = hdr->opcode;
|
||||
|
||||
if (left < cmdlen)
|
||||
return BadLength;
|
||||
|
||||
if ( (opcode >= __GLX_MIN_RENDER_OPCODE) &&
|
||||
(opcode <= __GLX_MAX_RENDER_OPCODE) ) {
|
||||
entry = &__glXRenderSizeTable[opcode];
|
||||
proc = __glXSwapRenderTable[opcode];
|
||||
#if __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT
|
||||
} else if ( (opcode >= __GLX_MIN_RENDER_OPCODE_EXT) &&
|
||||
(opcode <= __GLX_MAX_RENDER_OPCODE_EXT) ) {
|
||||
int index = opcode - __GLX_MIN_RENDER_OPCODE_EXT;
|
||||
entry = &__glXRenderSizeTable_EXT[index];
|
||||
proc = __glXSwapRenderTable_EXT[index];
|
||||
#endif /* __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT */
|
||||
} else {
|
||||
client->errorValue = commandsDone;
|
||||
return __glXBadRenderRequest;
|
||||
}
|
||||
if (!entry->bytes) {
|
||||
/* unused opcode */
|
||||
client->errorValue = commandsDone;
|
||||
return __glXBadRenderRequest;
|
||||
}
|
||||
|
||||
if (cmdlen < entry->bytes) {
|
||||
return BadLength;
|
||||
}
|
||||
|
||||
if (entry->varsize) {
|
||||
/* variable size command */
|
||||
extra = (*entry->varsize)(pc + __GLX_RENDER_HDR_SIZE, True,
|
||||
left - __GLX_RENDER_HDR_SIZE);
|
||||
if (extra < 0) {
|
||||
return BadLength;
|
||||
}
|
||||
}
|
||||
if (cmdlen != safe_pad(safe_add(entry->bytes, extra))) {
|
||||
return BadLength;
|
||||
}
|
||||
|
||||
/*
|
||||
** Skip over the header and execute the command. We allow the
|
||||
** caller to trash the command memory. This is useful especially
|
||||
** for things that require double alignment - they can just shift
|
||||
** the data towards lower memory (trashing the header) by 4 bytes
|
||||
** and achieve the required alignment.
|
||||
*/
|
||||
(*proc)(pc + __GLX_RENDER_HDR_SIZE);
|
||||
pc += cmdlen;
|
||||
left -= cmdlen;
|
||||
commandsDone++;
|
||||
}
|
||||
__GLX_NOTE_UNFLUSHED_CMDS(cx);
|
||||
return Success;
|
||||
}
|
||||
|
||||
/*
|
||||
** Execute a large rendering request (one that spans multiple X requests).
|
||||
*/
|
||||
int __glXSwapRenderLarge(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
xGLXRenderLargeReq *req;
|
||||
ClientPtr client= cl->client;
|
||||
size_t dataBytes;
|
||||
void (*proc)(GLbyte *);
|
||||
__GLXrenderLargeHeader *hdr;
|
||||
__GLXcontext *cx;
|
||||
int error;
|
||||
CARD16 opcode;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
/*
|
||||
** NOTE: much of this code also appears in the nonswapping version of this
|
||||
** routine, __glXRenderLarge(). Any changes made here should also be
|
||||
** duplicated there.
|
||||
*/
|
||||
|
||||
REQUEST_AT_LEAST_SIZE(xGLXRenderLargeReq);
|
||||
|
||||
req = (xGLXRenderLargeReq *) pc;
|
||||
__GLX_SWAP_SHORT(&req->length);
|
||||
__GLX_SWAP_INT(&req->contextTag);
|
||||
__GLX_SWAP_INT(&req->dataBytes);
|
||||
__GLX_SWAP_SHORT(&req->requestNumber);
|
||||
__GLX_SWAP_SHORT(&req->requestTotal);
|
||||
cx = __glXForceCurrent(cl, req->contextTag, &error);
|
||||
if (!cx) {
|
||||
/* Reset in case this isn't 1st request. */
|
||||
__glXResetLargeCommandStatus(cl);
|
||||
return error;
|
||||
}
|
||||
if (safe_pad(req->dataBytes) < 0)
|
||||
return BadLength;
|
||||
|
||||
dataBytes = req->dataBytes;
|
||||
|
||||
/*
|
||||
** Check the request length.
|
||||
*/
|
||||
if ((req->length << 2) != safe_pad(dataBytes) + sz_xGLXRenderLargeReq) {
|
||||
client->errorValue = req->length;
|
||||
/* Reset in case this isn't 1st request. */
|
||||
__glXResetLargeCommandStatus(cl);
|
||||
return BadLength;
|
||||
}
|
||||
pc += sz_xGLXRenderLargeReq;
|
||||
|
||||
if (cl->largeCmdRequestsSoFar == 0) {
|
||||
__GLXrenderSizeData *entry;
|
||||
int extra = 0;
|
||||
int left = (req->length << 2) - sz_xGLXRenderLargeReq;
|
||||
size_t cmdlen;
|
||||
/*
|
||||
** This is the first request of a multi request command.
|
||||
** Make enough space in the buffer, then copy the entire request.
|
||||
*/
|
||||
if (req->requestNumber != 1) {
|
||||
client->errorValue = req->requestNumber;
|
||||
return __glXBadLargeRequest;
|
||||
}
|
||||
if (dataBytes < __GLX_RENDER_LARGE_HDR_SIZE)
|
||||
return BadLength;
|
||||
|
||||
hdr = (__GLXrenderLargeHeader *) pc;
|
||||
__GLX_SWAP_INT(&hdr->length);
|
||||
__GLX_SWAP_INT(&hdr->opcode);
|
||||
opcode = hdr->opcode;
|
||||
|
||||
if ((cmdlen = safe_pad(hdr->length)) < 0)
|
||||
return BadLength;
|
||||
|
||||
if ( (opcode >= __GLX_MIN_RENDER_OPCODE) &&
|
||||
(opcode <= __GLX_MAX_RENDER_OPCODE) ) {
|
||||
entry = &__glXRenderSizeTable[opcode];
|
||||
proc = __glXSwapRenderTable[opcode];
|
||||
#if __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT
|
||||
} else if ( (opcode >= __GLX_MIN_RENDER_OPCODE_EXT) &&
|
||||
(opcode <= __GLX_MAX_RENDER_OPCODE_EXT) ) {
|
||||
int index = opcode - __GLX_MIN_RENDER_OPCODE_EXT;
|
||||
entry = &__glXRenderSizeTable_EXT[index];
|
||||
proc = __glXSwapRenderTable_EXT[index];
|
||||
#endif /* __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT */
|
||||
} else {
|
||||
client->errorValue = opcode;
|
||||
return __glXBadLargeRequest;
|
||||
}
|
||||
|
||||
if (!entry->bytes) {
|
||||
/* unused opcode */
|
||||
client->errorValue = opcode;
|
||||
return __glXBadLargeRequest;
|
||||
}
|
||||
if (entry->varsize) {
|
||||
/*
|
||||
** If it's a variable-size command (a command whose length must
|
||||
** be computed from its parameters), all the parameters needed
|
||||
** will be in the 1st request, so it's okay to do this.
|
||||
*/
|
||||
extra = (*entry->varsize)(pc + __GLX_RENDER_LARGE_HDR_SIZE, True,
|
||||
left - __GLX_RENDER_LARGE_HDR_SIZE);
|
||||
if (extra < 0) {
|
||||
return BadLength;
|
||||
}
|
||||
}
|
||||
/* the +4 is safe because we know entry->bytes is small */
|
||||
if (cmdlen != safe_pad(safe_add(entry->bytes + 4, extra))) {
|
||||
return BadLength;
|
||||
}
|
||||
|
||||
/*
|
||||
** Make enough space in the buffer, then copy the entire request.
|
||||
*/
|
||||
if (cl->largeCmdBufSize < cmdlen) {
|
||||
if (!cl->largeCmdBuf) {
|
||||
cl->largeCmdBuf = (GLbyte *) malloc(cmdlen);
|
||||
} else {
|
||||
cl->largeCmdBuf = (GLbyte *) realloc(cl->largeCmdBuf, cmdlen);
|
||||
}
|
||||
if (!cl->largeCmdBuf) {
|
||||
return BadAlloc;
|
||||
}
|
||||
cl->largeCmdBufSize = cmdlen;
|
||||
}
|
||||
memcpy(cl->largeCmdBuf, pc, dataBytes);
|
||||
|
||||
cl->largeCmdBytesSoFar = dataBytes;
|
||||
cl->largeCmdBytesTotal = cmdlen;
|
||||
cl->largeCmdRequestsSoFar = 1;
|
||||
cl->largeCmdRequestsTotal = req->requestTotal;
|
||||
return Success;
|
||||
|
||||
} else {
|
||||
/*
|
||||
** We are receiving subsequent (i.e. not the first) requests of a
|
||||
** multi request command.
|
||||
*/
|
||||
int bytesSoFar; /* including this packet */
|
||||
|
||||
/*
|
||||
** Check the request number and the total request count.
|
||||
*/
|
||||
if (req->requestNumber != cl->largeCmdRequestsSoFar + 1) {
|
||||
client->errorValue = req->requestNumber;
|
||||
__glXResetLargeCommandStatus(cl);
|
||||
return __glXBadLargeRequest;
|
||||
}
|
||||
if (req->requestTotal != cl->largeCmdRequestsTotal) {
|
||||
client->errorValue = req->requestTotal;
|
||||
__glXResetLargeCommandStatus(cl);
|
||||
return __glXBadLargeRequest;
|
||||
}
|
||||
|
||||
/*
|
||||
** Check that we didn't get too much data.
|
||||
*/
|
||||
if ((bytesSoFar = safe_add(cl->largeCmdBytesSoFar, dataBytes)) < 0) {
|
||||
client->errorValue = dataBytes;
|
||||
__glXResetLargeCommandStatus(cl);
|
||||
return __glXBadLargeRequest;
|
||||
}
|
||||
|
||||
if (bytesSoFar > cl->largeCmdBytesTotal) {
|
||||
client->errorValue = dataBytes;
|
||||
__glXResetLargeCommandStatus(cl);
|
||||
return __glXBadLargeRequest;
|
||||
}
|
||||
memcpy(cl->largeCmdBuf + cl->largeCmdBytesSoFar, pc, dataBytes);
|
||||
cl->largeCmdBytesSoFar += dataBytes;
|
||||
cl->largeCmdRequestsSoFar++;
|
||||
|
||||
if (req->requestNumber == cl->largeCmdRequestsTotal) {
|
||||
/*
|
||||
** This is the last request; it must have enough bytes to complete
|
||||
** the command.
|
||||
*/
|
||||
/* NOTE: the pad macro below is needed because the client library
|
||||
** pads the total byte count, but not the per-request byte counts.
|
||||
** The Protocol Encoding says the total byte count should not be
|
||||
** padded, so a proposal will be made to the ARB to relax the
|
||||
** padding constraint on the total byte count, thus preserving
|
||||
** backward compatibility. Meanwhile, the padding done below
|
||||
** fixes a bug that did not allow large commands of odd sizes to
|
||||
** be accepted by the server.
|
||||
*/
|
||||
|
||||
if (safe_pad(cl->largeCmdBytesSoFar) != cl->largeCmdBytesTotal) {
|
||||
client->errorValue = dataBytes;
|
||||
__glXResetLargeCommandStatus(cl);
|
||||
return __glXBadLargeRequest;
|
||||
}
|
||||
hdr = (__GLXrenderLargeHeader *) cl->largeCmdBuf;
|
||||
/*
|
||||
** The opcode and length field in the header had already been
|
||||
** swapped when the first request was received.
|
||||
*/
|
||||
|
||||
/*
|
||||
** Use the opcode to index into the procedure table.
|
||||
*/
|
||||
opcode = hdr->opcode;
|
||||
if ( (opcode >= __GLX_MIN_RENDER_OPCODE) &&
|
||||
(opcode <= __GLX_MAX_RENDER_OPCODE) ) {
|
||||
proc = __glXSwapRenderTable[opcode];
|
||||
#if __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT
|
||||
} else if ( (opcode >= __GLX_MIN_RENDER_OPCODE_EXT) &&
|
||||
(opcode <= __GLX_MAX_RENDER_OPCODE_EXT) ) {
|
||||
int index = opcode - __GLX_MIN_RENDER_OPCODE_EXT;
|
||||
proc = __glXSwapRenderTable_EXT[index];
|
||||
#endif /* __GLX_MAX_RENDER_OPCODE_EXT > __GLX_MIN_RENDER_OPCODE_EXT */
|
||||
} else {
|
||||
client->errorValue = opcode;
|
||||
return __glXBadLargeRequest;
|
||||
}
|
||||
|
||||
/*
|
||||
** Skip over the header and execute the command.
|
||||
*/
|
||||
(*proc)(cl->largeCmdBuf + __GLX_RENDER_LARGE_HDR_SIZE);
|
||||
__GLX_NOTE_UNFLUSHED_CMDS(cx);
|
||||
|
||||
/*
|
||||
** Reset for the next RenderLarge series.
|
||||
*/
|
||||
__glXResetLargeCommandStatus(cl);
|
||||
} else {
|
||||
/*
|
||||
** This is neither the first nor the last request.
|
||||
*/
|
||||
}
|
||||
return Success;
|
||||
}
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
/*
|
||||
** No support is provided for the vendor-private requests other than
|
||||
** allocating these entry points in the dispatch table.
|
||||
*/
|
||||
|
||||
int __glXSwapVendorPrivate(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
ClientPtr client = cl->client;
|
||||
xGLXVendorPrivateReq *req;
|
||||
GLint vendorcode;
|
||||
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
REQUEST_AT_LEAST_SIZE(xGLXVendorPrivateReq);
|
||||
|
||||
req = (xGLXVendorPrivateReq *) pc;
|
||||
__GLX_SWAP_SHORT(&req->length);
|
||||
__GLX_SWAP_INT(&req->vendorCode);
|
||||
|
||||
vendorcode = req->vendorCode;
|
||||
|
||||
#ifndef __DARWIN__
|
||||
switch( vendorcode ) {
|
||||
case X_GLvop_SampleMaskSGIS:
|
||||
__GLX_SWAP_FLOAT(pc + 4);
|
||||
__GLX_SWAP_INT(pc + 8);
|
||||
glSampleMaskSGIS(*(GLfloat *)(pc + 4),
|
||||
*(GLboolean *)(pc + 8));
|
||||
return Success;
|
||||
case X_GLvop_SamplePatternSGIS:
|
||||
__GLX_SWAP_INT(pc + 4);
|
||||
glSamplePatternSGIS( *(GLenum *)(pc + 4));
|
||||
return Success;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
if ((vendorcode >= __GLX_MIN_VENDPRIV_OPCODE_EXT) &&
|
||||
(vendorcode <= __GLX_MAX_VENDPRIV_OPCODE_EXT)) {
|
||||
(*__glXSwapVendorPrivTable_EXT[vendorcode-__GLX_MIN_VENDPRIV_OPCODE_EXT])(cl, (GLbyte*)req);
|
||||
return Success;
|
||||
}
|
||||
cl->client->errorValue = req->vendorCode;
|
||||
return __glXUnsupportedPrivateRequest;
|
||||
}
|
||||
|
||||
int __glXSwapVendorPrivateWithReply(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
ClientPtr client = cl->client;
|
||||
xGLXVendorPrivateWithReplyReq *req;
|
||||
GLint vendorcode;
|
||||
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
REQUEST_AT_LEAST_SIZE(xGLXVendorPrivateWithReplyReq);
|
||||
|
||||
req = (xGLXVendorPrivateWithReplyReq *) pc;
|
||||
__GLX_SWAP_SHORT(&req->length);
|
||||
__GLX_SWAP_INT(&req->vendorCode);
|
||||
|
||||
vendorcode = req->vendorCode;
|
||||
|
||||
switch (vendorcode) {
|
||||
case X_GLXvop_QueryContextInfoEXT:
|
||||
return __glXSwapQueryContextInfoEXT(cl, pc);
|
||||
case X_GLXvop_MakeCurrentReadSGI:
|
||||
return __glXSwapMakeCurrentReadSGI(cl, pc);
|
||||
case X_GLXvop_GetFBConfigsSGIX:
|
||||
return __glXSwapGetFBConfigsSGIX(cl, pc);
|
||||
case X_GLXvop_CreateContextWithConfigSGIX:
|
||||
return __glXSwapCreateContextWithConfigSGIX(cl, pc);
|
||||
case X_GLXvop_CreateGLXPixmapWithConfigSGIX:
|
||||
return __glXSwapCreateGLXPixmapWithConfigSGIX(cl, pc);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if ((vendorcode >= __GLX_MIN_VENDPRIV_OPCODE_EXT) &&
|
||||
(vendorcode <= __GLX_MAX_VENDPRIV_OPCODE_EXT)) {
|
||||
return (*__glXSwapVendorPrivTable_EXT[vendorcode-__GLX_MIN_VENDPRIV_OPCODE_EXT])(cl, (GLbyte*)req);
|
||||
}
|
||||
cl->client->errorValue = req->vendorCode;
|
||||
return __glXUnsupportedPrivateRequest;
|
||||
}
|
||||
163
nx-X11/programs/Xserver/GL/glx/glxcontext.h
Normal file
163
nx-X11/programs/Xserver/GL/glx/glxcontext.h
Normal file
@@ -0,0 +1,163 @@
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#ifndef _GLX_context_h_
|
||||
#define _GLX_context_h_
|
||||
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
** Additional Notice Provisions: The application programming interfaces
|
||||
** established by SGI in conjunction with the Original Code are The
|
||||
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
|
||||
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
|
||||
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
|
||||
** Window System(R) (Version 1.3), released October 19, 1998. This software
|
||||
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
*/
|
||||
|
||||
typedef struct __GLXcontextRec __GLXcontext;
|
||||
|
||||
/* XXX: should be defined somewhere globally */
|
||||
#define CAPI
|
||||
|
||||
#include "GL/internal/glcore.h"
|
||||
|
||||
struct __GLXcontextRec {
|
||||
/*
|
||||
** list of context structs
|
||||
*/
|
||||
struct __GLXcontextRec *last;
|
||||
struct __GLXcontextRec *next;
|
||||
|
||||
/*
|
||||
** list of contexts bound to the same drawable
|
||||
*/
|
||||
struct __GLXcontextRec *nextDrawPriv;
|
||||
struct __GLXcontextRec *nextReadPriv;
|
||||
|
||||
/*
|
||||
** Opaque pointer the context object created by the GL that the
|
||||
** server is bound with. Never dereferenced by this code, but used
|
||||
** as a handle to feed to the routines in the screen info struct.
|
||||
*/
|
||||
__GLinterface *gc;
|
||||
|
||||
/*
|
||||
** mode struct for this context
|
||||
*/
|
||||
__GLcontextModes *modes;
|
||||
|
||||
/*
|
||||
** Pointer to screen info data for this context. This is set
|
||||
** when the context is created.
|
||||
*/
|
||||
ScreenPtr pScreen;
|
||||
__GLXscreenInfo *pGlxScreen;
|
||||
|
||||
/*
|
||||
** This context is created with respect to this visual.
|
||||
*/
|
||||
VisualRec *pVisual;
|
||||
|
||||
/*
|
||||
** The XID of this context.
|
||||
*/
|
||||
XID id;
|
||||
|
||||
/*
|
||||
** The XID of the shareList context.
|
||||
*/
|
||||
XID share_id;
|
||||
|
||||
/*
|
||||
** Visual id.
|
||||
*/
|
||||
VisualID vid;
|
||||
|
||||
/*
|
||||
** screen number.
|
||||
*/
|
||||
GLint screen;
|
||||
|
||||
/*
|
||||
** Whether this context's ID still exists.
|
||||
*/
|
||||
GLboolean idExists;
|
||||
|
||||
/*
|
||||
** Whether this context is current for some client.
|
||||
*/
|
||||
GLboolean isCurrent;
|
||||
|
||||
/*
|
||||
** Whether this context is a direct rendering context.
|
||||
*/
|
||||
GLboolean isDirect;
|
||||
|
||||
/*
|
||||
** Window pending state
|
||||
*/
|
||||
GLuint pendingState;
|
||||
|
||||
/*
|
||||
** This flag keeps track of whether there are unflushed GL commands.
|
||||
*/
|
||||
GLboolean hasUnflushedCommands;
|
||||
|
||||
/*
|
||||
** Current rendering mode for this context.
|
||||
*/
|
||||
GLenum renderMode;
|
||||
|
||||
/*
|
||||
** Buffers for feedback and selection.
|
||||
*/
|
||||
GLfloat *feedbackBuf;
|
||||
GLint feedbackBufSize; /* number of elements allocated */
|
||||
GLuint *selectBuf;
|
||||
GLint selectBufSize; /* number of elements allocated */
|
||||
|
||||
/*
|
||||
** Set only if current drawable is a glx pixmap.
|
||||
*/
|
||||
__GLXpixmap *drawPixmap;
|
||||
__GLXpixmap *readPixmap;
|
||||
|
||||
/*
|
||||
** The drawable private this context is bound to
|
||||
*/
|
||||
__GLXdrawablePrivate *drawPriv;
|
||||
__GLXdrawablePrivate *readPriv;
|
||||
};
|
||||
|
||||
/* pending state defines */
|
||||
#define __GLX_PENDING_RESIZE 0x1
|
||||
#define __GLX_PENDING_DESTROY 0x2
|
||||
#define __GLX_PENDING_SWAP 0x4
|
||||
|
||||
#endif /* !__GLX_context_h__ */
|
||||
111
nx-X11/programs/Xserver/GL/glx/glxdrawable.h
Normal file
111
nx-X11/programs/Xserver/GL/glx/glxdrawable.h
Normal file
@@ -0,0 +1,111 @@
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#ifndef _GLX_drawable_h_
|
||||
#define _GLX_drawable_h_
|
||||
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
** Additional Notice Provisions: The application programming interfaces
|
||||
** established by SGI in conjunction with the Original Code are The
|
||||
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
|
||||
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
|
||||
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
|
||||
** Window System(R) (Version 1.3), released October 19, 1998. This software
|
||||
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
|
||||
DrawablePtr pDraw;
|
||||
__GLcontextModes *modes;
|
||||
__GLXscreenInfo *pGlxScreen;
|
||||
ScreenPtr pScreen;
|
||||
Bool idExists;
|
||||
int refcnt;
|
||||
|
||||
} __GLXpixmap;
|
||||
|
||||
struct __GLXdrawablePrivateRec {
|
||||
/*
|
||||
** list of drawable private structs
|
||||
*/
|
||||
struct __GLXdrawablePrivateRec *last;
|
||||
struct __GLXdrawablePrivateRec *next;
|
||||
|
||||
DrawablePtr pDraw;
|
||||
XID drawId;
|
||||
__GLXpixmap *pGlxPixmap;
|
||||
|
||||
/*
|
||||
** Either DRAWABLE_PIXMAP or DRAWABLE_WINDOW, copied from pDraw above.
|
||||
** Needed by the resource freer because pDraw might already have been
|
||||
** freed.
|
||||
*/
|
||||
int type;
|
||||
|
||||
/*
|
||||
** Configuration of the visual to which this drawable was created.
|
||||
*/
|
||||
__GLcontextModes *modes;
|
||||
|
||||
/*
|
||||
** cached drawable size and origin
|
||||
*/
|
||||
|
||||
GLint xorigin, yorigin;
|
||||
GLint width, height;
|
||||
|
||||
/*
|
||||
** Lists of contexts bound to this drawable. There are two lists here.
|
||||
** One list is of the contexts that have this drawable bound for drawing,
|
||||
** and the other is the list of contexts that have this drawable bound
|
||||
** for reading.
|
||||
*/
|
||||
struct __GLXcontextRec *drawGlxc;
|
||||
struct __GLXcontextRec *readGlxc;
|
||||
|
||||
/*
|
||||
** "methods" that the drawble should be able to respond to.
|
||||
*/
|
||||
void (*freeBuffers)(struct __GLXdrawablePrivateRec *);
|
||||
void (*updatePalette)(struct __GLXdrawablePrivateRec *);
|
||||
GLboolean (*swapBuffers)(struct __GLXdrawablePrivateRec *);
|
||||
|
||||
/*
|
||||
** The GL drawable (information shared between GLX and the GL core)
|
||||
*/
|
||||
__GLdrawablePrivate glPriv;
|
||||
|
||||
/*
|
||||
** reference count
|
||||
*/
|
||||
int refCount;
|
||||
};
|
||||
|
||||
#endif /* !__GLX_drawable_h__ */
|
||||
57
nx-X11/programs/Xserver/GL/glx/glxerror.h
Normal file
57
nx-X11/programs/Xserver/GL/glx/glxerror.h
Normal file
@@ -0,0 +1,57 @@
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#ifndef _GLX_error_h_
|
||||
#define _GLX_error_h_
|
||||
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
** Additional Notice Provisions: The application programming interfaces
|
||||
** established by SGI in conjunction with the Original Code are The
|
||||
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
|
||||
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
|
||||
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
|
||||
** Window System(R) (Version 1.3), released October 19, 1998. This software
|
||||
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
*/
|
||||
|
||||
/*
|
||||
** Error codes. These have the extension error base added to them
|
||||
** when the extension initializes.
|
||||
*/
|
||||
extern int __glXBadContext;
|
||||
extern int __glXBadContextState;
|
||||
extern int __glXBadDrawable;
|
||||
extern int __glXBadPixmap;
|
||||
extern int __glXBadCurrentWindow;
|
||||
extern int __glXBadContextTag;
|
||||
extern int __glXBadRenderRequest;
|
||||
extern int __glXBadLargeRequest;
|
||||
extern int __glXUnsupportedPrivateRequest;
|
||||
|
||||
#endif
|
||||
465
nx-X11/programs/Xserver/GL/glx/glxext.c
Normal file
465
nx-X11/programs/Xserver/GL/glx/glxext.c
Normal file
@@ -0,0 +1,465 @@
|
||||
/*
|
||||
** The contents of this file are subject to the GLX Public License Version 1.0
|
||||
** (the "License"). You may not use this file except in compliance with the
|
||||
** License. You may obtain a copy of the License at Silicon Graphics, Inc.,
|
||||
** attn: Legal Services, 2011 N. Shoreline Blvd., Mountain View, CA 94043
|
||||
** or at http://www.sgi.com/software/opensource/glx/license.html.
|
||||
**
|
||||
** Software distributed under the License is distributed on an "AS IS"
|
||||
** basis. ALL WARRANTIES ARE DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY
|
||||
** IMPLIED WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR
|
||||
** PURPOSE OR OF NON- INFRINGEMENT. See the License for the specific
|
||||
** language governing rights and limitations under the License.
|
||||
**
|
||||
** The Original Software is GLX version 1.2 source code, released February,
|
||||
** 1999. The developer of the Original Software is Silicon Graphics, Inc.
|
||||
** Those portions of the Subject Software created by Silicon Graphics, Inc.
|
||||
** are Copyright (c) 1991-9 Silicon Graphics, Inc. All Rights Reserved.
|
||||
**
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include "glxserver.h"
|
||||
#include <windowstr.h>
|
||||
#include <propertyst.h>
|
||||
#include <os.h>
|
||||
#include "g_disptab.h"
|
||||
#include "unpack.h"
|
||||
#include "glxutil.h"
|
||||
#include "glxext.h"
|
||||
#include "micmap.h"
|
||||
|
||||
|
||||
void GlxWrapInitVisuals(miInitVisualsProcPtr *);
|
||||
void GlxSetVisualConfigs(int nconfigs,
|
||||
__GLXvisualConfig *configs, void **privates);
|
||||
|
||||
static __GLXextensionInfo *__glXExt /* = &__glDDXExtensionInfo */;
|
||||
|
||||
/*
|
||||
** Forward declarations.
|
||||
*/
|
||||
static int __glXDispatch(ClientPtr);
|
||||
|
||||
/*
|
||||
** Called when the extension is reset.
|
||||
*/
|
||||
static void ResetExtension(ExtensionEntry* extEntry)
|
||||
{
|
||||
__glXFlushContextCache();
|
||||
(*__glXExt->resetExtension)();
|
||||
__glXScreenReset();
|
||||
}
|
||||
|
||||
/*
|
||||
** Initialize the per-client context storage.
|
||||
*/
|
||||
static void ResetClientState(int clientIndex)
|
||||
{
|
||||
__GLXclientState *cl = __glXClients[clientIndex];
|
||||
|
||||
if (cl->returnBuf) free(cl->returnBuf);
|
||||
if (cl->largeCmdBuf) free(cl->largeCmdBuf);
|
||||
if (cl->currentContexts) free(cl->currentContexts);
|
||||
if (cl->GLClientextensions) free(cl->GLClientextensions);
|
||||
memset(cl, 0, sizeof(__GLXclientState));
|
||||
/*
|
||||
** By default, assume that the client supports
|
||||
** GLX major version 1 minor version 0 protocol.
|
||||
*/
|
||||
cl->GLClientmajorVersion = 1;
|
||||
cl->GLClientminorVersion = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
** Reset state used to keep track of large (multi-request) commands.
|
||||
*/
|
||||
void __glXResetLargeCommandStatus(__GLXclientState *cl)
|
||||
{
|
||||
cl->largeCmdBytesSoFar = 0;
|
||||
cl->largeCmdBytesTotal = 0;
|
||||
cl->largeCmdRequestsSoFar = 0;
|
||||
cl->largeCmdRequestsTotal = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
** This procedure is called when the client who created the context goes
|
||||
** away OR when glXDestroyContext is called. In either case, all we do is
|
||||
** flag that the ID is no longer valid, and (maybe) free the context.
|
||||
** use.
|
||||
*/
|
||||
static int ContextGone(__GLXcontext* cx, XID id)
|
||||
{
|
||||
cx->idExists = GL_FALSE;
|
||||
if (!cx->isCurrent) {
|
||||
__glXFreeContext(cx);
|
||||
}
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
/*
|
||||
** Free a client's state.
|
||||
*/
|
||||
static int ClientGone(int clientIndex, XID id)
|
||||
{
|
||||
__GLXcontext *cx;
|
||||
__GLXclientState *cl = __glXClients[clientIndex];
|
||||
int i;
|
||||
|
||||
if (cl) {
|
||||
/*
|
||||
** Free all the contexts that are current for this client.
|
||||
*/
|
||||
for (i=0; i < cl->numCurrentContexts; i++) {
|
||||
cx = cl->currentContexts[i];
|
||||
if (cx) {
|
||||
__glXDeassociateContext(cx);
|
||||
cx->isCurrent = GL_FALSE;
|
||||
if (!cx->idExists) {
|
||||
__glXFreeContext(cx);
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
** Re-initialize the client state structure. Don't free it because
|
||||
** we'll probably get another client with this index and use the struct
|
||||
** again. There is a maximum of MAXCLIENTS of these structures.
|
||||
*/
|
||||
ResetClientState(clientIndex);
|
||||
}
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
/*
|
||||
** Free a GLX Pixmap.
|
||||
*/
|
||||
static int PixmapGone(__GLXpixmap *pGlxPixmap, XID id)
|
||||
{
|
||||
PixmapPtr pPixmap = (PixmapPtr) pGlxPixmap->pDraw;
|
||||
|
||||
pGlxPixmap->idExists = False;
|
||||
if (!pGlxPixmap->refcnt) {
|
||||
/*
|
||||
** The DestroyPixmap routine should decrement the refcount and free
|
||||
** only if it's zero.
|
||||
*/
|
||||
(*pGlxPixmap->pScreen->DestroyPixmap)(pPixmap);
|
||||
free(pGlxPixmap);
|
||||
}
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
/*
|
||||
** Free a context.
|
||||
*/
|
||||
GLboolean __glXFreeContext(__GLXcontext *cx)
|
||||
{
|
||||
if (cx->idExists || cx->isCurrent) return GL_FALSE;
|
||||
|
||||
if (!cx->isDirect) {
|
||||
if ((*cx->gc->exports.destroyContext)((__GLcontext *)cx->gc) == GL_FALSE) {
|
||||
return GL_FALSE;
|
||||
}
|
||||
}
|
||||
if (cx->feedbackBuf) free(cx->feedbackBuf);
|
||||
if (cx->selectBuf) free(cx->selectBuf);
|
||||
free(cx);
|
||||
if (cx == __glXLastContext) {
|
||||
__glXFlushContextCache();
|
||||
}
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
extern RESTYPE __glXSwapBarrierRes;
|
||||
|
||||
static int SwapBarrierGone(int screen, XID drawable)
|
||||
{
|
||||
if (__glXSwapBarrierFuncs &&
|
||||
__glXSwapBarrierFuncs[screen].bindSwapBarrierFunc != NULL) {
|
||||
__glXSwapBarrierFuncs[screen].bindSwapBarrierFunc(screen, drawable, 0);
|
||||
}
|
||||
FreeResourceByType(drawable, __glXSwapBarrierRes, FALSE);
|
||||
return True;
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
/*
|
||||
** These routines can be used to check whether a particular GL command
|
||||
** has caused an error. Specifically, we use them to check whether a
|
||||
** given query has caused an error, in which case a zero-length data
|
||||
** reply is sent to the client.
|
||||
*/
|
||||
|
||||
static GLboolean errorOccured = GL_FALSE;
|
||||
|
||||
/*
|
||||
** The GL was will call this routine if an error occurs.
|
||||
*/
|
||||
void __glXErrorCallBack(__GLinterface *gc, GLenum code)
|
||||
{
|
||||
errorOccured = GL_TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
** Clear the error flag before calling the GL command.
|
||||
*/
|
||||
void __glXClearErrorOccured(void)
|
||||
{
|
||||
errorOccured = GL_FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
** Check if the GL command caused an error.
|
||||
*/
|
||||
GLboolean __glXErrorOccured(void)
|
||||
{
|
||||
return errorOccured;
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
/*
|
||||
** Initialize the GLX extension.
|
||||
*/
|
||||
void GlxExtensionInit(void)
|
||||
{
|
||||
ExtensionEntry *extEntry;
|
||||
int i;
|
||||
|
||||
__glXContextRes = CreateNewResourceType((DeleteType)ContextGone);
|
||||
__glXClientRes = CreateNewResourceType((DeleteType)ClientGone);
|
||||
__glXPixmapRes = CreateNewResourceType((DeleteType)PixmapGone);
|
||||
|
||||
/*
|
||||
** Add extension to server extensions.
|
||||
*/
|
||||
extEntry = AddExtension(GLX_EXTENSION_NAME, __GLX_NUMBER_EVENTS,
|
||||
__GLX_NUMBER_ERRORS, __glXDispatch,
|
||||
__glXDispatch, ResetExtension,
|
||||
StandardMinorOpcode);
|
||||
if (!extEntry) {
|
||||
FatalError("__glXExtensionInit: AddExtensions failed\n");
|
||||
return;
|
||||
}
|
||||
if (!AddExtensionAlias(GLX_EXTENSION_ALIAS, extEntry)) {
|
||||
ErrorF("__glXExtensionInit: AddExtensionAlias failed\n");
|
||||
return;
|
||||
}
|
||||
|
||||
__glXBadContext = extEntry->errorBase + GLXBadContext;
|
||||
__glXBadContextState = extEntry->errorBase + GLXBadContextState;
|
||||
__glXBadDrawable = extEntry->errorBase + GLXBadDrawable;
|
||||
__glXBadPixmap = extEntry->errorBase + GLXBadPixmap;
|
||||
__glXBadContextTag = extEntry->errorBase + GLXBadContextTag;
|
||||
__glXBadCurrentWindow = extEntry->errorBase + GLXBadCurrentWindow;
|
||||
__glXBadRenderRequest = extEntry->errorBase + GLXBadRenderRequest;
|
||||
__glXBadLargeRequest = extEntry->errorBase + GLXBadLargeRequest;
|
||||
__glXUnsupportedPrivateRequest = extEntry->errorBase +
|
||||
GLXUnsupportedPrivateRequest;
|
||||
|
||||
__glXSwapBarrierRes = CreateNewResourceType((DeleteType)SwapBarrierGone);
|
||||
|
||||
/*
|
||||
** Initialize table of client state. There is never a client 0.
|
||||
*/
|
||||
for (i=1; i <= MAXCLIENTS; i++) {
|
||||
__glXClients[i] = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
** Initialize screen specific data.
|
||||
*/
|
||||
__glXScreenInit(screenInfo.numScreens);
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
Bool __glXCoreType(void)
|
||||
{
|
||||
return __glXExt->type;
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
void GlxSetVisualConfigs(int nconfigs,
|
||||
__GLXvisualConfig *configs, void **privates)
|
||||
{
|
||||
(*__glXExt->setVisualConfigs)(nconfigs, configs, privates);
|
||||
}
|
||||
|
||||
static miInitVisualsProcPtr saveInitVisualsProc;
|
||||
|
||||
Bool GlxInitVisuals(VisualPtr *visualp, DepthPtr *depthp,
|
||||
int *nvisualp, int *ndepthp,
|
||||
int *rootDepthp, VisualID *defaultVisp,
|
||||
unsigned long sizes, int bitsPerRGB,
|
||||
int preferredVis)
|
||||
{
|
||||
Bool ret;
|
||||
|
||||
if (saveInitVisualsProc) {
|
||||
ret = saveInitVisualsProc(visualp, depthp, nvisualp, ndepthp,
|
||||
rootDepthp, defaultVisp, sizes, bitsPerRGB,
|
||||
preferredVis);
|
||||
if (!ret)
|
||||
return False;
|
||||
}
|
||||
(*__glXExt->initVisuals)(visualp, depthp, nvisualp, ndepthp, rootDepthp,
|
||||
defaultVisp, sizes, bitsPerRGB);
|
||||
return True;
|
||||
}
|
||||
|
||||
void
|
||||
GlxWrapInitVisuals(miInitVisualsProcPtr *initVisProc)
|
||||
{
|
||||
saveInitVisualsProc = *initVisProc;
|
||||
*initVisProc = GlxInitVisuals;
|
||||
/* HACK: this shouldn't be done here but it's the earliest time */
|
||||
__glXExt = __glXglDDXExtensionInfo(); /* from GLcore */
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
void __glXFlushContextCache(void)
|
||||
{
|
||||
__glXLastContext = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
** Make a context the current one for the GL (in this implementation, there
|
||||
** is only one instance of the GL, and we use it to serve all GL clients by
|
||||
** switching it between different contexts). While we are at it, look up
|
||||
** a context by its tag and return its (__GLXcontext *).
|
||||
*/
|
||||
__GLXcontext *__glXForceCurrent(__GLXclientState *cl, GLXContextTag tag,
|
||||
int *error)
|
||||
{
|
||||
__GLXcontext *cx;
|
||||
|
||||
/*
|
||||
** See if the context tag is legal; it is managed by the extension,
|
||||
** so if it's invalid, we have an implementation error.
|
||||
*/
|
||||
cx = (__GLXcontext *) __glXLookupContextByTag(cl, tag);
|
||||
if (!cx) {
|
||||
cl->client->errorValue = tag;
|
||||
*error = __glXBadContextTag;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!cx->isDirect) {
|
||||
if (cx->drawPriv == NULL) {
|
||||
/*
|
||||
** The drawable has vanished. It must be a window, because only
|
||||
** windows can be destroyed from under us; GLX pixmaps are
|
||||
** refcounted and don't go away until no one is using them.
|
||||
*/
|
||||
*error = __glXBadCurrentWindow;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (cx == __glXLastContext) {
|
||||
/* No need to re-bind */
|
||||
return cx;
|
||||
}
|
||||
|
||||
/* Make this context the current one for the GL. */
|
||||
if (!cx->isDirect) {
|
||||
if (!(*cx->gc->exports.forceCurrent)((__GLcontext *)cx->gc)) {
|
||||
/* Bind failed, and set the error code. Bummer */
|
||||
cl->client->errorValue = cx->id;
|
||||
*error = __glXBadContextState;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
__glXLastContext = cx;
|
||||
return cx;
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
|
||||
/*
|
||||
** Top level dispatcher; all commands are executed from here down.
|
||||
*/
|
||||
#ifdef NXAGENT_SERVER
|
||||
static int xorg__glXDispatch(ClientPtr client)
|
||||
#else
|
||||
static int __glXDispatch(ClientPtr client)
|
||||
#endif
|
||||
{
|
||||
REQUEST(xGLXSingleReq);
|
||||
CARD8 opcode;
|
||||
int (*proc)(__GLXclientState *cl, GLbyte *pc);
|
||||
__GLXclientState *cl;
|
||||
|
||||
opcode = stuff->glxCode;
|
||||
cl = __glXClients[client->index];
|
||||
if (!cl) {
|
||||
cl = (__GLXclientState *) malloc(sizeof(__GLXclientState));
|
||||
__glXClients[client->index] = cl;
|
||||
if (!cl) {
|
||||
return BadAlloc;
|
||||
}
|
||||
memset(cl, 0, sizeof(__GLXclientState));
|
||||
}
|
||||
|
||||
if (!cl->inUse) {
|
||||
/*
|
||||
** This is first request from this client. Associate a resource
|
||||
** with the client so we will be notified when the client dies.
|
||||
*/
|
||||
XID xid = FakeClientID(client->index);
|
||||
if (!AddResource( xid, __glXClientRes, (void *)(long)client->index)) {
|
||||
return BadAlloc;
|
||||
}
|
||||
ResetClientState(client->index);
|
||||
cl->inUse = GL_TRUE;
|
||||
cl->client = client;
|
||||
}
|
||||
|
||||
/*
|
||||
** Check for valid opcode.
|
||||
*/
|
||||
if (opcode >= __GLX_SINGLE_TABLE_SIZE) {
|
||||
return BadRequest;
|
||||
}
|
||||
|
||||
/*
|
||||
** If we're expecting a glXRenderLarge request, this better be one.
|
||||
*/
|
||||
if ((cl->largeCmdRequestsSoFar != 0) && (opcode != X_GLXRenderLarge)) {
|
||||
client->errorValue = stuff->glxCode;
|
||||
return __glXBadLargeRequest;
|
||||
}
|
||||
|
||||
/*
|
||||
** Use the opcode to index into the procedure table.
|
||||
*/
|
||||
if (client->swapped)
|
||||
proc = __glXSwapSingleTable[opcode];
|
||||
else
|
||||
proc = __glXSingleTable[opcode];
|
||||
return (*proc)(cl, (GLbyte *) stuff);
|
||||
}
|
||||
|
||||
|
||||
int __glXNoSuchSingleOpcode(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
return BadRequest;
|
||||
}
|
||||
|
||||
void __glXNoSuchRenderOpcode(GLbyte *pc)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
130
nx-X11/programs/Xserver/GL/glx/glxext.h
Normal file
130
nx-X11/programs/Xserver/GL/glx/glxext.h
Normal file
@@ -0,0 +1,130 @@
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#ifndef _glxext_h_
|
||||
#define _glxext_h_
|
||||
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
** Additional Notice Provisions: The application programming interfaces
|
||||
** established by SGI in conjunction with the Original Code are The
|
||||
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
|
||||
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
|
||||
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
|
||||
** Window System(R) (Version 1.3), released October 19, 1998. This software
|
||||
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
*/
|
||||
|
||||
/*
|
||||
* Added by VA Linux for XFree86 4.0.x
|
||||
*/
|
||||
typedef struct {
|
||||
int type;
|
||||
void (*resetExtension)(void);
|
||||
Bool (*initVisuals)(
|
||||
VisualPtr * visualp,
|
||||
DepthPtr * depthp,
|
||||
int * nvisualp,
|
||||
int * ndepthp,
|
||||
int * rootDepthp,
|
||||
VisualID * defaultVisp,
|
||||
unsigned long sizes,
|
||||
int bitsPerRGB
|
||||
);
|
||||
void (*setVisualConfigs)(
|
||||
int nconfigs,
|
||||
__GLXvisualConfig *configs,
|
||||
void **privates
|
||||
);
|
||||
} __GLXextensionInfo;
|
||||
|
||||
extern GLboolean __glXFreeContext(__GLXcontext *glxc);
|
||||
extern void __glXFlushContextCache(void);
|
||||
|
||||
extern void __glXNoSuchRenderOpcode(GLbyte*);
|
||||
extern int __glXNoSuchSingleOpcode(__GLXclientState*, GLbyte*);
|
||||
extern void __glXErrorCallBack(__GLinterface *gc, GLenum code);
|
||||
extern void __glXClearErrorOccured(void);
|
||||
extern GLboolean __glXErrorOccured(void);
|
||||
extern void __glXResetLargeCommandStatus(__GLXclientState*);
|
||||
|
||||
extern int __glXQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc);
|
||||
extern int __glXSwapQueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc);
|
||||
|
||||
extern int DoMakeCurrent( __GLXclientState *cl, GLXDrawable drawId,
|
||||
GLXDrawable readId, GLXContextID contextId, GLXContextTag tag );
|
||||
extern int DoGetVisualConfigs(__GLXclientState *cl, unsigned screen,
|
||||
GLboolean do_swap);
|
||||
extern int DoGetFBConfigs(__GLXclientState *cl, unsigned screen,
|
||||
GLboolean do_swap);
|
||||
extern int DoCreateContext(__GLXclientState *cl, GLXContextID gcId,
|
||||
GLXContextID shareList, VisualID visual, GLuint screen, GLboolean isDirect);
|
||||
extern int DoCreateGLXPixmap(__GLXclientState *cl, VisualID visual,
|
||||
GLuint screenNum, XID pixmapId, XID glxpixmapId);
|
||||
|
||||
extern void GlxExtensionInit(void);
|
||||
|
||||
extern Bool __glXCoreType(void);
|
||||
|
||||
extern const char GLServerVersion[];
|
||||
extern int DoGetString(__GLXclientState *cl, GLbyte *pc, GLboolean need_swap);
|
||||
|
||||
extern int GlxInitVisuals(
|
||||
VisualPtr * visualp,
|
||||
DepthPtr * depthp,
|
||||
int * nvisualp,
|
||||
int * ndepthp,
|
||||
int * rootDepthp,
|
||||
VisualID * defaultVisp,
|
||||
unsigned long sizes,
|
||||
int bitsPerRGB,
|
||||
int preferredVis
|
||||
);
|
||||
|
||||
typedef struct {
|
||||
void * (* queryHyperpipeNetworkFunc)(int, int *, int *);
|
||||
void * (* queryHyperpipeConfigFunc)(int, int, int *, int *);
|
||||
int (* destroyHyperpipeConfigFunc)(int, int);
|
||||
void * (* hyperpipeConfigFunc)(int, int, int *, int *, void *);
|
||||
} __GLXHyperpipeExtensionFuncs;
|
||||
|
||||
extern void __glXHyperpipeInit(int screen, __GLXHyperpipeExtensionFuncs *funcs);
|
||||
|
||||
extern __GLXHyperpipeExtensionFuncs *__glXHyperpipeFuncs;
|
||||
|
||||
typedef struct {
|
||||
int (* bindSwapBarrierFunc)(int, XID, int);
|
||||
int (* queryMaxSwapBarriersFunc)(int);
|
||||
} __GLXSwapBarrierExtensionFuncs;
|
||||
|
||||
extern void __glXSwapBarrierInit(int screen, __GLXSwapBarrierExtensionFuncs *funcs);
|
||||
|
||||
extern __GLXSwapBarrierExtensionFuncs *__glXSwapBarrierFuncs;
|
||||
|
||||
#endif /* _glxext_h_ */
|
||||
|
||||
182
nx-X11/programs/Xserver/GL/glx/glxfb.c
Normal file
182
nx-X11/programs/Xserver/GL/glx/glxfb.c
Normal file
@@ -0,0 +1,182 @@
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
** Additional Notice Provisions: The application programming interfaces
|
||||
** established by SGI in conjunction with the Original Code are The
|
||||
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
|
||||
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
|
||||
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
|
||||
** Window System(R) (Version 1.3), released October 19, 1998. This software
|
||||
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
*/
|
||||
|
||||
/*
|
||||
** An implementation of a buffer which is part of the front buffer
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include "glxserver.h"
|
||||
#include "glxutil.h"
|
||||
#include "glxfb.h"
|
||||
|
||||
#include <gcstruct.h>
|
||||
|
||||
/* so we don't include glmath.h */
|
||||
extern GLuint __glFloorLog2(GLuint);
|
||||
|
||||
typedef struct __GLFBbufferInfoRec {
|
||||
GCPtr pGC;
|
||||
} __GLFBbufferInfo;
|
||||
|
||||
extern PixmapPtr __glXPrivPixGetPtr(__GLdrawableBuffer *);
|
||||
|
||||
/* ---------------------------------------------------------- */
|
||||
|
||||
static GLboolean
|
||||
Resize(__GLdrawableBuffer *buf,
|
||||
GLint x, GLint y, GLuint width, GLuint height,
|
||||
__GLdrawablePrivate *glPriv, GLuint bufferMask)
|
||||
{
|
||||
buf->width = width;
|
||||
buf->height = height;
|
||||
buf->byteWidth = width * buf->elementSize;
|
||||
buf->outerWidth = width;
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
Lock(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
Unlock(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
** Do a swap buffer with
|
||||
** a memory surface as a back buffer
|
||||
** a FB surface as a front buffer
|
||||
*/
|
||||
GLboolean
|
||||
__glXFBMemSwapBuffers(__GLXdrawablePrivate *glxPriv)
|
||||
{
|
||||
__GLdrawablePrivate *glPriv = &glxPriv->glPriv;
|
||||
__GLdrawableBuffer *front = &glPriv->frontBuffer;
|
||||
__GLdrawableBuffer *back = &glPriv->backBuffer;
|
||||
__GLFBbufferInfo *bufferInfo;
|
||||
GCPtr pGC;
|
||||
GLint width, height, depth, pad;
|
||||
GLubyte *buf;
|
||||
|
||||
bufferInfo = (__GLFBbufferInfo *) front->other;
|
||||
pGC = bufferInfo->pGC;
|
||||
|
||||
width = back->width;
|
||||
height = back->height;
|
||||
depth = back->depth;
|
||||
buf = back->base;
|
||||
pad = back->outerWidth - back->width; /* back buffer padding */
|
||||
/* adjust buffer padding. X wants left, GL has right */
|
||||
buf -= pad;
|
||||
|
||||
ValidateGC(glxPriv->pDraw, pGC);
|
||||
(*pGC->ops->PutImage)(glxPriv->pDraw, pGC,
|
||||
depth,
|
||||
0, 0, width, height,
|
||||
pad, ZPixmap,
|
||||
(char *)buf);
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
Free(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
|
||||
{
|
||||
__GLFBbufferInfo *bufferInfo;
|
||||
|
||||
bufferInfo = (__GLFBbufferInfo *) buf->other;
|
||||
|
||||
if (bufferInfo->pGC) {
|
||||
FreeScratchGC(bufferInfo->pGC);
|
||||
}
|
||||
|
||||
free(bufferInfo);
|
||||
buf->other = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
** function to return the X GC of this buffer (to be used by DDX)
|
||||
*/
|
||||
GCPtr __glXFBGetGC(__GLdrawableBuffer *buf)
|
||||
{
|
||||
__GLFBbufferInfo *bufferInfo;
|
||||
|
||||
bufferInfo = (__GLFBbufferInfo *) buf->other;
|
||||
|
||||
if (bufferInfo) {
|
||||
return bufferInfo->pGC;
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
__glXInitFB(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv, GLint bits)
|
||||
{
|
||||
__GLFBbufferInfo *bufferInfo;
|
||||
__GLXdrawablePrivate *glxPriv = (__GLXdrawablePrivate *) glPriv->other;
|
||||
GCPtr pGC;
|
||||
|
||||
buf->depth = bits;
|
||||
buf->width = buf->height = 0; /* to be filled during Update */
|
||||
buf->handle = buf->base = NULL; /* to be filled during Update */
|
||||
buf->size = 0;
|
||||
buf->byteWidth = 0;
|
||||
buf->elementSize = ((bits-1) / 8) + 1;
|
||||
buf->elementSizeLog2 = __glFloorLog2(buf->elementSize);
|
||||
|
||||
buf->resize = Resize;
|
||||
buf->lock = Lock;
|
||||
buf->unlock = Unlock;
|
||||
buf->fill = NULL;
|
||||
buf->free = Free;
|
||||
|
||||
/* allocate local information */
|
||||
bufferInfo = (__GLFBbufferInfo *) malloc(sizeof(__GLFBbufferInfo));
|
||||
buf->other = (void *) bufferInfo;
|
||||
|
||||
pGC = CreateScratchGC(glxPriv->pDraw->pScreen,
|
||||
glxPriv->pDraw->depth);
|
||||
bufferInfo->pGC = pGC;
|
||||
(*pGC->funcs->ChangeClip)(pGC, CT_NONE, NULL, 0);
|
||||
}
|
||||
51
nx-X11/programs/Xserver/GL/glx/glxfb.h
Normal file
51
nx-X11/programs/Xserver/GL/glx/glxfb.h
Normal file
@@ -0,0 +1,51 @@
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#ifndef _glxfb_h_
|
||||
#define _glxfb_h_
|
||||
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
** Additional Notice Provisions: The application programming interfaces
|
||||
** established by SGI in conjunction with the Original Code are The
|
||||
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
|
||||
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
|
||||
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
|
||||
** Window System(R) (Version 1.3), released October 19, 1998. This software
|
||||
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
*/
|
||||
|
||||
extern void __glXInitFB(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv,
|
||||
GLint bits);
|
||||
|
||||
extern GCPtr __glXFBGetGC(__GLdrawableBuffer *buf);
|
||||
|
||||
extern GLboolean __glXFBMemSwapBuffers(__GLXdrawablePrivate *glxPriv);
|
||||
|
||||
#endif /* _glxfb_h_ */
|
||||
|
||||
186
nx-X11/programs/Xserver/GL/glx/glximports.c
Normal file
186
nx-X11/programs/Xserver/GL/glx/glximports.c
Normal file
@@ -0,0 +1,186 @@
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
** Additional Notice Provisions: The application programming interfaces
|
||||
** established by SGI in conjunction with the Original Code are The
|
||||
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
|
||||
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
|
||||
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
|
||||
** Window System(R) (Version 1.3), released October 19, 1998. This software
|
||||
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "glxserver.h"
|
||||
#include "glxcontext.h"
|
||||
#include "glximports.h"
|
||||
|
||||
void *__glXImpMalloc(__GLcontext *gc, size_t size)
|
||||
{
|
||||
void *addr;
|
||||
|
||||
if (size == 0) {
|
||||
return NULL;
|
||||
}
|
||||
addr = malloc(size);
|
||||
if (addr == NULL) {
|
||||
/* XXX: handle out of memory error */
|
||||
return NULL;
|
||||
}
|
||||
return addr;
|
||||
}
|
||||
|
||||
void *__glXImpCalloc(__GLcontext *gc, size_t numElements, size_t elementSize)
|
||||
{
|
||||
void *addr;
|
||||
size_t size;
|
||||
|
||||
if ((numElements == 0) || (elementSize == 0)) {
|
||||
return NULL;
|
||||
}
|
||||
size = numElements * elementSize;
|
||||
addr = malloc(size);
|
||||
if (addr == NULL) {
|
||||
/* XXX: handle out of memory error */
|
||||
return NULL;
|
||||
}
|
||||
/* zero out memory */
|
||||
memset(addr, 0, size);
|
||||
|
||||
return addr;
|
||||
}
|
||||
|
||||
void __glXImpFree(__GLcontext *gc, void *addr)
|
||||
{
|
||||
if (addr) {
|
||||
free(addr);
|
||||
}
|
||||
}
|
||||
|
||||
void *__glXImpRealloc(__GLcontext *gc, void *addr, size_t newSize)
|
||||
{
|
||||
void *newAddr;
|
||||
|
||||
if (addr) {
|
||||
if (newSize == 0) {
|
||||
free(addr);
|
||||
return NULL;
|
||||
}
|
||||
newAddr = realloc(addr, newSize);
|
||||
} else {
|
||||
if (newSize == 0) {
|
||||
return NULL;
|
||||
}
|
||||
newAddr = malloc(newSize);
|
||||
}
|
||||
if (newAddr == NULL) {
|
||||
return NULL; /* XXX: out of memory error */
|
||||
}
|
||||
|
||||
return newAddr;
|
||||
}
|
||||
|
||||
void __glXImpWarning(__GLcontext *gc, char *msg)
|
||||
{
|
||||
ErrorF("%s",(char *)msg);
|
||||
}
|
||||
|
||||
void __glXImpFatal(__GLcontext *gc, char *msg)
|
||||
{
|
||||
ErrorF("%s",(char *)msg);
|
||||
abort();
|
||||
}
|
||||
|
||||
char *__glXImpGetenv(__GLcontext *gc, const char *var)
|
||||
{
|
||||
return getenv(var);
|
||||
}
|
||||
|
||||
int __glXImpAtoi(__GLcontext *gc, const char *str)
|
||||
{
|
||||
return atoi(str);
|
||||
}
|
||||
|
||||
int __glXImpSprintf(__GLcontext *gc, char *str, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
int ret;
|
||||
|
||||
/* have to deal with var args */
|
||||
va_start(ap, fmt);
|
||||
ret = vsprintf(str, fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void *__glXImpFopen(__GLcontext *gc, const char *path, const char *mode)
|
||||
{
|
||||
return (void *) fopen(path, mode);
|
||||
}
|
||||
|
||||
int __glXImpFclose(__GLcontext *gc, void *stream)
|
||||
{
|
||||
return fclose((FILE *)stream);
|
||||
}
|
||||
|
||||
int __glXImpFprintf(__GLcontext *gc, void *stream, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
int ret;
|
||||
|
||||
/* have to deal with var args */
|
||||
va_start(ap, fmt);
|
||||
ret = vfprintf((FILE *)stream, fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
__GLdrawablePrivate *__glXImpGetDrawablePrivate(__GLcontext *gc)
|
||||
{
|
||||
__GLinterface *glci = (__GLinterface *) gc;
|
||||
__GLXcontext *glrc = (__GLXcontext *) glci->imports.other;
|
||||
|
||||
return &glrc->drawPriv->glPriv;
|
||||
}
|
||||
|
||||
|
||||
__GLdrawablePrivate *__glXImpGetReadablePrivate(__GLcontext *gc)
|
||||
{
|
||||
__GLinterface *glci = (__GLinterface *) gc;
|
||||
__GLXcontext *glrc = (__GLXcontext *) glci->imports.other;
|
||||
|
||||
return &glrc->readPriv->glPriv;
|
||||
}
|
||||
65
nx-X11/programs/Xserver/GL/glx/glximports.h
Normal file
65
nx-X11/programs/Xserver/GL/glx/glximports.h
Normal file
@@ -0,0 +1,65 @@
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#ifndef _glximports_h_
|
||||
#define _glximports_h_
|
||||
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
** Additional Notice Provisions: The application programming interfaces
|
||||
** established by SGI in conjunction with the Original Code are The
|
||||
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
|
||||
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
|
||||
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
|
||||
** Window System(R) (Version 1.3), released October 19, 1998. This software
|
||||
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
*/
|
||||
|
||||
extern void *__glXImpMalloc(__GLcontext *gc, size_t size);
|
||||
extern void *__glXImpCalloc(__GLcontext *gc, size_t nElem, size_t eSize);
|
||||
extern void *__glXImpRealloc(__GLcontext *gc, void *addr, size_t newSize);
|
||||
extern void __glXImpFree(__GLcontext *gc, void *addr);
|
||||
|
||||
extern void __glXImpWarning(__GLcontext *gc, char *msg);
|
||||
extern void __glXImpFatal(__GLcontext *gc, char *msg);
|
||||
|
||||
extern char *__glXImpGetenv(__GLcontext *gc, const char *var);
|
||||
extern int __glXImpAtoi(__GLcontext *gc, const char *str);
|
||||
extern int __glXImpSprintf(__GLcontext *gc, char *str, const char *fmt, ...);
|
||||
extern void *__glXImpFopen(__GLcontext *gc, const char *path,
|
||||
const char *mode);
|
||||
extern int __glXImpFclose(__GLcontext *gc, void *stream);
|
||||
extern int __glXImpFprintf(__GLcontext *gc, void *stream,
|
||||
const char *fmt, ...);
|
||||
|
||||
extern __GLdrawablePrivate *__glXImpGetDrawablePrivate(__GLcontext *gc);
|
||||
extern __GLdrawablePrivate *__glXImpGetReadablePrivate(__GLcontext *gc);
|
||||
|
||||
|
||||
#endif /* _glximports_h_ */
|
||||
|
||||
150
nx-X11/programs/Xserver/GL/glx/glxmem.c
Normal file
150
nx-X11/programs/Xserver/GL/glx/glxmem.c
Normal file
@@ -0,0 +1,150 @@
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
** Additional Notice Provisions: The application programming interfaces
|
||||
** established by SGI in conjunction with the Original Code are The
|
||||
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
|
||||
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
|
||||
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
|
||||
** Window System(R) (Version 1.3), released October 19, 1998. This software
|
||||
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
*/
|
||||
|
||||
/*
|
||||
** Implementation of a buffer in main memory
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include "glxserver.h"
|
||||
#include "glxmem.h"
|
||||
#include "glxext.h"
|
||||
#include "GL/internal/glcore.h"
|
||||
|
||||
/* don't want to include glmath.h */
|
||||
extern GLuint __glFloorLog2(GLuint);
|
||||
|
||||
/* ---------------------------------------------------------- */
|
||||
|
||||
#define BUF_ALIGN 32 /* x86 cache alignment (used for assembly paths) */
|
||||
#define BUF_ALIGN_MASK (BUF_ALIGN-1)
|
||||
|
||||
static GLboolean
|
||||
Resize(__GLdrawableBuffer *buf,
|
||||
GLint x, GLint y, GLuint width, GLuint height,
|
||||
__GLdrawablePrivate *glPriv, GLuint bufferMask)
|
||||
{
|
||||
GLuint newSize;
|
||||
void *ubase;
|
||||
GLint pixelWidth;
|
||||
GLint alignedWidth;
|
||||
|
||||
/*
|
||||
** Note:
|
||||
** buf->handle : unaligned base
|
||||
** buf->base : aligned base
|
||||
*/
|
||||
|
||||
pixelWidth = BUF_ALIGN / buf->elementSize;
|
||||
alignedWidth = (width & ~(pixelWidth-1)) + pixelWidth;
|
||||
|
||||
newSize = alignedWidth * height * buf->elementSize;
|
||||
|
||||
/*
|
||||
** Only allocate buffer space for the SGI core.
|
||||
** Mesa and Aqua handle their own buffer allocations.
|
||||
*/
|
||||
#if defined(__GL_BUFFER_SIZE_TRACKS_WINDOW)
|
||||
if (__glXCoreType() == GL_CORE_SGI) {
|
||||
#else
|
||||
if (newSize > buf->size && __glXCoreType() == GL_CORE_SGI) {
|
||||
#endif
|
||||
if (buf->handle) {
|
||||
ubase = (*glPriv->realloc)(buf->handle, newSize + BUF_ALIGN_MASK);
|
||||
if (ubase == NULL) {
|
||||
return GL_FALSE;
|
||||
}
|
||||
} else {
|
||||
ubase = (*glPriv->malloc)(newSize + BUF_ALIGN_MASK);
|
||||
if (ubase == NULL) {
|
||||
return GL_FALSE;
|
||||
}
|
||||
}
|
||||
buf->size = newSize;
|
||||
|
||||
buf->handle = ubase;
|
||||
buf->base = (void *)(((size_t)ubase + BUF_ALIGN_MASK) &
|
||||
(unsigned int) ~BUF_ALIGN_MASK);
|
||||
assert(((size_t)buf->base % BUF_ALIGN) == 0);
|
||||
}
|
||||
|
||||
buf->width = width;
|
||||
buf->height = height;
|
||||
buf->byteWidth = alignedWidth * buf->elementSize;
|
||||
buf->outerWidth = alignedWidth;
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
Lock(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
Unlock(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
Free(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
|
||||
{
|
||||
if (buf->handle) {
|
||||
(*glPriv->free)(buf->handle);
|
||||
buf->handle = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
__glXInitMem(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv, GLint bits)
|
||||
{
|
||||
buf->width = buf->height = 0; /* to be filled during Update */
|
||||
buf->depth = bits;
|
||||
buf->size = 0;
|
||||
buf->handle = buf->base = NULL; /* to be filled during Update */
|
||||
buf->byteWidth = 0;
|
||||
buf->elementSize = ((bits - 1) / 8) + 1;
|
||||
buf->elementSizeLog2 = __glFloorLog2(buf->elementSize);
|
||||
|
||||
buf->resize = Resize;
|
||||
buf->lock = Lock;
|
||||
buf->unlock = Unlock;
|
||||
buf->fill = NULL;
|
||||
buf->free = Free;
|
||||
}
|
||||
47
nx-X11/programs/Xserver/GL/glx/glxmem.h
Normal file
47
nx-X11/programs/Xserver/GL/glx/glxmem.h
Normal file
@@ -0,0 +1,47 @@
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#ifndef _glxmem_h_
|
||||
#define _glxmem_h_
|
||||
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
** Additional Notice Provisions: The application programming interfaces
|
||||
** established by SGI in conjunction with the Original Code are The
|
||||
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
|
||||
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
|
||||
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
|
||||
** Window System(R) (Version 1.3), released October 19, 1998. This software
|
||||
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
*/
|
||||
|
||||
extern void __glXInitMem(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv,
|
||||
GLint bits);
|
||||
|
||||
#endif /* _glxmem_h_ */
|
||||
|
||||
131
nx-X11/programs/Xserver/GL/glx/glxpix.c
Normal file
131
nx-X11/programs/Xserver/GL/glx/glxpix.c
Normal file
@@ -0,0 +1,131 @@
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
** Additional Notice Provisions: The application programming interfaces
|
||||
** established by SGI in conjunction with the Original Code are The
|
||||
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
|
||||
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
|
||||
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
|
||||
** Window System(R) (Version 1.3), released October 19, 1998. This software
|
||||
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
*/
|
||||
|
||||
/*
|
||||
** An implementation of a glx pixmap buffer
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include "glxserver.h"
|
||||
#include "glxutil.h"
|
||||
#include "glxpix.h"
|
||||
|
||||
#include <gcstruct.h>
|
||||
|
||||
/* don't want to include glmath.h */
|
||||
extern GLuint __glFloorLog2(GLuint);
|
||||
|
||||
typedef struct __GLPixBufferInfoRec {
|
||||
GCPtr pGC;
|
||||
} __GLPixBufferInfo;
|
||||
|
||||
/* ---------------------------------------------------------- */
|
||||
|
||||
static GLboolean
|
||||
Resize(__GLdrawableBuffer *buf,
|
||||
GLint x, GLint y, GLuint width, GLuint height,
|
||||
__GLdrawablePrivate *glPriv, GLuint bufferMask)
|
||||
{
|
||||
buf->width = width;
|
||||
buf->height = width;
|
||||
buf->byteWidth = width * buf->elementSize;
|
||||
buf->outerWidth = width;
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
Lock(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
Unlock(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
Free(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv)
|
||||
{
|
||||
__GLPixBufferInfo *bufferInfo;
|
||||
|
||||
if (LookupIDByType((XID)(long)buf->handle, __glXPixmapRes)) {
|
||||
FreeResource((XID)(long)buf->handle, FALSE);
|
||||
buf->handle = NULL;
|
||||
}
|
||||
|
||||
bufferInfo = (__GLPixBufferInfo *) buf->other;
|
||||
|
||||
if (bufferInfo->pGC) {
|
||||
FreeScratchGC(bufferInfo->pGC);
|
||||
}
|
||||
|
||||
free(bufferInfo);
|
||||
buf->other = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
__glXInitPix(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv,
|
||||
GLint bits, XID glxpixmapId, __GLXpixmap *pGlxPixmap)
|
||||
{
|
||||
__GLPixBufferInfo *bufferInfo;
|
||||
|
||||
buf->width = buf->height = 0; /* to be filled during Update */
|
||||
buf->depth = bits;
|
||||
buf->size = 0;
|
||||
buf->base = NULL;
|
||||
buf->byteWidth = 0;
|
||||
buf->elementSize = ((bits-1) / 8) + 1;
|
||||
buf->elementSizeLog2 = __glFloorLog2(buf->elementSize);
|
||||
|
||||
buf->handle = (void *)(long) glxpixmapId;
|
||||
pGlxPixmap->refcnt++;
|
||||
|
||||
buf->resize = Resize;
|
||||
buf->lock = Lock;
|
||||
buf->unlock = Unlock;
|
||||
buf->fill = NULL;
|
||||
buf->free = Free;
|
||||
|
||||
/* allocate local information */
|
||||
bufferInfo = (__GLPixBufferInfo *) malloc(sizeof(__GLPixBufferInfo));
|
||||
buf->other = (void *) bufferInfo;
|
||||
|
||||
bufferInfo->pGC = CreateScratchGC(pGlxPixmap->pDraw->pScreen,
|
||||
pGlxPixmap->pDraw->depth);
|
||||
}
|
||||
47
nx-X11/programs/Xserver/GL/glx/glxpix.h
Normal file
47
nx-X11/programs/Xserver/GL/glx/glxpix.h
Normal file
@@ -0,0 +1,47 @@
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#ifndef _glxpix_h_
|
||||
#define _glxpix_h_
|
||||
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
** Additional Notice Provisions: The application programming interfaces
|
||||
** established by SGI in conjunction with the Original Code are The
|
||||
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
|
||||
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
|
||||
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
|
||||
** Window System(R) (Version 1.3), released October 19, 1998. This software
|
||||
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
*/
|
||||
|
||||
extern void __glXInitPix(__GLdrawableBuffer *buf, __GLdrawablePrivate *glPriv,
|
||||
GLint bits, XID glxpixmapId, __GLXpixmap *pGlxPixmap);
|
||||
|
||||
#endif /* _glxpix_h_ */
|
||||
|
||||
373
nx-X11/programs/Xserver/GL/glx/glxscreens.c
Normal file
373
nx-X11/programs/Xserver/GL/glx/glxscreens.c
Normal file
@@ -0,0 +1,373 @@
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
** Additional Notice Provisions: The application programming interfaces
|
||||
** established by SGI in conjunction with the Original Code are The
|
||||
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
|
||||
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
|
||||
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
|
||||
** Window System(R) (Version 1.3), released October 19, 1998. This software
|
||||
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include <windowstr.h>
|
||||
|
||||
#include "glxserver.h"
|
||||
#include "glxutil.h"
|
||||
#include "glxext.h"
|
||||
|
||||
const char GLServerVersion[] = "1.2";
|
||||
static const char GLServerExtensions[] =
|
||||
"GL_ARB_depth_texture "
|
||||
"GL_ARB_imaging "
|
||||
"GL_ARB_multitexture "
|
||||
"GL_ARB_point_parameters "
|
||||
"GL_ARB_point_sprite "
|
||||
"GL_ARB_shadow "
|
||||
"GL_ARB_shadow_ambient "
|
||||
"GL_ARB_texture_border_clamp "
|
||||
"GL_ARB_texture_cube_map "
|
||||
"GL_ARB_texture_env_add "
|
||||
"GL_ARB_texture_env_combine "
|
||||
"GL_ARB_texture_env_crossbar "
|
||||
"GL_ARB_texture_env_dot3 "
|
||||
"GL_ARB_texture_mirrored_repeat "
|
||||
"GL_ARB_transpose_matrix "
|
||||
"GL_ARB_window_pos "
|
||||
"GL_EXT_abgr "
|
||||
"GL_EXT_bgra "
|
||||
"GL_EXT_blend_color "
|
||||
"GL_EXT_blend_func_separate "
|
||||
"GL_EXT_blend_logic_op "
|
||||
"GL_EXT_blend_minmax "
|
||||
"GL_EXT_blend_subtract "
|
||||
"GL_EXT_clip_volume_hint "
|
||||
"GL_EXT_copy_texture "
|
||||
"GL_EXT_draw_range_elements "
|
||||
"GL_EXT_fog_coord "
|
||||
"GL_EXT_multi_draw_arrays "
|
||||
"GL_EXT_packed_pixels "
|
||||
"GL_EXT_polygon_offset "
|
||||
"GL_EXT_rescale_normal "
|
||||
"GL_EXT_secondary_color "
|
||||
"GL_EXT_separate_specular_color "
|
||||
"GL_EXT_shadow_funcs "
|
||||
"GL_EXT_stencil_two_side "
|
||||
"GL_EXT_stencil_wrap "
|
||||
"GL_EXT_subtexture "
|
||||
"GL_EXT_texture "
|
||||
"GL_EXT_texture3D "
|
||||
"GL_EXT_texture_edge_clamp "
|
||||
"GL_EXT_texture_env_add "
|
||||
"GL_EXT_texture_env_combine "
|
||||
"GL_EXT_texture_env_dot3 "
|
||||
"GL_EXT_texture_lod "
|
||||
"GL_EXT_texture_lod_bias "
|
||||
"GL_EXT_texture_object "
|
||||
"GL_EXT_texture_rectangle "
|
||||
"GL_EXT_vertex_array "
|
||||
"GL_APPLE_packed_pixels "
|
||||
"GL_ATI_texture_mirror_once "
|
||||
"GL_ATI_texture_env_combine3 "
|
||||
"GL_HP_occlusion_test "
|
||||
"GL_IBM_texture_mirrored_repeat "
|
||||
"GL_MESA_pack_invert "
|
||||
"GL_MESA_ycbcr_texture "
|
||||
"GL_NV_blend_square "
|
||||
"GL_NV_point_sprite "
|
||||
"GL_NV_texgen_reflection "
|
||||
"GL_NV_texture_rectangle "
|
||||
"GL_SGIS_generate_mipmap "
|
||||
"GL_SGIS_texture_border_clamp "
|
||||
"GL_SGIS_texture_edge_clamp "
|
||||
"GL_SGIS_texture_lod "
|
||||
"GL_SGIX_depth_texture "
|
||||
"GL_SGIX_shadow "
|
||||
"GL_SGIX_shadow_ambient "
|
||||
;
|
||||
|
||||
/*
|
||||
** We have made the simplifying assuption that the same extensions are
|
||||
** supported across all screens in a multi-screen system.
|
||||
*/
|
||||
static char GLXServerVendorName[] = "SGI";
|
||||
static char GLXServerVersion[] = "1.2";
|
||||
static char GLXServerExtensions[] =
|
||||
"GLX_ARB_multisample "
|
||||
"GLX_EXT_visual_info "
|
||||
"GLX_EXT_visual_rating "
|
||||
"GLX_EXT_import_context "
|
||||
"GLX_OML_swap_method "
|
||||
"GLX_SGI_make_current_read "
|
||||
#ifndef __DARWIN__
|
||||
"GLX_SGIS_multisample "
|
||||
"GLX_SGIX_hyperpipe "
|
||||
"GLX_SGIX_swap_barrier "
|
||||
#endif
|
||||
"GLX_SGIX_fbconfig "
|
||||
;
|
||||
|
||||
/*
|
||||
* __glDDXScreenInfo comes from GLcore, so we can't resolve this symbol at
|
||||
* module open time. Leave a placeholder, and fill this in when we first
|
||||
* need it (in __glXScreenInit). XXX Why make this an array?
|
||||
*/
|
||||
static __GLXscreenInfo *__glXScreens[] = {
|
||||
NULL /* &__glDDXScreenInfo */ ,
|
||||
};
|
||||
|
||||
static GLint __glXNumStaticScreens =
|
||||
(sizeof __glXScreens / sizeof __glXScreens[0]);
|
||||
|
||||
__GLXscreenInfo *__glXActiveScreens;
|
||||
GLint __glXNumActiveScreens;
|
||||
|
||||
__GLXSwapBarrierExtensionFuncs *__glXSwapBarrierFuncs = NULL;
|
||||
static int __glXNumSwapBarrierFuncs = 0;
|
||||
__GLXHyperpipeExtensionFuncs *__glXHyperpipeFuncs = NULL;
|
||||
static int __glXNumHyperpipeFuncs = 0;
|
||||
|
||||
|
||||
RESTYPE __glXDrawableRes;
|
||||
|
||||
__GLXscreenInfo *__glXgetActiveScreen(int num) {
|
||||
return &__glXActiveScreens[num];
|
||||
}
|
||||
|
||||
/*
|
||||
** Destroy routine that gets called when a drawable is freed. A drawable
|
||||
** contains the ancillary buffers needed for rendering.
|
||||
*/
|
||||
static Bool DrawableGone(__GLXdrawablePrivate *glxPriv, XID xid)
|
||||
{
|
||||
__GLXcontext *cx, *cx1;
|
||||
|
||||
/*
|
||||
** Use glxPriv->type to figure out what kind of drawable this is. Don't
|
||||
** use glxPriv->pDraw->type because by the time this routine is called,
|
||||
** the pDraw might already have been freed.
|
||||
*/
|
||||
if (glxPriv->type == DRAWABLE_WINDOW) {
|
||||
/*
|
||||
** When a window is destroyed, notify all context bound to
|
||||
** it, that there are no longer bound to anything.
|
||||
*/
|
||||
for (cx = glxPriv->drawGlxc; cx; cx = cx1) {
|
||||
cx1 = cx->nextDrawPriv;
|
||||
cx->pendingState |= __GLX_PENDING_DESTROY;
|
||||
}
|
||||
|
||||
for (cx = glxPriv->readGlxc; cx; cx = cx1) {
|
||||
cx1 = cx->nextReadPriv;
|
||||
cx->pendingState |= __GLX_PENDING_DESTROY;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** set the size to 0, so that context that may still be using this
|
||||
** drawable not do anything harmful
|
||||
*/
|
||||
glxPriv->xorigin = 0;
|
||||
glxPriv->yorigin = 0;
|
||||
glxPriv->width = 0;
|
||||
glxPriv->height = 0;
|
||||
|
||||
__glXUnrefDrawablePrivate(glxPriv);
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
/*
|
||||
** This hook gets called when a window moves or changes size.
|
||||
*/
|
||||
static Bool PositionWindow(WindowPtr pWin, int x, int y)
|
||||
{
|
||||
ScreenPtr pScreen;
|
||||
__GLXcontext *glxc;
|
||||
__GLXdrawablePrivate *glxPriv;
|
||||
Bool ret;
|
||||
|
||||
/*
|
||||
** Call wrapped position window routine
|
||||
*/
|
||||
pScreen = pWin->drawable.pScreen;
|
||||
pScreen->PositionWindow =
|
||||
__glXActiveScreens[pScreen->myNum].WrappedPositionWindow;
|
||||
ret = (*pScreen->PositionWindow)(pWin, x, y);
|
||||
pScreen->PositionWindow = PositionWindow;
|
||||
|
||||
/*
|
||||
** Tell all contexts rendering into this window that the window size
|
||||
** has changed.
|
||||
*/
|
||||
glxPriv = (__GLXdrawablePrivate *) LookupIDByType(pWin->drawable.id,
|
||||
__glXDrawableRes);
|
||||
if (glxPriv == NULL) {
|
||||
/*
|
||||
** This window is not being used by the OpenGL.
|
||||
*/
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
** resize the drawable
|
||||
*/
|
||||
/* first change the drawable size */
|
||||
if (__glXResizeDrawableBuffers(glxPriv) == GL_FALSE) {
|
||||
/* resize failed! */
|
||||
/* XXX: what can we possibly do here? */
|
||||
ret = False;
|
||||
}
|
||||
|
||||
/* mark contexts as needing resize */
|
||||
|
||||
for (glxc = glxPriv->drawGlxc; glxc; glxc = glxc->nextDrawPriv) {
|
||||
glxc->pendingState |= __GLX_PENDING_RESIZE;
|
||||
}
|
||||
|
||||
for (glxc = glxPriv->readGlxc; glxc; glxc = glxc->nextReadPriv) {
|
||||
glxc->pendingState |= __GLX_PENDING_RESIZE;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
** Wrap our own PositionWindow routine around the server's, so we can
|
||||
** be notified when a window changes size
|
||||
*/
|
||||
static void wrapPositionWindow(int screen)
|
||||
{
|
||||
ScreenPtr pScreen = screenInfo.screens[screen];
|
||||
|
||||
__glXActiveScreens[screen].WrappedPositionWindow = pScreen->PositionWindow;
|
||||
pScreen->PositionWindow = PositionWindow;
|
||||
}
|
||||
|
||||
/*
|
||||
* If your DDX driver wants to register support for swap barriers or hyperpipe
|
||||
* topology, it should call __glXHyperpipeInit() or __glXSwapBarrierInit()
|
||||
* with a dispatch table of functions to handle the requests. In the XFree86
|
||||
* DDX, for example, you would call these near the bottom of the driver's
|
||||
* ScreenInit method, after DRI has been initialized.
|
||||
*
|
||||
* This should be replaced with a better method when we teach the server how
|
||||
* to load DRI drivers.
|
||||
*/
|
||||
|
||||
void __glXHyperpipeInit(int screen, __GLXHyperpipeExtensionFuncs *funcs)
|
||||
{
|
||||
if (__glXNumHyperpipeFuncs < screen + 1) {
|
||||
__glXHyperpipeFuncs = realloc(__glXHyperpipeFuncs,
|
||||
(screen+1) * sizeof(__GLXHyperpipeExtensionFuncs));
|
||||
__glXNumHyperpipeFuncs = screen + 1;
|
||||
}
|
||||
|
||||
__glXHyperpipeFuncs[screen].queryHyperpipeNetworkFunc =
|
||||
*funcs->queryHyperpipeNetworkFunc;
|
||||
__glXHyperpipeFuncs[screen].queryHyperpipeConfigFunc =
|
||||
*funcs->queryHyperpipeConfigFunc;
|
||||
__glXHyperpipeFuncs[screen].destroyHyperpipeConfigFunc =
|
||||
*funcs->destroyHyperpipeConfigFunc;
|
||||
__glXHyperpipeFuncs[screen].hyperpipeConfigFunc =
|
||||
*funcs->hyperpipeConfigFunc;
|
||||
}
|
||||
|
||||
void __glXSwapBarrierInit(int screen, __GLXSwapBarrierExtensionFuncs *funcs)
|
||||
{
|
||||
if (__glXNumSwapBarrierFuncs < screen + 1) {
|
||||
__glXSwapBarrierFuncs = realloc(__glXSwapBarrierFuncs,
|
||||
(screen+1) * sizeof(__GLXSwapBarrierExtensionFuncs));
|
||||
__glXNumSwapBarrierFuncs = screen + 1;
|
||||
}
|
||||
|
||||
__glXSwapBarrierFuncs[screen].bindSwapBarrierFunc =
|
||||
funcs->bindSwapBarrierFunc;
|
||||
__glXSwapBarrierFuncs[screen].queryMaxSwapBarriersFunc =
|
||||
funcs->queryMaxSwapBarriersFunc;
|
||||
}
|
||||
|
||||
void __glXScreenInit(GLint numscreens)
|
||||
{
|
||||
GLint i,j;
|
||||
|
||||
__glXScreens[0] = __glXglDDXScreenInfo(); /* from GLcore */
|
||||
|
||||
/*
|
||||
** This alloc has to work or else the server might as well core dump.
|
||||
*/
|
||||
__glXActiveScreens =
|
||||
(__GLXscreenInfo *) malloc(sizeof(__GLXscreenInfo) * numscreens);
|
||||
|
||||
for (i=0; i < numscreens; i++) {
|
||||
/*
|
||||
** Probe each static screen to see which exists.
|
||||
*/
|
||||
for (j=0; j < __glXNumStaticScreens; j++) {
|
||||
if ((*__glXScreens[j]->screenProbe)(i)) {
|
||||
__glXActiveScreens[i] = *__glXScreens[j];
|
||||
|
||||
__glXActiveScreens[i].numUsableVisuals = __glXActiveScreens[i].numVisuals;
|
||||
__glXActiveScreens[i].GLextensions = strdup(GLServerExtensions);
|
||||
__glXActiveScreens[i].GLXvendor = strdup(GLXServerVendorName);
|
||||
__glXActiveScreens[i].GLXversion = strdup(GLXServerVersion);
|
||||
__glXActiveScreens[i].GLXextensions = strdup(GLXServerExtensions);
|
||||
|
||||
__glXDrawableRes = CreateNewResourceType((DeleteType)DrawableGone);
|
||||
wrapPositionWindow(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
__glXNumActiveScreens = numscreens;
|
||||
}
|
||||
|
||||
void __glXScreenReset(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < __glXNumActiveScreens; i++) {
|
||||
free(__glXActiveScreens[i].GLXvendor);
|
||||
free(__glXActiveScreens[i].GLXversion);
|
||||
free(__glXActiveScreens[i].GLXextensions);
|
||||
free(__glXActiveScreens[i].GLextensions);
|
||||
}
|
||||
free(__glXActiveScreens);
|
||||
free(__glXHyperpipeFuncs);
|
||||
free(__glXSwapBarrierFuncs);
|
||||
__glXNumHyperpipeFuncs = 0;
|
||||
__glXNumSwapBarrierFuncs = 0;
|
||||
__glXHyperpipeFuncs = NULL;
|
||||
__glXSwapBarrierFuncs = NULL;
|
||||
__glXActiveScreens = NULL;
|
||||
__glXNumActiveScreens = 0;
|
||||
}
|
||||
102
nx-X11/programs/Xserver/GL/glx/glxscreens.h
Normal file
102
nx-X11/programs/Xserver/GL/glx/glxscreens.h
Normal file
@@ -0,0 +1,102 @@
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#ifndef _GLX_screens_h_
|
||||
#define _GLX_screens_h_
|
||||
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
** Additional Notice Provisions: The application programming interfaces
|
||||
** established by SGI in conjunction with the Original Code are The
|
||||
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
|
||||
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
|
||||
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
|
||||
** Window System(R) (Version 1.3), released October 19, 1998. This software
|
||||
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
*/
|
||||
|
||||
/* XXX: should be defined somewhere globally */
|
||||
#define CAPI
|
||||
|
||||
#include "GL/internal/glcore.h"
|
||||
|
||||
/*
|
||||
** Screen dependent data. These methods are the interface between the DIX
|
||||
** and DDX layers of the GLX server extension. The methods provide an
|
||||
** interface for context management on a screen.
|
||||
*/
|
||||
typedef struct {
|
||||
/*
|
||||
** Probe the screen and see if it supports GL rendering. It will
|
||||
** return GL_FALSE if it doesn't, GL_TRUE otherwise.
|
||||
*/
|
||||
Bool (*screenProbe)(int screen);
|
||||
|
||||
/*
|
||||
** Create a context using configuration information from modes.
|
||||
** Use imports as callbacks back to the OS. Return an opaque handle
|
||||
** on the context (NULL if failure).
|
||||
*/
|
||||
__GLinterface *(*createContext)(__GLimports *imports,
|
||||
__GLcontextModes *modes,
|
||||
__GLinterface *shareGC);
|
||||
|
||||
/*
|
||||
** Create a buffer using information from glxPriv. This routine
|
||||
** sets up any wrappers necessary to resize, swap or destroy the
|
||||
** buffer.
|
||||
*/
|
||||
void (*createBuffer)(__GLXdrawablePrivate *glxPriv);
|
||||
|
||||
/**
|
||||
* Linked list of valid context modes for this screen.
|
||||
*/
|
||||
__GLcontextModes *modes;
|
||||
|
||||
void **pVisualPriv;
|
||||
GLint numVisuals;
|
||||
GLint numUsableVisuals;
|
||||
|
||||
char *GLextensions;
|
||||
|
||||
char *GLXvendor;
|
||||
char *GLXversion;
|
||||
char *GLXextensions;
|
||||
|
||||
/*
|
||||
** Things that are not statically set.
|
||||
*/
|
||||
Bool (*WrappedPositionWindow)(WindowPtr pWin, int x, int y);
|
||||
|
||||
} __GLXscreenInfo;
|
||||
|
||||
|
||||
extern void __glXScreenInit(GLint);
|
||||
extern void __glXScreenReset(void);
|
||||
|
||||
#endif /* !__GLX_screens_h__ */
|
||||
326
nx-X11/programs/Xserver/GL/glx/glxserver.h
Normal file
326
nx-X11/programs/Xserver/GL/glx/glxserver.h
Normal file
@@ -0,0 +1,326 @@
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#ifndef _GLX_server_h_
|
||||
#define _GLX_server_h_
|
||||
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
** Additional Notice Provisions: The application programming interfaces
|
||||
** established by SGI in conjunction with the Original Code are The
|
||||
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
|
||||
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
|
||||
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
|
||||
** Window System(R) (Version 1.3), released October 19, 1998. This software
|
||||
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
*/
|
||||
|
||||
#include <nx-X11/X.h>
|
||||
#include <nx-X11/Xproto.h>
|
||||
#include <nx-X11/Xmd.h>
|
||||
#include <misc.h>
|
||||
#include <dixstruct.h>
|
||||
#include <pixmapstr.h>
|
||||
#include <gcstruct.h>
|
||||
#include <extnsionst.h>
|
||||
#include <resource.h>
|
||||
#include <scrnintstr.h>
|
||||
#include "protocol-versions.h"
|
||||
|
||||
#include <limits.h>
|
||||
/*
|
||||
** The X header misc.h defines these math functions.
|
||||
*/
|
||||
#undef abs
|
||||
#undef fabs
|
||||
|
||||
#define GL_GLEXT_PROTOTYPES /* we want prototypes */
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glxproto.h>
|
||||
#include <GL/glxint.h>
|
||||
|
||||
/* For glxscreens.h */
|
||||
typedef struct __GLXdrawablePrivateRec __GLXdrawablePrivate;
|
||||
|
||||
#include "glxscreens.h"
|
||||
#include "glxdrawable.h"
|
||||
#include "glxcontext.h"
|
||||
#include "glxerror.h"
|
||||
|
||||
|
||||
#define GLX_SERVER_MAJOR_VERSION SERVER_GLX_MAJOR_VERSION
|
||||
#define GLX_SERVER_MINOR_VERSION SERVER_GLX_MINOR_VERSION
|
||||
|
||||
#ifndef True
|
||||
#define True 1
|
||||
#endif
|
||||
#ifndef False
|
||||
#define False 0
|
||||
#endif
|
||||
|
||||
/*
|
||||
** GLX resources.
|
||||
*/
|
||||
typedef XID GLXContextID;
|
||||
typedef XID GLXPixmap;
|
||||
typedef XID GLXDrawable;
|
||||
|
||||
typedef struct __GLXcontextRec *GLXContext;
|
||||
typedef struct __GLXclientStateRec __GLXclientState;
|
||||
|
||||
extern __GLXscreenInfo *__glXActiveScreens;
|
||||
extern GLint __glXNumActiveScreens;
|
||||
extern __GLXscreenInfo *__glXgetActiveScreen(int num);
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
/*
|
||||
** The last context used (from the server's persective) is cached.
|
||||
*/
|
||||
extern __GLXcontext *__glXLastContext;
|
||||
extern __GLXcontext *__glXForceCurrent(__GLXclientState*, GLXContextTag, int*);
|
||||
|
||||
/*
|
||||
** Macros to set, unset, and retrieve the flag that says whether a context
|
||||
** has unflushed commands.
|
||||
*/
|
||||
#define __GLX_NOTE_UNFLUSHED_CMDS(glxc) glxc->hasUnflushedCommands = GL_TRUE
|
||||
#define __GLX_NOTE_FLUSHED_CMDS(glxc) glxc->hasUnflushedCommands = GL_FALSE
|
||||
#define __GLX_HAS_UNFLUSHED_CMDS(glxc) (glxc->hasUnflushedCommands)
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
/*
|
||||
** State kept per client.
|
||||
*/
|
||||
struct __GLXclientStateRec {
|
||||
/*
|
||||
** Whether this structure is currently being used to support a client.
|
||||
*/
|
||||
Bool inUse;
|
||||
|
||||
/*
|
||||
** Buffer for returned data.
|
||||
*/
|
||||
GLbyte *returnBuf;
|
||||
GLint returnBufSize;
|
||||
|
||||
/*
|
||||
** 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 */
|
||||
GLbyte *largeCmdBuf;
|
||||
GLint largeCmdBufSize;
|
||||
|
||||
/*
|
||||
** Keep a list of all the contexts that are current for this client's
|
||||
** threads.
|
||||
*/
|
||||
__GLXcontext **currentContexts;
|
||||
GLint numCurrentContexts;
|
||||
|
||||
/* Back pointer to X client record */
|
||||
ClientPtr client;
|
||||
|
||||
int GLClientmajorVersion;
|
||||
int GLClientminorVersion;
|
||||
char *GLClientextensions;
|
||||
};
|
||||
|
||||
extern __GLXclientState *__glXClients[];
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
/*
|
||||
** Dispatch tables.
|
||||
*/
|
||||
typedef void (*__GLXdispatchRenderProcPtr)(GLbyte *);
|
||||
typedef int (*__GLXdispatchSingleProcPtr)(__GLXclientState *, GLbyte *);
|
||||
typedef int (*__GLXdispatchVendorPrivProcPtr)(__GLXclientState *, GLbyte *);
|
||||
|
||||
/*
|
||||
* Dispatch for GLX commands.
|
||||
*/
|
||||
typedef int (*__GLXprocPtr)(__GLXclientState *, char *pc);
|
||||
extern __GLXprocPtr __glXProcTable[];
|
||||
|
||||
/*
|
||||
* Tables for computing the size of each rendering command.
|
||||
*/
|
||||
typedef struct {
|
||||
int bytes;
|
||||
int (*varsize)(GLbyte *pc, Bool swap, int left);
|
||||
} __GLXrenderSizeData;
|
||||
extern __GLXrenderSizeData __glXRenderSizeTable[];
|
||||
extern __GLXrenderSizeData __glXRenderSizeTable_EXT[];
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
/*
|
||||
** X resources.
|
||||
*/
|
||||
extern RESTYPE __glXContextRes;
|
||||
extern RESTYPE __glXClientRes;
|
||||
extern RESTYPE __glXPixmapRes;
|
||||
extern RESTYPE __glXDrawableRes;
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
/*
|
||||
** Prototypes.
|
||||
*/
|
||||
|
||||
extern char *__glXcombine_strings(const char *, const char *);
|
||||
|
||||
/*
|
||||
** Routines for sending swapped replies.
|
||||
*/
|
||||
|
||||
extern void __glXSwapMakeCurrentReply(ClientPtr client,
|
||||
xGLXMakeCurrentReply *reply);
|
||||
extern void __glXSwapIsDirectReply(ClientPtr client,
|
||||
xGLXIsDirectReply *reply);
|
||||
extern void __glXSwapQueryVersionReply(ClientPtr client,
|
||||
xGLXQueryVersionReply *reply);
|
||||
extern void __glXSwapQueryContextInfoEXTReply(ClientPtr client,
|
||||
xGLXQueryContextInfoEXTReply *reply,
|
||||
int *buf);
|
||||
extern void glxSwapQueryExtensionsStringReply(ClientPtr client,
|
||||
xGLXQueryExtensionsStringReply *reply, char *buf);
|
||||
extern void glxSwapQueryServerStringReply(ClientPtr client,
|
||||
xGLXQueryServerStringReply *reply, char *buf);
|
||||
|
||||
|
||||
/*
|
||||
* Routines for computing the size of variably-sized rendering commands.
|
||||
*/
|
||||
static __inline__ int
|
||||
safe_add(int a, int b)
|
||||
{
|
||||
if (a < 0 || b < 0)
|
||||
return -1;
|
||||
|
||||
if (INT_MAX - a < b)
|
||||
return -1;
|
||||
|
||||
return a + b;
|
||||
}
|
||||
|
||||
static __inline__ int
|
||||
safe_mul(int a, int b)
|
||||
{
|
||||
if (a < 0 || b < 0)
|
||||
return -1;
|
||||
|
||||
if (a == 0 || b == 0)
|
||||
return 0;
|
||||
|
||||
if (a > INT_MAX / b)
|
||||
return -1;
|
||||
|
||||
return a * b;
|
||||
}
|
||||
|
||||
static __inline__ int
|
||||
safe_pad(int a)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (a < 0)
|
||||
return -1;
|
||||
|
||||
if ((ret = safe_add(a, 3)) < 0)
|
||||
return -1;
|
||||
|
||||
return ret & (GLuint)~3;
|
||||
}
|
||||
|
||||
extern int __glXTypeSize(GLenum enm);
|
||||
extern int __glXImageSize(GLenum format, GLenum type,
|
||||
GLenum target, GLsizei w, GLsizei h, GLsizei d,
|
||||
GLint imageHeight, GLint rowLength, GLint skipImages, GLint skipRows,
|
||||
GLint alignment);
|
||||
|
||||
extern int __glXCallListsReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
extern int __glXBitmapReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
extern int __glXFogfvReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
extern int __glXFogivReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
extern int __glXLightfvReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
extern int __glXLightivReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
extern int __glXLightModelfvReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
extern int __glXLightModelivReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
extern int __glXMaterialfvReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
extern int __glXMaterialivReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
extern int __glXTexParameterfvReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
extern int __glXTexParameterivReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
extern int __glXTexImage1DReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
extern int __glXTexImage2DReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
extern int __glXTexEnvfvReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
extern int __glXTexEnvivReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
extern int __glXTexGendvReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
extern int __glXTexGenfvReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
extern int __glXTexGenivReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
extern int __glXMap1dReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
extern int __glXMap1fReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
extern int __glXMap2dReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
extern int __glXMap2fReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
extern int __glXPixelMapfvReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
extern int __glXPixelMapuivReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
extern int __glXPixelMapusvReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
extern int __glXDrawPixelsReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
extern int __glXDrawArraysSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
extern int __glXPrioritizeTexturesReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
extern int __glXTexSubImage1DReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
extern int __glXTexSubImage2DReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
extern int __glXTexImage3DReqSize(GLbyte *pc, Bool swap, int reqlen );
|
||||
extern int __glXTexSubImage3DReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
extern int __glXConvolutionFilter1DReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
extern int __glXConvolutionFilter2DReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
extern int __glXConvolutionParameterivReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
extern int __glXConvolutionParameterfvReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
extern int __glXSeparableFilter2DReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
extern int __glXColorTableReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
extern int __glXColorSubTableReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
extern int __glXColorTableParameterfvReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
extern int __glXColorTableParameterivReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
|
||||
/*
|
||||
* 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);
|
||||
|
||||
extern int __glXPointParameterfvARBReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
extern int __glXPointParameterivReqSize(GLbyte *pc, Bool swap, int reqlen);
|
||||
|
||||
#endif /* !__GLX_server_h__ */
|
||||
433
nx-X11/programs/Xserver/GL/glx/glxutil.c
Normal file
433
nx-X11/programs/Xserver/GL/glx/glxutil.c
Normal file
@@ -0,0 +1,433 @@
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
** Additional Notice Provisions: The application programming interfaces
|
||||
** established by SGI in conjunction with the Original Code are The
|
||||
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
|
||||
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
|
||||
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
|
||||
** Window System(R) (Version 1.3), released October 19, 1998. This software
|
||||
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
*/
|
||||
|
||||
#define FONT_PCF
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "glxserver.h"
|
||||
#include <GL/glxtokens.h>
|
||||
#include <unpack.h>
|
||||
#include <pixmapstr.h>
|
||||
#include <windowstr.h>
|
||||
#include "glxutil.h"
|
||||
#include "glxbuf.h"
|
||||
#include "GL/internal/glcore.h"
|
||||
#include "GL/glxint.h"
|
||||
#include "glcontextmodes.h"
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
void __glXNop(void) {}
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
/* Context stuff */
|
||||
|
||||
/*
|
||||
** associate a context with a drawable
|
||||
*/
|
||||
void
|
||||
__glXAssociateContext(__GLXcontext *glxc)
|
||||
{
|
||||
glxc->nextDrawPriv = glxc->drawPriv->drawGlxc;
|
||||
glxc->drawPriv->drawGlxc = glxc;
|
||||
|
||||
__glXRefDrawablePrivate(glxc->drawPriv);
|
||||
|
||||
|
||||
glxc->nextReadPriv = glxc->readPriv->readGlxc;
|
||||
glxc->readPriv->readGlxc = glxc;
|
||||
|
||||
__glXRefDrawablePrivate(glxc->readPriv);
|
||||
}
|
||||
|
||||
/*
|
||||
** Deassociate a context from a drawable
|
||||
*/
|
||||
void
|
||||
__glXDeassociateContext(__GLXcontext *glxc)
|
||||
{
|
||||
__GLXcontext *curr, *prev;
|
||||
|
||||
prev = NULL;
|
||||
for ( curr = glxc->drawPriv->drawGlxc
|
||||
; curr != NULL
|
||||
; prev = curr, curr = curr->nextDrawPriv ) {
|
||||
if (curr == glxc) {
|
||||
/* found context. Deassociate. */
|
||||
if (prev == NULL) {
|
||||
glxc->drawPriv->drawGlxc = curr->nextDrawPriv;
|
||||
} else {
|
||||
prev->nextDrawPriv = curr->nextDrawPriv;
|
||||
}
|
||||
curr->nextDrawPriv = NULL;
|
||||
__glXUnrefDrawablePrivate(glxc->drawPriv);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
prev = NULL;
|
||||
for ( curr = glxc->readPriv->readGlxc
|
||||
; curr != NULL
|
||||
; prev = curr, curr = curr->nextReadPriv ) {
|
||||
if (curr == glxc) {
|
||||
/* found context. Deassociate. */
|
||||
if (prev == NULL) {
|
||||
glxc->readPriv->readGlxc = curr->nextReadPriv;
|
||||
} else {
|
||||
prev->nextReadPriv = curr->nextReadPriv;
|
||||
}
|
||||
curr->nextReadPriv = NULL;
|
||||
__glXUnrefDrawablePrivate(glxc->readPriv);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
void
|
||||
__glXGetDrawableSize(__GLdrawablePrivate *glPriv,
|
||||
GLint *x, GLint *y, GLuint *width, GLuint *height)
|
||||
{
|
||||
__GLXdrawablePrivate *glxPriv = (__GLXdrawablePrivate *)glPriv->other;
|
||||
|
||||
if (glxPriv) {
|
||||
*x = glxPriv->xorigin;
|
||||
*y = glxPriv->yorigin;
|
||||
*width = glxPriv->width;
|
||||
*height = glxPriv->height;
|
||||
} else {
|
||||
*x = *y = *width = *height = 0;
|
||||
}
|
||||
}
|
||||
|
||||
GLboolean
|
||||
__glXResizeDrawable(__GLdrawablePrivate *glPriv)
|
||||
{
|
||||
/* nothing to be done here */
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/* accessing the drawable private */
|
||||
|
||||
static void
|
||||
LockDP(__GLdrawablePrivate *glPriv, __GLcontext *gc)
|
||||
{
|
||||
__GLinterface *glci = (__GLinterface *) gc;
|
||||
__GLXcontext *glxc = (__GLXcontext *) glci->imports.other;
|
||||
|
||||
/* quick exit test */
|
||||
if ((glxc->pendingState &
|
||||
(__GLX_PENDING_RESIZE |
|
||||
__GLX_PENDING_DESTROY |
|
||||
__GLX_PENDING_SWAP)) == 0x0)
|
||||
return;
|
||||
|
||||
/* some pending state. Deal with it */
|
||||
if (glxc->pendingState & __GLX_PENDING_RESIZE) {
|
||||
glxc->pendingState &= ~__GLX_PENDING_RESIZE;
|
||||
|
||||
(*glci->exports.notifyResize)(gc);
|
||||
assert((glxc->pendingState & __GLX_PENDING_RESIZE) == 0x0);
|
||||
}
|
||||
if (glxc->pendingState & __GLX_PENDING_DESTROY) {
|
||||
glxc->pendingState &= ~__GLX_PENDING_DESTROY;
|
||||
|
||||
assert(glxc->drawPriv->xorigin == 0);
|
||||
assert(glxc->drawPriv->yorigin == 0);
|
||||
assert(glxc->drawPriv->width == 0);
|
||||
assert(glxc->drawPriv->height == 0);
|
||||
assert(glxc->readPriv->xorigin == 0);
|
||||
assert(glxc->readPriv->yorigin == 0);
|
||||
assert(glxc->readPriv->width == 0);
|
||||
assert(glxc->readPriv->height == 0);
|
||||
(*glci->exports.notifyDestroy)(gc);
|
||||
__glXDeassociateContext(glxc);
|
||||
assert((glxc->pendingState & __GLX_PENDING_DESTROY) == 0x0);
|
||||
}
|
||||
if (glxc->pendingState & __GLX_PENDING_SWAP) {
|
||||
|
||||
glxc->pendingState &= ~__GLX_PENDING_SWAP;
|
||||
|
||||
(*glci->exports.notifySwapBuffers)(gc);
|
||||
assert((glxc->pendingState & __GLX_PENDING_SWAP) == 0x0);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
UnlockDP(__GLdrawablePrivate *glPriv)
|
||||
{
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Drawable private stuff */
|
||||
|
||||
void
|
||||
__glXRefDrawablePrivate(__GLXdrawablePrivate *glxPriv)
|
||||
{
|
||||
glxPriv->refCount++;
|
||||
}
|
||||
|
||||
void
|
||||
__glXUnrefDrawablePrivate(__GLXdrawablePrivate *glxPriv)
|
||||
{
|
||||
glxPriv->refCount--;
|
||||
if (glxPriv->refCount == 0) {
|
||||
__glXDestroyDrawablePrivate(glxPriv);
|
||||
}
|
||||
}
|
||||
|
||||
__GLXdrawablePrivate *
|
||||
__glXCreateDrawablePrivate(DrawablePtr pDraw, XID drawId,
|
||||
__GLcontextModes *modes)
|
||||
{
|
||||
__GLXdrawablePrivate *glxPriv;
|
||||
__GLdrawablePrivate *glPriv;
|
||||
__GLXscreenInfo *pGlxScreen;
|
||||
|
||||
glxPriv = (__GLXdrawablePrivate *) malloc(sizeof(*glxPriv));
|
||||
memset(glxPriv, 0, sizeof(__GLXdrawablePrivate));
|
||||
|
||||
glxPriv->type = pDraw->type;
|
||||
glxPriv->pDraw = pDraw;
|
||||
glxPriv->drawId = drawId;
|
||||
|
||||
/* if not a pixmap, lookup will fail, so pGlxPixmap will be NULL */
|
||||
glxPriv->pGlxPixmap = (__GLXpixmap *)
|
||||
LookupIDByType(drawId, __glXPixmapRes);
|
||||
/* since we are creating the drawablePrivate, drawId should be new */
|
||||
if (!AddResource(drawId, __glXDrawableRes, glxPriv)) {
|
||||
/* oops! */
|
||||
free(glxPriv);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* fill up glPriv */
|
||||
glPriv = &glxPriv->glPriv;
|
||||
glPriv->modes = (__GLcontextModes *) malloc(sizeof(__GLcontextModes));
|
||||
*glPriv->modes = *modes;
|
||||
glPriv->malloc = malloc;
|
||||
glPriv->calloc = calloc;
|
||||
glPriv->realloc = realloc;
|
||||
glPriv->free = free;
|
||||
glPriv->addSwapRect = NULL;
|
||||
glPriv->setClipRect = (void (*)(__GLdrawablePrivate *, GLint, GLint, GLsizei, GLsizei)) __glXNop;
|
||||
glPriv->lockDP = LockDP;
|
||||
glPriv->unlockDP = UnlockDP;
|
||||
glPriv->getDrawableSize = __glXGetDrawableSize;
|
||||
glPriv->resize = __glXResizeDrawable;
|
||||
glPriv->other = glxPriv;
|
||||
|
||||
/* allocate a one-rect ownership region */
|
||||
glPriv->ownershipRegion.rects =
|
||||
(__GLregionRect *)calloc(1, sizeof(__GLregionRect));
|
||||
glPriv->ownershipRegion.numRects = 1;
|
||||
|
||||
glxPriv->freeBuffers = __glXFreeBuffers;
|
||||
glxPriv->updatePalette = (void (*)(__GLXdrawablePrivate *)) __glXNop;
|
||||
|
||||
pGlxScreen = &__glXActiveScreens[pDraw->pScreen->myNum];
|
||||
|
||||
if (glxPriv->type == DRAWABLE_WINDOW) {
|
||||
VisualID vid = wVisual((WindowPtr)pDraw);
|
||||
|
||||
glxPriv->modes = _gl_context_modes_find_visual( pGlxScreen->modes, vid );
|
||||
__glXFBInitDrawable(glxPriv, modes);
|
||||
} else {
|
||||
glxPriv->modes = glxPriv->pGlxPixmap->modes;
|
||||
__glXPixInitDrawable(glxPriv, modes);
|
||||
}
|
||||
|
||||
/* initialize the core's private buffer information */
|
||||
(*pGlxScreen->createBuffer)(glxPriv);
|
||||
|
||||
return glxPriv;
|
||||
}
|
||||
|
||||
GLboolean
|
||||
__glXDestroyDrawablePrivate(__GLXdrawablePrivate *glxPriv)
|
||||
{
|
||||
__GLdrawablePrivate *glPriv = &glxPriv->glPriv;
|
||||
|
||||
/* remove the drawable from the drawable list */
|
||||
FreeResourceByType(glxPriv->drawId, __glXDrawableRes, FALSE);
|
||||
|
||||
/* Have the core free any memory it may have attached to the drawable */
|
||||
if (glPriv->freePrivate) {
|
||||
(*glPriv->freePrivate)(glPriv);
|
||||
}
|
||||
|
||||
/* Free any framebuffer memory attached to the drawable */
|
||||
if (glxPriv->freeBuffers) {
|
||||
(*glxPriv->freeBuffers)(glxPriv);
|
||||
}
|
||||
|
||||
/* Free the drawable Private */
|
||||
free(glxPriv->glPriv.modes);
|
||||
free(glxPriv->glPriv.ownershipRegion.rects);
|
||||
free(glxPriv);
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
__GLXdrawablePrivate *
|
||||
__glXFindDrawablePrivate(XID drawId)
|
||||
{
|
||||
__GLXdrawablePrivate *glxPriv;
|
||||
|
||||
glxPriv = (__GLXdrawablePrivate *)LookupIDByType(drawId, __glXDrawableRes);
|
||||
|
||||
return glxPriv;
|
||||
}
|
||||
|
||||
__GLXdrawablePrivate *
|
||||
__glXGetDrawablePrivate(DrawablePtr pDraw, XID drawId,
|
||||
__GLcontextModes *modes)
|
||||
{
|
||||
__GLXdrawablePrivate *glxPriv;
|
||||
|
||||
glxPriv = __glXFindDrawablePrivate(drawId);
|
||||
|
||||
if (glxPriv == NULL) {
|
||||
glxPriv = __glXCreateDrawablePrivate(pDraw, drawId, modes);
|
||||
if (glxPriv) {
|
||||
__glXRefDrawablePrivate(glxPriv);
|
||||
}
|
||||
}
|
||||
|
||||
return glxPriv;
|
||||
}
|
||||
|
||||
void
|
||||
__glXCacheDrawableSize(__GLXdrawablePrivate *glxPriv)
|
||||
{
|
||||
if (glxPriv) {
|
||||
if (glxPriv->pDraw) {
|
||||
glxPriv->xorigin = glxPriv->pDraw->x;
|
||||
glxPriv->yorigin = glxPriv->pDraw->y;
|
||||
glxPriv->width = glxPriv->pDraw->width;
|
||||
glxPriv->height = glxPriv->pDraw->height;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** resize/move the drawable. Called during the actual resize callback
|
||||
** to update the drawable side of the buffers
|
||||
*/
|
||||
GLboolean
|
||||
__glXResizeDrawableBuffers(__GLXdrawablePrivate *glxPriv)
|
||||
{
|
||||
__GLdrawablePrivate *glPriv = &glxPriv->glPriv;
|
||||
GLint x, y;
|
||||
GLuint w, h;
|
||||
#if defined(__GL_ALIGNED_BUFFERS)
|
||||
GLint xAlignment, yAlignment;
|
||||
GLint xOffset, yOffset;
|
||||
GLint xStart, xEnd;
|
||||
GLint yStart, yEnd;
|
||||
GLuint xAlignedMask, yAlignedMask;
|
||||
#endif
|
||||
GLboolean status = GL_TRUE;
|
||||
|
||||
__glXCacheDrawableSize(glxPriv);
|
||||
|
||||
w = glxPriv->width;
|
||||
h = glxPriv->height;
|
||||
x = glxPriv->xorigin;
|
||||
y = glxPriv->yorigin;
|
||||
|
||||
#if defined(__GL_ALIGNED_BUFFERS)
|
||||
xAlignment = glPriv->xAlignment;
|
||||
yAlignment = glPriv->yAlignment;
|
||||
|
||||
xOffset = x & (xAlignment-1);
|
||||
yOffset = y & (yAlignment-1);
|
||||
|
||||
xAlignedMask = ~(xAlignment-1);
|
||||
yAlignedMask = ~(yAlignment-1);
|
||||
|
||||
xStart = x; xEnd = x+w;
|
||||
yStart = y; yEnd = y+h;
|
||||
|
||||
xStart &= xAlignedMask;
|
||||
if (xEnd & ~xAlignedMask) {
|
||||
xEnd = (xEnd&xAlignedMask) + xAlignment;
|
||||
}
|
||||
yStart &= yAlignedMask;
|
||||
if (yEnd & ~yAlignedMask) {
|
||||
yEnd = (yEnd&yAlignedMask) + yAlignment;
|
||||
}
|
||||
|
||||
x = xStart; y = yStart;
|
||||
w = xEnd-xStart; h = yEnd-yStart;
|
||||
#endif
|
||||
|
||||
if ((x != glPriv->xOrigin) ||
|
||||
(y != glPriv->yOrigin) ||
|
||||
#if defined(__GL_ALIGNED_BUFFERS)
|
||||
(xOffset != glPriv->xOffset) ||
|
||||
(yOffset != glPriv->yOffset) ||
|
||||
#endif
|
||||
(w != glPriv->width) ||
|
||||
(h != glPriv->height) ||
|
||||
(!w && !h)) {
|
||||
/* set up the glPriv info */
|
||||
glPriv->width = w;
|
||||
glPriv->height = h;
|
||||
glPriv->xOrigin = x;
|
||||
glPriv->yOrigin = y;
|
||||
#if defined(__GL_ALIGNED_BUFFERS)
|
||||
glPriv->xOffset = xOffset;
|
||||
glPriv->yOffset = yOffset;
|
||||
#endif
|
||||
|
||||
/* notify the buffers */
|
||||
status = __glXResizeBuffers(glPriv, x, y, w, h);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
77
nx-X11/programs/Xserver/GL/glx/glxutil.h
Normal file
77
nx-X11/programs/Xserver/GL/glx/glxutil.h
Normal file
@@ -0,0 +1,77 @@
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#ifndef _glxcmds_h_
|
||||
#define _glxcmds_h_
|
||||
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
** Additional Notice Provisions: The application programming interfaces
|
||||
** established by SGI in conjunction with the Original Code are The
|
||||
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
|
||||
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
|
||||
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
|
||||
** Window System(R) (Version 1.3), released October 19, 1998. This software
|
||||
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
*/
|
||||
|
||||
extern void __glXNop(void);
|
||||
|
||||
/* relate contexts with drawables */
|
||||
extern void __glXAssociateContext(__GLXcontext *glxc);
|
||||
extern void __glXDeassociateContext(__GLXcontext *glxc);
|
||||
|
||||
/* drawable operation */
|
||||
extern void __glXGetDrawableSize(__GLdrawablePrivate *glPriv,
|
||||
GLint *x, GLint *y,
|
||||
GLuint *width, GLuint *height);
|
||||
extern GLboolean __glXResizeDrawable(__GLdrawablePrivate *glPriv);
|
||||
extern GLboolean __glXResizeDrawableBuffers(__GLXdrawablePrivate *glxPriv);
|
||||
|
||||
/* drawable management */
|
||||
extern void __glXRefDrawablePrivate(__GLXdrawablePrivate *glxPriv);
|
||||
extern void __glXUnrefDrawablePrivate(__GLXdrawablePrivate *glxPriv);
|
||||
extern __GLXdrawablePrivate *__glXCreateDrawablePrivate(DrawablePtr pDraw,
|
||||
XID glxpixmapId,
|
||||
__GLcontextModes *modes);
|
||||
extern GLboolean __glXDestroyDrawablePrivate(__GLXdrawablePrivate *glxPriv);
|
||||
extern __GLXdrawablePrivate *__glXFindDrawablePrivate(XID glxpixmapId);
|
||||
extern __GLXdrawablePrivate *__glXGetDrawablePrivate(DrawablePtr pDraw,
|
||||
XID glxpixmapId,
|
||||
__GLcontextModes *modes);
|
||||
extern void __glXCacheDrawableSize(__GLXdrawablePrivate *glxPriv);
|
||||
|
||||
/* context helper routines */
|
||||
extern __GLXcontext *__glXLookupContextByTag(__GLXclientState*, GLXContextTag);
|
||||
|
||||
/* init helper routines */
|
||||
extern void *__glXglDDXScreenInfo(void);
|
||||
extern void *__glXglDDXExtensionInfo(void);
|
||||
|
||||
#endif /* _glxcmds_h_ */
|
||||
|
||||
55
nx-X11/programs/Xserver/GL/glx/impsize.h
Normal file
55
nx-X11/programs/Xserver/GL/glx/impsize.h
Normal file
@@ -0,0 +1,55 @@
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#ifndef _impsize_h_
|
||||
#define _impsize_h_
|
||||
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
** Additional Notice Provisions: The application programming interfaces
|
||||
** established by SGI in conjunction with the Original Code are The
|
||||
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
|
||||
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
|
||||
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
|
||||
** Window System(R) (Version 1.3), released October 19, 1998. This software
|
||||
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
*/
|
||||
|
||||
/*
|
||||
** These are defined in libsampleGL.a. They are not technically part of
|
||||
** the defined interface between libdixGL.a and libsampleGL.a (that interface
|
||||
** being the functions in the __glXScreenInfo structure, plus the OpenGL API
|
||||
** itself), but we thought it was better to call these routines than to
|
||||
** replicate the code in here.
|
||||
*/
|
||||
|
||||
#include "indirect_size.h"
|
||||
|
||||
extern int __glDrawPixels_size(GLenum format, GLenum type, GLsizei w,GLsizei h);
|
||||
|
||||
#endif /* _impsize_h_ */
|
||||
269
nx-X11/programs/Xserver/GL/glx/render2.c
Normal file
269
nx-X11/programs/Xserver/GL/glx/render2.c
Normal file
@@ -0,0 +1,269 @@
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
** Additional Notice Provisions: The application programming interfaces
|
||||
** established by SGI in conjunction with the Original Code are The
|
||||
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
|
||||
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
|
||||
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
|
||||
** Window System(R) (Version 1.3), released October 19, 1998. This software
|
||||
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <glxserver.h>
|
||||
#include "unpack.h"
|
||||
#include "g_disptab.h"
|
||||
#include "g_disptab_EXT.h"
|
||||
#include "indirect_size.h"
|
||||
|
||||
void __glXDisp_Map1f(GLbyte *pc)
|
||||
{
|
||||
GLint order, k;
|
||||
GLfloat u1, u2, *points;
|
||||
GLenum target;
|
||||
|
||||
target = *(GLenum *)(pc + 0);
|
||||
order = *(GLint *)(pc + 12);
|
||||
u1 = *(GLfloat *)(pc + 4);
|
||||
u2 = *(GLfloat *)(pc + 8);
|
||||
points = (GLfloat *)(pc + 16);
|
||||
k = __glMap1f_size(target);
|
||||
|
||||
glMap1f(target, u1, u2, k, order, points);
|
||||
}
|
||||
|
||||
void __glXDisp_Map2f(GLbyte *pc)
|
||||
{
|
||||
GLint uorder, vorder, ustride, vstride, k;
|
||||
GLfloat u1, u2, v1, v2, *points;
|
||||
GLenum target;
|
||||
|
||||
target = *(GLenum *)(pc + 0);
|
||||
uorder = *(GLint *)(pc + 12);
|
||||
vorder = *(GLint *)(pc + 24);
|
||||
u1 = *(GLfloat *)(pc + 4);
|
||||
u2 = *(GLfloat *)(pc + 8);
|
||||
v1 = *(GLfloat *)(pc + 16);
|
||||
v2 = *(GLfloat *)(pc + 20);
|
||||
points = (GLfloat *)(pc + 28);
|
||||
|
||||
k = __glMap2f_size(target);
|
||||
ustride = vorder * k;
|
||||
vstride = k;
|
||||
|
||||
glMap2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
|
||||
}
|
||||
|
||||
void __glXDisp_Map1d(GLbyte *pc)
|
||||
{
|
||||
GLint order, k;
|
||||
#ifdef __GLX_ALIGN64
|
||||
GLint compsize;
|
||||
#endif
|
||||
GLenum target;
|
||||
GLdouble u1, u2, *points;
|
||||
|
||||
target = *(GLenum*) (pc + 16);
|
||||
order = *(GLint*) (pc + 20);
|
||||
k = __glMap1d_size(target);
|
||||
|
||||
#ifdef __GLX_ALIGN64
|
||||
if (order < 0 || k < 0) {
|
||||
compsize = 0;
|
||||
} else {
|
||||
compsize = order * k;
|
||||
}
|
||||
#endif
|
||||
|
||||
__GLX_GET_DOUBLE(u1,pc);
|
||||
__GLX_GET_DOUBLE(u2,pc+8);
|
||||
pc += 24;
|
||||
|
||||
#ifdef __GLX_ALIGN64
|
||||
if (((unsigned long)pc) & 7) {
|
||||
/*
|
||||
** Copy the doubles up 4 bytes, trashing the command but aligning
|
||||
** the data in the process
|
||||
*/
|
||||
__GLX_MEM_COPY(pc-4, pc, compsize*8);
|
||||
points = (GLdouble*) (pc - 4);
|
||||
} else {
|
||||
points = (GLdouble*) pc;
|
||||
}
|
||||
#else
|
||||
points = (GLdouble*) pc;
|
||||
#endif
|
||||
glMap1d(target, u1, u2, k, order, points);
|
||||
}
|
||||
|
||||
void __glXDisp_Map2d(GLbyte *pc)
|
||||
{
|
||||
GLdouble u1, u2, v1, v2, *points;
|
||||
GLint uorder, vorder, ustride, vstride, k;
|
||||
#ifdef __GLX_ALIGN64
|
||||
GLint compsize;
|
||||
#endif
|
||||
GLenum target;
|
||||
|
||||
target = *(GLenum *)(pc + 32);
|
||||
uorder = *(GLint *)(pc + 36);
|
||||
vorder = *(GLint *)(pc + 40);
|
||||
k = __glMap2d_size(target);
|
||||
|
||||
#ifdef __GLX_ALIGN64
|
||||
if (vorder < 0 || uorder < 0 || k < 0) {
|
||||
compsize = 0;
|
||||
} else {
|
||||
compsize = uorder * vorder * k;
|
||||
}
|
||||
#endif
|
||||
|
||||
__GLX_GET_DOUBLE(u1,pc);
|
||||
__GLX_GET_DOUBLE(u2,pc+8);
|
||||
__GLX_GET_DOUBLE(v1,pc+16);
|
||||
__GLX_GET_DOUBLE(v2,pc+24);
|
||||
pc += 44;
|
||||
|
||||
ustride = vorder * k;
|
||||
vstride = k;
|
||||
|
||||
#ifdef __GLX_ALIGN64
|
||||
if (((unsigned long)pc) & 7) {
|
||||
/*
|
||||
** Copy the doubles up 4 bytes, trashing the command but aligning
|
||||
** the data in the process
|
||||
*/
|
||||
__GLX_MEM_COPY(pc-4, pc, compsize*8);
|
||||
points = (GLdouble*) (pc - 4);
|
||||
} else {
|
||||
points = (GLdouble*) pc;
|
||||
}
|
||||
#else
|
||||
points = (GLdouble*) pc;
|
||||
#endif
|
||||
glMap2d(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
|
||||
}
|
||||
|
||||
void __glXDisp_CallLists(GLbyte *pc)
|
||||
{
|
||||
GLenum type;
|
||||
GLsizei n;
|
||||
|
||||
type = *(GLenum *)(pc + 4);
|
||||
n = *(GLsizei *)(pc + 0);
|
||||
glCallLists(n, type, pc + 8);
|
||||
}
|
||||
|
||||
void __glXDisp_DrawArrays(GLbyte *pc)
|
||||
{
|
||||
__GLXdispatchDrawArraysHeader *hdr = (__GLXdispatchDrawArraysHeader *)pc;
|
||||
__GLXdispatchDrawArraysComponentHeader *compHeader;
|
||||
GLint numVertexes = hdr->numVertexes;
|
||||
GLint numComponents = hdr->numComponents;
|
||||
GLenum primType = hdr->primType;
|
||||
GLint stride = 0;
|
||||
int i;
|
||||
|
||||
pc += sizeof(__GLXdispatchDrawArraysHeader);
|
||||
compHeader = (__GLXdispatchDrawArraysComponentHeader *)pc;
|
||||
|
||||
/* compute stride (same for all component arrays) */
|
||||
for (i = 0; i < numComponents; i++) {
|
||||
GLenum datatype = compHeader[i].datatype;
|
||||
GLint numVals = compHeader[i].numVals;
|
||||
|
||||
stride += __GLX_PAD(numVals * __glXTypeSize(datatype));
|
||||
}
|
||||
|
||||
pc += numComponents * sizeof(__GLXdispatchDrawArraysComponentHeader);
|
||||
|
||||
/* set up component arrays */
|
||||
for (i = 0; i < numComponents; i++) {
|
||||
GLenum datatype = compHeader[i].datatype;
|
||||
GLint numVals = compHeader[i].numVals;
|
||||
GLenum component = compHeader[i].component;
|
||||
|
||||
switch (component) {
|
||||
case GL_VERTEX_ARRAY:
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
glVertexPointer(numVals, datatype, stride, pc);
|
||||
break;
|
||||
case GL_NORMAL_ARRAY:
|
||||
glEnableClientState(GL_NORMAL_ARRAY);
|
||||
glNormalPointer(datatype, stride, pc);
|
||||
break;
|
||||
case GL_COLOR_ARRAY:
|
||||
glEnableClientState(GL_COLOR_ARRAY);
|
||||
glColorPointer(numVals, datatype, stride, pc);
|
||||
break;
|
||||
case GL_INDEX_ARRAY:
|
||||
glEnableClientState(GL_INDEX_ARRAY);
|
||||
glIndexPointer(datatype, stride, pc);
|
||||
break;
|
||||
case GL_TEXTURE_COORD_ARRAY:
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glTexCoordPointer(numVals, datatype, stride, pc);
|
||||
break;
|
||||
case GL_EDGE_FLAG_ARRAY:
|
||||
glEnableClientState(GL_EDGE_FLAG_ARRAY);
|
||||
glEdgeFlagPointer(stride, (const GLboolean *)pc);
|
||||
break;
|
||||
case GL_SECONDARY_COLOR_ARRAY:
|
||||
glEnableClientState(GL_SECONDARY_COLOR_ARRAY);
|
||||
glSecondaryColorPointer(numVals, datatype, stride, pc);
|
||||
break;
|
||||
case GL_FOG_COORD_ARRAY:
|
||||
glEnableClientState(GL_FOG_COORD_ARRAY);
|
||||
glFogCoordPointer(datatype, stride, pc);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
pc += __GLX_PAD(numVals * __glXTypeSize(datatype));
|
||||
}
|
||||
|
||||
glDrawArrays(primType, 0, numVertexes);
|
||||
|
||||
/* turn off anything we might have turned on */
|
||||
glDisableClientState(GL_VERTEX_ARRAY);
|
||||
glDisableClientState(GL_NORMAL_ARRAY);
|
||||
glDisableClientState(GL_COLOR_ARRAY);
|
||||
glDisableClientState(GL_INDEX_ARRAY);
|
||||
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glDisableClientState(GL_EDGE_FLAG_ARRAY);
|
||||
glDisableClientState(GL_SECONDARY_COLOR_ARRAY);
|
||||
glDisableClientState(GL_FOG_COORD_ARRAY);
|
||||
}
|
||||
|
||||
void __glXDisp_DrawArraysEXT(GLbyte *pc)
|
||||
{
|
||||
__glXDisp_DrawArrays(pc);
|
||||
}
|
||||
391
nx-X11/programs/Xserver/GL/glx/render2swap.c
Normal file
391
nx-X11/programs/Xserver/GL/glx/render2swap.c
Normal file
@@ -0,0 +1,391 @@
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
** Additional Notice Provisions: The application programming interfaces
|
||||
** established by SGI in conjunction with the Original Code are The
|
||||
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
|
||||
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
|
||||
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
|
||||
** Window System(R) (Version 1.3), released October 19, 1998. This software
|
||||
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include "glxserver.h"
|
||||
#include "unpack.h"
|
||||
#include "g_disptab.h"
|
||||
#include "g_disptab_EXT.h"
|
||||
#include "indirect_size.h"
|
||||
|
||||
void __glXDispSwap_Map1f(GLbyte *pc)
|
||||
{
|
||||
GLint order, k;
|
||||
GLfloat u1, u2, *points;
|
||||
GLenum target;
|
||||
GLint compsize;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
|
||||
|
||||
__GLX_SWAP_INT(pc + 0);
|
||||
__GLX_SWAP_INT(pc + 12);
|
||||
__GLX_SWAP_FLOAT(pc + 4);
|
||||
__GLX_SWAP_FLOAT(pc + 8);
|
||||
|
||||
target = *(GLenum *)(pc + 0);
|
||||
order = *(GLint *)(pc + 12);
|
||||
u1 = *(GLfloat *)(pc + 4);
|
||||
u2 = *(GLfloat *)(pc + 8);
|
||||
points = (GLfloat *)(pc + 16);
|
||||
k = __glMap1f_size(target);
|
||||
|
||||
if (order <= 0 || k < 0) {
|
||||
/* Erroneous command. */
|
||||
compsize = 0;
|
||||
} else {
|
||||
compsize = order * k;
|
||||
}
|
||||
__GLX_SWAP_FLOAT_ARRAY(points, compsize);
|
||||
|
||||
glMap1f(target, u1, u2, k, order, points);
|
||||
}
|
||||
|
||||
void __glXDispSwap_Map2f(GLbyte *pc)
|
||||
{
|
||||
GLint uorder, vorder, ustride, vstride, k;
|
||||
GLfloat u1, u2, v1, v2, *points;
|
||||
GLenum target;
|
||||
GLint compsize;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
|
||||
|
||||
__GLX_SWAP_INT(pc + 0);
|
||||
__GLX_SWAP_INT(pc + 12);
|
||||
__GLX_SWAP_INT(pc + 24);
|
||||
__GLX_SWAP_FLOAT(pc + 4);
|
||||
__GLX_SWAP_FLOAT(pc + 8);
|
||||
__GLX_SWAP_FLOAT(pc + 16);
|
||||
__GLX_SWAP_FLOAT(pc + 20);
|
||||
|
||||
target = *(GLenum *)(pc + 0);
|
||||
uorder = *(GLint *)(pc + 12);
|
||||
vorder = *(GLint *)(pc + 24);
|
||||
u1 = *(GLfloat *)(pc + 4);
|
||||
u2 = *(GLfloat *)(pc + 8);
|
||||
v1 = *(GLfloat *)(pc + 16);
|
||||
v2 = *(GLfloat *)(pc + 20);
|
||||
points = (GLfloat *)(pc + 28);
|
||||
|
||||
k = __glMap2f_size(target);
|
||||
ustride = vorder * k;
|
||||
vstride = k;
|
||||
|
||||
if (vorder <= 0 || uorder <= 0 || k < 0) {
|
||||
/* Erroneous command. */
|
||||
compsize = 0;
|
||||
} else {
|
||||
compsize = uorder * vorder * k;
|
||||
}
|
||||
__GLX_SWAP_FLOAT_ARRAY(points, compsize);
|
||||
|
||||
glMap2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
|
||||
}
|
||||
|
||||
void __glXDispSwap_Map1d(GLbyte *pc)
|
||||
{
|
||||
GLint order, k, compsize;
|
||||
GLenum target;
|
||||
GLdouble u1, u2, *points;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
|
||||
|
||||
__GLX_SWAP_DOUBLE(pc + 0);
|
||||
__GLX_SWAP_DOUBLE(pc + 8);
|
||||
__GLX_SWAP_INT(pc + 16);
|
||||
__GLX_SWAP_INT(pc + 20);
|
||||
|
||||
target = *(GLenum*) (pc + 16);
|
||||
order = *(GLint*) (pc + 20);
|
||||
k = __glMap1d_size(target);
|
||||
if (order <= 0 || k < 0) {
|
||||
/* Erroneous command. */
|
||||
compsize = 0;
|
||||
} else {
|
||||
compsize = order * k;
|
||||
}
|
||||
__GLX_GET_DOUBLE(u1,pc);
|
||||
__GLX_GET_DOUBLE(u2,pc+8);
|
||||
__GLX_SWAP_DOUBLE_ARRAY(pc+24, compsize);
|
||||
pc += 24;
|
||||
|
||||
#ifdef __GLX_ALIGN64
|
||||
if (((unsigned long)pc) & 7) {
|
||||
/*
|
||||
** Copy the doubles up 4 bytes, trashing the command but aligning
|
||||
** the data in the process
|
||||
*/
|
||||
__GLX_MEM_COPY(pc-4, pc, compsize*8);
|
||||
points = (GLdouble*) (pc - 4);
|
||||
} else {
|
||||
points = (GLdouble*) pc;
|
||||
}
|
||||
#else
|
||||
points = (GLdouble*) pc;
|
||||
#endif
|
||||
glMap1d(target, u1, u2, k, order, points);
|
||||
}
|
||||
|
||||
void __glXDispSwap_Map2d(GLbyte *pc)
|
||||
{
|
||||
GLdouble u1, u2, v1, v2, *points;
|
||||
GLint uorder, vorder, ustride, vstride, k, compsize;
|
||||
GLenum target;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
|
||||
|
||||
__GLX_SWAP_DOUBLE(pc + 0);
|
||||
__GLX_SWAP_DOUBLE(pc + 8);
|
||||
__GLX_SWAP_DOUBLE(pc + 16);
|
||||
__GLX_SWAP_DOUBLE(pc + 24);
|
||||
__GLX_SWAP_INT(pc + 32);
|
||||
__GLX_SWAP_INT(pc + 36);
|
||||
__GLX_SWAP_INT(pc + 40);
|
||||
|
||||
target = *(GLenum *)(pc + 32);
|
||||
uorder = *(GLint *)(pc + 36);
|
||||
vorder = *(GLint *)(pc + 40);
|
||||
k = __glMap2d_size(target);
|
||||
if (vorder <= 0 || uorder <= 0 || k < 0) {
|
||||
/* Erroneous command. */
|
||||
compsize = 0;
|
||||
} else {
|
||||
compsize = uorder * vorder * k;
|
||||
}
|
||||
__GLX_GET_DOUBLE(u1,pc);
|
||||
__GLX_GET_DOUBLE(u2,pc+8);
|
||||
__GLX_GET_DOUBLE(v1,pc+16);
|
||||
__GLX_GET_DOUBLE(v2,pc+24);
|
||||
__GLX_SWAP_DOUBLE_ARRAY(pc+44, compsize);
|
||||
pc += 44;
|
||||
ustride = vorder * k;
|
||||
vstride = k;
|
||||
|
||||
#ifdef __GLX_ALIGN64
|
||||
if (((unsigned long)pc) & 7) {
|
||||
/*
|
||||
** Copy the doubles up 4 bytes, trashing the command but aligning
|
||||
** the data in the process
|
||||
*/
|
||||
__GLX_MEM_COPY(pc-4, pc, compsize*8);
|
||||
points = (GLdouble*) (pc - 4);
|
||||
} else {
|
||||
points = (GLdouble*) pc;
|
||||
}
|
||||
#else
|
||||
points = (GLdouble*) pc;
|
||||
#endif
|
||||
glMap2d(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points);
|
||||
}
|
||||
|
||||
void __glXDispSwap_CallLists(GLbyte *pc)
|
||||
{
|
||||
GLenum type;
|
||||
GLsizei n;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
|
||||
|
||||
__GLX_SWAP_INT(pc + 4);
|
||||
__GLX_SWAP_INT(pc + 0);
|
||||
type = *(GLenum *)(pc + 4);
|
||||
n = *(GLsizei *)(pc + 0);
|
||||
|
||||
switch (type) {
|
||||
case GL_BYTE:
|
||||
case GL_UNSIGNED_BYTE:
|
||||
case GL_2_BYTES:
|
||||
case GL_3_BYTES:
|
||||
case GL_4_BYTES:
|
||||
break;
|
||||
case GL_SHORT:
|
||||
case GL_UNSIGNED_SHORT:
|
||||
__GLX_SWAP_SHORT_ARRAY(pc+8, n);
|
||||
break;
|
||||
case GL_INT:
|
||||
case GL_UNSIGNED_INT:
|
||||
__GLX_SWAP_INT_ARRAY(pc+8, n);
|
||||
break;
|
||||
case GL_FLOAT:
|
||||
__GLX_SWAP_FLOAT_ARRAY(pc+8, n);
|
||||
break;
|
||||
}
|
||||
|
||||
glCallLists(n, type, pc+8);
|
||||
}
|
||||
|
||||
static void swapArray(GLint numVals, GLenum datatype,
|
||||
GLint stride, GLint numVertexes, GLbyte *pc)
|
||||
{
|
||||
int i,j;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
switch (datatype) {
|
||||
case GL_BYTE:
|
||||
case GL_UNSIGNED_BYTE:
|
||||
/* don't need to swap */
|
||||
return;
|
||||
case GL_SHORT:
|
||||
case GL_UNSIGNED_SHORT:
|
||||
for (i=0; i<numVertexes; i++) {
|
||||
GLshort *pVal = (GLshort *) pc;
|
||||
for (j=0; j<numVals; j++) {
|
||||
__GLX_SWAP_SHORT(&pVal[j]);
|
||||
}
|
||||
pc += stride;
|
||||
}
|
||||
break;
|
||||
case GL_INT:
|
||||
case GL_UNSIGNED_INT:
|
||||
for (i=0; i<numVertexes; i++) {
|
||||
GLint *pVal = (GLint *) pc;
|
||||
for (j=0; j<numVals; j++) {
|
||||
__GLX_SWAP_INT(&pVal[j]);
|
||||
}
|
||||
pc += stride;
|
||||
}
|
||||
break;
|
||||
case GL_FLOAT:
|
||||
for (i=0; i<numVertexes; i++) {
|
||||
GLfloat *pVal = (GLfloat *) pc;
|
||||
for (j=0; j<numVals; j++) {
|
||||
__GLX_SWAP_FLOAT(&pVal[j]);
|
||||
}
|
||||
pc += stride;
|
||||
}
|
||||
break;
|
||||
case GL_DOUBLE:
|
||||
for (i=0; i<numVertexes; i++) {
|
||||
GLdouble *pVal = (GLdouble *) pc;
|
||||
for (j=0; j<numVals; j++) {
|
||||
__GLX_SWAP_DOUBLE(&pVal[j]);
|
||||
}
|
||||
pc += stride;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void __glXDispSwap_DrawArrays(GLbyte *pc)
|
||||
{
|
||||
__GLXdispatchDrawArraysHeader *hdr = (__GLXdispatchDrawArraysHeader *)pc;
|
||||
__GLXdispatchDrawArraysComponentHeader *compHeader;
|
||||
GLint numVertexes = hdr->numVertexes;
|
||||
GLint numComponents = hdr->numComponents;
|
||||
GLenum primType = hdr->primType;
|
||||
GLint stride = 0;
|
||||
int i;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
__GLX_SWAP_INT(&numVertexes);
|
||||
__GLX_SWAP_INT(&numComponents);
|
||||
__GLX_SWAP_INT(&primType);
|
||||
|
||||
pc += sizeof(__GLXdispatchDrawArraysHeader);
|
||||
compHeader = (__GLXdispatchDrawArraysComponentHeader *) pc;
|
||||
|
||||
/* compute stride (same for all component arrays) */
|
||||
for (i=0; i<numComponents; i++) {
|
||||
GLenum datatype = compHeader[i].datatype;
|
||||
GLint numVals = compHeader[i].numVals;
|
||||
GLenum component = compHeader[i].component;
|
||||
|
||||
__GLX_SWAP_INT(&datatype);
|
||||
__GLX_SWAP_INT(&numVals);
|
||||
__GLX_SWAP_INT(&component);
|
||||
|
||||
stride += __GLX_PAD(numVals * __glXTypeSize(datatype));
|
||||
}
|
||||
|
||||
pc += numComponents * sizeof(__GLXdispatchDrawArraysComponentHeader);
|
||||
|
||||
/* set up component arrays */
|
||||
for (i=0; i<numComponents; i++) {
|
||||
GLenum datatype = compHeader[i].datatype;
|
||||
GLint numVals = compHeader[i].numVals;
|
||||
GLenum component = compHeader[i].component;
|
||||
|
||||
swapArray(numVals, datatype, stride, numVertexes, pc);
|
||||
|
||||
switch (component) {
|
||||
case GL_VERTEX_ARRAY:
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
glVertexPointer(numVals, datatype, stride, pc);
|
||||
break;
|
||||
case GL_NORMAL_ARRAY:
|
||||
glEnableClientState(GL_NORMAL_ARRAY);
|
||||
glNormalPointer(datatype, stride, pc);
|
||||
break;
|
||||
case GL_COLOR_ARRAY:
|
||||
glEnableClientState(GL_COLOR_ARRAY);
|
||||
glColorPointer(numVals, datatype, stride, pc);
|
||||
break;
|
||||
case GL_INDEX_ARRAY:
|
||||
glEnableClientState(GL_INDEX_ARRAY);
|
||||
glIndexPointer(datatype, stride, pc);
|
||||
break;
|
||||
case GL_TEXTURE_COORD_ARRAY:
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glTexCoordPointer(numVals, datatype, stride, pc);
|
||||
break;
|
||||
case GL_EDGE_FLAG_ARRAY:
|
||||
glEnableClientState(GL_EDGE_FLAG_ARRAY);
|
||||
glEdgeFlagPointer(stride, (const GLboolean *)pc);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
pc += __GLX_PAD(numVals * __glXTypeSize(datatype));
|
||||
}
|
||||
|
||||
glDrawArrays(primType, 0, numVertexes);
|
||||
|
||||
/* turn off anything we might have turned on */
|
||||
glDisableClientState(GL_VERTEX_ARRAY);
|
||||
glDisableClientState(GL_NORMAL_ARRAY);
|
||||
glDisableClientState(GL_COLOR_ARRAY);
|
||||
glDisableClientState(GL_INDEX_ARRAY);
|
||||
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glDisableClientState(GL_EDGE_FLAG_ARRAY);
|
||||
}
|
||||
|
||||
void __glXDispSwap_DrawArraysEXT(GLbyte *pc)
|
||||
{
|
||||
__glXDispSwap_DrawArrays(pc);
|
||||
}
|
||||
310
nx-X11/programs/Xserver/GL/glx/renderpix.c
Normal file
310
nx-X11/programs/Xserver/GL/glx/renderpix.c
Normal file
@@ -0,0 +1,310 @@
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
** Additional Notice Provisions: The application programming interfaces
|
||||
** established by SGI in conjunction with the Original Code are The
|
||||
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
|
||||
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
|
||||
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
|
||||
** Window System(R) (Version 1.3), released October 19, 1998. This software
|
||||
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include "glxserver.h"
|
||||
#include "unpack.h"
|
||||
#include "g_disptab.h"
|
||||
#include "g_disptab_EXT.h"
|
||||
|
||||
void __glXDisp_PolygonStipple(GLbyte *pc)
|
||||
{
|
||||
__GLXpixelHeader *hdr = (__GLXpixelHeader *) pc;
|
||||
|
||||
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
|
||||
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
|
||||
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
|
||||
|
||||
glPolygonStipple((GLubyte *)(hdr+1));
|
||||
}
|
||||
|
||||
void __glXDisp_Bitmap(GLbyte *pc)
|
||||
{
|
||||
__GLXdispatchBitmapHeader *hdr = (__GLXdispatchBitmapHeader *) pc;
|
||||
|
||||
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
|
||||
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
|
||||
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
|
||||
|
||||
glBitmap((GLsizei) hdr->width,
|
||||
(GLsizei) hdr->height,
|
||||
(GLfloat) hdr->xorig,
|
||||
(GLfloat) hdr->yorig,
|
||||
(GLfloat) hdr->xmove,
|
||||
(GLfloat) hdr->ymove,
|
||||
(GLubyte *)(hdr+1));
|
||||
}
|
||||
|
||||
void __glXDisp_TexImage1D(GLbyte *pc)
|
||||
{
|
||||
__GLXdispatchTexImageHeader *hdr = (__GLXdispatchTexImageHeader *) pc;
|
||||
|
||||
glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
|
||||
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
|
||||
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
|
||||
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
|
||||
|
||||
glTexImage1D(hdr->target,
|
||||
(GLint) hdr->level,
|
||||
(GLint) hdr->components,
|
||||
(GLsizei) hdr->width,
|
||||
(GLint) hdr->border,
|
||||
hdr->format,
|
||||
hdr->type,
|
||||
(GLvoid *)(hdr+1));
|
||||
}
|
||||
|
||||
void __glXDisp_TexImage2D(GLbyte *pc)
|
||||
{
|
||||
__GLXdispatchTexImageHeader *hdr = (__GLXdispatchTexImageHeader *) pc;
|
||||
|
||||
glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
|
||||
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
|
||||
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
|
||||
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
|
||||
|
||||
glTexImage2D(hdr->target,
|
||||
(GLint) hdr->level,
|
||||
(GLint) hdr->components,
|
||||
(GLsizei) hdr->width,
|
||||
(GLsizei) hdr->height,
|
||||
(GLint) hdr->border,
|
||||
hdr->format,
|
||||
hdr->type,
|
||||
(GLvoid *)(hdr+1));
|
||||
}
|
||||
|
||||
void __glXDisp_TexImage3D(GLbyte *pc)
|
||||
{
|
||||
__GLXdispatchTexImage3DHeader *hdr = (__GLXdispatchTexImage3DHeader *) pc;
|
||||
|
||||
glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
|
||||
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
|
||||
glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, hdr->imageHeight);
|
||||
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
|
||||
glPixelStorei(GL_UNPACK_SKIP_IMAGES, hdr->skipImages);
|
||||
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
|
||||
|
||||
glTexImage3D(hdr->target, hdr->level, hdr->internalformat, hdr->width,
|
||||
hdr->height, hdr->depth, hdr->border, hdr->format, hdr->type,
|
||||
(GLvoid *)(hdr+1));
|
||||
}
|
||||
|
||||
void __glXDisp_DrawPixels(GLbyte *pc)
|
||||
{
|
||||
__GLXdispatchDrawPixelsHeader *hdr = (__GLXdispatchDrawPixelsHeader *) pc;
|
||||
|
||||
glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
|
||||
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
|
||||
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
|
||||
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
|
||||
|
||||
glDrawPixels((GLsizei) hdr->width,
|
||||
(GLsizei) hdr->height,
|
||||
hdr->format,
|
||||
hdr->type,
|
||||
(GLvoid *)(hdr+1));
|
||||
}
|
||||
|
||||
void __glXDisp_TexSubImage1D(GLbyte *pc)
|
||||
{
|
||||
__GLXdispatchTexSubImageHeader *hdr = (__GLXdispatchTexSubImageHeader *) pc;
|
||||
|
||||
glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
|
||||
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
|
||||
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
|
||||
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
|
||||
|
||||
glTexSubImage1D(hdr->target,
|
||||
(GLint) hdr->level,
|
||||
(GLint) hdr->xoffset,
|
||||
(GLsizei) hdr->width,
|
||||
hdr->format,
|
||||
hdr->type,
|
||||
(GLvoid *)(hdr+1));
|
||||
}
|
||||
|
||||
void __glXDisp_TexSubImage2D(GLbyte *pc)
|
||||
{
|
||||
__GLXdispatchTexSubImageHeader *hdr = (__GLXdispatchTexSubImageHeader *) pc;
|
||||
|
||||
glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
|
||||
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
|
||||
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
|
||||
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
|
||||
|
||||
glTexSubImage2D(hdr->target,
|
||||
(GLint) hdr->level,
|
||||
(GLint) hdr->xoffset,
|
||||
(GLint) hdr->yoffset,
|
||||
(GLsizei) hdr->width,
|
||||
(GLsizei) hdr->height,
|
||||
hdr->format,
|
||||
hdr->type,
|
||||
(GLvoid *)(hdr+1));
|
||||
}
|
||||
|
||||
void __glXDisp_TexSubImage3D(GLbyte *pc)
|
||||
{
|
||||
__GLXdispatchTexSubImage3DHeader *hdr =
|
||||
(__GLXdispatchTexSubImage3DHeader *) pc;
|
||||
|
||||
glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
|
||||
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
|
||||
glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, hdr->imageHeight);
|
||||
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
|
||||
glPixelStorei(GL_UNPACK_SKIP_IMAGES, hdr->skipImages);
|
||||
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
|
||||
|
||||
glTexSubImage3D(hdr->target, hdr->level, hdr->xoffset, hdr->yoffset,
|
||||
hdr->zoffset, hdr->width, hdr->height, hdr->depth,
|
||||
hdr->format, hdr->type, (GLvoid *)(hdr+1));
|
||||
}
|
||||
|
||||
void __glXDisp_ColorTable(GLbyte *pc)
|
||||
{
|
||||
__GLXdispatchColorTableHeader *hdr =
|
||||
(__GLXdispatchColorTableHeader *) pc;
|
||||
|
||||
glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
|
||||
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
|
||||
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
|
||||
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
|
||||
|
||||
glColorTable(hdr->target, hdr->internalformat,
|
||||
hdr->width, hdr->format, hdr->type,
|
||||
(GLvoid *)(hdr+1));
|
||||
}
|
||||
|
||||
void __glXDisp_ColorSubTable(GLbyte *pc)
|
||||
{
|
||||
__GLXdispatchColorSubTableHeader *hdr =
|
||||
(__GLXdispatchColorSubTableHeader *) pc;
|
||||
|
||||
glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
|
||||
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
|
||||
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
|
||||
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
|
||||
|
||||
glColorSubTable(hdr->target, hdr->start, hdr->count, hdr->format,
|
||||
hdr->type, (GLvoid *)(hdr+1));
|
||||
}
|
||||
|
||||
void __glXDisp_ConvolutionFilter1D(GLbyte *pc)
|
||||
{
|
||||
__GLXdispatchConvolutionFilterHeader *hdr =
|
||||
(__GLXdispatchConvolutionFilterHeader *) pc;
|
||||
|
||||
glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
|
||||
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
|
||||
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
|
||||
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
|
||||
|
||||
glConvolutionFilter1D(hdr->target, hdr->internalformat,
|
||||
hdr->width, hdr->format, hdr->type,
|
||||
(GLvoid *)(hdr+1));
|
||||
}
|
||||
|
||||
void __glXDisp_ConvolutionFilter2D(GLbyte *pc)
|
||||
{
|
||||
__GLXdispatchConvolutionFilterHeader *hdr =
|
||||
(__GLXdispatchConvolutionFilterHeader *) pc;
|
||||
|
||||
glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
|
||||
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
|
||||
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
|
||||
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
|
||||
|
||||
glConvolutionFilter2D(hdr->target, hdr->internalformat,
|
||||
hdr->width, hdr->height, hdr->format, hdr->type,
|
||||
(GLvoid *)(hdr+1));
|
||||
}
|
||||
|
||||
void __glXDisp_SeparableFilter2D(GLbyte *pc)
|
||||
{
|
||||
__GLXdispatchConvolutionFilterHeader *hdr =
|
||||
(__GLXdispatchConvolutionFilterHeader *) pc;
|
||||
GLint hdrlen, image1len;
|
||||
|
||||
hdrlen = __GLX_PAD(__GLX_CONV_FILT_CMD_DISPATCH_HDR_SIZE);
|
||||
|
||||
glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
|
||||
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
|
||||
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
|
||||
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
|
||||
|
||||
/* XXX check this usage - internal code called
|
||||
** a version without the packing parameters
|
||||
*/
|
||||
image1len = __glXImageSize(hdr->format, hdr->type, 0, hdr->width, 1, 1,
|
||||
0, hdr->rowLength, 0, hdr->skipRows,
|
||||
hdr->alignment);
|
||||
image1len = __GLX_PAD(image1len);
|
||||
|
||||
glSeparableFilter2D(hdr->target, hdr->internalformat,
|
||||
hdr->width, hdr->height, hdr->format, hdr->type,
|
||||
((GLubyte *)hdr+hdrlen), ((GLubyte *)hdr+hdrlen+image1len));
|
||||
}
|
||||
553
nx-X11/programs/Xserver/GL/glx/renderpixswap.c
Normal file
553
nx-X11/programs/Xserver/GL/glx/renderpixswap.c
Normal file
@@ -0,0 +1,553 @@
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
** Additional Notice Provisions: The application programming interfaces
|
||||
** established by SGI in conjunction with the Original Code are The
|
||||
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
|
||||
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
|
||||
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
|
||||
** Window System(R) (Version 1.3), released October 19, 1998. This software
|
||||
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include "glxserver.h"
|
||||
#include "unpack.h"
|
||||
#include "g_disptab.h"
|
||||
#include "g_disptab_EXT.h"
|
||||
|
||||
void __glXDispSwap_PolygonStipple(GLbyte *pc)
|
||||
{
|
||||
__GLXpixelHeader *hdr = (__GLXpixelHeader *) pc;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
|
||||
|
||||
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
|
||||
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
|
||||
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
|
||||
|
||||
glPolygonStipple((GLubyte *)(hdr+1));
|
||||
}
|
||||
|
||||
void __glXDispSwap_Bitmap(GLbyte *pc)
|
||||
{
|
||||
__GLXdispatchBitmapHeader *hdr = (__GLXdispatchBitmapHeader *) pc;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
|
||||
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->width);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->height);
|
||||
__GLX_SWAP_FLOAT((GLbyte *)&hdr->xorig);
|
||||
__GLX_SWAP_FLOAT((GLbyte *)&hdr->yorig);
|
||||
__GLX_SWAP_FLOAT((GLbyte *)&hdr->xmove);
|
||||
__GLX_SWAP_FLOAT((GLbyte *)&hdr->ymove);
|
||||
|
||||
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
|
||||
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
|
||||
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
|
||||
|
||||
glBitmap((GLsizei) hdr->width,
|
||||
(GLsizei) hdr->height,
|
||||
(GLfloat) hdr->xorig,
|
||||
(GLfloat) hdr->yorig,
|
||||
(GLfloat) hdr->xmove,
|
||||
(GLfloat) hdr->ymove,
|
||||
(GLubyte *)(hdr+1));
|
||||
}
|
||||
|
||||
void __glXDispSwap_TexImage1D(GLbyte *pc)
|
||||
{
|
||||
__GLXdispatchTexImageHeader *hdr = (__GLXdispatchTexImageHeader *) pc;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
|
||||
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->target);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->level);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->components);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->width);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->height);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->border);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->format);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->type);
|
||||
|
||||
/*
|
||||
** Just invert swapBytes flag; the GL will figure out if it needs to swap
|
||||
** the pixel data.
|
||||
*/
|
||||
glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
|
||||
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
|
||||
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
|
||||
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
|
||||
|
||||
glTexImage1D(hdr->target,
|
||||
(GLint) hdr->level,
|
||||
(GLint) hdr->components,
|
||||
(GLsizei) hdr->width,
|
||||
(GLint) hdr->border,
|
||||
hdr->format,
|
||||
hdr->type,
|
||||
(GLvoid *)(hdr+1));
|
||||
}
|
||||
|
||||
void __glXDispSwap_TexImage2D(GLbyte *pc)
|
||||
{
|
||||
__GLXdispatchTexImageHeader *hdr = (__GLXdispatchTexImageHeader *) pc;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
|
||||
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->target);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->level);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->components);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->width);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->height);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->border);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->format);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->type);
|
||||
|
||||
/*
|
||||
** Just invert swapBytes flag; the GL will figure out if it needs to swap
|
||||
** the pixel data.
|
||||
*/
|
||||
glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
|
||||
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
|
||||
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
|
||||
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
|
||||
|
||||
glTexImage2D(hdr->target,
|
||||
(GLint) hdr->level,
|
||||
(GLint) hdr->components,
|
||||
(GLsizei) hdr->width,
|
||||
(GLsizei) hdr->height,
|
||||
(GLint) hdr->border,
|
||||
hdr->format,
|
||||
hdr->type,
|
||||
(GLvoid *)(hdr+1));
|
||||
}
|
||||
|
||||
void __glXDispSwap_TexImage3D(GLbyte *pc)
|
||||
{
|
||||
__GLXdispatchTexImage3DHeader *hdr = (__GLXdispatchTexImage3DHeader *) pc;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->imageHeight);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->imageDepth);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->skipImages);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->skipVolumes);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
|
||||
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->target);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->level);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->internalformat);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->width);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->height);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->depth);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->size4d);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->border);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->format);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->type);
|
||||
|
||||
/*
|
||||
** Just invert swapBytes flag; the GL will figure out if it needs to swap
|
||||
** the pixel data.
|
||||
*/
|
||||
glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
|
||||
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
|
||||
glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, hdr->imageHeight);
|
||||
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
|
||||
glPixelStorei(GL_UNPACK_SKIP_IMAGES, hdr->skipImages);
|
||||
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
|
||||
|
||||
glTexImage3D(hdr->target, hdr->level, hdr->internalformat, hdr->width,
|
||||
hdr->height, hdr->depth, hdr->border, hdr->format, hdr->type,
|
||||
(GLvoid *)(hdr+1));
|
||||
}
|
||||
|
||||
void __glXDispSwap_DrawPixels(GLbyte *pc)
|
||||
{
|
||||
__GLXdispatchDrawPixelsHeader *hdr = (__GLXdispatchDrawPixelsHeader *) pc;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
|
||||
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->width);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->height);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->format);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->type);
|
||||
|
||||
/*
|
||||
** Just invert swapBytes flag; the GL will figure out if it needs to swap
|
||||
** the pixel data.
|
||||
*/
|
||||
glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
|
||||
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
|
||||
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
|
||||
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
|
||||
|
||||
glDrawPixels((GLsizei) hdr->width,
|
||||
(GLsizei) hdr->height,
|
||||
hdr->format,
|
||||
hdr->type,
|
||||
(GLvoid *)(hdr+1));
|
||||
}
|
||||
|
||||
void __glXDispSwap_TexSubImage1D(GLbyte *pc)
|
||||
{
|
||||
__GLXdispatchTexSubImageHeader *hdr = (__GLXdispatchTexSubImageHeader *) pc;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
|
||||
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->target);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->level);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->xoffset);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->width);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->format);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->type);
|
||||
|
||||
/*
|
||||
** Just invert swapBytes flag; the GL will figure out if it needs to swap
|
||||
** the pixel data.
|
||||
*/
|
||||
glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
|
||||
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
|
||||
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
|
||||
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
|
||||
|
||||
glTexSubImage1D(hdr->target,
|
||||
(GLint) hdr->level,
|
||||
(GLint) hdr->xoffset,
|
||||
(GLsizei) hdr->width,
|
||||
hdr->format,
|
||||
hdr->type,
|
||||
(GLvoid *)(hdr+1));
|
||||
}
|
||||
|
||||
void __glXDispSwap_TexSubImage2D(GLbyte *pc)
|
||||
{
|
||||
__GLXdispatchTexSubImageHeader *hdr = (__GLXdispatchTexSubImageHeader *) pc;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
|
||||
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->target);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->level);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->xoffset);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->yoffset);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->width);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->height);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->format);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->type);
|
||||
|
||||
/*
|
||||
** Just invert swapBytes flag; the GL will figure out if it needs to swap
|
||||
** the pixel data.
|
||||
*/
|
||||
glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
|
||||
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
|
||||
glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
|
||||
glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
|
||||
|
||||
glTexSubImage2D(hdr->target,
|
||||
(GLint) hdr->level,
|
||||
(GLint) hdr->xoffset,
|
||||
(GLint) hdr->yoffset,
|
||||
(GLsizei) hdr->width,
|
||||
(GLsizei) hdr->height,
|
||||
hdr->format,
|
||||
hdr->type,
|
||||
(GLvoid *)(hdr+1));
|
||||
}
|
||||
|
||||
void __glXDispSwap_TexSubImage3D(GLbyte *pc)
|
||||
{
|
||||
__GLXdispatchTexSubImage3DHeader *hdr =
|
||||
(__GLXdispatchTexSubImage3DHeader *) pc;
|
||||
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->imageHeight);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->imageDepth);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->skipImages);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->skipVolumes);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
|
||||
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->target);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->level);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->xoffset);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->yoffset);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->zoffset);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->width);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->height);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->depth);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->size4d);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->format);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->type);
|
||||
|
||||
/*
|
||||
** Just invert swapBytes flag; the GL will figure out if it needs to swap
|
||||
** the pixel data.
|
||||
*/
|
||||
glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
|
||||
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
|
||||
glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, hdr->imageHeight);
|
||||
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
|
||||
glPixelStorei(GL_UNPACK_SKIP_IMAGES, hdr->skipImages);
|
||||
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
|
||||
|
||||
glTexSubImage3D(hdr->target, hdr->level, hdr->xoffset, hdr->yoffset,
|
||||
hdr->zoffset, hdr->width, hdr->height, hdr->depth,
|
||||
hdr->format, hdr->type, (GLvoid *)(hdr+1));
|
||||
}
|
||||
|
||||
void __glXDispSwap_ColorTable(GLbyte *pc)
|
||||
{
|
||||
__GLXdispatchColorTableHeader *hdr =
|
||||
(__GLXdispatchColorTableHeader *) pc;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
|
||||
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->target);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->internalformat);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->width);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->format);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->type);
|
||||
|
||||
/*
|
||||
** Just invert swapBytes flag; the GL will figure out if it needs to swap
|
||||
** the pixel data.
|
||||
*/
|
||||
glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
|
||||
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
|
||||
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
|
||||
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
|
||||
|
||||
glColorTable(hdr->target, hdr->internalformat,
|
||||
hdr->width, hdr->format, hdr->type,
|
||||
(GLvoid *)(hdr+1));
|
||||
}
|
||||
|
||||
void __glXDispSwap_ColorSubTable(GLbyte *pc)
|
||||
{
|
||||
__GLXdispatchColorSubTableHeader *hdr =
|
||||
(__GLXdispatchColorSubTableHeader *) pc;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
|
||||
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->target);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->start);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->count);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->format);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->type);
|
||||
|
||||
/*
|
||||
** Just invert swapBytes flag; the GL will figure out if it needs to swap
|
||||
** the pixel data.
|
||||
*/
|
||||
glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
|
||||
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
|
||||
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
|
||||
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
|
||||
|
||||
glColorSubTable(hdr->target, hdr->start, hdr->count, hdr->format,
|
||||
hdr->type, (GLvoid *)(hdr+1));
|
||||
}
|
||||
|
||||
void __glXDispSwap_ConvolutionFilter1D(GLbyte *pc)
|
||||
{
|
||||
__GLXdispatchConvolutionFilterHeader *hdr =
|
||||
(__GLXdispatchConvolutionFilterHeader *) pc;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
|
||||
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->target);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->internalformat);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->width);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->format);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->type);
|
||||
|
||||
/*
|
||||
** Just invert swapBytes flag; the GL will figure out if it needs to swap
|
||||
** the pixel data.
|
||||
*/
|
||||
glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
|
||||
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
|
||||
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
|
||||
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
|
||||
|
||||
glConvolutionFilter2D(hdr->target, hdr->internalformat,
|
||||
hdr->width, 1, hdr->format, hdr->type,
|
||||
(GLvoid *)(hdr+1));
|
||||
}
|
||||
|
||||
void __glXDispSwap_ConvolutionFilter2D(GLbyte *pc)
|
||||
{
|
||||
__GLXdispatchConvolutionFilterHeader *hdr =
|
||||
(__GLXdispatchConvolutionFilterHeader *) pc;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
|
||||
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->target);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->internalformat);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->width);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->height);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->format);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->type);
|
||||
|
||||
/*
|
||||
** Just invert swapBytes flag; the GL will figure out if it needs to swap
|
||||
** the pixel data.
|
||||
*/
|
||||
glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
|
||||
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
|
||||
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
|
||||
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
|
||||
|
||||
glConvolutionFilter2D(hdr->target, hdr->internalformat,
|
||||
hdr->width, hdr->height, hdr->format, hdr->type,
|
||||
(GLvoid *)(hdr+1));
|
||||
}
|
||||
|
||||
void __glXDispSwap_SeparableFilter2D(GLbyte *pc)
|
||||
{
|
||||
__GLXdispatchConvolutionFilterHeader *hdr =
|
||||
(__GLXdispatchConvolutionFilterHeader *) pc;
|
||||
GLint hdrlen, image1len;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
hdrlen = __GLX_PAD(__GLX_CONV_FILT_CMD_HDR_SIZE);
|
||||
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->rowLength);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->skipRows);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->skipPixels);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->alignment);
|
||||
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->target);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->internalformat);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->width);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->height);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->format);
|
||||
__GLX_SWAP_INT((GLbyte *)&hdr->type);
|
||||
|
||||
/*
|
||||
** Just invert swapBytes flag; the GL will figure out if it needs to swap
|
||||
** the pixel data.
|
||||
*/
|
||||
glPixelStorei(GL_UNPACK_SWAP_BYTES, !hdr->swapBytes);
|
||||
glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, hdr->rowLength);
|
||||
glPixelStorei(GL_UNPACK_SKIP_ROWS, hdr->skipRows);
|
||||
glPixelStorei(GL_UNPACK_SKIP_PIXELS, hdr->skipPixels);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, hdr->alignment);
|
||||
|
||||
/* XXX check this usage - internal code called
|
||||
** a version without the packing parameters
|
||||
*/
|
||||
image1len = __glXImageSize(hdr->format, hdr->type, 0, hdr->width, 1, 1,
|
||||
0, hdr->rowLength, 0, hdr->skipRows,
|
||||
hdr->alignment);
|
||||
image1len = __GLX_PAD(image1len);
|
||||
|
||||
|
||||
glSeparableFilter2D(hdr->target, hdr->internalformat,
|
||||
hdr->width, hdr->height, hdr->format, hdr->type,
|
||||
((GLubyte *)hdr+hdrlen), ((GLubyte *)hdr+hdrlen+image1len));
|
||||
}
|
||||
1001
nx-X11/programs/Xserver/GL/glx/rensize.c
Normal file
1001
nx-X11/programs/Xserver/GL/glx/rensize.c
Normal file
File diff suppressed because it is too large
Load Diff
2447
nx-X11/programs/Xserver/GL/glx/rensizetab.c
Normal file
2447
nx-X11/programs/Xserver/GL/glx/rensizetab.c
Normal file
File diff suppressed because it is too large
Load Diff
425
nx-X11/programs/Xserver/GL/glx/single2.c
Normal file
425
nx-X11/programs/Xserver/GL/glx/single2.c
Normal file
@@ -0,0 +1,425 @@
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
** Additional Notice Provisions: The application programming interfaces
|
||||
** established by SGI in conjunction with the Original Code are The
|
||||
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
|
||||
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
|
||||
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
|
||||
** Window System(R) (Version 1.3), released October 19, 1998. This software
|
||||
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "glxserver.h"
|
||||
#include "glxutil.h"
|
||||
#include "glxext.h"
|
||||
#include "unpack.h"
|
||||
#include "g_disptab.h"
|
||||
|
||||
int __glXDisp_FeedbackBuffer(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
ClientPtr client = cl->client;
|
||||
GLsizei size;
|
||||
GLenum type;
|
||||
__GLXcontext *cx;
|
||||
int error;
|
||||
|
||||
REQUEST_FIXED_SIZE(xGLXSingleReq, 8);
|
||||
|
||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||
if (!cx) {
|
||||
return error;
|
||||
}
|
||||
|
||||
pc += __GLX_SINGLE_HDR_SIZE;
|
||||
size = *(GLsizei *)(pc+0);
|
||||
type = *(GLenum *)(pc+4);
|
||||
if (cx->feedbackBufSize < size) {
|
||||
cx->feedbackBuf = (GLfloat *) realloc(cx->feedbackBuf,
|
||||
(size_t)size
|
||||
* __GLX_SIZE_FLOAT32);
|
||||
if (!cx->feedbackBuf) {
|
||||
cl->client->errorValue = size;
|
||||
return BadAlloc;
|
||||
}
|
||||
cx->feedbackBufSize = size;
|
||||
}
|
||||
glFeedbackBuffer(size, type, cx->feedbackBuf);
|
||||
__GLX_NOTE_UNFLUSHED_CMDS(cx);
|
||||
return Success;
|
||||
}
|
||||
|
||||
int __glXDisp_SelectBuffer(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
ClientPtr client = cl->client;
|
||||
__GLXcontext *cx;
|
||||
GLsizei size;
|
||||
int error;
|
||||
|
||||
REQUEST_FIXED_SIZE(xGLXSingleReq, 4);
|
||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||
if (!cx) {
|
||||
return error;
|
||||
}
|
||||
|
||||
pc += __GLX_SINGLE_HDR_SIZE;
|
||||
size = *(GLsizei *)(pc+0);
|
||||
if (cx->selectBufSize < size) {
|
||||
cx->selectBuf = (GLuint *) realloc(cx->selectBuf,
|
||||
(size_t) size
|
||||
* __GLX_SIZE_CARD32);
|
||||
if (!cx->selectBuf) {
|
||||
cl->client->errorValue = size;
|
||||
return BadAlloc;
|
||||
}
|
||||
cx->selectBufSize = size;
|
||||
}
|
||||
glSelectBuffer(size, cx->selectBuf);
|
||||
__GLX_NOTE_UNFLUSHED_CMDS(cx);
|
||||
return Success;
|
||||
}
|
||||
|
||||
int __glXDisp_RenderMode(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
ClientPtr client = cl->client;
|
||||
xGLXRenderModeReply reply;
|
||||
__GLXcontext *cx;
|
||||
GLint nitems=0, retBytes=0, retval, newModeCheck;
|
||||
GLubyte *retBuffer = NULL;
|
||||
GLenum newMode;
|
||||
int error;
|
||||
|
||||
REQUEST_FIXED_SIZE(xGLXSingleReq, 4);
|
||||
|
||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||
if (!cx) {
|
||||
return error;
|
||||
}
|
||||
|
||||
pc += __GLX_SINGLE_HDR_SIZE;
|
||||
newMode = *(GLenum*) pc;
|
||||
retval = glRenderMode(newMode);
|
||||
|
||||
/* Check that render mode worked */
|
||||
glGetIntegerv(GL_RENDER_MODE, &newModeCheck);
|
||||
if (newModeCheck != newMode) {
|
||||
/* Render mode change failed. Bail */
|
||||
newMode = newModeCheck;
|
||||
goto noChangeAllowed;
|
||||
}
|
||||
|
||||
/*
|
||||
** Render mode might have still failed if we get here. But in this
|
||||
** case we can't really tell, nor does it matter. If it did fail, it
|
||||
** will return 0, and thus we won't send any data across the wire.
|
||||
*/
|
||||
|
||||
switch (cx->renderMode) {
|
||||
case GL_RENDER:
|
||||
cx->renderMode = newMode;
|
||||
break;
|
||||
case GL_FEEDBACK:
|
||||
if (retval < 0) {
|
||||
/* Overflow happened. Copy the entire buffer */
|
||||
nitems = cx->feedbackBufSize;
|
||||
} else {
|
||||
nitems = retval;
|
||||
}
|
||||
retBytes = nitems * __GLX_SIZE_FLOAT32;
|
||||
retBuffer = (GLubyte*) cx->feedbackBuf;
|
||||
cx->renderMode = newMode;
|
||||
break;
|
||||
case GL_SELECT:
|
||||
if (retval < 0) {
|
||||
/* Overflow happened. Copy the entire buffer */
|
||||
nitems = cx->selectBufSize;
|
||||
} else {
|
||||
GLuint *bp = cx->selectBuf;
|
||||
GLint i;
|
||||
|
||||
/*
|
||||
** Figure out how many bytes of data need to be sent. Parse
|
||||
** the selection buffer to determine this fact as the
|
||||
** return value is the number of hits, not the number of
|
||||
** items in the buffer.
|
||||
*/
|
||||
nitems = 0;
|
||||
i = retval;
|
||||
while (--i >= 0) {
|
||||
GLuint n;
|
||||
|
||||
/* Parse select data for this hit */
|
||||
n = *bp;
|
||||
bp += 3 + n;
|
||||
}
|
||||
nitems = bp - cx->selectBuf;
|
||||
}
|
||||
retBytes = nitems * __GLX_SIZE_CARD32;
|
||||
retBuffer = (GLubyte*) cx->selectBuf;
|
||||
cx->renderMode = newMode;
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
** First reply is the number of elements returned in the feedback or
|
||||
** selection array, as per the API for glRenderMode itself.
|
||||
*/
|
||||
noChangeAllowed:;
|
||||
reply.length = nitems;
|
||||
reply.type = X_Reply;
|
||||
reply.sequenceNumber = client->sequence;
|
||||
reply.retval = retval;
|
||||
reply.size = nitems;
|
||||
reply.newMode = newMode;
|
||||
WriteToClient(client, sz_xGLXRenderModeReply, &reply);
|
||||
if (retBytes) {
|
||||
WriteToClient(client, retBytes, retBuffer);
|
||||
}
|
||||
return Success;
|
||||
}
|
||||
|
||||
int __glXDisp_Flush(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
ClientPtr client = cl->client;
|
||||
__GLXcontext *cx;
|
||||
int error;
|
||||
|
||||
REQUEST_SIZE_MATCH(xGLXSingleReq);
|
||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||
if (!cx) {
|
||||
return error;
|
||||
}
|
||||
|
||||
glFlush();
|
||||
__GLX_NOTE_FLUSHED_CMDS(cx);
|
||||
return Success;
|
||||
}
|
||||
|
||||
int __glXDisp_Finish(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
ClientPtr client = cl->client;
|
||||
__GLXcontext *cx;
|
||||
int error;
|
||||
|
||||
REQUEST_SIZE_MATCH(xGLXSingleReq);
|
||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||
if (!cx) {
|
||||
return error;
|
||||
}
|
||||
|
||||
/* Do a local glFinish */
|
||||
glFinish();
|
||||
__GLX_NOTE_FLUSHED_CMDS(cx);
|
||||
|
||||
/* Send empty reply packet to indicate finish is finished */
|
||||
__GLX_BEGIN_REPLY(0);
|
||||
__GLX_SEND_HEADER();
|
||||
return Success;
|
||||
}
|
||||
|
||||
#define SEPARATOR " "
|
||||
|
||||
char *__glXcombine_strings(const char *cext_string, const char *sext_string)
|
||||
{
|
||||
size_t clen, slen;
|
||||
char *combo_string, *token, *s1;
|
||||
const char *s2, *end;
|
||||
|
||||
/* safeguard to prevent potentially fatal errors in the string functions */
|
||||
if (!cext_string)
|
||||
cext_string = "";
|
||||
if (!sext_string)
|
||||
sext_string = "";
|
||||
|
||||
/*
|
||||
** String can't be longer than min(cstring, sstring)
|
||||
** pull tokens out of shortest string
|
||||
** include space in combo_string for final separator and null terminator
|
||||
*/
|
||||
clen = strlen(cext_string);
|
||||
slen = strlen(sext_string);
|
||||
if (clen > slen) {
|
||||
combo_string = (char *) malloc(slen + 2);
|
||||
s1 = (char *) malloc(slen + 2);
|
||||
strcpy(s1, sext_string);
|
||||
s2 = cext_string;
|
||||
} else {
|
||||
combo_string = (char *) malloc(clen + 2);
|
||||
s1 = (char *) malloc(clen + 2);
|
||||
strcpy(s1, cext_string);
|
||||
s2 = sext_string;
|
||||
}
|
||||
if (!combo_string || !s1) {
|
||||
if (combo_string)
|
||||
free(combo_string);
|
||||
if (s1)
|
||||
free(s1);
|
||||
return NULL;
|
||||
}
|
||||
combo_string[0] = '\0';
|
||||
|
||||
/* Get first extension token */
|
||||
token = strtok( s1, SEPARATOR);
|
||||
while ( token != NULL ) {
|
||||
|
||||
/*
|
||||
** if token in second string then save it
|
||||
** beware of extension names which are prefixes of other extension names
|
||||
*/
|
||||
const char *p = s2;
|
||||
end = p + strlen(p);
|
||||
while (p < end) {
|
||||
size_t n = strcspn(p, SEPARATOR);
|
||||
if ((strlen(token) == n) && (strncmp(token, p, n) == 0)) {
|
||||
combo_string = strcat(combo_string, token);
|
||||
combo_string = strcat(combo_string, SEPARATOR);
|
||||
}
|
||||
p += (n + 1);
|
||||
}
|
||||
|
||||
/* Get next extension token */
|
||||
token = strtok( NULL, SEPARATOR);
|
||||
}
|
||||
free(s1);
|
||||
return combo_string;
|
||||
}
|
||||
|
||||
int DoGetString(__GLXclientState *cl, GLbyte *pc, GLboolean need_swap)
|
||||
{
|
||||
ClientPtr client = cl->client;
|
||||
__GLXcontext *cx;
|
||||
GLenum name;
|
||||
const char *string;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
int error;
|
||||
char *buf = NULL, *buf1 = NULL;
|
||||
GLint length = 0;
|
||||
|
||||
REQUEST_FIXED_SIZE(xGLXSingleReq, 4);
|
||||
|
||||
/* If the client has the opposite byte order, swap the contextTag and
|
||||
* the name.
|
||||
*/
|
||||
if ( need_swap ) {
|
||||
__GLX_SWAP_INT(pc + 4);
|
||||
__GLX_SWAP_INT(pc + __GLX_SINGLE_HDR_SIZE);
|
||||
}
|
||||
|
||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||
if (!cx) {
|
||||
return error;
|
||||
}
|
||||
|
||||
pc += __GLX_SINGLE_HDR_SIZE;
|
||||
name = *(GLenum *)(pc + 0);
|
||||
string = (const char *)glGetString(name);
|
||||
|
||||
/*
|
||||
** Restrict extensions to those that are supported by both the
|
||||
** implementation and the connection. That is, return the
|
||||
** intersection of client, server, and core extension strings.
|
||||
*/
|
||||
if (name == GL_EXTENSIONS) {
|
||||
buf1 = __glXcombine_strings(string,
|
||||
cl->GLClientextensions);
|
||||
buf = __glXcombine_strings(buf1,
|
||||
cx->pGlxScreen->GLextensions);
|
||||
if (buf1 != NULL) {
|
||||
free(buf1);
|
||||
}
|
||||
string = buf;
|
||||
}
|
||||
else if ( name == GL_VERSION ) {
|
||||
if ( atof( string ) > atof( GLServerVersion ) ) {
|
||||
buf = malloc( strlen( string ) + strlen( GLServerVersion ) + 4 );
|
||||
if ( buf == NULL ) {
|
||||
string = GLServerVersion;
|
||||
}
|
||||
else {
|
||||
sprintf( buf, "%s (%s)", GLServerVersion, string );
|
||||
string = buf;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (string) {
|
||||
length = strlen((const char *) string) + 1;
|
||||
}
|
||||
|
||||
__GLX_BEGIN_REPLY(length);
|
||||
__GLX_PUT_SIZE(length);
|
||||
|
||||
if ( need_swap ) {
|
||||
__GLX_SWAP_REPLY_SIZE();
|
||||
__GLX_SWAP_REPLY_HEADER();
|
||||
}
|
||||
|
||||
__GLX_SEND_HEADER();
|
||||
WriteToClient(client, length, string);
|
||||
if (buf != NULL) {
|
||||
free(buf);
|
||||
}
|
||||
return Success;
|
||||
}
|
||||
|
||||
int __glXDisp_GetString(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
return DoGetString(cl, pc, GL_FALSE);
|
||||
}
|
||||
|
||||
int __glXDisp_GetClipPlane(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
__GLXcontext *cx;
|
||||
ClientPtr client = cl->client;
|
||||
int error;
|
||||
GLdouble answer[4];
|
||||
|
||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||
if (!cx) {
|
||||
return error;
|
||||
}
|
||||
pc += __GLX_SINGLE_HDR_SIZE;
|
||||
|
||||
__glXClearErrorOccured();
|
||||
glGetClipPlane(*(GLenum *)(pc + 0), answer);
|
||||
if (__glXErrorOccured()) {
|
||||
__GLX_BEGIN_REPLY(0);
|
||||
__GLX_SEND_HEADER();
|
||||
} else {
|
||||
__GLX_BEGIN_REPLY(32);
|
||||
__GLX_SEND_HEADER();
|
||||
__GLX_SEND_DOUBLE_ARRAY(4);
|
||||
}
|
||||
return Success;
|
||||
}
|
||||
|
||||
307
nx-X11/programs/Xserver/GL/glx/single2swap.c
Normal file
307
nx-X11/programs/Xserver/GL/glx/single2swap.c
Normal file
@@ -0,0 +1,307 @@
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
** Additional Notice Provisions: The application programming interfaces
|
||||
** established by SGI in conjunction with the Original Code are The
|
||||
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
|
||||
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
|
||||
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
|
||||
** Window System(R) (Version 1.3), released October 19, 1998. This software
|
||||
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include "glxserver.h"
|
||||
#include "glxutil.h"
|
||||
#include "glxext.h"
|
||||
#include "unpack.h"
|
||||
#include "g_disptab.h"
|
||||
|
||||
int __glXDispSwap_FeedbackBuffer(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
ClientPtr client = cl->client;
|
||||
GLsizei size;
|
||||
GLenum type;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
__GLXcontext *cx;
|
||||
int error;
|
||||
|
||||
REQUEST_FIXED_SIZE(xGLXSingleReq, 8);
|
||||
__GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
|
||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||
if (!cx) {
|
||||
return error;
|
||||
}
|
||||
|
||||
pc += __GLX_SINGLE_HDR_SIZE;
|
||||
__GLX_SWAP_INT(pc+0);
|
||||
__GLX_SWAP_INT(pc+4);
|
||||
size = *(GLsizei *)(pc+0);
|
||||
type = *(GLenum *)(pc+4);
|
||||
if (cx->feedbackBufSize < size) {
|
||||
cx->feedbackBuf = (GLfloat *) realloc(cx->feedbackBuf,
|
||||
(size_t) size
|
||||
* __GLX_SIZE_FLOAT32);
|
||||
if (!cx->feedbackBuf) {
|
||||
cl->client->errorValue = size;
|
||||
return BadAlloc;
|
||||
}
|
||||
cx->feedbackBufSize = size;
|
||||
}
|
||||
glFeedbackBuffer(size, type, cx->feedbackBuf);
|
||||
__GLX_NOTE_UNFLUSHED_CMDS(cx);
|
||||
return Success;
|
||||
}
|
||||
|
||||
int __glXDispSwap_SelectBuffer(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
ClientPtr client = cl->client;
|
||||
__GLXcontext *cx;
|
||||
GLsizei size;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
int error;
|
||||
|
||||
REQUEST_FIXED_SIZE(xGLXSingleReq, 4);
|
||||
__GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
|
||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||
if (!cx) {
|
||||
return error;
|
||||
}
|
||||
|
||||
pc += __GLX_SINGLE_HDR_SIZE;
|
||||
__GLX_SWAP_INT(pc+0);
|
||||
size = *(GLsizei *)(pc+0);
|
||||
if (cx->selectBufSize < size) {
|
||||
cx->selectBuf = (GLuint *) realloc(cx->selectBuf,
|
||||
(size_t) size
|
||||
* __GLX_SIZE_CARD32);
|
||||
if (!cx->selectBuf) {
|
||||
cl->client->errorValue = size;
|
||||
return BadAlloc;
|
||||
}
|
||||
cx->selectBufSize = size;
|
||||
}
|
||||
glSelectBuffer(size, cx->selectBuf);
|
||||
__GLX_NOTE_UNFLUSHED_CMDS(cx);
|
||||
return Success;
|
||||
}
|
||||
|
||||
int __glXDispSwap_RenderMode(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
ClientPtr client = cl->client;
|
||||
__GLXcontext *cx;
|
||||
xGLXRenderModeReply reply;
|
||||
GLint nitems=0, retBytes=0, retval, newModeCheck;
|
||||
GLubyte *retBuffer = NULL;
|
||||
GLenum newMode;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
|
||||
int error;
|
||||
|
||||
REQUEST_FIXED_SIZE(xGLXSingleReq, 4);
|
||||
|
||||
__GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
|
||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||
if (!cx) {
|
||||
return error;
|
||||
}
|
||||
|
||||
pc += __GLX_SINGLE_HDR_SIZE;
|
||||
__GLX_SWAP_INT(pc);
|
||||
newMode = *(GLenum*) pc;
|
||||
retval = glRenderMode(newMode);
|
||||
|
||||
/* Check that render mode worked */
|
||||
glGetIntegerv(GL_RENDER_MODE, &newModeCheck);
|
||||
if (newModeCheck != newMode) {
|
||||
/* Render mode change failed. Bail */
|
||||
newMode = newModeCheck;
|
||||
goto noChangeAllowed;
|
||||
}
|
||||
|
||||
/*
|
||||
** Render mode might have still failed if we get here. But in this
|
||||
** case we can't really tell, nor does it matter. If it did fail, it
|
||||
** will return 0, and thus we won't send any data across the wire.
|
||||
*/
|
||||
|
||||
switch (cx->renderMode) {
|
||||
case GL_RENDER:
|
||||
cx->renderMode = newMode;
|
||||
break;
|
||||
case GL_FEEDBACK:
|
||||
if (retval < 0) {
|
||||
/* Overflow happened. Copy the entire buffer */
|
||||
nitems = cx->feedbackBufSize;
|
||||
} else {
|
||||
nitems = retval;
|
||||
}
|
||||
retBytes = nitems * __GLX_SIZE_FLOAT32;
|
||||
retBuffer = (GLubyte*) cx->feedbackBuf;
|
||||
__GLX_SWAP_FLOAT_ARRAY((GLbyte *)retBuffer, nitems);
|
||||
cx->renderMode = newMode;
|
||||
break;
|
||||
case GL_SELECT:
|
||||
if (retval < 0) {
|
||||
/* Overflow happened. Copy the entire buffer */
|
||||
nitems = cx->selectBufSize;
|
||||
} else {
|
||||
GLuint *bp = cx->selectBuf;
|
||||
GLint i;
|
||||
|
||||
/*
|
||||
** Figure out how many bytes of data need to be sent. Parse
|
||||
** the selection buffer to determine this fact as the
|
||||
** return value is the number of hits, not the number of
|
||||
** items in the buffer.
|
||||
*/
|
||||
nitems = 0;
|
||||
i = retval;
|
||||
while (--i >= 0) {
|
||||
GLuint n;
|
||||
|
||||
/* Parse select data for this hit */
|
||||
n = *bp;
|
||||
bp += 3 + n;
|
||||
}
|
||||
nitems = bp - cx->selectBuf;
|
||||
}
|
||||
retBytes = nitems * __GLX_SIZE_CARD32;
|
||||
retBuffer = (GLubyte*) cx->selectBuf;
|
||||
__GLX_SWAP_INT_ARRAY((GLbyte *)retBuffer, nitems);
|
||||
cx->renderMode = newMode;
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
** First reply is the number of elements returned in the feedback or
|
||||
** selection array, as per the API for glRenderMode itself.
|
||||
*/
|
||||
noChangeAllowed:;
|
||||
reply.length = nitems;
|
||||
reply.type = X_Reply;
|
||||
reply.sequenceNumber = client->sequence;
|
||||
reply.retval = retval;
|
||||
reply.size = nitems;
|
||||
reply.newMode = newMode;
|
||||
__GLX_SWAP_SHORT(&reply.sequenceNumber);
|
||||
__GLX_SWAP_INT(&reply.length);
|
||||
__GLX_SWAP_INT(&reply.retval);
|
||||
__GLX_SWAP_INT(&reply.size);
|
||||
__GLX_SWAP_INT(&reply.newMode);
|
||||
WriteToClient(client, sz_xGLXRenderModeReply, &reply);
|
||||
if (retBytes) {
|
||||
WriteToClient(client, retBytes, retBuffer);
|
||||
}
|
||||
return Success;
|
||||
}
|
||||
|
||||
int __glXDispSwap_Flush(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
ClientPtr client = cl->client;
|
||||
__GLXcontext *cx;
|
||||
int error;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
REQUEST_SIZE_MATCH(xGLXSingleReq);
|
||||
__GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
|
||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||
if (!cx) {
|
||||
return error;
|
||||
}
|
||||
|
||||
glFlush();
|
||||
__GLX_NOTE_FLUSHED_CMDS(cx);
|
||||
return Success;
|
||||
}
|
||||
|
||||
int __glXDispSwap_Finish(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
ClientPtr client = cl->client;
|
||||
__GLXcontext *cx;
|
||||
int error;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
REQUEST_SIZE_MATCH(xGLXSingleReq);
|
||||
__GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
|
||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||
if (!cx) {
|
||||
return error;
|
||||
}
|
||||
|
||||
/* Do a local glFinish */
|
||||
glFinish();
|
||||
__GLX_NOTE_FLUSHED_CMDS(cx);
|
||||
|
||||
/* Send empty reply packet to indicate finish is finished */
|
||||
__GLX_BEGIN_REPLY(0);
|
||||
__GLX_PUT_RETVAL(0);
|
||||
__GLX_SWAP_REPLY_HEADER();
|
||||
__GLX_SEND_HEADER();
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
int __glXDispSwap_GetString(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
return DoGetString(cl, pc, GL_TRUE);
|
||||
}
|
||||
|
||||
int __glXDispSwap_GetClipPlane(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
__GLXcontext *cx;
|
||||
ClientPtr client = cl->client;
|
||||
int error;
|
||||
GLdouble answer[4];
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
|
||||
|
||||
__GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
|
||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||
if (!cx) {
|
||||
return error;
|
||||
}
|
||||
pc += __GLX_SINGLE_HDR_SIZE;
|
||||
__GLX_SWAP_INT(pc + 0);
|
||||
|
||||
__glXClearErrorOccured();
|
||||
glGetClipPlane(*(GLenum *)(pc + 0), answer);
|
||||
if (__glXErrorOccured()) {
|
||||
__GLX_BEGIN_REPLY(0);
|
||||
__GLX_SWAP_REPLY_HEADER();
|
||||
__GLX_SEND_HEADER();
|
||||
} else {
|
||||
__GLX_SWAP_DOUBLE_ARRAY((GLbyte *)answer, 4);
|
||||
__GLX_BEGIN_REPLY(32);
|
||||
__GLX_SWAP_REPLY_HEADER();
|
||||
__GLX_SEND_HEADER();
|
||||
__GLX_SEND_DOUBLE_ARRAY(4);
|
||||
}
|
||||
return Success;
|
||||
}
|
||||
469
nx-X11/programs/Xserver/GL/glx/singlepix.c
Normal file
469
nx-X11/programs/Xserver/GL/glx/singlepix.c
Normal file
@@ -0,0 +1,469 @@
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
** Additional Notice Provisions: The application programming interfaces
|
||||
** established by SGI in conjunction with the Original Code are The
|
||||
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
|
||||
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
|
||||
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
|
||||
** Window System(R) (Version 1.3), released October 19, 1998. This software
|
||||
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include "glxserver.h"
|
||||
#include "glxext.h"
|
||||
#include "singlesize.h"
|
||||
#include "unpack.h"
|
||||
#include "g_disptab.h"
|
||||
#include "g_disptab_EXT.h"
|
||||
|
||||
int __glXDisp_ReadPixels(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
GLsizei width, height;
|
||||
GLenum format, type;
|
||||
GLboolean swapBytes, lsbFirst;
|
||||
GLint compsize;
|
||||
__GLXcontext *cx;
|
||||
ClientPtr client = cl->client;
|
||||
int error;
|
||||
char *answer, answerBuffer[200];
|
||||
|
||||
REQUEST_FIXED_SIZE(xGLXSingleReq, 28);
|
||||
|
||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||
if (!cx) {
|
||||
return error;
|
||||
}
|
||||
|
||||
pc += __GLX_SINGLE_HDR_SIZE;
|
||||
width = *(GLsizei *)(pc + 8);
|
||||
height = *(GLsizei *)(pc + 12);
|
||||
format = *(GLenum *)(pc + 16);
|
||||
type = *(GLenum *)(pc + 20);
|
||||
swapBytes = *(GLboolean *)(pc + 24);
|
||||
lsbFirst = *(GLboolean *)(pc + 25);
|
||||
compsize = __glReadPixels_size(format,type,width,height);
|
||||
if (compsize < 0) return BadLength;
|
||||
|
||||
glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
|
||||
glPixelStorei(GL_PACK_LSB_FIRST, lsbFirst);
|
||||
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
|
||||
__glXClearErrorOccured();
|
||||
glReadPixels(
|
||||
*(GLint *)(pc + 0),
|
||||
*(GLint *)(pc + 4),
|
||||
*(GLsizei *)(pc + 8),
|
||||
*(GLsizei *)(pc + 12),
|
||||
*(GLenum *)(pc + 16),
|
||||
*(GLenum *)(pc + 20),
|
||||
answer
|
||||
);
|
||||
|
||||
if (__glXErrorOccured()) {
|
||||
__GLX_BEGIN_REPLY(0);
|
||||
__GLX_SEND_HEADER();
|
||||
} else {
|
||||
__GLX_BEGIN_REPLY(compsize);
|
||||
__GLX_SEND_HEADER();
|
||||
__GLX_SEND_VOID_ARRAY(compsize);
|
||||
}
|
||||
return Success;
|
||||
}
|
||||
|
||||
int __glXDisp_GetTexImage(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
GLint level, compsize;
|
||||
GLenum format, type, target;
|
||||
GLboolean swapBytes;
|
||||
__GLXcontext *cx;
|
||||
ClientPtr client = cl->client;
|
||||
int error;
|
||||
char *answer, answerBuffer[200];
|
||||
GLint width=0, height=0, depth=1;
|
||||
|
||||
REQUEST_FIXED_SIZE(xGLXSingleReq, 20);
|
||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||
if (!cx) {
|
||||
return error;
|
||||
}
|
||||
|
||||
pc += __GLX_SINGLE_HDR_SIZE;
|
||||
level = *(GLint *)(pc + 4);
|
||||
format = *(GLenum *)(pc + 8);
|
||||
type = *(GLenum *)(pc + 12);
|
||||
target = *(GLenum *)(pc + 0);
|
||||
swapBytes = *(GLboolean *)(pc + 16);
|
||||
|
||||
glGetTexLevelParameteriv(target, level, GL_TEXTURE_WIDTH, &width);
|
||||
glGetTexLevelParameteriv(target, level, GL_TEXTURE_HEIGHT, &height);
|
||||
if ( target == GL_TEXTURE_3D) {
|
||||
glGetTexLevelParameteriv(target, level, GL_TEXTURE_DEPTH, &depth);
|
||||
}
|
||||
/*
|
||||
* The three queries above might fail if we're in a state where queries
|
||||
* are illegal, but then width, height, and depth would still be zero anyway.
|
||||
*/
|
||||
compsize = __glGetTexImage_size(target,level,format,type,width,height,depth);
|
||||
if (compsize < 0) return BadLength;
|
||||
|
||||
glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
|
||||
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
|
||||
__glXClearErrorOccured();
|
||||
glGetTexImage(
|
||||
*(GLenum *)(pc + 0),
|
||||
*(GLint *)(pc + 4),
|
||||
*(GLenum *)(pc + 8),
|
||||
*(GLenum *)(pc + 12),
|
||||
answer
|
||||
);
|
||||
|
||||
if (__glXErrorOccured()) {
|
||||
__GLX_BEGIN_REPLY(0);
|
||||
__GLX_SEND_HEADER();
|
||||
} else {
|
||||
__GLX_BEGIN_REPLY(compsize);
|
||||
((xGLXGetTexImageReply *)&__glXReply)->width = width;
|
||||
((xGLXGetTexImageReply *)&__glXReply)->height = height;
|
||||
((xGLXGetTexImageReply *)&__glXReply)->depth = depth;
|
||||
__GLX_SEND_HEADER();
|
||||
__GLX_SEND_VOID_ARRAY(compsize);
|
||||
}
|
||||
return Success;
|
||||
}
|
||||
|
||||
int __glXDisp_GetPolygonStipple(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
GLboolean lsbFirst;
|
||||
__GLXcontext *cx;
|
||||
ClientPtr client = cl->client;
|
||||
int error;
|
||||
GLubyte answerBuffer[200];
|
||||
char *answer;
|
||||
|
||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||
if (!cx) {
|
||||
return error;
|
||||
}
|
||||
|
||||
pc += __GLX_SINGLE_HDR_SIZE;
|
||||
lsbFirst = *(GLboolean *)(pc + 0);
|
||||
|
||||
glPixelStorei(GL_PACK_LSB_FIRST, lsbFirst);
|
||||
__GLX_GET_ANSWER_BUFFER(answer,cl,128,1);
|
||||
|
||||
__glXClearErrorOccured();
|
||||
glGetPolygonStipple(
|
||||
(GLubyte *) answer
|
||||
);
|
||||
|
||||
if (__glXErrorOccured()) {
|
||||
__GLX_BEGIN_REPLY(0);
|
||||
__GLX_SEND_HEADER();
|
||||
} else {
|
||||
__GLX_BEGIN_REPLY(128);
|
||||
__GLX_SEND_HEADER();
|
||||
__GLX_SEND_BYTE_ARRAY(128);
|
||||
}
|
||||
return Success;
|
||||
}
|
||||
|
||||
int __glXDisp_GetSeparableFilter(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
GLint compsize, compsize2;
|
||||
GLenum format, type, target;
|
||||
GLboolean swapBytes;
|
||||
__GLXcontext *cx;
|
||||
ClientPtr client = cl->client;
|
||||
int error;
|
||||
char *answer, answerBuffer[200];
|
||||
GLint width=0, height=0;
|
||||
|
||||
REQUEST_FIXED_SIZE(xGLXSingleReq, 16);
|
||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||
if (!cx) {
|
||||
return error;
|
||||
}
|
||||
|
||||
pc += __GLX_SINGLE_HDR_SIZE;
|
||||
format = *(GLenum *)(pc + 4);
|
||||
type = *(GLenum *)(pc + 8);
|
||||
target = *(GLenum *)(pc + 0);
|
||||
swapBytes = *(GLboolean *)(pc + 12);
|
||||
|
||||
/* target must be SEPARABLE_2D, however I guess we can let the GL
|
||||
barf on this one.... */
|
||||
|
||||
glGetConvolutionParameteriv(target, GL_CONVOLUTION_WIDTH, &width);
|
||||
glGetConvolutionParameteriv(target, GL_CONVOLUTION_HEIGHT, &height);
|
||||
/*
|
||||
* The two queries above might fail if we're in a state where queries
|
||||
* are illegal, but then width and height would still be zero anyway.
|
||||
*/
|
||||
compsize = __glGetTexImage_size(target,1,format,type,width,1,1);
|
||||
compsize2 = __glGetTexImage_size(target,1,format,type,height,1,1);
|
||||
|
||||
if ((compsize = safe_pad(compsize)) < 0) return BadLength;
|
||||
if ((compsize2 = safe_pad(compsize2)) < 0) return BadLength;
|
||||
|
||||
glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
|
||||
__GLX_GET_ANSWER_BUFFER(answer,cl,safe_add(compsize, compsize2),1);
|
||||
__glXClearErrorOccured();
|
||||
glGetSeparableFilter(
|
||||
*(GLenum *)(pc + 0),
|
||||
*(GLenum *)(pc + 4),
|
||||
*(GLenum *)(pc + 8),
|
||||
answer,
|
||||
answer + compsize,
|
||||
NULL
|
||||
);
|
||||
|
||||
if (__glXErrorOccured()) {
|
||||
__GLX_BEGIN_REPLY(0);
|
||||
__GLX_SEND_HEADER();
|
||||
} else {
|
||||
__GLX_BEGIN_REPLY(compsize + compsize2);
|
||||
((xGLXGetSeparableFilterReply *)&__glXReply)->width = width;
|
||||
((xGLXGetSeparableFilterReply *)&__glXReply)->height = height;
|
||||
__GLX_SEND_HEADER();
|
||||
__GLX_SEND_VOID_ARRAY(compsize + compsize2);
|
||||
}
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
int __glXDisp_GetConvolutionFilter(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
GLint compsize;
|
||||
GLenum format, type, target;
|
||||
GLboolean swapBytes;
|
||||
__GLXcontext *cx;
|
||||
ClientPtr client = cl->client;
|
||||
int error;
|
||||
char *answer, answerBuffer[200];
|
||||
GLint width=0, height=0;
|
||||
|
||||
REQUEST_FIXED_SIZE(xGLXSingleReq, 16);
|
||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||
if (!cx) {
|
||||
return error;
|
||||
}
|
||||
|
||||
pc += __GLX_SINGLE_HDR_SIZE;
|
||||
format = *(GLenum *)(pc + 4);
|
||||
type = *(GLenum *)(pc + 8);
|
||||
target = *(GLenum *)(pc + 0);
|
||||
swapBytes = *(GLboolean *)(pc + 12);
|
||||
|
||||
glGetConvolutionParameteriv(target, GL_CONVOLUTION_WIDTH, &width);
|
||||
if (target == GL_CONVOLUTION_1D) {
|
||||
height = 1;
|
||||
} else {
|
||||
glGetConvolutionParameteriv(target, GL_CONVOLUTION_HEIGHT, &height);
|
||||
}
|
||||
/*
|
||||
* The two queries above might fail if we're in a state where queries
|
||||
* are illegal, but then width and height would still be zero anyway.
|
||||
*/
|
||||
compsize = __glGetTexImage_size(target,1,format,type,width,height,1);
|
||||
if (compsize < 0) return BadLength;
|
||||
|
||||
glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
|
||||
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
|
||||
__glXClearErrorOccured();
|
||||
glGetConvolutionFilter(
|
||||
*(GLenum *)(pc + 0),
|
||||
*(GLenum *)(pc + 4),
|
||||
*(GLenum *)(pc + 8),
|
||||
answer
|
||||
);
|
||||
|
||||
if (__glXErrorOccured()) {
|
||||
__GLX_BEGIN_REPLY(0);
|
||||
__GLX_SEND_HEADER();
|
||||
} else {
|
||||
__GLX_BEGIN_REPLY(compsize);
|
||||
((xGLXGetConvolutionFilterReply *)&__glXReply)->width = width;
|
||||
((xGLXGetConvolutionFilterReply *)&__glXReply)->height = height;
|
||||
__GLX_SEND_HEADER();
|
||||
__GLX_SEND_VOID_ARRAY(compsize);
|
||||
}
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
int __glXDisp_GetHistogram(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
GLint compsize;
|
||||
GLenum format, type, target;
|
||||
GLboolean swapBytes, reset;
|
||||
__GLXcontext *cx;
|
||||
ClientPtr client = cl->client;
|
||||
int error;
|
||||
char *answer, answerBuffer[200];
|
||||
GLint width=0;
|
||||
|
||||
REQUEST_FIXED_SIZE(xGLXSingleReq, 16);
|
||||
|
||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||
if (!cx) {
|
||||
return error;
|
||||
}
|
||||
|
||||
pc += __GLX_SINGLE_HDR_SIZE;
|
||||
format = *(GLenum *)(pc + 4);
|
||||
type = *(GLenum *)(pc + 8);
|
||||
target = *(GLenum *)(pc + 0);
|
||||
swapBytes = *(GLboolean *)(pc + 12);
|
||||
reset = *(GLboolean *)(pc + 13);
|
||||
|
||||
glGetHistogramParameteriv(target, GL_HISTOGRAM_WIDTH, &width);
|
||||
/*
|
||||
* The one query above might fail if we're in a state where queries
|
||||
* are illegal, but then width would still be zero anyway.
|
||||
*/
|
||||
compsize = __glGetTexImage_size(target,1,format,type,width,1,1);
|
||||
if (compsize < 0) return BadLength;
|
||||
|
||||
glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
|
||||
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
|
||||
__glXClearErrorOccured();
|
||||
glGetHistogram( target, reset, format, type, answer);
|
||||
|
||||
if (__glXErrorOccured()) {
|
||||
__GLX_BEGIN_REPLY(0);
|
||||
__GLX_SEND_HEADER();
|
||||
} else {
|
||||
__GLX_BEGIN_REPLY(compsize);
|
||||
((xGLXGetHistogramReply *)&__glXReply)->width = width;
|
||||
__GLX_SEND_HEADER();
|
||||
__GLX_SEND_VOID_ARRAY(compsize);
|
||||
}
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
int __glXDisp_GetMinmax(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
GLint compsize;
|
||||
GLenum format, type, target;
|
||||
GLboolean swapBytes, reset;
|
||||
__GLXcontext *cx;
|
||||
ClientPtr client = cl->client;
|
||||
int error;
|
||||
char *answer, answerBuffer[200];
|
||||
|
||||
REQUEST_FIXED_SIZE(xGLXSingleReq, 16);
|
||||
|
||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||
if (!cx) {
|
||||
return error;
|
||||
}
|
||||
|
||||
pc += __GLX_SINGLE_HDR_SIZE;
|
||||
format = *(GLenum *)(pc + 4);
|
||||
type = *(GLenum *)(pc + 8);
|
||||
target = *(GLenum *)(pc + 0);
|
||||
swapBytes = *(GLboolean *)(pc + 12);
|
||||
reset = *(GLboolean *)(pc + 13);
|
||||
|
||||
compsize = __glGetTexImage_size(target,1,format,type,2,1,1);
|
||||
if (compsize < 0) return BadLength;
|
||||
|
||||
glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
|
||||
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
|
||||
__glXClearErrorOccured();
|
||||
glGetMinmax( target, reset, format, type, answer);
|
||||
|
||||
if (__glXErrorOccured()) {
|
||||
__GLX_BEGIN_REPLY(0);
|
||||
__GLX_SEND_HEADER();
|
||||
} else {
|
||||
__GLX_BEGIN_REPLY(compsize);
|
||||
__GLX_SEND_HEADER();
|
||||
__GLX_SEND_VOID_ARRAY(compsize);
|
||||
}
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
int __glXDisp_GetColorTable(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
GLint compsize;
|
||||
GLenum format, type, target;
|
||||
GLboolean swapBytes;
|
||||
__GLXcontext *cx;
|
||||
ClientPtr client = cl->client;
|
||||
int error;
|
||||
char *answer, answerBuffer[200];
|
||||
GLint width=0;
|
||||
|
||||
REQUEST_FIXED_SIZE(xGLXSingleReq, 16);
|
||||
|
||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||
if (!cx) {
|
||||
return error;
|
||||
}
|
||||
|
||||
pc += __GLX_SINGLE_HDR_SIZE;
|
||||
target = *(GLenum *)(pc + 0);
|
||||
format = *(GLenum *)(pc + 4);
|
||||
type = *(GLenum *)(pc + 8);
|
||||
swapBytes = *(GLboolean *)(pc + 12);
|
||||
|
||||
glGetColorTableParameteriv(target, GL_COLOR_TABLE_WIDTH, &width);
|
||||
/*
|
||||
* The one query above might fail if we're in a state where queries
|
||||
* are illegal, but then width would still be zero anyway.
|
||||
*/
|
||||
compsize = __glGetTexImage_size(target,1,format,type,width,1,1);
|
||||
if (compsize < 0) return BadLength;
|
||||
|
||||
glPixelStorei(GL_PACK_SWAP_BYTES, swapBytes);
|
||||
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
|
||||
__glXClearErrorOccured();
|
||||
glGetColorTable(
|
||||
*(GLenum *)(pc + 0),
|
||||
*(GLenum *)(pc + 4),
|
||||
*(GLenum *)(pc + 8),
|
||||
answer
|
||||
);
|
||||
|
||||
if (__glXErrorOccured()) {
|
||||
__GLX_BEGIN_REPLY(0);
|
||||
__GLX_SEND_HEADER();
|
||||
} else {
|
||||
__GLX_BEGIN_REPLY(compsize);
|
||||
((xGLXGetColorTableReply *)&__glXReply)->width = width;
|
||||
__GLX_SEND_HEADER();
|
||||
__GLX_SEND_VOID_ARRAY(compsize);
|
||||
}
|
||||
|
||||
return Success;
|
||||
}
|
||||
523
nx-X11/programs/Xserver/GL/glx/singlepixswap.c
Normal file
523
nx-X11/programs/Xserver/GL/glx/singlepixswap.c
Normal file
@@ -0,0 +1,523 @@
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
** Additional Notice Provisions: The application programming interfaces
|
||||
** established by SGI in conjunction with the Original Code are The
|
||||
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
|
||||
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
|
||||
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
|
||||
** Window System(R) (Version 1.3), released October 19, 1998. This software
|
||||
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include "glxserver.h"
|
||||
#include "glxext.h"
|
||||
#include "singlesize.h"
|
||||
#include "unpack.h"
|
||||
#include "g_disptab.h"
|
||||
#include "g_disptab_EXT.h"
|
||||
|
||||
int __glXDispSwap_ReadPixels(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
GLsizei width, height;
|
||||
GLenum format, type;
|
||||
GLboolean swapBytes, lsbFirst;
|
||||
GLint compsize;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
__GLXcontext *cx;
|
||||
ClientPtr client = cl->client;
|
||||
int error;
|
||||
char *answer, answerBuffer[200];
|
||||
|
||||
REQUEST_FIXED_SIZE(xGLXSingleReq, 28);
|
||||
|
||||
__GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
|
||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||
if (!cx) {
|
||||
return error;
|
||||
}
|
||||
|
||||
pc += __GLX_SINGLE_HDR_SIZE;
|
||||
__GLX_SWAP_INT(pc+0);
|
||||
__GLX_SWAP_INT(pc+4);
|
||||
__GLX_SWAP_INT(pc+8);
|
||||
__GLX_SWAP_INT(pc+12);
|
||||
__GLX_SWAP_INT(pc+16);
|
||||
__GLX_SWAP_INT(pc+20);
|
||||
|
||||
width = *(GLsizei *)(pc + 8);
|
||||
height = *(GLsizei *)(pc + 12);
|
||||
format = *(GLenum *)(pc + 16);
|
||||
type = *(GLenum *)(pc + 20);
|
||||
swapBytes = *(GLboolean *)(pc + 24);
|
||||
lsbFirst = *(GLboolean *)(pc + 25);
|
||||
compsize = __glReadPixels_size(format,type,width,height);
|
||||
if (compsize < 0) return BadLength;
|
||||
|
||||
glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
|
||||
glPixelStorei(GL_PACK_LSB_FIRST, lsbFirst);
|
||||
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
|
||||
__glXClearErrorOccured();
|
||||
glReadPixels(
|
||||
*(GLint *)(pc + 0),
|
||||
*(GLint *)(pc + 4),
|
||||
*(GLsizei *)(pc + 8),
|
||||
*(GLsizei *)(pc + 12),
|
||||
*(GLenum *)(pc + 16),
|
||||
*(GLenum *)(pc + 20),
|
||||
answer
|
||||
);
|
||||
|
||||
if (__glXErrorOccured()) {
|
||||
__GLX_BEGIN_REPLY(0);
|
||||
__GLX_SWAP_REPLY_HEADER();
|
||||
__GLX_SEND_HEADER();
|
||||
} else {
|
||||
__GLX_BEGIN_REPLY(compsize);
|
||||
__GLX_SWAP_REPLY_HEADER();
|
||||
__GLX_SEND_HEADER();
|
||||
__GLX_SEND_VOID_ARRAY(compsize);
|
||||
}
|
||||
return Success;
|
||||
}
|
||||
|
||||
int __glXDispSwap_GetTexImage(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
GLint level, compsize;
|
||||
GLenum format, type, target;
|
||||
GLboolean swapBytes;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
__GLXcontext *cx;
|
||||
ClientPtr client = cl->client;
|
||||
int error;
|
||||
char *answer, answerBuffer[200];
|
||||
GLint width=0, height=0, depth=1;
|
||||
|
||||
REQUEST_FIXED_SIZE(xGLXSingleReq, 24);
|
||||
__GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
|
||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||
if (!cx) {
|
||||
return error;
|
||||
}
|
||||
|
||||
pc += __GLX_SINGLE_HDR_SIZE;
|
||||
__GLX_SWAP_INT(pc+0);
|
||||
__GLX_SWAP_INT(pc+4);
|
||||
__GLX_SWAP_INT(pc+8);
|
||||
__GLX_SWAP_INT(pc+12);
|
||||
|
||||
level = *(GLint *)(pc + 4);
|
||||
format = *(GLenum *)(pc + 8);
|
||||
type = *(GLenum *)(pc + 12);
|
||||
target = *(GLenum *)(pc + 0);
|
||||
swapBytes = *(GLboolean *)(pc + 16);
|
||||
|
||||
glGetTexLevelParameteriv(target, level, GL_TEXTURE_WIDTH, &width);
|
||||
glGetTexLevelParameteriv(target, level, GL_TEXTURE_HEIGHT, &height);
|
||||
if ( target == GL_TEXTURE_3D) {
|
||||
glGetTexLevelParameteriv(target, level, GL_TEXTURE_DEPTH, &depth);
|
||||
}
|
||||
/*
|
||||
* The three queries above might fail if we're in a state where queries
|
||||
* are illegal, but then width, height, and depth would still be zero anyway.
|
||||
*/
|
||||
compsize = __glGetTexImage_size(target,level,format,type,width,height,depth);
|
||||
if (compsize < 0) return BadLength;
|
||||
|
||||
glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
|
||||
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
|
||||
__glXClearErrorOccured();
|
||||
glGetTexImage(
|
||||
*(GLenum *)(pc + 0),
|
||||
*(GLint *)(pc + 4),
|
||||
*(GLenum *)(pc + 8),
|
||||
*(GLenum *)(pc + 12),
|
||||
answer
|
||||
);
|
||||
|
||||
if (__glXErrorOccured()) {
|
||||
__GLX_BEGIN_REPLY(0);
|
||||
__GLX_SWAP_REPLY_HEADER();
|
||||
__GLX_SEND_HEADER();
|
||||
} else {
|
||||
__GLX_BEGIN_REPLY(compsize);
|
||||
__GLX_SWAP_REPLY_HEADER();
|
||||
__GLX_SWAP_INT(&width);
|
||||
__GLX_SWAP_INT(&height);
|
||||
__GLX_SWAP_INT(&depth);
|
||||
((xGLXGetTexImageReply *)&__glXReply)->width = width;
|
||||
((xGLXGetTexImageReply *)&__glXReply)->height = height;
|
||||
((xGLXGetTexImageReply *)&__glXReply)->depth = depth;
|
||||
__GLX_SEND_HEADER();
|
||||
__GLX_SEND_VOID_ARRAY(compsize);
|
||||
}
|
||||
return Success;
|
||||
}
|
||||
|
||||
int __glXDispSwap_GetPolygonStipple(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
GLboolean lsbFirst;
|
||||
__GLXcontext *cx;
|
||||
ClientPtr client = cl->client;
|
||||
int error;
|
||||
GLubyte answerBuffer[200];
|
||||
char *answer;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
|
||||
REQUEST_FIXED_SIZE(xGLXSingleReq, 4);
|
||||
__GLX_SWAP_INT(&((xGLXSingleReq *)pc)->contextTag);
|
||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||
if (!cx) {
|
||||
return error;
|
||||
}
|
||||
pc += __GLX_SINGLE_HDR_SIZE;
|
||||
lsbFirst = *(GLboolean *)(pc + 0);
|
||||
|
||||
glPixelStorei(GL_PACK_LSB_FIRST, lsbFirst);
|
||||
__GLX_GET_ANSWER_BUFFER(answer,cl,128,1);
|
||||
|
||||
__glXClearErrorOccured();
|
||||
glGetPolygonStipple(
|
||||
(GLubyte *) answer
|
||||
);
|
||||
if (__glXErrorOccured()) {
|
||||
__GLX_BEGIN_REPLY(0);
|
||||
__GLX_SWAP_REPLY_HEADER();
|
||||
__GLX_SEND_HEADER();
|
||||
} else {
|
||||
__GLX_BEGIN_REPLY(128);
|
||||
__GLX_SWAP_REPLY_HEADER();
|
||||
__GLX_SEND_HEADER();
|
||||
__GLX_SEND_BYTE_ARRAY(128);
|
||||
}
|
||||
return Success;
|
||||
}
|
||||
|
||||
int __glXDispSwap_GetSeparableFilter(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
GLint compsize, compsize2;
|
||||
GLenum format, type, target;
|
||||
GLboolean swapBytes;
|
||||
__GLXcontext *cx;
|
||||
ClientPtr client = cl->client;
|
||||
int error;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
char *answer, answerBuffer[200];
|
||||
GLint width=0, height=0;
|
||||
|
||||
REQUEST_FIXED_SIZE(xGLXSingleReq, 16);
|
||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||
if (!cx) {
|
||||
return error;
|
||||
}
|
||||
|
||||
pc += __GLX_SINGLE_HDR_SIZE;
|
||||
__GLX_SWAP_INT(pc+0);
|
||||
__GLX_SWAP_INT(pc+4);
|
||||
__GLX_SWAP_INT(pc+8);
|
||||
|
||||
format = *(GLenum *)(pc + 4);
|
||||
type = *(GLenum *)(pc + 8);
|
||||
target = *(GLenum *)(pc + 0);
|
||||
swapBytes = *(GLboolean *)(pc + 12);
|
||||
|
||||
/* target must be SEPARABLE_2D, however I guess we can let the GL
|
||||
barf on this one.... */
|
||||
|
||||
glGetConvolutionParameteriv(target, GL_CONVOLUTION_WIDTH, &width);
|
||||
glGetConvolutionParameteriv(target, GL_CONVOLUTION_HEIGHT, &height);
|
||||
/*
|
||||
* The two queries above might fail if we're in a state where queries
|
||||
* are illegal, but then width and height would still be zero anyway.
|
||||
*/
|
||||
compsize = __glGetTexImage_size(target,1,format,type,width,1,1);
|
||||
compsize2 = __glGetTexImage_size(target,1,format,type,height,1,1);
|
||||
|
||||
if ((compsize = safe_pad(compsize)) < 0) return BadLength;
|
||||
if ((compsize2 = safe_pad(compsize2)) < 0) return BadLength;
|
||||
|
||||
glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
|
||||
__GLX_GET_ANSWER_BUFFER(answer,cl,safe_add(compsize, compsize2),1);
|
||||
__glXClearErrorOccured();
|
||||
glGetSeparableFilter(
|
||||
*(GLenum *)(pc + 0),
|
||||
*(GLenum *)(pc + 4),
|
||||
*(GLenum *)(pc + 8),
|
||||
answer,
|
||||
answer + compsize,
|
||||
NULL
|
||||
);
|
||||
|
||||
if (__glXErrorOccured()) {
|
||||
__GLX_BEGIN_REPLY(0);
|
||||
__GLX_SWAP_REPLY_HEADER();
|
||||
} else {
|
||||
__GLX_BEGIN_REPLY(compsize + compsize2);
|
||||
__GLX_SWAP_REPLY_HEADER();
|
||||
__GLX_SWAP_INT(&width);
|
||||
__GLX_SWAP_INT(&height);
|
||||
((xGLXGetSeparableFilterReply *)&__glXReply)->width = width;
|
||||
((xGLXGetSeparableFilterReply *)&__glXReply)->height = height;
|
||||
__GLX_SEND_VOID_ARRAY(compsize + compsize2);
|
||||
}
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
int __glXDispSwap_GetConvolutionFilter(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
GLint compsize;
|
||||
GLenum format, type, target;
|
||||
GLboolean swapBytes;
|
||||
__GLXcontext *cx;
|
||||
ClientPtr client = cl->client;
|
||||
int error;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
char *answer, answerBuffer[200];
|
||||
GLint width=0, height=0;
|
||||
|
||||
REQUEST_FIXED_SIZE(xGLXSingleReq, 16);
|
||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||
if (!cx) {
|
||||
return error;
|
||||
}
|
||||
|
||||
pc += __GLX_SINGLE_HDR_SIZE;
|
||||
__GLX_SWAP_INT(pc+0);
|
||||
__GLX_SWAP_INT(pc+4);
|
||||
__GLX_SWAP_INT(pc+8);
|
||||
|
||||
format = *(GLenum *)(pc + 4);
|
||||
type = *(GLenum *)(pc + 8);
|
||||
target = *(GLenum *)(pc + 0);
|
||||
swapBytes = *(GLboolean *)(pc + 12);
|
||||
|
||||
glGetConvolutionParameteriv(target, GL_CONVOLUTION_WIDTH, &width);
|
||||
if (target == GL_CONVOLUTION_2D) {
|
||||
height = 1;
|
||||
} else {
|
||||
glGetConvolutionParameteriv(target, GL_CONVOLUTION_HEIGHT, &height);
|
||||
}
|
||||
/*
|
||||
* The two queries above might fail if we're in a state where queries
|
||||
* are illegal, but then width and height would still be zero anyway.
|
||||
*/
|
||||
compsize = __glGetTexImage_size(target,1,format,type,width,height,1);
|
||||
if (compsize < 0) return BadLength;
|
||||
|
||||
glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
|
||||
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
|
||||
__glXClearErrorOccured();
|
||||
glGetConvolutionFilter(
|
||||
*(GLenum *)(pc + 0),
|
||||
*(GLenum *)(pc + 4),
|
||||
*(GLenum *)(pc + 8),
|
||||
answer
|
||||
);
|
||||
|
||||
if (__glXErrorOccured()) {
|
||||
__GLX_BEGIN_REPLY(0);
|
||||
__GLX_SWAP_REPLY_HEADER();
|
||||
} else {
|
||||
__GLX_BEGIN_REPLY(compsize);
|
||||
__GLX_SWAP_REPLY_HEADER();
|
||||
__GLX_SWAP_INT(&width);
|
||||
__GLX_SWAP_INT(&height);
|
||||
((xGLXGetConvolutionFilterReply *)&__glXReply)->width = width;
|
||||
((xGLXGetConvolutionFilterReply *)&__glXReply)->height = height;
|
||||
__GLX_SEND_VOID_ARRAY(compsize);
|
||||
}
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
int __glXDispSwap_GetHistogram(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
GLint compsize;
|
||||
GLenum format, type, target;
|
||||
GLboolean swapBytes, reset;
|
||||
__GLXcontext *cx;
|
||||
ClientPtr client = cl->client;
|
||||
int error;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
char *answer, answerBuffer[200];
|
||||
GLint width=0;
|
||||
|
||||
REQUEST_FIXED_SIZE(xGLXSingleReq, 16);
|
||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||
if (!cx) {
|
||||
return error;
|
||||
}
|
||||
|
||||
pc += __GLX_SINGLE_HDR_SIZE;
|
||||
__GLX_SWAP_INT(pc+0);
|
||||
__GLX_SWAP_INT(pc+4);
|
||||
__GLX_SWAP_INT(pc+8);
|
||||
|
||||
format = *(GLenum *)(pc + 4);
|
||||
type = *(GLenum *)(pc + 8);
|
||||
target = *(GLenum *)(pc + 0);
|
||||
swapBytes = *(GLboolean *)(pc + 12);
|
||||
reset = *(GLboolean *)(pc + 13);
|
||||
|
||||
glGetHistogramParameteriv(target, GL_HISTOGRAM_WIDTH, &width);
|
||||
/*
|
||||
* The one query above might fail if we're in a state where queries
|
||||
* are illegal, but then width would still be zero anyway.
|
||||
*/
|
||||
compsize = __glGetTexImage_size(target,1,format,type,width,1,1);
|
||||
if (compsize < 0) return BadLength;
|
||||
|
||||
glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
|
||||
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
|
||||
__glXClearErrorOccured();
|
||||
glGetHistogram( target, reset, format, type, answer);
|
||||
|
||||
if (__glXErrorOccured()) {
|
||||
__GLX_BEGIN_REPLY(0);
|
||||
__GLX_SWAP_REPLY_HEADER();
|
||||
} else {
|
||||
__GLX_BEGIN_REPLY(compsize);
|
||||
__GLX_SWAP_REPLY_HEADER();
|
||||
__GLX_SWAP_INT(&width);
|
||||
((xGLXGetHistogramReply *)&__glXReply)->width = width;
|
||||
__GLX_SEND_VOID_ARRAY(compsize);
|
||||
}
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
int __glXDispSwap_GetMinmax(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
GLint compsize;
|
||||
GLenum format, type, target;
|
||||
GLboolean swapBytes, reset;
|
||||
__GLXcontext *cx;
|
||||
ClientPtr client = cl->client;
|
||||
int error;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
char *answer, answerBuffer[200];
|
||||
|
||||
REQUEST_FIXED_SIZE(xGLXSingleReq, 16);
|
||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||
if (!cx) {
|
||||
return error;
|
||||
}
|
||||
|
||||
pc += __GLX_SINGLE_HDR_SIZE;
|
||||
__GLX_SWAP_INT(pc+0);
|
||||
__GLX_SWAP_INT(pc+4);
|
||||
__GLX_SWAP_INT(pc+8);
|
||||
|
||||
format = *(GLenum *)(pc + 4);
|
||||
type = *(GLenum *)(pc + 8);
|
||||
target = *(GLenum *)(pc + 0);
|
||||
swapBytes = *(GLboolean *)(pc + 12);
|
||||
reset = *(GLboolean *)(pc + 13);
|
||||
|
||||
compsize = __glGetTexImage_size(target,1,format,type,2,1,1);
|
||||
if (compsize < 0) return BadLength;
|
||||
|
||||
glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
|
||||
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
|
||||
__glXClearErrorOccured();
|
||||
glGetMinmax( target, reset, format, type, answer);
|
||||
|
||||
if (__glXErrorOccured()) {
|
||||
__GLX_BEGIN_REPLY(0);
|
||||
__GLX_SWAP_REPLY_HEADER();
|
||||
} else {
|
||||
__GLX_BEGIN_REPLY(compsize);
|
||||
__GLX_SWAP_REPLY_HEADER();
|
||||
__GLX_SEND_VOID_ARRAY(compsize);
|
||||
}
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
int __glXDispSwap_GetColorTable(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
GLint compsize;
|
||||
GLenum format, type, target;
|
||||
GLboolean swapBytes;
|
||||
__GLXcontext *cx;
|
||||
ClientPtr client = cl->client;
|
||||
int error;
|
||||
__GLX_DECLARE_SWAP_VARIABLES;
|
||||
char *answer, answerBuffer[200];
|
||||
GLint width=0;
|
||||
|
||||
REQUEST_FIXED_SIZE(xGLXSingleReq, 16);
|
||||
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
|
||||
if (!cx) {
|
||||
return error;
|
||||
}
|
||||
|
||||
pc += __GLX_SINGLE_HDR_SIZE;
|
||||
__GLX_SWAP_INT(pc+0);
|
||||
__GLX_SWAP_INT(pc+4);
|
||||
__GLX_SWAP_INT(pc+8);
|
||||
|
||||
format = *(GLenum *)(pc + 4);
|
||||
type = *(GLenum *)(pc + 8);
|
||||
target = *(GLenum *)(pc + 0);
|
||||
swapBytes = *(GLboolean *)(pc + 12);
|
||||
|
||||
glGetColorTableParameteriv(target, GL_COLOR_TABLE_WIDTH, &width);
|
||||
/*
|
||||
* The one query above might fail if we're in a state where queries
|
||||
* are illegal, but then width would still be zero anyway.
|
||||
*/
|
||||
compsize = __glGetTexImage_size(target,1,format,type,width,1,1);
|
||||
if (compsize < 0) return BadLength;
|
||||
|
||||
glPixelStorei(GL_PACK_SWAP_BYTES, !swapBytes);
|
||||
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
|
||||
__glXClearErrorOccured();
|
||||
glGetColorTable(
|
||||
*(GLenum *)(pc + 0),
|
||||
*(GLenum *)(pc + 4),
|
||||
*(GLenum *)(pc + 8),
|
||||
answer
|
||||
);
|
||||
|
||||
if (__glXErrorOccured()) {
|
||||
__GLX_BEGIN_REPLY(0);
|
||||
__GLX_SWAP_REPLY_HEADER();
|
||||
} else {
|
||||
__GLX_BEGIN_REPLY(compsize);
|
||||
__GLX_SWAP_REPLY_HEADER();
|
||||
__GLX_SWAP_INT(&width);
|
||||
((xGLXGetColorTableReply *)&__glXReply)->width = width;
|
||||
__GLX_SEND_VOID_ARRAY(compsize);
|
||||
}
|
||||
|
||||
return Success;
|
||||
}
|
||||
1221
nx-X11/programs/Xserver/GL/glx/singlesize.c
Normal file
1221
nx-X11/programs/Xserver/GL/glx/singlesize.c
Normal file
File diff suppressed because it is too large
Load Diff
86
nx-X11/programs/Xserver/GL/glx/singlesize.h
Normal file
86
nx-X11/programs/Xserver/GL/glx/singlesize.h
Normal file
@@ -0,0 +1,86 @@
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#ifndef _singlesize_h_
|
||||
#define _singlesize_h_
|
||||
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
** Additional Notice Provisions: The application programming interfaces
|
||||
** established by SGI in conjunction with the Original Code are The
|
||||
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
|
||||
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
|
||||
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
|
||||
** Window System(R) (Version 1.3), released October 19, 1998. This software
|
||||
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
*/
|
||||
|
||||
#include "indirect_size.h"
|
||||
|
||||
extern GLint __glReadPixels_size(GLenum format, GLenum type,
|
||||
GLint width, GLint height);
|
||||
extern GLint __glGetTexEnvfv_size(GLenum pname);
|
||||
extern GLint __glGetTexEnviv_size(GLenum pname);
|
||||
extern GLint __glGetTexGenfv_size(GLenum pname);
|
||||
extern GLint __glGetTexGendv_size(GLenum pname);
|
||||
extern GLint __glGetTexGeniv_size(GLenum pname);
|
||||
extern GLint __glGetTexParameterfv_size(GLenum pname);
|
||||
extern GLint __glGetTexParameteriv_size(GLenum pname);
|
||||
extern GLint __glGetLightfv_size(GLenum pname);
|
||||
extern GLint __glGetLightiv_size(GLenum pname);
|
||||
extern GLint __glGetMap_size(GLenum pname, GLenum query);
|
||||
extern GLint __glGetMapdv_size(GLenum target, GLenum query);
|
||||
extern GLint __glGetMapfv_size(GLenum target, GLenum query);
|
||||
extern GLint __glGetMapiv_size(GLenum target, GLenum query);
|
||||
extern GLint __glGetMaterialfv_size(GLenum pname);
|
||||
extern GLint __glGetMaterialiv_size(GLenum pname);
|
||||
extern GLint __glGetPixelMap_size(GLenum map);
|
||||
extern GLint __glGetPixelMapfv_size(GLenum map);
|
||||
extern GLint __glGetPixelMapuiv_size(GLenum map);
|
||||
extern GLint __glGetPixelMapusv_size(GLenum map);
|
||||
extern GLint __glGet_size(GLenum sq);
|
||||
extern GLint __glGetDoublev_size(GLenum sq);
|
||||
extern GLint __glGetFloatv_size(GLenum sq);
|
||||
extern GLint __glGetIntegerv_size(GLenum sq);
|
||||
extern GLint __glGetBooleanv_size(GLenum sq);
|
||||
extern GLint __glGetTexLevelParameterfv_size(GLenum pname);
|
||||
extern GLint __glGetTexLevelParameteriv_size(GLenum pname);
|
||||
extern GLint __glGetTexImage_size(GLenum target, GLint level, GLenum format,
|
||||
GLenum type, GLint width, GLint height,
|
||||
GLint depth);
|
||||
extern GLint __glGetColorTableParameterfv_size(GLenum pname);
|
||||
extern GLint __glGetColorTableParameteriv_size(GLenum pname);
|
||||
extern GLint __glGetConvolutionParameterfv_size(GLenum pname);
|
||||
extern GLint __glGetConvolutionParameteriv_size(GLenum pname);
|
||||
extern GLint __glGetHistogramParameterfv_size(GLenum pname);
|
||||
extern GLint __glGetHistogramParameteriv_size(GLenum pname);
|
||||
extern GLint __glGetMinmaxParameterfv_size(GLenum pname);
|
||||
extern GLint __glGetMinmaxParameteriv_size(GLenum pname);
|
||||
|
||||
#endif /* _singlesize_h_ */
|
||||
|
||||
240
nx-X11/programs/Xserver/GL/glx/unpack.h
Normal file
240
nx-X11/programs/Xserver/GL/glx/unpack.h
Normal file
@@ -0,0 +1,240 @@
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#ifndef __GLX_unpack_h__
|
||||
#define __GLX_unpack_h__
|
||||
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
** Additional Notice Provisions: The application programming interfaces
|
||||
** established by SGI in conjunction with the Original Code are The
|
||||
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
|
||||
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
|
||||
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
|
||||
** Window System(R) (Version 1.3), released October 19, 1998. This software
|
||||
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
*/
|
||||
|
||||
#define __GLX_PAD(s) (((s)+3) & (GLuint)~3)
|
||||
|
||||
/*
|
||||
** Fetch the context-id out of a SingleReq request pointed to by pc.
|
||||
*/
|
||||
#define __GLX_GET_SINGLE_CONTEXT_TAG(pc) (((xGLXSingleReq*)pc)->contextTag)
|
||||
#define __GLX_GET_VENDPRIV_CONTEXT_TAG(pc) (((xGLXVendorPrivateReq*)pc)->contextTag)
|
||||
|
||||
/*
|
||||
** Fetch a double from potentially unaligned memory.
|
||||
*/
|
||||
#ifdef __GLX_ALIGN64
|
||||
#define __GLX_MEM_COPY(dst,src,n) memmove(dst,src,n)
|
||||
#define __GLX_GET_DOUBLE(dst,src) __GLX_MEM_COPY(&dst,src,8)
|
||||
#else
|
||||
#define __GLX_GET_DOUBLE(dst,src) (dst) = *((GLdouble*)(src))
|
||||
#endif
|
||||
|
||||
extern void __glXMemInit(void);
|
||||
|
||||
extern xGLXSingleReply __glXReply;
|
||||
|
||||
#define __GLX_BEGIN_REPLY(size) \
|
||||
__glXReply.length = __GLX_PAD(size) >> 2; \
|
||||
__glXReply.type = X_Reply; \
|
||||
__glXReply.sequenceNumber = client->sequence;
|
||||
|
||||
#define __GLX_SEND_HEADER() \
|
||||
WriteToClient( client, sz_xGLXSingleReply, &__glXReply);
|
||||
|
||||
#define __GLX_PUT_RETVAL(a) \
|
||||
__glXReply.retval = (a);
|
||||
|
||||
#define __GLX_PUT_SIZE(a) \
|
||||
__glXReply.size = (a);
|
||||
|
||||
#define __GLX_PUT_RENDERMODE(m) \
|
||||
__glXReply.pad3 = (m)
|
||||
|
||||
/*
|
||||
** Get a buffer to hold returned data, with the given alignment. If we have
|
||||
** to realloc, allocate size+align, in case the pointer has to be bumped for
|
||||
** alignment. The answerBuffer should already be aligned.
|
||||
**
|
||||
** NOTE: the cast (long)res below assumes a long is large enough to hold a
|
||||
** pointer.
|
||||
*/
|
||||
#define __GLX_GET_ANSWER_BUFFER(res,cl,size,align) \
|
||||
if (size < 0) return BadLength; \
|
||||
else if ((size) > sizeof(answerBuffer)) { \
|
||||
int bump; \
|
||||
if ((cl)->returnBufSize < (size)+(align)) { \
|
||||
(cl)->returnBuf = (GLbyte*)realloc((cl)->returnBuf, \
|
||||
(size)+(align)); \
|
||||
if (!(cl)->returnBuf) { \
|
||||
return BadAlloc; \
|
||||
} \
|
||||
(cl)->returnBufSize = (size)+(align); \
|
||||
} \
|
||||
res = (char*)cl->returnBuf; \
|
||||
bump = (long)(res) % (align); \
|
||||
if (bump) res += (align) - (bump); \
|
||||
} else { \
|
||||
res = (char *)answerBuffer; \
|
||||
}
|
||||
|
||||
#define __GLX_PUT_BYTE() \
|
||||
*(GLbyte *)&__glXReply.pad3 = *(GLbyte *)answer
|
||||
|
||||
#define __GLX_PUT_SHORT() \
|
||||
*(GLshort *)&__glXReply.pad3 = *(GLshort *)answer
|
||||
|
||||
#define __GLX_PUT_INT() \
|
||||
*(GLint *)&__glXReply.pad3 = *(GLint *)answer
|
||||
|
||||
#define __GLX_PUT_FLOAT() \
|
||||
*(GLfloat *)&__glXReply.pad3 = *(GLfloat *)answer
|
||||
|
||||
#define __GLX_PUT_DOUBLE() \
|
||||
*(GLdouble *)&__glXReply.pad3 = *(GLdouble *)answer
|
||||
|
||||
#define __GLX_SEND_BYTE_ARRAY(len) \
|
||||
WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT8), answer)
|
||||
|
||||
#define __GLX_SEND_SHORT_ARRAY(len) \
|
||||
WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT16), answer)
|
||||
|
||||
#define __GLX_SEND_INT_ARRAY(len) \
|
||||
WriteToClient(client, (len)*__GLX_SIZE_INT32, answer)
|
||||
|
||||
#define __GLX_SEND_FLOAT_ARRAY(len) \
|
||||
WriteToClient(client, (len)*__GLX_SIZE_FLOAT32, answer)
|
||||
|
||||
#define __GLX_SEND_DOUBLE_ARRAY(len) \
|
||||
WriteToClient(client, (len)*__GLX_SIZE_FLOAT64, answer)
|
||||
|
||||
|
||||
#define __GLX_SEND_VOID_ARRAY(len) __GLX_SEND_BYTE_ARRAY(len)
|
||||
#define __GLX_SEND_UBYTE_ARRAY(len) __GLX_SEND_BYTE_ARRAY(len)
|
||||
#define __GLX_SEND_USHORT_ARRAY(len) __GLX_SEND_SHORT_ARRAY(len)
|
||||
#define __GLX_SEND_UINT_ARRAY(len) __GLX_SEND_INT_ARRAY(len)
|
||||
|
||||
/*
|
||||
** PERFORMANCE NOTE:
|
||||
** Machine dependent optimizations abound here; these swapping macros can
|
||||
** conceivably be replaced with routines that do the job faster.
|
||||
*/
|
||||
#define __GLX_DECLARE_SWAP_VARIABLES \
|
||||
GLbyte sw
|
||||
|
||||
#define __GLX_DECLARE_SWAP_ARRAY_VARIABLES \
|
||||
GLbyte *swapPC; \
|
||||
GLbyte *swapEnd
|
||||
|
||||
|
||||
#define __GLX_SWAP_INT(pc) \
|
||||
sw = ((GLbyte *)(pc))[0]; \
|
||||
((GLbyte *)(pc))[0] = ((GLbyte *)(pc))[3]; \
|
||||
((GLbyte *)(pc))[3] = sw; \
|
||||
sw = ((GLbyte *)(pc))[1]; \
|
||||
((GLbyte *)(pc))[1] = ((GLbyte *)(pc))[2]; \
|
||||
((GLbyte *)(pc))[2] = sw;
|
||||
|
||||
#define __GLX_SWAP_SHORT(pc) \
|
||||
sw = ((GLbyte *)(pc))[0]; \
|
||||
((GLbyte *)(pc))[0] = ((GLbyte *)(pc))[1]; \
|
||||
((GLbyte *)(pc))[1] = sw;
|
||||
|
||||
#define __GLX_SWAP_DOUBLE(pc) \
|
||||
sw = ((GLbyte *)(pc))[0]; \
|
||||
((GLbyte *)(pc))[0] = ((GLbyte *)(pc))[7]; \
|
||||
((GLbyte *)(pc))[7] = sw; \
|
||||
sw = ((GLbyte *)(pc))[1]; \
|
||||
((GLbyte *)(pc))[1] = ((GLbyte *)(pc))[6]; \
|
||||
((GLbyte *)(pc))[6] = sw; \
|
||||
sw = ((GLbyte *)(pc))[2]; \
|
||||
((GLbyte *)(pc))[2] = ((GLbyte *)(pc))[5]; \
|
||||
((GLbyte *)(pc))[5] = sw; \
|
||||
sw = ((GLbyte *)(pc))[3]; \
|
||||
((GLbyte *)(pc))[3] = ((GLbyte *)(pc))[4]; \
|
||||
((GLbyte *)(pc))[4] = sw;
|
||||
|
||||
#define __GLX_SWAP_FLOAT(pc) \
|
||||
sw = ((GLbyte *)(pc))[0]; \
|
||||
((GLbyte *)(pc))[0] = ((GLbyte *)(pc))[3]; \
|
||||
((GLbyte *)(pc))[3] = sw; \
|
||||
sw = ((GLbyte *)(pc))[1]; \
|
||||
((GLbyte *)(pc))[1] = ((GLbyte *)(pc))[2]; \
|
||||
((GLbyte *)(pc))[2] = sw;
|
||||
|
||||
#define __GLX_SWAP_INT_ARRAY(pc, count) \
|
||||
swapPC = ((GLbyte *)(pc)); \
|
||||
swapEnd = ((GLbyte *)(pc)) + (count)*__GLX_SIZE_INT32;\
|
||||
while (swapPC < swapEnd) { \
|
||||
__GLX_SWAP_INT(swapPC); \
|
||||
swapPC += __GLX_SIZE_INT32; \
|
||||
}
|
||||
|
||||
#define __GLX_SWAP_SHORT_ARRAY(pc, count) \
|
||||
swapPC = ((GLbyte *)(pc)); \
|
||||
swapEnd = ((GLbyte *)(pc)) + (count)*__GLX_SIZE_INT16;\
|
||||
while (swapPC < swapEnd) { \
|
||||
__GLX_SWAP_SHORT(swapPC); \
|
||||
swapPC += __GLX_SIZE_INT16; \
|
||||
}
|
||||
|
||||
#define __GLX_SWAP_DOUBLE_ARRAY(pc, count) \
|
||||
swapPC = ((GLbyte *)(pc)); \
|
||||
swapEnd = ((GLbyte *)(pc)) + (count)*__GLX_SIZE_FLOAT64;\
|
||||
while (swapPC < swapEnd) { \
|
||||
__GLX_SWAP_DOUBLE(swapPC); \
|
||||
swapPC += __GLX_SIZE_FLOAT64; \
|
||||
}
|
||||
|
||||
#define __GLX_SWAP_FLOAT_ARRAY(pc, count) \
|
||||
swapPC = ((GLbyte *)(pc)); \
|
||||
swapEnd = ((GLbyte *)(pc)) + (count)*__GLX_SIZE_FLOAT32;\
|
||||
while (swapPC < swapEnd) { \
|
||||
__GLX_SWAP_FLOAT(swapPC); \
|
||||
swapPC += __GLX_SIZE_FLOAT32; \
|
||||
}
|
||||
|
||||
#define __GLX_SWAP_REPLY_HEADER() \
|
||||
__GLX_SWAP_SHORT(&__glXReply.sequenceNumber); \
|
||||
__GLX_SWAP_INT(&__glXReply.length);
|
||||
|
||||
#define __GLX_SWAP_REPLY_RETVAL() \
|
||||
__GLX_SWAP_INT(&__glXReply.retval)
|
||||
|
||||
#define __GLX_SWAP_REPLY_SIZE() \
|
||||
__GLX_SWAP_INT(&__glXReply.size)
|
||||
|
||||
#endif /* !__GLX_unpack_h__ */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
193
nx-X11/programs/Xserver/GL/glx/xfont.c
Normal file
193
nx-X11/programs/Xserver/GL/glx/xfont.c
Normal file
@@ -0,0 +1,193 @@
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
** Additional Notice Provisions: The application programming interfaces
|
||||
** established by SGI in conjunction with the Original Code are The
|
||||
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
|
||||
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
|
||||
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
|
||||
** Window System(R) (Version 1.3), released October 19, 1998. This software
|
||||
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
*/
|
||||
|
||||
#ifdef HAVE_DIX_CONFIG_H
|
||||
#include <dix-config.h>
|
||||
#endif
|
||||
|
||||
#include "glxserver.h"
|
||||
#include "glxutil.h"
|
||||
#include "g_disptab.h"
|
||||
#include <unpack.h>
|
||||
#include <GL/gl.h>
|
||||
#include <pixmapstr.h>
|
||||
#include <windowstr.h>
|
||||
#include <dixfontstr.h>
|
||||
|
||||
extern XID clientErrorValue; /* imported kludge from dix layer */
|
||||
|
||||
/*
|
||||
** Make a single GL bitmap from a single X glyph
|
||||
*/
|
||||
static int __glXMakeBitmapFromGlyph(FontPtr font, CharInfoPtr pci)
|
||||
{
|
||||
int i, j;
|
||||
int widthPadded; /* width of glyph in bytes, as padded by X */
|
||||
int allocBytes; /* bytes to allocate to store bitmap */
|
||||
int w; /* width of glyph in bits */
|
||||
int h; /* height of glyph */
|
||||
register unsigned char *pglyph;
|
||||
register unsigned char *p;
|
||||
unsigned char *allocbuf;
|
||||
#define __GL_CHAR_BUF_SIZE 2048
|
||||
unsigned char buf[__GL_CHAR_BUF_SIZE];
|
||||
|
||||
w = GLYPHWIDTHPIXELS(pci);
|
||||
h = GLYPHHEIGHTPIXELS(pci);
|
||||
widthPadded = GLYPHWIDTHBYTESPADDED(pci);
|
||||
|
||||
/*
|
||||
** Use the local buf if possible, otherwise malloc.
|
||||
*/
|
||||
allocBytes = widthPadded * h;
|
||||
if (allocBytes <= __GL_CHAR_BUF_SIZE) {
|
||||
p = buf;
|
||||
allocbuf = 0;
|
||||
} else {
|
||||
p = (unsigned char *) malloc(allocBytes);
|
||||
if (!p)
|
||||
return BadAlloc;
|
||||
allocbuf = p;
|
||||
}
|
||||
|
||||
/*
|
||||
** We have to reverse the picture, top to bottom
|
||||
*/
|
||||
|
||||
pglyph = FONTGLYPHBITS(FONTGLYPHS(font), pci) + (h-1)*widthPadded;
|
||||
for (j=0; j < h; j++) {
|
||||
for (i=0; i < widthPadded; i++) {
|
||||
p[i] = pglyph[i];
|
||||
}
|
||||
pglyph -= widthPadded;
|
||||
p += widthPadded;
|
||||
}
|
||||
glBitmap(w, h, -pci->metrics.leftSideBearing, pci->metrics.descent,
|
||||
pci->metrics.characterWidth, 0, allocbuf ? allocbuf : buf);
|
||||
|
||||
if (allocbuf) {
|
||||
free(allocbuf);
|
||||
}
|
||||
return Success;
|
||||
#undef __GL_CHAR_BUF_SIZE
|
||||
}
|
||||
|
||||
/*
|
||||
** Create a GL bitmap for each character in the X font. The bitmap is stored
|
||||
** in a display list.
|
||||
*/
|
||||
|
||||
static int
|
||||
MakeBitmapsFromFont(FontPtr pFont, int first, int count, int list_base)
|
||||
{
|
||||
unsigned long i, nglyphs;
|
||||
CARD8 chs[2]; /* the font index we are going after */
|
||||
CharInfoPtr pci;
|
||||
int rv; /* return value */
|
||||
int encoding = (FONTLASTROW(pFont) == 0) ? Linear16Bit : TwoD16Bit;
|
||||
|
||||
glPixelStorei(GL_UNPACK_SWAP_BYTES, FALSE);
|
||||
glPixelStorei(GL_UNPACK_LSB_FIRST, BITMAP_BIT_ORDER == LSBFirst);
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
|
||||
glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
|
||||
glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, GLYPHPADBYTES);
|
||||
for (i=0; i < count; i++) {
|
||||
chs[0] = (first + i) >> 8; /* high byte is first byte */
|
||||
chs[1] = first + i;
|
||||
|
||||
(*pFont->get_glyphs)(pFont, 1, chs, (FontEncoding)encoding,
|
||||
&nglyphs, &pci);
|
||||
|
||||
/*
|
||||
** Define a display list containing just a glBitmap() call.
|
||||
*/
|
||||
glNewList(list_base + i, GL_COMPILE);
|
||||
if (nglyphs ) {
|
||||
rv = __glXMakeBitmapFromGlyph(pFont, pci);
|
||||
if (rv) {
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
glEndList();
|
||||
}
|
||||
return Success;
|
||||
}
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
int __glXUseXFont(__GLXclientState *cl, GLbyte *pc)
|
||||
{
|
||||
ClientPtr client = cl->client;
|
||||
xGLXUseXFontReq *req;
|
||||
FontPtr pFont;
|
||||
GC *pGC;
|
||||
GLuint currentListIndex;
|
||||
__GLXcontext *cx;
|
||||
int error;
|
||||
|
||||
req = (xGLXUseXFontReq *) pc;
|
||||
cx = __glXForceCurrent(cl, req->contextTag, &error);
|
||||
if (!cx) {
|
||||
return error;
|
||||
}
|
||||
|
||||
glGetIntegerv(GL_LIST_INDEX, (GLint*) ¤tListIndex);
|
||||
if (currentListIndex != 0) {
|
||||
/*
|
||||
** A display list is currently being made. It is an error
|
||||
** to try to make a font during another lists construction.
|
||||
*/
|
||||
client->errorValue = cx->id;
|
||||
return __glXBadContextState;
|
||||
}
|
||||
|
||||
/*
|
||||
** Font can actually be either the ID of a font or the ID of a GC
|
||||
** containing a font.
|
||||
*/
|
||||
pFont = (FontPtr)LookupIDByType(req->font, RT_FONT);
|
||||
if (!pFont) {
|
||||
pGC = (GC *)LookupIDByType(req->font, RT_GC);
|
||||
if (!pGC) {
|
||||
client->errorValue = req->font;
|
||||
return BadFont;
|
||||
}
|
||||
pFont = pGC->font;
|
||||
}
|
||||
|
||||
return MakeBitmapsFromFont(pFont, req->first, req->count,
|
||||
req->listBase);
|
||||
}
|
||||
Reference in New Issue
Block a user