Add some missing bits of GL_SGI_color_table.

This commit is contained in:
Ian Romanick 2006-08-24 17:58:52 -07:00
parent ae608b2071
commit a29e6dd2d2
4 changed files with 116 additions and 0 deletions

View File

@ -1154,6 +1154,8 @@ ALIAS( GetMinmaxParameteriv, GetMinmaxParameterfv )
ALIAS( GetVertexAttribfvARB, GetVertexAttribdvARB )
ALIAS( GetVertexAttribivARB, GetVertexAttribdvARB )
ALIAS( GetQueryObjectuivARB, GetQueryObjectivARB )
ALIAS( GetColorTableParameterfvSGI, GetColorTableParameterfv )
ALIAS( GetColorTableParameterivSGI, GetColorTableParameterfv )
ALIAS( GetVertexAttribfvNV, GetVertexAttribdvNV )
ALIAS( GetVertexAttribivNV, GetVertexAttribdvNV )
ALIAS( PointParameterivNV, PointParameterfvEXT )

View File

@ -86,6 +86,8 @@ extern INTERNAL PURE FASTCALL GLint __glGetVertexAttribivARB_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glGetQueryObjectivARB_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glGetQueryObjectuivARB_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glGetQueryivARB_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glGetColorTableParameterfvSGI_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glGetColorTableParameterivSGI_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glGetProgramivNV_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glGetVertexAttribdvNV_size(GLenum);
extern INTERNAL PURE FASTCALL GLint __glGetVertexAttribfvNV_size(GLenum);

View File

@ -463,6 +463,59 @@ int __glXDisp_GetColorTable(__GLXclientState *cl, GLbyte *pc)
return Success;
}
int __glXDisp_GetColorTableSGI(__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;
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_VENDPRIV_HDR_SIZE;
target = *(GLenum *)(pc + 0);
format = *(GLenum *)(pc + 4);
type = *(GLenum *)(pc + 8);
swapBytes = *(GLboolean *)(pc + 12);
CALL_GetColorTableParameterivSGI( GET_DISPATCH(), (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) compsize = 0;
CALL_PixelStorei( GET_DISPATCH(), (GL_PACK_SWAP_BYTES, swapBytes) );
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
__glXClearErrorOccured();
CALL_GetColorTableSGI( GET_DISPATCH(), (
*(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;
}
int __glXDisp_GetCompressedTexImageARB(__GLXclientState *cl, GLbyte *pc)
{
return BadRequest;

View File

@ -518,6 +518,65 @@ int __glXDispSwap_GetColorTable(__GLXclientState *cl, GLbyte *pc)
return Success;
}
int __glXDispSwap_GetColorTableSGI(__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;
cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc), &error);
if (!cx) {
return error;
}
pc += __GLX_VENDPRIV_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);
CALL_GetColorTableParameterivSGI( GET_DISPATCH(), (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) compsize = 0;
CALL_PixelStorei( GET_DISPATCH(), (GL_PACK_SWAP_BYTES, !swapBytes) );
__GLX_GET_ANSWER_BUFFER(answer,cl,compsize,1);
__glXClearErrorOccured();
CALL_GetColorTableSGI( GET_DISPATCH(), (
*(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;
}
int __glXDispSwap_GetCompressedTexImageARB(__GLXclientState *cl, GLbyte *pc)
{
return BadRequest;