Make the transition to script-genereated GLX code easier.
[mesa.git] / src / glx / x11 / g_vendpriv.c
1 /* $XFree86$ */
2 /*
3 ** License Applicability. Except to the extent portions of this file are
4 ** made subject to an alternative license as permitted in the SGI Free
5 ** Software License B, Version 1.1 (the "License"), the contents of this
6 ** file are subject only to the provisions of the License. You may not use
7 ** this file except in compliance with the License. You may obtain a copy
8 ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
9 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
10 **
11 ** http://oss.sgi.com/projects/FreeB
12 **
13 ** Note that, as provided in the License, the Software is distributed on an
14 ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
15 ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
16 ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
17 ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
18 **
19 ** Original Code. The Original Code is: OpenGL Sample Implementation,
20 ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
21 ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
22 ** Copyright in any portions created by third parties is as indicated
23 ** elsewhere herein. All Rights Reserved.
24 **
25 ** Additional Notice Provisions: This software was created using the
26 ** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
27 ** not been independently verified as being compliant with the OpenGL(R)
28 ** version 1.2.1 Specification.
29 */
30
31 #include "packvendpriv.h"
32
33 GLboolean __indirect_glAreTexturesResidentEXT(GLsizei n, const GLuint *textures, GLboolean *residences)
34 {
35 __GLX_VENDPRIV_DECLARE_VARIABLES();
36 GLboolean retval = 0;
37 xGLXVendorPrivReply reply;
38 __GLX_VENDPRIV_LOAD_VARIABLES();
39 if (n < 0) return retval;
40 cmdlen = 4+n*4;
41 __GLX_VENDPRIV_BEGIN(X_GLXVendorPrivateWithReply,X_GLvop_AreTexturesResidentEXT,cmdlen);
42 __GLX_VENDPRIV_PUT_LONG(0,n);
43 __GLX_PUT_LONG_ARRAY(4,textures,n);
44 __GLX_VENDPRIV_READ_XREPLY();
45 __GLX_VENDPRIV_GET_RETVAL(retval, GLboolean);
46 __GLX_VENDPRIV_GET_CHAR_ARRAY(residences,n);
47 __GLX_VENDPRIV_END();
48 return retval;
49 }
50
51 void __indirect_glDeleteTexturesEXT(GLsizei n, const GLuint *textures)
52 {
53 __GLX_VENDPRIV_DECLARE_VARIABLES();
54 __GLX_VENDPRIV_LOAD_VARIABLES();
55 if (n < 0) return;
56 cmdlen = 4+n*4;
57 __GLX_VENDPRIV_BEGIN(X_GLXVendorPrivate,X_GLvop_DeleteTexturesEXT,cmdlen);
58 __GLX_VENDPRIV_PUT_LONG(0,n);
59 __GLX_PUT_LONG_ARRAY(4,textures,n);
60 __GLX_VENDPRIV_END();
61 }
62
63 void __indirect_glGenTexturesEXT(GLsizei n, GLuint *textures)
64 {
65 __GLX_VENDPRIV_DECLARE_VARIABLES();
66 xGLXVendorPrivReply reply;
67 __GLX_VENDPRIV_LOAD_VARIABLES();
68 __GLX_VENDPRIV_BEGIN(X_GLXVendorPrivateWithReply,X_GLvop_GenTexturesEXT,4);
69 __GLX_VENDPRIV_PUT_LONG(0,n);
70 __GLX_VENDPRIV_READ_XREPLY();
71 __GLX_VENDPRIV_GET_LONG_ARRAY(textures,n);
72 __GLX_VENDPRIV_END();
73 }
74
75 GLboolean __indirect_glIsTextureEXT(GLuint texture)
76 {
77 __GLX_VENDPRIV_DECLARE_VARIABLES();
78 GLboolean retval = 0;
79 xGLXVendorPrivReply reply;
80 __GLX_VENDPRIV_LOAD_VARIABLES();
81 __GLX_VENDPRIV_BEGIN(X_GLXVendorPrivateWithReply,X_GLvop_IsTextureEXT,4);
82 __GLX_VENDPRIV_PUT_LONG(0,texture);
83 __GLX_VENDPRIV_READ_XREPLY();
84 __GLX_VENDPRIV_GET_RETVAL(retval, GLboolean);
85 __GLX_VENDPRIV_END();
86 return retval;
87 }
88