1 /* DO NOT EDIT *************************************************
2 * THIS FILE AUTOMATICALLY GENERATED BY THE es_generator.py SCRIPT
3 * API specification file: main/APIspec.xml
4 * GLES version: GLES1.1
5 * date: 2011-11-17 11:46:39
10 #include "GLES/glext.h"
11 #include "main/mfeatures.h"
12 #include "main/compiler.h"
13 #include "main/api_exec.h"
18 #define GLAPIENTRYP GL_APIENTRYP
22 /* These types are needed for the Mesa veneer, but are not defined in
23 * the standard GLES headers.
25 typedef double GLdouble;
26 typedef double GLclampd;
28 /* Mesa error handling requires these */
29 extern void *_mesa_get_current_context(void);
30 extern void _mesa_error(void *ctx, GLenum error, const char *fmtString, ... );
32 /*************************************************************
33 * Generated functions begin here
36 extern void GL_APIENTRY _mesa_ActiveTextureARB(GLenum texture);
37 static void GL_APIENTRY _es_ActiveTexture(GLenum texture)
74 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glActiveTexture(texture=0x%x)", texture);
78 _mesa_ActiveTextureARB(texture);
81 extern void GL_APIENTRY _mesa_AlphaFunc(GLenum func, GLclampf ref);
82 static void GL_APIENTRY _es_AlphaFunc(GLenum func, GLclampf ref)
95 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glAlphaFunc(func=0x%x)", func);
99 _mesa_AlphaFunc(func, ref);
102 extern void GL_APIENTRY _mesa_AlphaFunc(GLenum func, GLclampf ref);
103 static void GL_APIENTRY _es_AlphaFuncx(GLenum func, GLclampx ref)
105 GLclampf converted_ref;
118 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glAlphaFuncx(func=0x%x)", func);
122 converted_ref = (GLclampf) (ref / 65536.0f);
124 _mesa_AlphaFunc(func, converted_ref);
127 extern void GL_APIENTRY _mesa_BindBufferARB(GLenum target, GLuint buffer);
128 static void GL_APIENTRY _es_BindBuffer(GLenum target, GLuint buffer)
131 case GL_ARRAY_BUFFER:
132 case GL_ELEMENT_ARRAY_BUFFER:
135 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glBindBuffer(target=0x%x)", target);
139 _mesa_BindBufferARB(target, buffer);
142 extern void GL_APIENTRY _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer);
143 static void GL_APIENTRY _es_BindFramebufferOES(GLenum target, GLuint framebuffer)
146 case GL_FRAMEBUFFER_OES:
149 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glBindFramebufferOES(target=0x%x)", target);
153 _mesa_BindFramebufferEXT(target, framebuffer);
156 extern void GL_APIENTRY _mesa_BindRenderbufferEXT(GLenum target, GLuint renderbuffer);
157 static void GL_APIENTRY _es_BindRenderbufferOES(GLenum target, GLuint renderbuffer)
160 case GL_RENDERBUFFER_OES:
163 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glBindRenderbufferOES(target=0x%x)", target);
167 _mesa_BindRenderbufferEXT(target, renderbuffer);
170 extern void GL_APIENTRY _mesa_BindTexture(GLenum target, GLuint texture);
171 static void GL_APIENTRY _es_BindTexture(GLenum target, GLuint texture)
175 case GL_TEXTURE_CUBE_MAP_OES:
178 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glBindTexture(target=0x%x)", target);
182 _mesa_BindTexture(target, texture);
185 extern void GL_APIENTRY _mesa_BlendEquation(GLenum mode);
186 static void GL_APIENTRY _es_BlendEquationOES(GLenum mode)
189 case GL_FUNC_ADD_OES:
190 case GL_FUNC_SUBTRACT_OES:
191 case GL_FUNC_REVERSE_SUBTRACT_OES:
196 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glBlendEquationOES(mode=0x%x)", mode);
200 _mesa_BlendEquation(mode);
203 extern void GL_APIENTRY _mesa_BlendEquationSeparateEXT(GLenum modeRGB, GLenum modeAlpha);
204 static void GL_APIENTRY _es_BlendEquationSeparateOES(GLenum modeRGB, GLenum modeAlpha)
207 case GL_FUNC_ADD_OES:
208 case GL_FUNC_SUBTRACT_OES:
209 case GL_FUNC_REVERSE_SUBTRACT_OES:
214 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glBlendEquationSeparateOES(modeRGB=0x%x)", modeRGB);
218 case GL_FUNC_ADD_OES:
219 case GL_FUNC_SUBTRACT_OES:
220 case GL_FUNC_REVERSE_SUBTRACT_OES:
225 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glBlendEquationSeparateOES(modeAlpha=0x%x)", modeAlpha);
229 _mesa_BlendEquationSeparateEXT(modeRGB, modeAlpha);
232 extern void GL_APIENTRY _mesa_BlendFunc(GLenum sfactor, GLenum dfactor);
233 static void GL_APIENTRY _es_BlendFunc(GLenum sfactor, GLenum dfactor)
239 case GL_ONE_MINUS_SRC_COLOR:
241 case GL_ONE_MINUS_SRC_ALPHA:
243 case GL_ONE_MINUS_DST_ALPHA:
245 case GL_ONE_MINUS_DST_COLOR:
246 case GL_SRC_ALPHA_SATURATE:
249 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glBlendFunc(sfactor=0x%x)", sfactor);
256 case GL_ONE_MINUS_SRC_COLOR:
258 case GL_ONE_MINUS_SRC_ALPHA:
260 case GL_ONE_MINUS_DST_ALPHA:
262 case GL_ONE_MINUS_DST_COLOR:
265 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glBlendFunc(dfactor=0x%x)", dfactor);
269 _mesa_BlendFunc(sfactor, dfactor);
272 extern void GL_APIENTRY _mesa_BlendFuncSeparateEXT(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
273 static void GL_APIENTRY _es_BlendFuncSeparateOES(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
279 case GL_ONE_MINUS_SRC_COLOR:
281 case GL_ONE_MINUS_SRC_ALPHA:
283 case GL_ONE_MINUS_DST_ALPHA:
285 case GL_ONE_MINUS_DST_COLOR:
286 case GL_SRC_ALPHA_SATURATE:
289 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glBlendFuncSeparateOES(srcRGB=0x%x)", srcRGB);
296 case GL_ONE_MINUS_SRC_COLOR:
298 case GL_ONE_MINUS_SRC_ALPHA:
300 case GL_ONE_MINUS_DST_ALPHA:
302 case GL_ONE_MINUS_DST_COLOR:
305 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glBlendFuncSeparateOES(dstRGB=0x%x)", dstRGB);
312 case GL_ONE_MINUS_SRC_COLOR:
314 case GL_ONE_MINUS_SRC_ALPHA:
316 case GL_ONE_MINUS_DST_ALPHA:
318 case GL_ONE_MINUS_DST_COLOR:
319 case GL_SRC_ALPHA_SATURATE:
322 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glBlendFuncSeparateOES(srcAlpha=0x%x)", srcAlpha);
329 case GL_ONE_MINUS_SRC_COLOR:
331 case GL_ONE_MINUS_SRC_ALPHA:
333 case GL_ONE_MINUS_DST_ALPHA:
335 case GL_ONE_MINUS_DST_COLOR:
338 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glBlendFuncSeparateOES(dstAlpha=0x%x)", dstAlpha);
342 _mesa_BlendFuncSeparateEXT(srcRGB, dstRGB, srcAlpha, dstAlpha);
345 extern void GL_APIENTRY _mesa_BufferDataARB(GLenum target, GLsizeiptr size, const GLvoid * data, GLenum usage);
346 static void GL_APIENTRY _es_BufferData(GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage)
349 case GL_ARRAY_BUFFER:
350 case GL_ELEMENT_ARRAY_BUFFER:
353 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glBufferData(target=0x%x)", target);
358 case GL_DYNAMIC_DRAW:
361 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glBufferData(usage=0x%x)", usage);
365 _mesa_BufferDataARB(target, size, data, usage);
368 extern void GL_APIENTRY _mesa_BufferSubDataARB(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid * data);
369 static void GL_APIENTRY _es_BufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data)
372 case GL_ARRAY_BUFFER:
373 case GL_ELEMENT_ARRAY_BUFFER:
376 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glBufferSubData(target=0x%x)", target);
380 _mesa_BufferSubDataARB(target, offset, size, data);
383 extern GLenum GL_APIENTRY _mesa_CheckFramebufferStatusEXT(GLenum target);
384 static GLenum GL_APIENTRY _es_CheckFramebufferStatusOES(GLenum target)
387 case GL_FRAMEBUFFER_OES:
390 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glCheckFramebufferStatusOES(target=0x%x)", target);
394 return _mesa_CheckFramebufferStatusEXT(target);
397 extern void GL_APIENTRY _mesa_Clear(GLbitfield mask);
398 static void GL_APIENTRY _es_Clear(GLbitfield mask)
400 printf("%s 1\n", __FUNCTION__);
404 case (GL_COLOR_BUFFER_BIT):
405 case (GL_DEPTH_BUFFER_BIT):
406 case (GL_STENCIL_BUFFER_BIT):
407 case (GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT):
408 case (GL_COLOR_BUFFER_BIT|GL_STENCIL_BUFFER_BIT):
409 case (GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT):
410 case (GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT):
413 _mesa_error(_mesa_get_current_context(), GL_INVALID_VALUE, "glClear(mask=0x%x)", mask);
420 extern void GL_APIENTRY _mesa_ClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
421 #define _es_ClearColor _mesa_ClearColor
423 extern void GL_APIENTRY _mesa_ClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
424 static void GL_APIENTRY _es_ClearColorx(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha)
426 GLclampf converted_red;
427 GLclampf converted_green;
428 GLclampf converted_blue;
429 GLclampf converted_alpha;
431 converted_red = (GLclampf) (red / 65536.0f);
432 converted_green = (GLclampf) (green / 65536.0f);
433 converted_blue = (GLclampf) (blue / 65536.0f);
434 converted_alpha = (GLclampf) (alpha / 65536.0f);
436 _mesa_ClearColor(converted_red, converted_green, converted_blue, converted_alpha);
439 extern void GL_APIENTRY _mesa_ClearDepthf(GLclampf depth);
440 #define _es_ClearDepthf _mesa_ClearDepthf
442 extern void GL_APIENTRY _mesa_ClearDepthf(GLclampf depth);
443 static void GL_APIENTRY _es_ClearDepthx(GLclampx depth)
445 GLclampf converted_depth;
447 converted_depth = (GLclampf) (depth / 65536.0f);
449 _mesa_ClearDepthf(converted_depth);
452 extern void GL_APIENTRY _mesa_ClearStencil(GLint s);
453 #define _es_ClearStencil _mesa_ClearStencil
455 extern void GL_APIENTRY _mesa_ClientActiveTextureARB(GLenum texture);
456 static void GL_APIENTRY _es_ClientActiveTexture(GLenum texture)
493 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glClientActiveTexture(texture=0x%x)", texture);
497 _mesa_ClientActiveTextureARB(texture);
500 extern void GL_APIENTRY _mesa_ClipPlane(GLenum plane, GLdouble const * equation);
501 static void GL_APIENTRY _es_ClipPlanef(GLenum plane, const GLfloat *equation)
503 register unsigned int i;
504 unsigned int n_equation = 4;
505 GLdouble converted_equation[4];
516 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glClipPlanef(plane=0x%x)", plane);
520 for (i = 0; i < n_equation; i++) {
521 converted_equation[i] = (GLdouble) (equation[i]);
524 _mesa_ClipPlane(plane, converted_equation);
527 extern void GL_APIENTRY _mesa_ClipPlane(GLenum plane, GLdouble const * equation);
528 static void GL_APIENTRY _es_ClipPlanex(GLenum plane, const GLfixed *equation)
530 register unsigned int i;
531 unsigned int n_equation = 4;
532 GLdouble converted_equation[4];
543 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glClipPlanex(plane=0x%x)", plane);
547 for (i = 0; i < n_equation; i++) {
548 converted_equation[i] = (GLdouble) (equation[i] / 65536.0);
551 _mesa_ClipPlane(plane, converted_equation);
554 /* this function is special and is defined elsewhere */
555 extern void GL_APIENTRY _es_Color4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
556 #define _check_Color4f _es_Color4f
558 extern void GL_APIENTRY _es_Color4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
559 static void GL_APIENTRY _es_Color4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
561 GLfloat converted_red;
562 GLfloat converted_green;
563 GLfloat converted_blue;
564 GLfloat converted_alpha;
566 converted_red = (GLfloat) (red / 255.0f);
567 converted_green = (GLfloat) (green / 255.0f);
568 converted_blue = (GLfloat) (blue / 255.0f);
569 converted_alpha = (GLfloat) (alpha / 255.0f);
571 _es_Color4f(converted_red, converted_green, converted_blue, converted_alpha);
574 extern void GL_APIENTRY _es_Color4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
575 static void GL_APIENTRY _es_Color4x(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
577 GLfloat converted_red;
578 GLfloat converted_green;
579 GLfloat converted_blue;
580 GLfloat converted_alpha;
582 converted_red = (GLfloat) (red / 65536.0f);
583 converted_green = (GLfloat) (green / 65536.0f);
584 converted_blue = (GLfloat) (blue / 65536.0f);
585 converted_alpha = (GLfloat) (alpha / 65536.0f);
587 _es_Color4f(converted_red, converted_green, converted_blue, converted_alpha);
590 extern void GL_APIENTRY _mesa_ColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
591 #define _es_ColorMask _mesa_ColorMask
593 extern void GL_APIENTRY _mesa_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer);
594 static void GL_APIENTRY _es_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
600 _mesa_error(_mesa_get_current_context(), GL_INVALID_VALUE, "glColorPointer(size=%d)", size);
604 case GL_UNSIGNED_BYTE:
609 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glColorPointer(type=0x%x)", type);
613 _mesa_ColorPointer(size, type, stride, pointer);
616 extern void GL_APIENTRY _mesa_CompressedTexImage2DARB(GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data);
617 static void GL_APIENTRY _es_CompressedTexImage2D(GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data)
621 case GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES:
622 case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES:
623 case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES:
624 case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES:
625 case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES:
626 case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES:
629 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glCompressedTexImage2D(target=0x%x)", target);
632 switch(internalFormat) {
633 case GL_PALETTE4_RGB8_OES:
634 case GL_PALETTE4_RGBA8_OES:
635 case GL_PALETTE4_R5_G6_B5_OES:
636 case GL_PALETTE4_RGBA4_OES:
637 case GL_PALETTE4_RGB5_A1_OES:
638 case GL_PALETTE8_RGB8_OES:
639 case GL_PALETTE8_RGBA8_OES:
640 case GL_PALETTE8_R5_G6_B5_OES:
641 case GL_PALETTE8_RGBA4_OES:
642 case GL_PALETTE8_RGB5_A1_OES:
645 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glCompressedTexImage2D(internalFormat=0x%x)", internalFormat);
652 _mesa_error(_mesa_get_current_context(), GL_INVALID_VALUE, "glCompressedTexImage2D(border=%d)", border);
656 _mesa_CompressedTexImage2DARB(target, level, internalFormat, width, height, border, imageSize, data);
659 extern void GL_APIENTRY _mesa_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data);
660 static void GL_APIENTRY _es_CompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data)
664 case GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES:
665 case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES:
666 case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES:
667 case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES:
668 case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES:
669 case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES:
672 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glCompressedTexSubImage2D(target=0x%x)", target);
676 _mesa_CompressedTexSubImage2DARB(target, level, xoffset, yoffset, width, height, format, imageSize, data);
679 extern void GL_APIENTRY _mesa_CopyTexImage2D(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
680 static void GL_APIENTRY _es_CopyTexImage2D(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
684 case GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES:
685 case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES:
686 case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES:
687 case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES:
688 case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES:
689 case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES:
692 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glCopyTexImage2D(target=0x%x)", target);
695 switch(internalFormat) {
700 case GL_LUMINANCE_ALPHA:
703 _mesa_error(_mesa_get_current_context(), GL_INVALID_VALUE, "glCopyTexImage2D(internalFormat=0x%x)", internalFormat);
710 _mesa_error(_mesa_get_current_context(), GL_INVALID_VALUE, "glCopyTexImage2D(border=%d)", border);
714 _mesa_CopyTexImage2D(target, level, internalFormat, x, y, width, height, border);
717 extern void GL_APIENTRY _mesa_CopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
718 static void GL_APIENTRY _es_CopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
722 case GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES:
723 case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES:
724 case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES:
725 case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES:
726 case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES:
727 case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES:
730 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glCopyTexSubImage2D(target=0x%x)", target);
734 _mesa_CopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
737 extern void GL_APIENTRY _mesa_CullFace(GLenum mode);
738 static void GL_APIENTRY _es_CullFace(GLenum mode)
743 case GL_FRONT_AND_BACK:
746 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glCullFace(mode=0x%x)", mode);
750 _mesa_CullFace(mode);
753 extern void GL_APIENTRY _mesa_DeleteBuffersARB(GLsizei n, const GLuint * buffer);
754 #define _es_DeleteBuffers _mesa_DeleteBuffersARB
756 extern void GL_APIENTRY _mesa_DeleteFramebuffersEXT(GLsizei n, const GLuint * framebuffers);
757 #define _es_DeleteFramebuffersOES _mesa_DeleteFramebuffersEXT
759 extern void GL_APIENTRY _mesa_DeleteRenderbuffersEXT(GLsizei n, const GLuint * renderbuffers);
760 #define _es_DeleteRenderbuffersOES _mesa_DeleteRenderbuffersEXT
762 extern void GL_APIENTRY _mesa_DeleteTextures(GLsizei n, const GLuint * textures);
763 #define _es_DeleteTextures _mesa_DeleteTextures
765 extern void GL_APIENTRY _mesa_DepthFunc(GLenum func);
766 static void GL_APIENTRY _es_DepthFunc(GLenum func)
779 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glDepthFunc(func=0x%x)", func);
783 _mesa_DepthFunc(func);
786 extern void GL_APIENTRY _mesa_DepthMask(GLboolean flag);
787 #define _es_DepthMask _mesa_DepthMask
789 extern void GL_APIENTRY _mesa_DepthRangef(GLclampf zNear, GLclampf zFar);
790 #define _es_DepthRangef _mesa_DepthRangef
792 extern void GL_APIENTRY _mesa_DepthRangef(GLclampf zNear, GLclampf zFar);
793 static void GL_APIENTRY _es_DepthRangex(GLclampx zNear, GLclampx zFar)
795 GLclampf converted_zNear;
796 GLclampf converted_zFar;
798 converted_zNear = (GLclampf) (zNear / 65536.0f);
799 converted_zFar = (GLclampf) (zFar / 65536.0f);
801 _mesa_DepthRangef(converted_zNear, converted_zFar);
804 extern void GL_APIENTRY _mesa_Disable(GLenum cap);
805 static void GL_APIENTRY _es_Disable(GLenum cap)
809 case GL_RESCALE_NORMAL:
818 case GL_COLOR_MATERIAL:
827 case GL_POINT_SMOOTH:
830 case GL_POLYGON_OFFSET_FILL:
832 case GL_SAMPLE_ALPHA_TO_COVERAGE:
833 case GL_SAMPLE_ALPHA_TO_ONE:
834 case GL_SAMPLE_COVERAGE:
836 case GL_SCISSOR_TEST:
838 case GL_STENCIL_TEST:
842 case GL_COLOR_LOGIC_OP:
843 case GL_POINT_SPRITE_OES:
844 case GL_MATRIX_PALETTE_OES:
845 case GL_TEXTURE_CUBE_MAP_OES:
846 case GL_TEXTURE_GEN_STR_OES:
849 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glDisable(cap=0x%x)", cap);
856 extern void GL_APIENTRY _mesa_DisableClientState(GLenum array);
857 static void GL_APIENTRY _es_DisableClientState(GLenum array)
860 case GL_VERTEX_ARRAY:
861 case GL_NORMAL_ARRAY:
863 case GL_TEXTURE_COORD_ARRAY:
864 case GL_MATRIX_INDEX_ARRAY_OES:
865 case GL_WEIGHT_ARRAY_OES:
866 case GL_POINT_SIZE_ARRAY_OES:
869 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glDisableClientState(array=0x%x)", array);
873 _mesa_DisableClientState(array);
876 extern void GL_APIENTRY _mesa_DrawArrays(GLenum mode, GLint first, GLsizei count);
877 static void GL_APIENTRY _es_DrawArrays(GLenum mode, GLint first, GLsizei count)
885 case GL_TRIANGLE_STRIP:
886 case GL_TRIANGLE_FAN:
889 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glDrawArrays(mode=0x%x)", mode);
893 _mesa_DrawArrays(mode, first, count);
896 extern void GL_APIENTRY _mesa_DrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices);
897 static void GL_APIENTRY _es_DrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices)
905 case GL_TRIANGLE_STRIP:
906 case GL_TRIANGLE_FAN:
909 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glDrawElements(mode=0x%x)", mode);
913 case GL_UNSIGNED_BYTE:
914 case GL_UNSIGNED_SHORT:
915 case GL_UNSIGNED_INT:
918 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glDrawElements(type=0x%x)", type);
922 _mesa_DrawElements(mode, count, type, indices);
925 extern void GL_APIENTRY _mesa_DrawTexf(GLfloat x, GLfloat y, GLfloat z, GLfloat w, GLfloat h);
926 #define _es_DrawTexfOES _mesa_DrawTexf
928 extern void GL_APIENTRY _mesa_DrawTexfv(const GLfloat * coords);
929 #define _es_DrawTexfvOES _mesa_DrawTexfv
931 extern void GL_APIENTRY _mesa_DrawTexi(GLint x, GLint y, GLint z, GLint w, GLint h);
932 #define _es_DrawTexiOES _mesa_DrawTexi
934 extern void GL_APIENTRY _mesa_DrawTexiv(const GLint * coords);
935 #define _es_DrawTexivOES _mesa_DrawTexiv
937 extern void GL_APIENTRY _mesa_DrawTexs(GLshort x, GLshort y, GLshort z, GLshort w, GLshort h);
938 #define _es_DrawTexsOES _mesa_DrawTexs
940 extern void GL_APIENTRY _mesa_DrawTexsv(const GLshort * coords);
941 #define _es_DrawTexsvOES _mesa_DrawTexsv
943 extern void GL_APIENTRY _mesa_DrawTexf(GLfloat x, GLfloat y, GLfloat z, GLfloat w, GLfloat h);
944 static void GL_APIENTRY _es_DrawTexxOES(GLfixed x, GLfixed y, GLfixed z, GLfixed w, GLfixed h)
952 converted_x = (GLfloat) (x / 65536.0f);
953 converted_y = (GLfloat) (y / 65536.0f);
954 converted_z = (GLfloat) (z / 65536.0f);
955 converted_w = (GLfloat) (w / 65536.0f);
956 converted_h = (GLfloat) (h / 65536.0f);
958 _mesa_DrawTexf(converted_x, converted_y, converted_z, converted_w, converted_h);
961 extern void GL_APIENTRY _mesa_DrawTexfv(GLfloat const * coords);
962 static void GL_APIENTRY _es_DrawTexxvOES(const GLfixed *coords)
964 register unsigned int i;
965 unsigned int n_coords = 5;
966 GLfloat converted_coords[5];
968 for (i = 0; i < n_coords; i++) {
969 converted_coords[i] = (GLfloat) (coords[i] / 65536.0f);
972 _mesa_DrawTexfv(converted_coords);
975 extern void GL_APIENTRY _mesa_EGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image);
976 static void GL_APIENTRY _es_EGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image)
979 case GL_RENDERBUFFER_OES:
982 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glEGLImageTargetRenderbufferStorageOES(target=0x%x)", target);
986 _mesa_EGLImageTargetRenderbufferStorageOES(target, image);
989 extern void GL_APIENTRY _mesa_EGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image);
990 static void GL_APIENTRY _es_EGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image)
996 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glEGLImageTargetTexture2DOES(target=0x%x)", target);
1000 _mesa_EGLImageTargetTexture2DOES(target, image);
1003 extern void GL_APIENTRY _mesa_Enable(GLenum cap);
1004 static void GL_APIENTRY _es_Enable(GLenum cap)
1008 case GL_RESCALE_NORMAL:
1009 case GL_CLIP_PLANE0:
1010 case GL_CLIP_PLANE1:
1011 case GL_CLIP_PLANE2:
1012 case GL_CLIP_PLANE3:
1013 case GL_CLIP_PLANE4:
1014 case GL_CLIP_PLANE5:
1017 case GL_COLOR_MATERIAL:
1026 case GL_POINT_SMOOTH:
1027 case GL_LINE_SMOOTH:
1029 case GL_POLYGON_OFFSET_FILL:
1030 case GL_MULTISAMPLE:
1031 case GL_SAMPLE_ALPHA_TO_COVERAGE:
1032 case GL_SAMPLE_ALPHA_TO_ONE:
1033 case GL_SAMPLE_COVERAGE:
1035 case GL_SCISSOR_TEST:
1037 case GL_STENCIL_TEST:
1041 case GL_COLOR_LOGIC_OP:
1042 case GL_POINT_SPRITE_OES:
1043 case GL_MATRIX_PALETTE_OES:
1044 case GL_TEXTURE_CUBE_MAP_OES:
1045 case GL_TEXTURE_GEN_STR_OES:
1048 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glEnable(cap=0x%x)", cap);
1055 extern void GL_APIENTRY _mesa_EnableClientState(GLenum array);
1056 static void GL_APIENTRY _es_EnableClientState(GLenum array)
1059 case GL_VERTEX_ARRAY:
1060 case GL_NORMAL_ARRAY:
1061 case GL_COLOR_ARRAY:
1062 case GL_TEXTURE_COORD_ARRAY:
1063 case GL_MATRIX_INDEX_ARRAY_OES:
1064 case GL_WEIGHT_ARRAY_OES:
1065 case GL_POINT_SIZE_ARRAY_OES:
1068 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glEnableClientState(array=0x%x)", array);
1072 _mesa_EnableClientState(array);
1075 extern void GL_APIENTRY _mesa_Finish(void);
1076 #define _es_Finish _mesa_Finish
1078 extern void GL_APIENTRY _mesa_Flush(void);
1079 #define _es_Flush _mesa_Flush
1081 extern void GL_APIENTRY _mesa_Fogf(GLenum pname, GLfloat param);
1082 static void GL_APIENTRY _es_Fogf(GLenum pname, GLfloat param)
1086 if (param != GL_EXP && param != GL_EXP2 && param != GL_LINEAR) {
1087 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glFogf(pname=0x%x)", pname);
1091 case GL_FOG_DENSITY:
1096 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glFogf(pname=0x%x)", pname);
1100 _mesa_Fogf(pname, param);
1103 extern void GL_APIENTRY _mesa_Fogfv(GLenum pname, const GLfloat * params);
1104 static void GL_APIENTRY _es_Fogfv(GLenum pname, const GLfloat *params)
1107 case GL_FOG_MODE: /* size 1 */
1108 if (params[0] != GL_EXP && params[0] != GL_EXP2 && params[0] != GL_LINEAR) {
1109 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glFogfv(pname=0x%x)", pname);
1113 case GL_FOG_COLOR: /* size 4 */
1114 case GL_FOG_DENSITY: /* size 1 */
1115 case GL_FOG_START: /* size 1 */
1116 case GL_FOG_END: /* size 1 */
1119 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glFogfv(pname=0x%x)", pname);
1123 _mesa_Fogfv(pname, params);
1126 extern void GL_APIENTRY _mesa_Fogf(GLenum pname, GLfloat param);
1127 static void GL_APIENTRY _es_Fogx(GLenum pname, GLfixed param)
1129 GLfloat converted_param;
1130 int convert_param_value = 1;
1134 if (param != GL_EXP && param != GL_EXP2 && param != GL_LINEAR) {
1135 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glFogx(pname=0x%x)", pname);
1138 convert_param_value = 0;
1140 case GL_FOG_DENSITY:
1145 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glFogx(pname=0x%x)", pname);
1149 if (convert_param_value) {
1150 converted_param = (GLfloat) (param / 65536.0f);
1152 converted_param = (GLfloat) param;
1155 _mesa_Fogf(pname, converted_param);
1158 extern void GL_APIENTRY _mesa_Fogfv(GLenum pname, GLfloat const * params);
1159 static void GL_APIENTRY _es_Fogxv(GLenum pname, const GLfixed *params)
1161 register unsigned int i;
1162 unsigned int n_params = 4;
1163 GLfloat converted_params[4];
1164 int convert_params_value = 1;
1168 if (params[0] != GL_EXP && params[0] != GL_EXP2 && params[0] != GL_LINEAR) {
1169 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glFogxv(pname=0x%x)", pname);
1172 convert_params_value = 0;
1178 case GL_FOG_DENSITY:
1184 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glFogxv(pname=0x%x)", pname);
1188 if (convert_params_value) {
1189 for (i = 0; i < n_params; i++) {
1190 converted_params[i] = (GLfloat) (params[i] / 65536.0f);
1193 for (i = 0; i < n_params; i++) {
1194 converted_params[i] = (GLfloat) params[i];
1198 _mesa_Fogfv(pname, converted_params);
1201 extern void GL_APIENTRY _mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
1202 static void GL_APIENTRY _es_FramebufferRenderbufferOES(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
1205 case GL_FRAMEBUFFER_OES:
1208 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glFramebufferRenderbufferOES(target=0x%x)", target);
1211 switch(attachment) {
1212 case GL_COLOR_ATTACHMENT0_OES:
1213 case GL_DEPTH_ATTACHMENT_OES:
1214 case GL_STENCIL_ATTACHMENT_OES:
1217 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glFramebufferRenderbufferOES(attachment=0x%x)", attachment);
1220 switch(renderbuffertarget) {
1221 case GL_RENDERBUFFER_OES:
1224 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glFramebufferRenderbufferOES(renderbuffertarget=0x%x)", renderbuffertarget);
1228 _mesa_FramebufferRenderbufferEXT(target, attachment, renderbuffertarget, renderbuffer);
1231 extern void GL_APIENTRY _mesa_FramebufferTexture2DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
1232 static void GL_APIENTRY _es_FramebufferTexture2DOES(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
1235 case GL_FRAMEBUFFER_OES:
1238 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glFramebufferTexture2DOES(target=0x%x)", target);
1241 switch(attachment) {
1242 case GL_COLOR_ATTACHMENT0_OES:
1243 case GL_DEPTH_ATTACHMENT_OES:
1244 case GL_STENCIL_ATTACHMENT_OES:
1247 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glFramebufferTexture2DOES(attachment=0x%x)", attachment);
1252 case GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES:
1253 case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES:
1254 case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES:
1255 case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES:
1256 case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES:
1257 case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES:
1260 _mesa_error(_mesa_get_current_context(), GL_INVALID_OPERATION, "glFramebufferTexture2DOES(textarget=0x%x)", textarget);
1264 _mesa_FramebufferTexture2DEXT(target, attachment, textarget, texture, level);
1267 extern void GL_APIENTRY _mesa_FrontFace(GLenum mode);
1268 static void GL_APIENTRY _es_FrontFace(GLenum mode)
1275 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glFrontFace(mode=0x%x)", mode);
1279 _mesa_FrontFace(mode);
1282 extern void GL_APIENTRY _mesa_Frustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
1283 static void GL_APIENTRY _es_Frustumf(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
1285 GLdouble converted_left;
1286 GLdouble converted_right;
1287 GLdouble converted_bottom;
1288 GLdouble converted_top;
1289 GLdouble converted_zNear;
1290 GLdouble converted_zFar;
1292 converted_left = (GLdouble) (left);
1293 converted_right = (GLdouble) (right);
1294 converted_bottom = (GLdouble) (bottom);
1295 converted_top = (GLdouble) (top);
1296 converted_zNear = (GLdouble) (zNear);
1297 converted_zFar = (GLdouble) (zFar);
1299 _mesa_Frustum(converted_left, converted_right, converted_bottom, converted_top, converted_zNear, converted_zFar);
1302 extern void GL_APIENTRY _mesa_Frustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
1303 static void GL_APIENTRY _es_Frustumx(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
1305 GLdouble converted_left;
1306 GLdouble converted_right;
1307 GLdouble converted_bottom;
1308 GLdouble converted_top;
1309 GLdouble converted_zNear;
1310 GLdouble converted_zFar;
1312 converted_left = (GLdouble) (left / 65536.0);
1313 converted_right = (GLdouble) (right / 65536.0);
1314 converted_bottom = (GLdouble) (bottom / 65536.0);
1315 converted_top = (GLdouble) (top / 65536.0);
1316 converted_zNear = (GLdouble) (zNear / 65536.0);
1317 converted_zFar = (GLdouble) (zFar / 65536.0);
1319 _mesa_Frustum(converted_left, converted_right, converted_bottom, converted_top, converted_zNear, converted_zFar);
1322 extern void GL_APIENTRY _mesa_GenBuffersARB(GLsizei n, GLuint * buffer);
1323 #define _es_GenBuffers _mesa_GenBuffersARB
1325 extern void GL_APIENTRY _mesa_GenFramebuffersEXT(GLsizei n, GLuint * ids);
1326 #define _es_GenFramebuffersOES _mesa_GenFramebuffersEXT
1328 extern void GL_APIENTRY _mesa_GenRenderbuffersEXT(GLsizei n, GLuint * renderbuffers);
1329 #define _es_GenRenderbuffersOES _mesa_GenRenderbuffersEXT
1331 extern void GL_APIENTRY _mesa_GenTextures(GLsizei n, GLuint * textures);
1332 #define _es_GenTextures _mesa_GenTextures
1334 extern void GL_APIENTRY _mesa_GenerateMipmapEXT(GLenum target);
1335 static void GL_APIENTRY _es_GenerateMipmapOES(GLenum target)
1339 case GL_TEXTURE_CUBE_MAP_OES:
1342 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGenerateMipmapOES(target=0x%x)", target);
1346 _mesa_GenerateMipmapEXT(target);
1349 extern void GL_APIENTRY _mesa_GetBooleanv(GLenum pname, GLboolean * params);
1350 #define _es_GetBooleanv _mesa_GetBooleanv
1352 extern void GL_APIENTRY _mesa_GetBufferParameterivARB(GLenum target, GLenum pname, GLint * params);
1353 static void GL_APIENTRY _es_GetBufferParameteriv(GLenum target, GLenum pname, GLint *params)
1356 case GL_ARRAY_BUFFER:
1357 case GL_ELEMENT_ARRAY_BUFFER:
1360 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetBufferParameteriv(target=0x%x)", target);
1364 case GL_BUFFER_SIZE:
1365 case GL_BUFFER_USAGE:
1366 case GL_BUFFER_ACCESS_OES:
1367 case GL_BUFFER_MAPPED_OES:
1370 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetBufferParameteriv(pname=0x%x)", pname);
1374 _mesa_GetBufferParameterivARB(target, pname, params);
1377 extern void GL_APIENTRY _mesa_GetBufferPointervARB(GLenum target, GLenum pname, GLvoid ** params);
1378 static void GL_APIENTRY _es_GetBufferPointervOES(GLenum target, GLenum pname, GLvoid **params)
1381 case GL_ARRAY_BUFFER:
1382 case GL_ELEMENT_ARRAY_BUFFER:
1385 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetBufferPointervOES(target=0x%x)", target);
1389 case GL_BUFFER_MAP_POINTER_OES:
1392 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetBufferPointervOES(pname=0x%x)", pname);
1396 _mesa_GetBufferPointervARB(target, pname, params);
1399 extern void GL_APIENTRY _mesa_GetClipPlane(GLenum plane, GLdouble * equation);
1400 static void GL_APIENTRY _es_GetClipPlanef(GLenum plane, GLfloat *equation)
1402 register unsigned int i;
1403 unsigned int n_equation = 4;
1404 GLdouble converted_equation[4];
1407 case GL_CLIP_PLANE0:
1408 case GL_CLIP_PLANE1:
1409 case GL_CLIP_PLANE2:
1410 case GL_CLIP_PLANE3:
1411 case GL_CLIP_PLANE4:
1412 case GL_CLIP_PLANE5:
1415 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetClipPlanef(plane=0x%x)", plane);
1419 _mesa_GetClipPlane(plane, converted_equation);
1420 for (i = 0; i < n_equation; i++) {
1421 equation[i] = (GLfloat) (converted_equation[i]);
1425 extern void GL_APIENTRY _mesa_GetClipPlane(GLenum plane, GLdouble * equation);
1426 static void GL_APIENTRY _es_GetClipPlanex(GLenum plane, GLfixed *equation)
1428 register unsigned int i;
1429 unsigned int n_equation = 4;
1430 GLdouble converted_equation[4];
1433 case GL_CLIP_PLANE0:
1434 case GL_CLIP_PLANE1:
1435 case GL_CLIP_PLANE2:
1436 case GL_CLIP_PLANE3:
1437 case GL_CLIP_PLANE4:
1438 case GL_CLIP_PLANE5:
1441 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetClipPlanex(plane=0x%x)", plane);
1445 _mesa_GetClipPlane(plane, converted_equation);
1446 for (i = 0; i < n_equation; i++) {
1447 equation[i] = (GLfixed) (converted_equation[i] * 65536);
1451 extern GLenum GL_APIENTRY _mesa_GetError(void);
1452 #define _es_GetError _mesa_GetError
1454 extern void GL_APIENTRY _mesa_GetFixedv(GLenum pname, GLfixed * params);
1455 #define _es_GetFixedv _mesa_GetFixedv
1457 extern void GL_APIENTRY _mesa_GetFloatv(GLenum pname, GLfloat * params);
1458 #define _es_GetFloatv _mesa_GetFloatv
1460 extern void GL_APIENTRY _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, GLenum pname, GLint * params);
1461 static void GL_APIENTRY _es_GetFramebufferAttachmentParameterivOES(GLenum target, GLenum attachment, GLenum pname, GLint *params)
1464 case GL_FRAMEBUFFER_OES:
1467 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetFramebufferAttachmentParameterivOES(target=0x%x)", target);
1471 case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_OES: /* size 1 */
1472 case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_OES: /* size 1 */
1473 case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_OES: /* size 1 */
1474 case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_OES: /* size 1 */
1477 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetFramebufferAttachmentParameterivOES(pname=0x%x)", pname);
1481 _mesa_GetFramebufferAttachmentParameterivEXT(target, attachment, pname, params);
1484 extern void GL_APIENTRY _mesa_GetIntegerv(GLenum pname, GLint * params);
1485 #define _es_GetIntegerv _mesa_GetIntegerv
1487 extern void GL_APIENTRY _mesa_GetLightfv(GLenum light, GLenum pname, GLfloat * params);
1488 static void GL_APIENTRY _es_GetLightfv(GLenum light, GLenum pname, GLfloat *params)
1501 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetLightfv(light=0x%x)", light);
1505 case GL_AMBIENT: /* size 4 */
1506 case GL_DIFFUSE: /* size 4 */
1507 case GL_SPECULAR: /* size 4 */
1508 case GL_POSITION: /* size 4 */
1509 case GL_SPOT_DIRECTION: /* size 3 */
1510 case GL_SPOT_EXPONENT: /* size 1 */
1511 case GL_SPOT_CUTOFF: /* size 1 */
1512 case GL_CONSTANT_ATTENUATION: /* size 1 */
1513 case GL_LINEAR_ATTENUATION: /* size 1 */
1514 case GL_QUADRATIC_ATTENUATION: /* size 1 */
1517 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetLightfv(pname=0x%x)", pname);
1521 _mesa_GetLightfv(light, pname, params);
1524 extern void GL_APIENTRY _mesa_GetLightfv(GLenum light, GLenum pname, GLfloat * params);
1525 static void GL_APIENTRY _es_GetLightxv(GLenum light, GLenum pname, GLfixed *params)
1527 register unsigned int i;
1528 unsigned int n_params = 4;
1529 GLfloat converted_params[4];
1542 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetLightxv(light=0x%x)", light);
1552 case GL_SPOT_DIRECTION:
1555 case GL_SPOT_EXPONENT:
1556 case GL_SPOT_CUTOFF:
1557 case GL_CONSTANT_ATTENUATION:
1558 case GL_LINEAR_ATTENUATION:
1559 case GL_QUADRATIC_ATTENUATION:
1563 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetLightxv(pname=0x%x)", pname);
1567 _mesa_GetLightfv(light, pname, converted_params);
1568 for (i = 0; i < n_params; i++) {
1569 params[i] = (GLint) (converted_params[i] * 65536);
1573 extern void GL_APIENTRY _mesa_GetMaterialfv(GLenum face, GLenum pname, GLfloat * params);
1574 static void GL_APIENTRY _es_GetMaterialfv(GLenum face, GLenum pname, GLfloat *params)
1581 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetMaterialfv(face=0x%x)", face);
1585 case GL_SHININESS: /* size 1 */
1586 case GL_AMBIENT: /* size 4 */
1587 case GL_DIFFUSE: /* size 4 */
1588 case GL_AMBIENT_AND_DIFFUSE: /* size 4 */
1589 case GL_SPECULAR: /* size 4 */
1590 case GL_EMISSION: /* size 4 */
1593 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetMaterialfv(pname=0x%x)", pname);
1597 _mesa_GetMaterialfv(face, pname, params);
1600 extern void GL_APIENTRY _mesa_GetMaterialfv(GLenum face, GLenum pname, GLfloat * params);
1601 static void GL_APIENTRY _es_GetMaterialxv(GLenum face, GLenum pname, GLfixed *params)
1603 register unsigned int i;
1604 unsigned int n_params = 4;
1605 GLfloat converted_params[4];
1612 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetMaterialxv(face=0x%x)", face);
1621 case GL_AMBIENT_AND_DIFFUSE:
1627 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetMaterialxv(pname=0x%x)", pname);
1631 _mesa_GetMaterialfv(face, pname, converted_params);
1632 for (i = 0; i < n_params; i++) {
1633 params[i] = (GLint) (converted_params[i] * 65536);
1637 extern void GL_APIENTRY _mesa_GetPointerv(GLenum pname, GLvoid ** params);
1638 static void GL_APIENTRY _es_GetPointerv(GLenum pname, GLvoid **params)
1641 case GL_VERTEX_ARRAY_POINTER:
1642 case GL_NORMAL_ARRAY_POINTER:
1643 case GL_COLOR_ARRAY_POINTER:
1644 case GL_TEXTURE_COORD_ARRAY_POINTER:
1645 case GL_MATRIX_INDEX_ARRAY_POINTER_OES:
1646 case GL_WEIGHT_ARRAY_POINTER_OES:
1647 case GL_POINT_SIZE_ARRAY_POINTER_OES:
1650 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetPointerv(pname=0x%x)", pname);
1654 _mesa_GetPointerv(pname, params);
1657 extern void GL_APIENTRY _mesa_GetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint * params);
1658 static void GL_APIENTRY _es_GetRenderbufferParameterivOES(GLenum target, GLenum pname, GLint *params)
1661 case GL_RENDERBUFFER_OES:
1664 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetRenderbufferParameterivOES(target=0x%x)", target);
1668 case GL_RENDERBUFFER_WIDTH_OES: /* size 1 */
1669 case GL_RENDERBUFFER_HEIGHT_OES: /* size 1 */
1670 case GL_RENDERBUFFER_INTERNAL_FORMAT_OES: /* size 1 */
1671 case GL_RENDERBUFFER_RED_SIZE_OES: /* size 1 */
1672 case GL_RENDERBUFFER_GREEN_SIZE_OES: /* size 1 */
1673 case GL_RENDERBUFFER_BLUE_SIZE_OES: /* size 1 */
1674 case GL_RENDERBUFFER_ALPHA_SIZE_OES: /* size 1 */
1675 case GL_RENDERBUFFER_DEPTH_SIZE_OES: /* size 1 */
1676 case GL_RENDERBUFFER_STENCIL_SIZE_OES: /* size 1 */
1679 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetRenderbufferParameterivOES(pname=0x%x)", pname);
1683 _mesa_GetRenderbufferParameterivEXT(target, pname, params);
1686 extern const GLubyte * GL_APIENTRY _mesa_GetString(GLenum name);
1687 static const GLubyte * GL_APIENTRY _es_GetString(GLenum name)
1696 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetString(name=0x%x)", name);
1697 return (const GLubyte *) 0;
1700 return _mesa_GetString(name);
1703 extern void GL_APIENTRY _mesa_GetTexEnvfv(GLenum target, GLenum pname, GLfloat * params);
1704 static void GL_APIENTRY _es_GetTexEnvfv(GLenum target, GLenum pname, GLfloat *params)
1707 case GL_POINT_SPRITE_OES:
1708 if (pname != GL_COORD_REPLACE_OES) {
1709 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetTexEnvfv(target=0x%x)", target);
1713 case GL_TEXTURE_FILTER_CONTROL_EXT:
1714 if (pname != GL_TEXTURE_LOD_BIAS_EXT) {
1715 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetTexEnvfv(target=0x%x)", target);
1719 case GL_TEXTURE_ENV:
1720 if (pname != GL_TEXTURE_ENV_COLOR && pname != GL_RGB_SCALE && pname != GL_ALPHA_SCALE && pname != GL_TEXTURE_ENV_MODE && pname != GL_COMBINE_RGB && pname != GL_COMBINE_ALPHA && pname != GL_SRC0_RGB && pname != GL_SRC1_RGB && pname != GL_SRC2_RGB && pname != GL_SRC0_ALPHA && pname != GL_SRC1_ALPHA && pname != GL_SRC2_ALPHA && pname != GL_OPERAND0_RGB && pname != GL_OPERAND1_RGB && pname != GL_OPERAND2_RGB && pname != GL_OPERAND0_ALPHA && pname != GL_OPERAND1_ALPHA && pname != GL_OPERAND2_ALPHA) {
1721 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetTexEnvfv(target=0x%x)", target);
1726 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetTexEnvfv(target=0x%x)", target);
1730 case GL_COORD_REPLACE_OES: /* size 1 */
1732 case GL_TEXTURE_LOD_BIAS_EXT: /* size 1 */
1733 case GL_TEXTURE_ENV_COLOR: /* size 4 */
1734 case GL_RGB_SCALE: /* size 1 */
1735 case GL_ALPHA_SCALE: /* size 1 */
1737 case GL_TEXTURE_ENV_MODE: /* size 1 */
1738 case GL_COMBINE_RGB: /* size 1 */
1739 case GL_COMBINE_ALPHA: /* size 1 */
1740 case GL_SRC0_RGB: /* size 1 */
1741 case GL_SRC1_RGB: /* size 1 */
1742 case GL_SRC2_RGB: /* size 1 */
1743 case GL_SRC0_ALPHA: /* size 1 */
1744 case GL_SRC1_ALPHA: /* size 1 */
1745 case GL_SRC2_ALPHA: /* size 1 */
1746 case GL_OPERAND0_RGB: /* size 1 */
1747 case GL_OPERAND1_RGB: /* size 1 */
1748 case GL_OPERAND2_RGB: /* size 1 */
1749 case GL_OPERAND0_ALPHA: /* size 1 */
1750 case GL_OPERAND1_ALPHA: /* size 1 */
1751 case GL_OPERAND2_ALPHA: /* size 1 */
1754 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetTexEnvfv(pname=0x%x)", pname);
1758 _mesa_GetTexEnvfv(target, pname, params);
1761 extern void GL_APIENTRY _mesa_GetTexEnviv(GLenum target, GLenum pname, GLint * params);
1762 static void GL_APIENTRY _es_GetTexEnviv(GLenum target, GLenum pname, GLint *params)
1765 case GL_POINT_SPRITE_OES:
1766 if (pname != GL_COORD_REPLACE_OES) {
1767 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetTexEnviv(target=0x%x)", target);
1771 case GL_TEXTURE_FILTER_CONTROL_EXT:
1772 if (pname != GL_TEXTURE_LOD_BIAS_EXT) {
1773 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetTexEnviv(target=0x%x)", target);
1777 case GL_TEXTURE_ENV:
1778 if (pname != GL_TEXTURE_ENV_COLOR && pname != GL_RGB_SCALE && pname != GL_ALPHA_SCALE && pname != GL_TEXTURE_ENV_MODE && pname != GL_COMBINE_RGB && pname != GL_COMBINE_ALPHA && pname != GL_SRC0_RGB && pname != GL_SRC1_RGB && pname != GL_SRC2_RGB && pname != GL_SRC0_ALPHA && pname != GL_SRC1_ALPHA && pname != GL_SRC2_ALPHA && pname != GL_OPERAND0_RGB && pname != GL_OPERAND1_RGB && pname != GL_OPERAND2_RGB && pname != GL_OPERAND0_ALPHA && pname != GL_OPERAND1_ALPHA && pname != GL_OPERAND2_ALPHA) {
1779 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetTexEnviv(target=0x%x)", target);
1784 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetTexEnviv(target=0x%x)", target);
1788 case GL_COORD_REPLACE_OES: /* size 1 */
1790 case GL_TEXTURE_LOD_BIAS_EXT: /* size 1 */
1791 case GL_TEXTURE_ENV_COLOR: /* size 4 */
1792 case GL_RGB_SCALE: /* size 1 */
1793 case GL_ALPHA_SCALE: /* size 1 */
1795 case GL_TEXTURE_ENV_MODE: /* size 1 */
1796 case GL_COMBINE_RGB: /* size 1 */
1797 case GL_COMBINE_ALPHA: /* size 1 */
1798 case GL_SRC0_RGB: /* size 1 */
1799 case GL_SRC1_RGB: /* size 1 */
1800 case GL_SRC2_RGB: /* size 1 */
1801 case GL_SRC0_ALPHA: /* size 1 */
1802 case GL_SRC1_ALPHA: /* size 1 */
1803 case GL_SRC2_ALPHA: /* size 1 */
1804 case GL_OPERAND0_RGB: /* size 1 */
1805 case GL_OPERAND1_RGB: /* size 1 */
1806 case GL_OPERAND2_RGB: /* size 1 */
1807 case GL_OPERAND0_ALPHA: /* size 1 */
1808 case GL_OPERAND1_ALPHA: /* size 1 */
1809 case GL_OPERAND2_ALPHA: /* size 1 */
1812 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetTexEnviv(pname=0x%x)", pname);
1816 _mesa_GetTexEnviv(target, pname, params);
1819 extern void GL_APIENTRY _mesa_GetTexEnvfv(GLenum target, GLenum pname, GLfloat * params);
1820 static void GL_APIENTRY _es_GetTexEnvxv(GLenum target, GLenum pname, GLfixed *params)
1822 register unsigned int i;
1823 unsigned int n_params = 4;
1824 GLfloat converted_params[4];
1825 int convert_params_value = 1;
1828 case GL_POINT_SPRITE_OES:
1829 if (pname != GL_COORD_REPLACE_OES) {
1830 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetTexEnvxv(target=0x%x)", target);
1834 case GL_TEXTURE_FILTER_CONTROL_EXT:
1835 if (pname != GL_TEXTURE_LOD_BIAS_EXT) {
1836 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetTexEnvxv(target=0x%x)", target);
1840 case GL_TEXTURE_ENV:
1841 if (pname != GL_TEXTURE_ENV_COLOR && pname != GL_RGB_SCALE && pname != GL_ALPHA_SCALE && pname != GL_TEXTURE_ENV_MODE && pname != GL_COMBINE_RGB && pname != GL_COMBINE_ALPHA && pname != GL_SRC0_RGB && pname != GL_SRC1_RGB && pname != GL_SRC2_RGB && pname != GL_SRC0_ALPHA && pname != GL_SRC1_ALPHA && pname != GL_SRC2_ALPHA && pname != GL_OPERAND0_RGB && pname != GL_OPERAND1_RGB && pname != GL_OPERAND2_RGB && pname != GL_OPERAND0_ALPHA && pname != GL_OPERAND1_ALPHA && pname != GL_OPERAND2_ALPHA) {
1842 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetTexEnvxv(target=0x%x)", target);
1847 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetTexEnvxv(target=0x%x)", target);
1851 case GL_COORD_REPLACE_OES:
1852 convert_params_value = 0;
1855 case GL_TEXTURE_LOD_BIAS_EXT:
1858 case GL_TEXTURE_ENV_COLOR:
1862 case GL_ALPHA_SCALE:
1865 case GL_TEXTURE_ENV_MODE:
1866 case GL_COMBINE_RGB:
1867 case GL_COMBINE_ALPHA:
1874 case GL_OPERAND0_RGB:
1875 case GL_OPERAND1_RGB:
1876 case GL_OPERAND2_RGB:
1877 case GL_OPERAND0_ALPHA:
1878 case GL_OPERAND1_ALPHA:
1879 case GL_OPERAND2_ALPHA:
1880 convert_params_value = 0;
1884 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetTexEnvxv(pname=0x%x)", pname);
1888 _mesa_GetTexEnvfv(target, pname, converted_params);
1889 if (convert_params_value) {
1890 for (i = 0; i < n_params; i++) {
1891 params[i] = (GLint) (converted_params[i] * 65536);
1894 for (i = 0; i < n_params; i++) {
1895 params[i] = (GLfixed) converted_params[i];
1900 /* this function is special and is defined elsewhere */
1901 extern void GL_APIENTRY _es_GetTexGenfv(GLenum coord, GLenum pname, GLfloat * params);
1902 static void GL_APIENTRY _check_GetTexGenfvOES(GLenum coord, GLenum pname, GLfloat *params)
1905 case GL_TEXTURE_GEN_STR_OES:
1908 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetTexGenfvOES(coord=0x%x)", coord);
1912 case GL_TEXTURE_GEN_MODE_OES: /* size 1 */
1915 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetTexGenfvOES(pname=0x%x)", pname);
1919 _es_GetTexGenfv(coord, pname, params);
1922 /* this function is special and is defined elsewhere */
1923 extern void GL_APIENTRY _es_GetTexGenfv(GLenum coord, GLenum pname, GLfloat * params);
1924 static void GL_APIENTRY _check_GetTexGenivOES(GLenum coord, GLenum pname, GLint *params)
1926 register unsigned int i;
1927 unsigned int n_params = 1;
1928 GLfloat converted_params[1];
1931 case GL_TEXTURE_GEN_STR_OES:
1934 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetTexGenivOES(coord=0x%x)", coord);
1938 case GL_TEXTURE_GEN_MODE_OES:
1942 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetTexGenivOES(pname=0x%x)", pname);
1946 _es_GetTexGenfv(coord, pname, converted_params);
1947 for (i = 0; i < n_params; i++) {
1948 params[i] = (GLfloat) converted_params[i];
1952 /* this function is special and is defined elsewhere */
1953 extern void GL_APIENTRY _es_GetTexGenfv(GLenum coord, GLenum pname, GLfloat * params);
1954 static void GL_APIENTRY _check_GetTexGenxvOES(GLenum coord, GLenum pname, GLfixed *params)
1956 register unsigned int i;
1957 unsigned int n_params = 1;
1958 GLfloat converted_params[1];
1961 case GL_TEXTURE_GEN_STR_OES:
1964 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetTexGenxvOES(coord=0x%x)", coord);
1968 case GL_TEXTURE_GEN_MODE_OES:
1972 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetTexGenxvOES(pname=0x%x)", pname);
1976 _es_GetTexGenfv(coord, pname, converted_params);
1977 for (i = 0; i < n_params; i++) {
1978 params[i] = (GLfloat) converted_params[i];
1982 extern void GL_APIENTRY _mesa_GetTexParameterfv(GLenum target, GLenum pname, GLfloat * params);
1983 static void GL_APIENTRY _es_GetTexParameterfv(GLenum target, GLenum pname, GLfloat *params)
1987 case GL_TEXTURE_CUBE_MAP_OES:
1990 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetTexParameterfv(target=0x%x)", target);
1994 case GL_TEXTURE_WRAP_S: /* size 1 */
1995 case GL_TEXTURE_WRAP_T: /* size 1 */
1996 case GL_TEXTURE_MIN_FILTER: /* size 1 */
1997 case GL_TEXTURE_MAG_FILTER: /* size 1 */
1998 case GL_GENERATE_MIPMAP: /* size 1 */
2000 case GL_TEXTURE_CROP_RECT_OES: /* size 4 */
2003 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetTexParameterfv(pname=0x%x)", pname);
2007 _mesa_GetTexParameterfv(target, pname, params);
2010 extern void GL_APIENTRY _mesa_GetTexParameteriv(GLenum target, GLenum pname, GLint * params);
2011 static void GL_APIENTRY _es_GetTexParameteriv(GLenum target, GLenum pname, GLint *params)
2015 case GL_TEXTURE_CUBE_MAP_OES:
2018 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetTexParameteriv(target=0x%x)", target);
2022 case GL_TEXTURE_WRAP_S: /* size 1 */
2023 case GL_TEXTURE_WRAP_T: /* size 1 */
2024 case GL_TEXTURE_MIN_FILTER: /* size 1 */
2025 case GL_TEXTURE_MAG_FILTER: /* size 1 */
2026 case GL_GENERATE_MIPMAP: /* size 1 */
2028 case GL_TEXTURE_CROP_RECT_OES: /* size 4 */
2031 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetTexParameteriv(pname=0x%x)", pname);
2035 _mesa_GetTexParameteriv(target, pname, params);
2038 extern void GL_APIENTRY _mesa_GetTexParameterfv(GLenum target, GLenum pname, GLfloat * params);
2039 static void GL_APIENTRY _es_GetTexParameterxv(GLenum target, GLenum pname, GLfixed *params)
2041 register unsigned int i;
2042 unsigned int n_params = 4;
2043 GLfloat converted_params[4];
2044 int convert_params_value = 1;
2048 case GL_TEXTURE_CUBE_MAP_OES:
2051 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetTexParameterxv(target=0x%x)", target);
2055 case GL_TEXTURE_WRAP_S:
2056 case GL_TEXTURE_WRAP_T:
2057 case GL_TEXTURE_MIN_FILTER:
2058 case GL_TEXTURE_MAG_FILTER:
2059 case GL_GENERATE_MIPMAP:
2060 convert_params_value = 0;
2063 case GL_TEXTURE_CROP_RECT_OES:
2067 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glGetTexParameterxv(pname=0x%x)", pname);
2071 _mesa_GetTexParameterfv(target, pname, converted_params);
2072 if (convert_params_value) {
2073 for (i = 0; i < n_params; i++) {
2074 params[i] = (GLint) (converted_params[i] * 65536);
2077 for (i = 0; i < n_params; i++) {
2078 params[i] = (GLfixed) converted_params[i];
2083 extern void GL_APIENTRY _mesa_Hint(GLenum target, GLenum mode);
2084 static void GL_APIENTRY _es_Hint(GLenum target, GLenum mode)
2088 case GL_LINE_SMOOTH_HINT:
2089 case GL_PERSPECTIVE_CORRECTION_HINT:
2090 case GL_POINT_SMOOTH_HINT:
2091 case GL_GENERATE_MIPMAP_HINT:
2094 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glHint(target=0x%x)", target);
2103 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glHint(mode=0x%x)", mode);
2107 _mesa_Hint(target, mode);
2110 extern GLboolean GL_APIENTRY _mesa_IsBufferARB(GLuint buffer);
2111 #define _es_IsBuffer _mesa_IsBufferARB
2113 extern GLboolean GL_APIENTRY _mesa_IsEnabled(GLenum cap);
2114 static GLboolean GL_APIENTRY _es_IsEnabled(GLenum cap)
2118 case GL_RESCALE_NORMAL:
2119 case GL_CLIP_PLANE0:
2120 case GL_CLIP_PLANE1:
2121 case GL_CLIP_PLANE2:
2122 case GL_CLIP_PLANE3:
2123 case GL_CLIP_PLANE4:
2124 case GL_CLIP_PLANE5:
2127 case GL_COLOR_MATERIAL:
2136 case GL_POINT_SMOOTH:
2137 case GL_LINE_SMOOTH:
2139 case GL_POLYGON_OFFSET_FILL:
2140 case GL_MULTISAMPLE:
2141 case GL_SAMPLE_ALPHA_TO_COVERAGE:
2142 case GL_SAMPLE_ALPHA_TO_ONE:
2143 case GL_SAMPLE_COVERAGE:
2145 case GL_SCISSOR_TEST:
2147 case GL_STENCIL_TEST:
2151 case GL_COLOR_LOGIC_OP:
2152 case GL_POINT_SPRITE_OES:
2153 case GL_TEXTURE_CUBE_MAP_OES:
2154 case GL_TEXTURE_GEN_STR_OES:
2155 case GL_VERTEX_ARRAY:
2156 case GL_NORMAL_ARRAY:
2157 case GL_COLOR_ARRAY:
2158 case GL_TEXTURE_COORD_ARRAY:
2159 case GL_MATRIX_INDEX_ARRAY_OES:
2160 case GL_WEIGHT_ARRAY_OES:
2161 case GL_POINT_SIZE_ARRAY_OES:
2164 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glIsEnabled(cap=0x%x)", cap);
2168 return _mesa_IsEnabled(cap);
2171 extern GLboolean GL_APIENTRY _mesa_IsFramebufferEXT(GLuint framebuffer);
2172 #define _es_IsFramebufferOES _mesa_IsFramebufferEXT
2174 extern GLboolean GL_APIENTRY _mesa_IsRenderbufferEXT(GLuint renderbuffer);
2175 #define _es_IsRenderbufferOES _mesa_IsRenderbufferEXT
2177 extern GLboolean GL_APIENTRY _mesa_IsTexture(GLuint texture);
2178 #define _es_IsTexture _mesa_IsTexture
2180 extern void GL_APIENTRY _mesa_LightModelf(GLenum pname, GLfloat param);
2181 static void GL_APIENTRY _es_LightModelf(GLenum pname, GLfloat param)
2184 case GL_LIGHT_MODEL_TWO_SIDE:
2185 if (param != GL_TRUE && param != GL_FALSE) {
2186 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glLightModelf(pname=0x%x)", pname);
2191 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glLightModelf(pname=0x%x)", pname);
2195 _mesa_LightModelf(pname, param);
2198 extern void GL_APIENTRY _mesa_LightModelfv(GLenum pname, const GLfloat * params);
2199 static void GL_APIENTRY _es_LightModelfv(GLenum pname, const GLfloat *params)
2202 case GL_LIGHT_MODEL_AMBIENT: /* size 4 */
2204 case GL_LIGHT_MODEL_TWO_SIDE: /* size 1 */
2205 if (params[0] != GL_TRUE && params[0] != GL_FALSE) {
2206 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glLightModelfv(pname=0x%x)", pname);
2211 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glLightModelfv(pname=0x%x)", pname);
2215 _mesa_LightModelfv(pname, params);
2218 extern void GL_APIENTRY _mesa_LightModelf(GLenum pname, GLfloat param);
2219 static void GL_APIENTRY _es_LightModelx(GLenum pname, GLfixed param)
2221 GLfloat converted_param;
2224 case GL_LIGHT_MODEL_TWO_SIDE:
2225 if (param != GL_TRUE && param != GL_FALSE) {
2226 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glLightModelx(pname=0x%x)", pname);
2231 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glLightModelx(pname=0x%x)", pname);
2235 converted_param = (GLfloat) param;
2237 _mesa_LightModelf(pname, converted_param);
2240 extern void GL_APIENTRY _mesa_LightModelfv(GLenum pname, GLfloat const * params);
2241 static void GL_APIENTRY _es_LightModelxv(GLenum pname, const GLfixed *params)
2243 register unsigned int i;
2244 unsigned int n_params = 4;
2245 GLfloat converted_params[4];
2246 int convert_params_value = 1;
2249 case GL_LIGHT_MODEL_AMBIENT:
2252 case GL_LIGHT_MODEL_TWO_SIDE:
2253 if (params[0] != GL_TRUE && params[0] != GL_FALSE) {
2254 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glLightModelxv(pname=0x%x)", pname);
2257 convert_params_value = 0;
2261 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glLightModelxv(pname=0x%x)", pname);
2265 if (convert_params_value) {
2266 for (i = 0; i < n_params; i++) {
2267 converted_params[i] = (GLfloat) (params[i] / 65536.0f);
2270 for (i = 0; i < n_params; i++) {
2271 converted_params[i] = (GLfloat) params[i];
2275 _mesa_LightModelfv(pname, converted_params);
2278 extern void GL_APIENTRY _mesa_Lightf(GLenum light, GLenum pname, GLfloat param);
2279 static void GL_APIENTRY _es_Lightf(GLenum light, GLenum pname, GLfloat param)
2292 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glLightf(light=0x%x)", light);
2296 case GL_SPOT_EXPONENT:
2297 case GL_SPOT_CUTOFF:
2298 case GL_CONSTANT_ATTENUATION:
2299 case GL_LINEAR_ATTENUATION:
2300 case GL_QUADRATIC_ATTENUATION:
2303 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glLightf(pname=0x%x)", pname);
2307 _mesa_Lightf(light, pname, param);
2310 extern void GL_APIENTRY _mesa_Lightfv(GLenum light, GLenum pname, const GLfloat * params);
2311 static void GL_APIENTRY _es_Lightfv(GLenum light, GLenum pname, const GLfloat *params)
2324 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glLightfv(light=0x%x)", light);
2328 case GL_AMBIENT: /* size 4 */
2329 case GL_DIFFUSE: /* size 4 */
2330 case GL_SPECULAR: /* size 4 */
2331 case GL_POSITION: /* size 4 */
2332 case GL_SPOT_DIRECTION: /* size 3 */
2333 case GL_SPOT_EXPONENT: /* size 1 */
2334 case GL_SPOT_CUTOFF: /* size 1 */
2335 case GL_CONSTANT_ATTENUATION: /* size 1 */
2336 case GL_LINEAR_ATTENUATION: /* size 1 */
2337 case GL_QUADRATIC_ATTENUATION: /* size 1 */
2340 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glLightfv(pname=0x%x)", pname);
2344 _mesa_Lightfv(light, pname, params);
2347 extern void GL_APIENTRY _mesa_Lightf(GLenum light, GLenum pname, GLfloat param);
2348 static void GL_APIENTRY _es_Lightx(GLenum light, GLenum pname, GLfixed param)
2350 GLfloat converted_param;
2363 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glLightx(light=0x%x)", light);
2367 case GL_SPOT_EXPONENT:
2368 case GL_SPOT_CUTOFF:
2369 case GL_CONSTANT_ATTENUATION:
2370 case GL_LINEAR_ATTENUATION:
2371 case GL_QUADRATIC_ATTENUATION:
2374 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glLightx(pname=0x%x)", pname);
2378 converted_param = (GLfloat) (param / 65536.0f);
2380 _mesa_Lightf(light, pname, converted_param);
2383 extern void GL_APIENTRY _mesa_Lightfv(GLenum light, GLenum pname, GLfloat const * params);
2384 static void GL_APIENTRY _es_Lightxv(GLenum light, GLenum pname, const GLfixed *params)
2386 register unsigned int i;
2387 unsigned int n_params = 4;
2388 GLfloat converted_params[4];
2401 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glLightxv(light=0x%x)", light);
2411 case GL_SPOT_DIRECTION:
2414 case GL_SPOT_EXPONENT:
2415 case GL_SPOT_CUTOFF:
2416 case GL_CONSTANT_ATTENUATION:
2417 case GL_LINEAR_ATTENUATION:
2418 case GL_QUADRATIC_ATTENUATION:
2422 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glLightxv(pname=0x%x)", pname);
2426 for (i = 0; i < n_params; i++) {
2427 converted_params[i] = (GLfloat) (params[i] / 65536.0f);
2430 _mesa_Lightfv(light, pname, converted_params);
2433 extern void GL_APIENTRY _mesa_LineWidth(GLfloat width);
2434 #define _es_LineWidth _mesa_LineWidth
2436 extern void GL_APIENTRY _mesa_LineWidth(GLfloat width);
2437 static void GL_APIENTRY _es_LineWidthx(GLfixed width)
2439 GLfloat converted_width;
2441 converted_width = (GLfloat) (width / 65536.0f);
2443 _mesa_LineWidth(converted_width);
2446 extern void GL_APIENTRY _mesa_LoadIdentity(void);
2447 #define _es_LoadIdentity _mesa_LoadIdentity
2449 extern void GL_APIENTRY _mesa_LoadMatrixf(const GLfloat * m);
2450 #define _es_LoadMatrixf _mesa_LoadMatrixf
2452 extern void GL_APIENTRY _mesa_LoadMatrixf(GLfloat const * m);
2453 static void GL_APIENTRY _es_LoadMatrixx(const GLfixed *m)
2455 register unsigned int i;
2456 unsigned int n_m = 16;
2457 GLfloat converted_m[16];
2459 for (i = 0; i < n_m; i++) {
2460 converted_m[i] = (GLfloat) (m[i] / 65536.0f);
2463 _mesa_LoadMatrixf(converted_m);
2466 extern void GL_APIENTRY _mesa_LogicOp(GLenum opcode);
2467 static void GL_APIENTRY _es_LogicOp(GLenum opcode)
2473 case GL_COPY_INVERTED:
2482 case GL_AND_REVERSE:
2483 case GL_AND_INVERTED:
2485 case GL_OR_INVERTED:
2488 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glLogicOp(opcode=0x%x)", opcode);
2492 _mesa_LogicOp(opcode);
2495 extern void * GL_APIENTRY _mesa_MapBufferARB(GLenum target, GLenum access);
2496 static void * GL_APIENTRY _es_MapBufferOES(GLenum target, GLenum access)
2499 case GL_ARRAY_BUFFER:
2500 case GL_ELEMENT_ARRAY_BUFFER:
2503 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glMapBufferOES(target=0x%x)", target);
2507 case GL_WRITE_ONLY_OES:
2510 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glMapBufferOES(access=0x%x)", access);
2514 return _mesa_MapBufferARB(target, access);
2517 /* this function is special and is defined elsewhere */
2518 extern void GL_APIENTRY _es_Materialf(GLenum face, GLenum pname, GLfloat param);
2519 static void GL_APIENTRY _check_Materialf(GLenum face, GLenum pname, GLfloat param)
2522 case GL_FRONT_AND_BACK:
2525 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glMaterialf(face=0x%x)", face);
2532 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glMaterialf(pname=0x%x)", pname);
2536 _es_Materialf(face, pname, param);
2539 /* this function is special and is defined elsewhere */
2540 extern void GL_APIENTRY _es_Materialfv(GLenum face, GLenum pname, const GLfloat * params);
2541 static void GL_APIENTRY _check_Materialfv(GLenum face, GLenum pname, const GLfloat *params)
2544 case GL_FRONT_AND_BACK:
2547 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glMaterialfv(face=0x%x)", face);
2551 case GL_AMBIENT: /* size 4 */
2552 case GL_DIFFUSE: /* size 4 */
2553 case GL_AMBIENT_AND_DIFFUSE: /* size 4 */
2554 case GL_SPECULAR: /* size 4 */
2555 case GL_EMISSION: /* size 4 */
2556 case GL_SHININESS: /* size 1 */
2559 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glMaterialfv(pname=0x%x)", pname);
2563 _es_Materialfv(face, pname, params);
2566 extern void GL_APIENTRY _es_Materialf(GLenum face, GLenum pname, GLfloat param);
2567 static void GL_APIENTRY _es_Materialx(GLenum face, GLenum pname, GLfixed param)
2569 GLfloat converted_param;
2572 case GL_FRONT_AND_BACK:
2575 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glMaterialx(face=0x%x)", face);
2582 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glMaterialx(pname=0x%x)", pname);
2586 converted_param = (GLfloat) (param / 65536.0f);
2588 _es_Materialf(face, pname, converted_param);
2591 extern void GL_APIENTRY _es_Materialfv(GLenum face, GLenum pname, GLfloat const * params);
2592 static void GL_APIENTRY _es_Materialxv(GLenum face, GLenum pname, const GLfixed *params)
2594 register unsigned int i;
2595 unsigned int n_params = 4;
2596 GLfloat converted_params[4];
2599 case GL_FRONT_AND_BACK:
2602 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glMaterialxv(face=0x%x)", face);
2608 case GL_AMBIENT_AND_DIFFUSE:
2617 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glMaterialxv(pname=0x%x)", pname);
2621 for (i = 0; i < n_params; i++) {
2622 converted_params[i] = (GLfloat) (params[i] / 65536.0f);
2625 _es_Materialfv(face, pname, converted_params);
2628 extern void GL_APIENTRY _mesa_MatrixMode(GLenum mode);
2629 static void GL_APIENTRY _es_MatrixMode(GLenum mode)
2635 case GL_MATRIX_PALETTE_OES:
2638 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glMatrixMode(mode=0x%x)", mode);
2642 _mesa_MatrixMode(mode);
2645 extern void GL_APIENTRY _mesa_MultMatrixf(const GLfloat * m);
2646 #define _es_MultMatrixf _mesa_MultMatrixf
2648 extern void GL_APIENTRY _mesa_MultMatrixf(GLfloat const * m);
2649 static void GL_APIENTRY _es_MultMatrixx(const GLfixed *m)
2651 register unsigned int i;
2652 unsigned int n_m = 16;
2653 GLfloat converted_m[16];
2655 for (i = 0; i < n_m; i++) {
2656 converted_m[i] = (GLfloat) (m[i] / 65536.0f);
2659 _mesa_MultMatrixf(converted_m);
2662 extern void GL_APIENTRY _mesa_MultiDrawArraysEXT(GLenum mode, const GLint * first, const GLsizei * count, GLsizei primcount);
2663 static void GL_APIENTRY _es_MultiDrawArraysEXT(GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount)
2671 case GL_TRIANGLE_STRIP:
2672 case GL_TRIANGLE_FAN:
2675 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glMultiDrawArraysEXT(mode=0x%x)", mode);
2679 _mesa_MultiDrawArraysEXT(mode, first, count, primcount);
2682 extern void GL_APIENTRY _mesa_MultiDrawElementsEXT(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount);
2683 static void GL_APIENTRY _es_MultiDrawElementsEXT(GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount)
2691 case GL_TRIANGLE_STRIP:
2692 case GL_TRIANGLE_FAN:
2695 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glMultiDrawElementsEXT(mode=0x%x)", mode);
2699 case GL_UNSIGNED_BYTE:
2700 case GL_UNSIGNED_SHORT:
2701 case GL_UNSIGNED_INT:
2704 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glMultiDrawElementsEXT(type=0x%x)", type);
2708 _mesa_MultiDrawElementsEXT(mode, count, type, indices, primcount);
2711 /* this function is special and is defined elsewhere */
2712 extern void GL_APIENTRY _es_MultiTexCoord4f(GLenum texture, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
2713 static void GL_APIENTRY _check_MultiTexCoord4f(GLenum texture, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
2750 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glMultiTexCoord4f(texture=0x%x)", texture);
2754 _es_MultiTexCoord4f(texture, s, t, r, q);
2757 extern void GL_APIENTRY _es_MultiTexCoord4f(GLenum texture, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
2758 static void GL_APIENTRY _es_MultiTexCoord4x(GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q)
2760 GLfloat converted_s;
2761 GLfloat converted_t;
2762 GLfloat converted_r;
2763 GLfloat converted_q;
2800 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glMultiTexCoord4x(texture=0x%x)", texture);
2804 converted_s = (GLfloat) (s / 65536.0f);
2805 converted_t = (GLfloat) (t / 65536.0f);
2806 converted_r = (GLfloat) (r / 65536.0f);
2807 converted_q = (GLfloat) (q / 65536.0f);
2809 _es_MultiTexCoord4f(texture, converted_s, converted_t, converted_r, converted_q);
2812 /* this function is special and is defined elsewhere */
2813 extern void GL_APIENTRY _es_Normal3f(GLfloat nx, GLfloat ny, GLfloat nz);
2814 #define _check_Normal3f _es_Normal3f
2816 extern void GL_APIENTRY _es_Normal3f(GLfloat nx, GLfloat ny, GLfloat nz);
2817 static void GL_APIENTRY _es_Normal3x(GLfixed nx, GLfixed ny, GLfixed nz)
2819 GLfloat converted_nx;
2820 GLfloat converted_ny;
2821 GLfloat converted_nz;
2823 converted_nx = (GLfloat) (nx / 65536.0f);
2824 converted_ny = (GLfloat) (ny / 65536.0f);
2825 converted_nz = (GLfloat) (nz / 65536.0f);
2827 _es_Normal3f(converted_nx, converted_ny, converted_nz);
2830 extern void GL_APIENTRY _mesa_NormalPointer(GLenum type, GLsizei stride, const GLvoid * pointer);
2831 static void GL_APIENTRY _es_NormalPointer(GLenum type, GLsizei stride, const GLvoid *pointer)
2840 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glNormalPointer(type=0x%x)", type);
2844 _mesa_NormalPointer(type, stride, pointer);
2847 extern void GL_APIENTRY _mesa_Ortho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
2848 static void GL_APIENTRY _es_Orthof(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
2850 GLdouble converted_left;
2851 GLdouble converted_right;
2852 GLdouble converted_bottom;
2853 GLdouble converted_top;
2854 GLdouble converted_zNear;
2855 GLdouble converted_zFar;
2857 converted_left = (GLdouble) (left);
2858 converted_right = (GLdouble) (right);
2859 converted_bottom = (GLdouble) (bottom);
2860 converted_top = (GLdouble) (top);
2861 converted_zNear = (GLdouble) (zNear);
2862 converted_zFar = (GLdouble) (zFar);
2864 _mesa_Ortho(converted_left, converted_right, converted_bottom, converted_top, converted_zNear, converted_zFar);
2867 extern void GL_APIENTRY _mesa_Ortho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
2868 static void GL_APIENTRY _es_Orthox(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
2870 GLdouble converted_left;
2871 GLdouble converted_right;
2872 GLdouble converted_bottom;
2873 GLdouble converted_top;
2874 GLdouble converted_zNear;
2875 GLdouble converted_zFar;
2877 converted_left = (GLdouble) (left / 65536.0);
2878 converted_right = (GLdouble) (right / 65536.0);
2879 converted_bottom = (GLdouble) (bottom / 65536.0);
2880 converted_top = (GLdouble) (top / 65536.0);
2881 converted_zNear = (GLdouble) (zNear / 65536.0);
2882 converted_zFar = (GLdouble) (zFar / 65536.0);
2884 _mesa_Ortho(converted_left, converted_right, converted_bottom, converted_top, converted_zNear, converted_zFar);
2887 extern void GL_APIENTRY _mesa_PixelStorei(GLenum pname, GLint param);
2888 static void GL_APIENTRY _es_PixelStorei(GLenum pname, GLint param)
2891 case GL_PACK_ALIGNMENT:
2892 case GL_UNPACK_ALIGNMENT:
2895 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glPixelStorei(pname=0x%x)", pname);
2905 _mesa_error(_mesa_get_current_context(), GL_INVALID_VALUE, "glPixelStorei(param=%d)", param);
2909 _mesa_PixelStorei(pname, param);
2912 extern void GL_APIENTRY _mesa_PointParameterf(GLenum pname, GLfloat param);
2913 static void GL_APIENTRY _es_PointParameterf(GLenum pname, GLfloat param)
2916 case GL_POINT_SIZE_MIN:
2917 case GL_POINT_SIZE_MAX:
2918 case GL_POINT_FADE_THRESHOLD_SIZE:
2921 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glPointParameterf(pname=0x%x)", pname);
2925 _mesa_PointParameterf(pname, param);
2928 extern void GL_APIENTRY _mesa_PointParameterfv(GLenum pname, const GLfloat * params);
2929 static void GL_APIENTRY _es_PointParameterfv(GLenum pname, const GLfloat *params)
2932 case GL_POINT_SIZE_MIN: /* size 1 */
2933 case GL_POINT_SIZE_MAX: /* size 1 */
2934 case GL_POINT_FADE_THRESHOLD_SIZE: /* size 1 */
2935 case GL_POINT_DISTANCE_ATTENUATION: /* size 3 */
2938 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glPointParameterfv(pname=0x%x)", pname);
2942 _mesa_PointParameterfv(pname, params);
2945 extern void GL_APIENTRY _mesa_PointParameterf(GLenum pname, GLfloat param);
2946 static void GL_APIENTRY _es_PointParameterx(GLenum pname, GLfixed param)
2948 GLfloat converted_param;
2951 case GL_POINT_SIZE_MIN:
2952 case GL_POINT_SIZE_MAX:
2953 case GL_POINT_FADE_THRESHOLD_SIZE:
2956 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glPointParameterx(pname=0x%x)", pname);
2960 converted_param = (GLfloat) (param / 65536.0f);
2962 _mesa_PointParameterf(pname, converted_param);
2965 extern void GL_APIENTRY _mesa_PointParameterfv(GLenum pname, GLfloat const * params);
2966 static void GL_APIENTRY _es_PointParameterxv(GLenum pname, const GLfixed *params)
2968 register unsigned int i;
2969 unsigned int n_params = 3;
2970 GLfloat converted_params[3];
2973 case GL_POINT_SIZE_MIN:
2974 case GL_POINT_SIZE_MAX:
2975 case GL_POINT_FADE_THRESHOLD_SIZE:
2978 case GL_POINT_DISTANCE_ATTENUATION:
2982 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glPointParameterxv(pname=0x%x)", pname);
2986 for (i = 0; i < n_params; i++) {
2987 converted_params[i] = (GLfloat) (params[i] / 65536.0f);
2990 _mesa_PointParameterfv(pname, converted_params);
2993 extern void GL_APIENTRY _mesa_PointSize(GLfloat size);
2994 #define _es_PointSize _mesa_PointSize
2996 extern void GL_APIENTRY _mesa_PointSizePointer(GLenum type, GLsizei stride, const GLvoid * pointer);
2997 static void GL_APIENTRY _es_PointSizePointerOES(GLenum type, GLsizei stride, const GLvoid *pointer)
3004 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glPointSizePointerOES(type=0x%x)", type);
3008 _mesa_PointSizePointer(type, stride, pointer);
3011 extern void GL_APIENTRY _mesa_PointSize(GLfloat size);
3012 static void GL_APIENTRY _es_PointSizex(GLfixed size)
3014 GLfloat converted_size;
3016 converted_size = (GLfloat) (size / 65536.0f);
3018 _mesa_PointSize(converted_size);
3021 extern void GL_APIENTRY _mesa_PolygonOffset(GLfloat factor, GLfloat units);
3022 #define _es_PolygonOffset _mesa_PolygonOffset
3024 extern void GL_APIENTRY _mesa_PolygonOffset(GLfloat factor, GLfloat units);
3025 static void GL_APIENTRY _es_PolygonOffsetx(GLfixed factor, GLfixed units)
3027 GLfloat converted_factor;
3028 GLfloat converted_units;
3030 converted_factor = (GLfloat) (factor / 65536.0f);
3031 converted_units = (GLfloat) (units / 65536.0f);
3033 _mesa_PolygonOffset(converted_factor, converted_units);
3036 extern void GL_APIENTRY _mesa_PopMatrix(void);
3037 #define _es_PopMatrix _mesa_PopMatrix
3039 extern void GL_APIENTRY _mesa_PushMatrix(void);
3040 #define _es_PushMatrix _mesa_PushMatrix
3042 /* this function is special and is defined elsewhere */
3043 extern GLbitfield GL_APIENTRY _es_QueryMatrixxOES(GLfixed * mantissa, GLint * exponent);
3044 #define _check_QueryMatrixxOES _es_QueryMatrixxOES
3046 extern void GL_APIENTRY _mesa_ReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * pixels);
3047 static void GL_APIENTRY _es_ReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels)
3051 if (type != GL_UNSIGNED_BYTE) {
3052 _mesa_error(_mesa_get_current_context(), GL_INVALID_OPERATION, "glReadPixels(format=0x%x)", format);
3057 if (type != GL_UNSIGNED_BYTE && type != GL_UNSIGNED_SHORT_5_6_5) {
3058 _mesa_error(_mesa_get_current_context(), GL_INVALID_OPERATION, "glReadPixels(format=0x%x)", format);
3063 if (type != GL_UNSIGNED_BYTE && type != GL_UNSIGNED_SHORT_4_4_4_4 && type != GL_UNSIGNED_SHORT_5_5_5_1) {
3064 _mesa_error(_mesa_get_current_context(), GL_INVALID_OPERATION, "glReadPixels(format=0x%x)", format);
3069 case GL_LUMINANCE_ALPHA:
3070 if (type != GL_UNSIGNED_BYTE) {
3071 _mesa_error(_mesa_get_current_context(), GL_INVALID_OPERATION, "glReadPixels(format=0x%x)", format);
3076 _mesa_error(_mesa_get_current_context(), GL_INVALID_OPERATION, "glReadPixels(format=0x%x)", format);
3080 _mesa_ReadPixels(x, y, width, height, format, type, pixels);
3083 /* this function is special and is defined elsewhere */
3084 extern void GL_APIENTRY _es_RenderbufferStorageEXT(GLenum target, GLenum internalFormat, GLsizei width, GLsizei height);
3085 static void GL_APIENTRY _check_RenderbufferStorageOES(GLenum target, GLenum internalFormat, GLsizei width, GLsizei height)
3088 case GL_RENDERBUFFER_OES:
3091 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glRenderbufferStorageOES(target=0x%x)", target);
3094 switch(internalFormat) {
3095 case GL_DEPTH_COMPONENT16_OES:
3097 case GL_RGB5_A1_OES:
3099 case GL_STENCIL_INDEX8_OES:
3100 case GL_DEPTH_COMPONENT24_OES:
3101 case GL_DEPTH_COMPONENT32_OES:
3104 case GL_STENCIL_INDEX1_OES:
3105 case GL_STENCIL_INDEX4_OES:
3108 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glRenderbufferStorageOES(internalFormat=0x%x)", internalFormat);
3112 _es_RenderbufferStorageEXT(target, internalFormat, width, height);
3115 extern void GL_APIENTRY _mesa_Rotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
3116 #define _es_Rotatef _mesa_Rotatef
3118 extern void GL_APIENTRY _mesa_Rotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
3119 static void GL_APIENTRY _es_Rotatex(GLfixed angle, GLfixed x, GLfixed y, GLfixed z)
3121 GLfloat converted_angle;
3122 GLfloat converted_x;
3123 GLfloat converted_y;
3124 GLfloat converted_z;
3126 converted_angle = (GLfloat) (angle / 65536.0f);
3127 converted_x = (GLfloat) (x / 65536.0f);
3128 converted_y = (GLfloat) (y / 65536.0f);
3129 converted_z = (GLfloat) (z / 65536.0f);
3131 _mesa_Rotatef(converted_angle, converted_x, converted_y, converted_z);
3134 extern void GL_APIENTRY _mesa_SampleCoverageARB(GLclampf value, GLboolean invert);
3135 #define _es_SampleCoverage _mesa_SampleCoverageARB
3137 extern void GL_APIENTRY _mesa_SampleCoverageARB(GLclampf value, GLboolean invert);
3138 static void GL_APIENTRY _es_SampleCoveragex(GLclampx value, GLboolean invert)
3140 GLclampf converted_value;
3142 converted_value = (GLclampf) (value / 65536.0f);
3144 _mesa_SampleCoverageARB(converted_value, invert);
3147 extern void GL_APIENTRY _mesa_Scalef(GLfloat x, GLfloat y, GLfloat z);
3148 #define _es_Scalef _mesa_Scalef
3150 extern void GL_APIENTRY _mesa_Scalef(GLfloat x, GLfloat y, GLfloat z);
3151 static void GL_APIENTRY _es_Scalex(GLfixed x, GLfixed y, GLfixed z)
3153 GLfloat converted_x;
3154 GLfloat converted_y;
3155 GLfloat converted_z;
3157 converted_x = (GLfloat) (x / 65536.0f);
3158 converted_y = (GLfloat) (y / 65536.0f);
3159 converted_z = (GLfloat) (z / 65536.0f);
3161 _mesa_Scalef(converted_x, converted_y, converted_z);
3164 extern void GL_APIENTRY _mesa_Scissor(GLint x, GLint y, GLsizei width, GLsizei height);
3165 #define _es_Scissor _mesa_Scissor
3167 extern void GL_APIENTRY _mesa_ShadeModel(GLenum mode);
3168 static void GL_APIENTRY _es_ShadeModel(GLenum mode)
3175 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glShadeModel(mode=0x%x)", mode);
3179 _mesa_ShadeModel(mode);
3182 extern void GL_APIENTRY _mesa_StencilFunc(GLenum func, GLint ref, GLuint mask);
3183 static void GL_APIENTRY _es_StencilFunc(GLenum func, GLint ref, GLuint mask)
3196 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glStencilFunc(func=0x%x)", func);
3200 _mesa_StencilFunc(func, ref, mask);
3203 extern void GL_APIENTRY _mesa_StencilMask(GLuint mask);
3204 #define _es_StencilMask _mesa_StencilMask
3206 extern void GL_APIENTRY _mesa_StencilOp(GLenum fail, GLenum zfail, GLenum zpass);
3207 static void GL_APIENTRY _es_StencilOp(GLenum fail, GLenum zfail, GLenum zpass)
3216 case GL_INCR_WRAP_OES:
3217 case GL_DECR_WRAP_OES:
3220 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glStencilOp(fail=0x%x)", fail);
3230 case GL_INCR_WRAP_OES:
3231 case GL_DECR_WRAP_OES:
3234 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glStencilOp(zfail=0x%x)", zfail);
3244 case GL_INCR_WRAP_OES:
3245 case GL_DECR_WRAP_OES:
3248 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glStencilOp(zpass=0x%x)", zpass);
3252 _mesa_StencilOp(fail, zfail, zpass);
3255 extern void GL_APIENTRY _mesa_TexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer);
3256 static void GL_APIENTRY _es_TexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
3264 _mesa_error(_mesa_get_current_context(), GL_INVALID_VALUE, "glTexCoordPointer(size=%d)", size);
3274 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexCoordPointer(type=0x%x)", type);
3278 _mesa_TexCoordPointer(size, type, stride, pointer);
3281 extern void GL_APIENTRY _mesa_TexEnvf(GLenum target, GLenum pname, GLfloat param);
3282 static void GL_APIENTRY _es_TexEnvf(GLenum target, GLenum pname, GLfloat param)
3285 case GL_POINT_SPRITE_OES:
3286 if (pname != GL_COORD_REPLACE_OES) {
3287 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvf(target=0x%x)", target);
3291 case GL_TEXTURE_FILTER_CONTROL_EXT:
3292 if (pname != GL_TEXTURE_LOD_BIAS_EXT) {
3293 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvf(target=0x%x)", target);
3297 case GL_TEXTURE_ENV:
3298 if (pname != GL_TEXTURE_ENV_MODE && pname != GL_COMBINE_RGB && pname != GL_COMBINE_ALPHA && pname != GL_RGB_SCALE && pname != GL_ALPHA_SCALE && pname != GL_SRC0_RGB && pname != GL_SRC1_RGB && pname != GL_SRC2_RGB && pname != GL_SRC0_ALPHA && pname != GL_SRC1_ALPHA && pname != GL_SRC2_ALPHA && pname != GL_OPERAND0_RGB && pname != GL_OPERAND1_RGB && pname != GL_OPERAND2_RGB && pname != GL_OPERAND0_ALPHA && pname != GL_OPERAND1_ALPHA && pname != GL_OPERAND2_ALPHA && pname != GL_TEXTURE_ENV_COLOR) {
3299 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvf(target=0x%x)", target);
3304 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvf(target=0x%x)", target);
3308 case GL_COORD_REPLACE_OES:
3309 if (param != GL_TRUE && param != GL_FALSE) {
3310 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvf(pname=0x%x)", pname);
3314 case GL_TEXTURE_LOD_BIAS_EXT:
3316 case GL_TEXTURE_ENV_MODE:
3317 if (param != GL_REPLACE && param != GL_MODULATE && param != GL_DECAL && param != GL_BLEND && param != GL_ADD && param != GL_COMBINE) {
3318 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvf(pname=0x%x)", pname);
3322 case GL_COMBINE_RGB:
3323 if (param != GL_REPLACE && param != GL_MODULATE && param != GL_ADD && param != GL_ADD_SIGNED && param != GL_INTERPOLATE && param != GL_SUBTRACT && param != GL_DOT3_RGB && param != GL_DOT3_RGBA) {
3324 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvf(pname=0x%x)", pname);
3328 case GL_COMBINE_ALPHA:
3329 if (param != GL_REPLACE && param != GL_MODULATE && param != GL_ADD && param != GL_ADD_SIGNED && param != GL_INTERPOLATE && param != GL_SUBTRACT) {
3330 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvf(pname=0x%x)", pname);
3335 case GL_ALPHA_SCALE:
3336 if (param != 1.0 && param != 2.0 && param != 4.0) {
3337 _mesa_error(_mesa_get_current_context(), GL_INVALID_VALUE, "glTexEnvf(pname=0x%x)", pname);
3347 if (param != GL_TEXTURE && param != GL_CONSTANT && param != GL_PRIMARY_COLOR && param != GL_PREVIOUS && param != GL_TEXTURE0 && param != GL_TEXTURE1 && param != GL_TEXTURE2 && param != GL_TEXTURE3 && param != GL_TEXTURE4 && param != GL_TEXTURE5 && param != GL_TEXTURE6 && param != GL_TEXTURE7 && param != GL_TEXTURE8 && param != GL_TEXTURE9 && param != GL_TEXTURE10 && param != GL_TEXTURE11 && param != GL_TEXTURE12 && param != GL_TEXTURE13 && param != GL_TEXTURE14 && param != GL_TEXTURE15 && param != GL_TEXTURE16 && param != GL_TEXTURE17 && param != GL_TEXTURE18 && param != GL_TEXTURE19 && param != GL_TEXTURE20 && param != GL_TEXTURE21 && param != GL_TEXTURE22 && param != GL_TEXTURE23 && param != GL_TEXTURE24 && param != GL_TEXTURE25 && param != GL_TEXTURE26 && param != GL_TEXTURE27 && param != GL_TEXTURE28 && param != GL_TEXTURE29 && param != GL_TEXTURE30 && param != GL_TEXTURE31) {
3348 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvf(pname=0x%x)", pname);
3352 case GL_OPERAND0_RGB:
3353 case GL_OPERAND1_RGB:
3354 case GL_OPERAND2_RGB:
3355 if (param != GL_SRC_COLOR && param != GL_ONE_MINUS_SRC_COLOR && param != GL_SRC_ALPHA && param != GL_ONE_MINUS_SRC_ALPHA) {
3356 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvf(pname=0x%x)", pname);
3360 case GL_OPERAND0_ALPHA:
3361 case GL_OPERAND1_ALPHA:
3362 case GL_OPERAND2_ALPHA:
3363 if (param != GL_SRC_ALPHA && param != GL_ONE_MINUS_SRC_ALPHA) {
3364 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvf(pname=0x%x)", pname);
3369 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvf(pname=0x%x)", pname);
3373 _mesa_TexEnvf(target, pname, param);
3376 extern void GL_APIENTRY _mesa_TexEnvfv(GLenum target, GLenum pname, const GLfloat * params);
3377 static void GL_APIENTRY _es_TexEnvfv(GLenum target, GLenum pname, const GLfloat *params)
3380 case GL_POINT_SPRITE_OES:
3381 if (pname != GL_COORD_REPLACE_OES) {
3382 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvfv(target=0x%x)", target);
3386 case GL_TEXTURE_FILTER_CONTROL_EXT:
3387 if (pname != GL_TEXTURE_LOD_BIAS_EXT) {
3388 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvfv(target=0x%x)", target);
3392 case GL_TEXTURE_ENV:
3393 if (pname != GL_TEXTURE_ENV_MODE && pname != GL_COMBINE_RGB && pname != GL_COMBINE_ALPHA && pname != GL_RGB_SCALE && pname != GL_ALPHA_SCALE && pname != GL_SRC0_RGB && pname != GL_SRC1_RGB && pname != GL_SRC2_RGB && pname != GL_SRC0_ALPHA && pname != GL_SRC1_ALPHA && pname != GL_SRC2_ALPHA && pname != GL_OPERAND0_RGB && pname != GL_OPERAND1_RGB && pname != GL_OPERAND2_RGB && pname != GL_OPERAND0_ALPHA && pname != GL_OPERAND1_ALPHA && pname != GL_OPERAND2_ALPHA && pname != GL_TEXTURE_ENV_COLOR) {
3394 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvfv(target=0x%x)", target);
3399 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvfv(target=0x%x)", target);
3403 case GL_COORD_REPLACE_OES: /* size 1 */
3404 if (params[0] != GL_TRUE && params[0] != GL_FALSE) {
3405 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvfv(pname=0x%x)", pname);
3409 case GL_TEXTURE_LOD_BIAS_EXT: /* size 1 */
3411 case GL_TEXTURE_ENV_MODE: /* size 1 */
3412 if (params[0] != GL_REPLACE && params[0] != GL_MODULATE && params[0] != GL_DECAL && params[0] != GL_BLEND && params[0] != GL_ADD && params[0] != GL_COMBINE) {
3413 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvfv(pname=0x%x)", pname);
3417 case GL_COMBINE_RGB: /* size 1 */
3418 if (params[0] != GL_REPLACE && params[0] != GL_MODULATE && params[0] != GL_ADD && params[0] != GL_ADD_SIGNED && params[0] != GL_INTERPOLATE && params[0] != GL_SUBTRACT && params[0] != GL_DOT3_RGB && params[0] != GL_DOT3_RGBA) {
3419 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvfv(pname=0x%x)", pname);
3423 case GL_COMBINE_ALPHA: /* size 1 */
3424 if (params[0] != GL_REPLACE && params[0] != GL_MODULATE && params[0] != GL_ADD && params[0] != GL_ADD_SIGNED && params[0] != GL_INTERPOLATE && params[0] != GL_SUBTRACT) {
3425 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvfv(pname=0x%x)", pname);
3430 case GL_ALPHA_SCALE:
3431 if (params[0] != 1.0 && params[0] != 2.0 && params[0] != 4.0) {
3432 _mesa_error(_mesa_get_current_context(), GL_INVALID_VALUE, "glTexEnvfv(pname=0x%x)", pname);
3436 case GL_SRC0_RGB: /* size 1 */
3437 case GL_SRC1_RGB: /* size 1 */
3438 case GL_SRC2_RGB: /* size 1 */
3439 case GL_SRC0_ALPHA: /* size 1 */
3440 case GL_SRC1_ALPHA: /* size 1 */
3441 case GL_SRC2_ALPHA: /* size 1 */
3442 if (params[0] != GL_TEXTURE && params[0] != GL_CONSTANT && params[0] != GL_PRIMARY_COLOR && params[0] != GL_PREVIOUS && params[0] != GL_TEXTURE0 && params[0] != GL_TEXTURE1 && params[0] != GL_TEXTURE2 && params[0] != GL_TEXTURE3 && params[0] != GL_TEXTURE4 && params[0] != GL_TEXTURE5 && params[0] != GL_TEXTURE6 && params[0] != GL_TEXTURE7 && params[0] != GL_TEXTURE8 && params[0] != GL_TEXTURE9 && params[0] != GL_TEXTURE10 && params[0] != GL_TEXTURE11 && params[0] != GL_TEXTURE12 && params[0] != GL_TEXTURE13 && params[0] != GL_TEXTURE14 && params[0] != GL_TEXTURE15 && params[0] != GL_TEXTURE16 && params[0] != GL_TEXTURE17 && params[0] != GL_TEXTURE18 && params[0] != GL_TEXTURE19 && params[0] != GL_TEXTURE20 && params[0] != GL_TEXTURE21 && params[0] != GL_TEXTURE22 && params[0] != GL_TEXTURE23 && params[0] != GL_TEXTURE24 && params[0] != GL_TEXTURE25 && params[0] != GL_TEXTURE26 && params[0] != GL_TEXTURE27 && params[0] != GL_TEXTURE28 && params[0] != GL_TEXTURE29 && params[0] != GL_TEXTURE30 && params[0] != GL_TEXTURE31) {
3443 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvfv(pname=0x%x)", pname);
3447 case GL_OPERAND0_RGB: /* size 1 */
3448 case GL_OPERAND1_RGB: /* size 1 */
3449 case GL_OPERAND2_RGB: /* size 1 */
3450 if (params[0] != GL_SRC_COLOR && params[0] != GL_ONE_MINUS_SRC_COLOR && params[0] != GL_SRC_ALPHA && params[0] != GL_ONE_MINUS_SRC_ALPHA) {
3451 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvfv(pname=0x%x)", pname);
3455 case GL_OPERAND0_ALPHA: /* size 1 */
3456 case GL_OPERAND1_ALPHA: /* size 1 */
3457 case GL_OPERAND2_ALPHA: /* size 1 */
3458 if (params[0] != GL_SRC_ALPHA && params[0] != GL_ONE_MINUS_SRC_ALPHA) {
3459 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvfv(pname=0x%x)", pname);
3463 case GL_TEXTURE_ENV_COLOR: /* size 4 */
3466 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvfv(pname=0x%x)", pname);
3470 _mesa_TexEnvfv(target, pname, params);
3473 extern void GL_APIENTRY _mesa_TexEnvi(GLenum target, GLenum pname, GLint param);
3474 static void GL_APIENTRY _es_TexEnvi(GLenum target, GLenum pname, GLint param)
3477 case GL_POINT_SPRITE_OES:
3478 if (pname != GL_COORD_REPLACE_OES) {
3479 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvi(target=0x%x)", target);
3483 case GL_TEXTURE_FILTER_CONTROL_EXT:
3484 if (pname != GL_TEXTURE_LOD_BIAS_EXT) {
3485 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvi(target=0x%x)", target);
3489 case GL_TEXTURE_ENV:
3490 if (pname != GL_TEXTURE_ENV_MODE && pname != GL_COMBINE_RGB && pname != GL_COMBINE_ALPHA && pname != GL_RGB_SCALE && pname != GL_ALPHA_SCALE && pname != GL_SRC0_RGB && pname != GL_SRC1_RGB && pname != GL_SRC2_RGB && pname != GL_SRC0_ALPHA && pname != GL_SRC1_ALPHA && pname != GL_SRC2_ALPHA && pname != GL_OPERAND0_RGB && pname != GL_OPERAND1_RGB && pname != GL_OPERAND2_RGB && pname != GL_OPERAND0_ALPHA && pname != GL_OPERAND1_ALPHA && pname != GL_OPERAND2_ALPHA && pname != GL_TEXTURE_ENV_COLOR) {
3491 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvi(target=0x%x)", target);
3496 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvi(target=0x%x)", target);
3500 case GL_COORD_REPLACE_OES:
3501 if (param != GL_TRUE && param != GL_FALSE) {
3502 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvi(pname=0x%x)", pname);
3506 case GL_TEXTURE_LOD_BIAS_EXT:
3508 case GL_TEXTURE_ENV_MODE:
3509 if (param != GL_REPLACE && param != GL_MODULATE && param != GL_DECAL && param != GL_BLEND && param != GL_ADD && param != GL_COMBINE) {
3510 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvi(pname=0x%x)", pname);
3514 case GL_COMBINE_RGB:
3515 if (param != GL_REPLACE && param != GL_MODULATE && param != GL_ADD && param != GL_ADD_SIGNED && param != GL_INTERPOLATE && param != GL_SUBTRACT && param != GL_DOT3_RGB && param != GL_DOT3_RGBA) {
3516 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvi(pname=0x%x)", pname);
3520 case GL_COMBINE_ALPHA:
3521 if (param != GL_REPLACE && param != GL_MODULATE && param != GL_ADD && param != GL_ADD_SIGNED && param != GL_INTERPOLATE && param != GL_SUBTRACT) {
3522 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvi(pname=0x%x)", pname);
3527 case GL_ALPHA_SCALE:
3528 if (param != 1.0 && param != 2.0 && param != 4.0) {
3529 _mesa_error(_mesa_get_current_context(), GL_INVALID_VALUE, "glTexEnvi(pname=0x%x)", pname);
3539 if (param != GL_TEXTURE && param != GL_CONSTANT && param != GL_PRIMARY_COLOR && param != GL_PREVIOUS && param != GL_TEXTURE0 && param != GL_TEXTURE1 && param != GL_TEXTURE2 && param != GL_TEXTURE3 && param != GL_TEXTURE4 && param != GL_TEXTURE5 && param != GL_TEXTURE6 && param != GL_TEXTURE7 && param != GL_TEXTURE8 && param != GL_TEXTURE9 && param != GL_TEXTURE10 && param != GL_TEXTURE11 && param != GL_TEXTURE12 && param != GL_TEXTURE13 && param != GL_TEXTURE14 && param != GL_TEXTURE15 && param != GL_TEXTURE16 && param != GL_TEXTURE17 && param != GL_TEXTURE18 && param != GL_TEXTURE19 && param != GL_TEXTURE20 && param != GL_TEXTURE21 && param != GL_TEXTURE22 && param != GL_TEXTURE23 && param != GL_TEXTURE24 && param != GL_TEXTURE25 && param != GL_TEXTURE26 && param != GL_TEXTURE27 && param != GL_TEXTURE28 && param != GL_TEXTURE29 && param != GL_TEXTURE30 && param != GL_TEXTURE31) {
3540 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvi(pname=0x%x)", pname);
3544 case GL_OPERAND0_RGB:
3545 case GL_OPERAND1_RGB:
3546 case GL_OPERAND2_RGB:
3547 if (param != GL_SRC_COLOR && param != GL_ONE_MINUS_SRC_COLOR && param != GL_SRC_ALPHA && param != GL_ONE_MINUS_SRC_ALPHA) {
3548 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvi(pname=0x%x)", pname);
3552 case GL_OPERAND0_ALPHA:
3553 case GL_OPERAND1_ALPHA:
3554 case GL_OPERAND2_ALPHA:
3555 if (param != GL_SRC_ALPHA && param != GL_ONE_MINUS_SRC_ALPHA) {
3556 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvi(pname=0x%x)", pname);
3561 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvi(pname=0x%x)", pname);
3565 _mesa_TexEnvi(target, pname, param);
3568 extern void GL_APIENTRY _mesa_TexEnviv(GLenum target, GLenum pname, const GLint * params);
3569 static void GL_APIENTRY _es_TexEnviv(GLenum target, GLenum pname, const GLint *params)
3572 case GL_POINT_SPRITE_OES:
3573 if (pname != GL_COORD_REPLACE_OES) {
3574 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnviv(target=0x%x)", target);
3578 case GL_TEXTURE_FILTER_CONTROL_EXT:
3579 if (pname != GL_TEXTURE_LOD_BIAS_EXT) {
3580 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnviv(target=0x%x)", target);
3584 case GL_TEXTURE_ENV:
3585 if (pname != GL_TEXTURE_ENV_MODE && pname != GL_COMBINE_RGB && pname != GL_COMBINE_ALPHA && pname != GL_RGB_SCALE && pname != GL_ALPHA_SCALE && pname != GL_SRC0_RGB && pname != GL_SRC1_RGB && pname != GL_SRC2_RGB && pname != GL_SRC0_ALPHA && pname != GL_SRC1_ALPHA && pname != GL_SRC2_ALPHA && pname != GL_OPERAND0_RGB && pname != GL_OPERAND1_RGB && pname != GL_OPERAND2_RGB && pname != GL_OPERAND0_ALPHA && pname != GL_OPERAND1_ALPHA && pname != GL_OPERAND2_ALPHA && pname != GL_TEXTURE_ENV_COLOR) {
3586 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnviv(target=0x%x)", target);
3591 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnviv(target=0x%x)", target);
3595 case GL_COORD_REPLACE_OES: /* size 1 */
3596 if (params[0] != GL_TRUE && params[0] != GL_FALSE) {
3597 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnviv(pname=0x%x)", pname);
3601 case GL_TEXTURE_LOD_BIAS_EXT: /* size 1 */
3603 case GL_TEXTURE_ENV_MODE: /* size 1 */
3604 if (params[0] != GL_REPLACE && params[0] != GL_MODULATE && params[0] != GL_DECAL && params[0] != GL_BLEND && params[0] != GL_ADD && params[0] != GL_COMBINE) {
3605 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnviv(pname=0x%x)", pname);
3609 case GL_COMBINE_RGB: /* size 1 */
3610 if (params[0] != GL_REPLACE && params[0] != GL_MODULATE && params[0] != GL_ADD && params[0] != GL_ADD_SIGNED && params[0] != GL_INTERPOLATE && params[0] != GL_SUBTRACT && params[0] != GL_DOT3_RGB && params[0] != GL_DOT3_RGBA) {
3611 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnviv(pname=0x%x)", pname);
3615 case GL_COMBINE_ALPHA: /* size 1 */
3616 if (params[0] != GL_REPLACE && params[0] != GL_MODULATE && params[0] != GL_ADD && params[0] != GL_ADD_SIGNED && params[0] != GL_INTERPOLATE && params[0] != GL_SUBTRACT) {
3617 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnviv(pname=0x%x)", pname);
3622 case GL_ALPHA_SCALE:
3623 if (params[0] != 1.0 && params[0] != 2.0 && params[0] != 4.0) {
3624 _mesa_error(_mesa_get_current_context(), GL_INVALID_VALUE, "glTexEnviv(pname=0x%x)", pname);
3628 case GL_SRC0_RGB: /* size 1 */
3629 case GL_SRC1_RGB: /* size 1 */
3630 case GL_SRC2_RGB: /* size 1 */
3631 case GL_SRC0_ALPHA: /* size 1 */
3632 case GL_SRC1_ALPHA: /* size 1 */
3633 case GL_SRC2_ALPHA: /* size 1 */
3634 if (params[0] != GL_TEXTURE && params[0] != GL_CONSTANT && params[0] != GL_PRIMARY_COLOR && params[0] != GL_PREVIOUS && params[0] != GL_TEXTURE0 && params[0] != GL_TEXTURE1 && params[0] != GL_TEXTURE2 && params[0] != GL_TEXTURE3 && params[0] != GL_TEXTURE4 && params[0] != GL_TEXTURE5 && params[0] != GL_TEXTURE6 && params[0] != GL_TEXTURE7 && params[0] != GL_TEXTURE8 && params[0] != GL_TEXTURE9 && params[0] != GL_TEXTURE10 && params[0] != GL_TEXTURE11 && params[0] != GL_TEXTURE12 && params[0] != GL_TEXTURE13 && params[0] != GL_TEXTURE14 && params[0] != GL_TEXTURE15 && params[0] != GL_TEXTURE16 && params[0] != GL_TEXTURE17 && params[0] != GL_TEXTURE18 && params[0] != GL_TEXTURE19 && params[0] != GL_TEXTURE20 && params[0] != GL_TEXTURE21 && params[0] != GL_TEXTURE22 && params[0] != GL_TEXTURE23 && params[0] != GL_TEXTURE24 && params[0] != GL_TEXTURE25 && params[0] != GL_TEXTURE26 && params[0] != GL_TEXTURE27 && params[0] != GL_TEXTURE28 && params[0] != GL_TEXTURE29 && params[0] != GL_TEXTURE30 && params[0] != GL_TEXTURE31) {
3635 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnviv(pname=0x%x)", pname);
3639 case GL_OPERAND0_RGB: /* size 1 */
3640 case GL_OPERAND1_RGB: /* size 1 */
3641 case GL_OPERAND2_RGB: /* size 1 */
3642 if (params[0] != GL_SRC_COLOR && params[0] != GL_ONE_MINUS_SRC_COLOR && params[0] != GL_SRC_ALPHA && params[0] != GL_ONE_MINUS_SRC_ALPHA) {
3643 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnviv(pname=0x%x)", pname);
3647 case GL_OPERAND0_ALPHA: /* size 1 */
3648 case GL_OPERAND1_ALPHA: /* size 1 */
3649 case GL_OPERAND2_ALPHA: /* size 1 */
3650 if (params[0] != GL_SRC_ALPHA && params[0] != GL_ONE_MINUS_SRC_ALPHA) {
3651 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnviv(pname=0x%x)", pname);
3655 case GL_TEXTURE_ENV_COLOR: /* size 4 */
3658 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnviv(pname=0x%x)", pname);
3662 _mesa_TexEnviv(target, pname, params);
3665 extern void GL_APIENTRY _mesa_TexEnvf(GLenum target, GLenum pname, GLfloat param);
3666 static void GL_APIENTRY _es_TexEnvx(GLenum target, GLenum pname, GLfixed param)
3668 GLfloat converted_param;
3669 int convert_param_value = 1;
3672 case GL_POINT_SPRITE_OES:
3673 if (pname != GL_COORD_REPLACE_OES) {
3674 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvx(target=0x%x)", target);
3678 case GL_TEXTURE_FILTER_CONTROL_EXT:
3679 if (pname != GL_TEXTURE_LOD_BIAS_EXT) {
3680 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvx(target=0x%x)", target);
3684 case GL_TEXTURE_ENV:
3685 if (pname != GL_TEXTURE_ENV_MODE && pname != GL_COMBINE_RGB && pname != GL_COMBINE_ALPHA && pname != GL_RGB_SCALE && pname != GL_ALPHA_SCALE && pname != GL_SRC0_RGB && pname != GL_SRC1_RGB && pname != GL_SRC2_RGB && pname != GL_SRC0_ALPHA && pname != GL_SRC1_ALPHA && pname != GL_SRC2_ALPHA && pname != GL_OPERAND0_RGB && pname != GL_OPERAND1_RGB && pname != GL_OPERAND2_RGB && pname != GL_OPERAND0_ALPHA && pname != GL_OPERAND1_ALPHA && pname != GL_OPERAND2_ALPHA && pname != GL_TEXTURE_ENV_COLOR) {
3686 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvx(target=0x%x)", target);
3691 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvx(target=0x%x)", target);
3695 case GL_COORD_REPLACE_OES:
3696 if (param != GL_TRUE && param != GL_FALSE) {
3697 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvx(pname=0x%x)", pname);
3700 convert_param_value = 0;
3702 case GL_TEXTURE_LOD_BIAS_EXT:
3704 case GL_TEXTURE_ENV_MODE:
3705 if (param != GL_REPLACE && param != GL_MODULATE && param != GL_DECAL && param != GL_BLEND && param != GL_ADD && param != GL_COMBINE) {
3706 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvx(pname=0x%x)", pname);
3709 convert_param_value = 0;
3711 case GL_COMBINE_RGB:
3712 if (param != GL_REPLACE && param != GL_MODULATE && param != GL_ADD && param != GL_ADD_SIGNED && param != GL_INTERPOLATE && param != GL_SUBTRACT && param != GL_DOT3_RGB && param != GL_DOT3_RGBA) {
3713 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvx(pname=0x%x)", pname);
3716 convert_param_value = 0;
3718 case GL_COMBINE_ALPHA:
3719 if (param != GL_REPLACE && param != GL_MODULATE && param != GL_ADD && param != GL_ADD_SIGNED && param != GL_INTERPOLATE && param != GL_SUBTRACT) {
3720 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvx(pname=0x%x)", pname);
3723 convert_param_value = 0;
3726 case GL_ALPHA_SCALE:
3727 if (param != 1.0 && param != 2.0 && param != 4.0) {
3728 _mesa_error(_mesa_get_current_context(), GL_INVALID_VALUE, "glTexEnvx(pname=0x%x)", pname);
3738 if (param != GL_TEXTURE && param != GL_CONSTANT && param != GL_PRIMARY_COLOR && param != GL_PREVIOUS && param != GL_TEXTURE0 && param != GL_TEXTURE1 && param != GL_TEXTURE2 && param != GL_TEXTURE3 && param != GL_TEXTURE4 && param != GL_TEXTURE5 && param != GL_TEXTURE6 && param != GL_TEXTURE7 && param != GL_TEXTURE8 && param != GL_TEXTURE9 && param != GL_TEXTURE10 && param != GL_TEXTURE11 && param != GL_TEXTURE12 && param != GL_TEXTURE13 && param != GL_TEXTURE14 && param != GL_TEXTURE15 && param != GL_TEXTURE16 && param != GL_TEXTURE17 && param != GL_TEXTURE18 && param != GL_TEXTURE19 && param != GL_TEXTURE20 && param != GL_TEXTURE21 && param != GL_TEXTURE22 && param != GL_TEXTURE23 && param != GL_TEXTURE24 && param != GL_TEXTURE25 && param != GL_TEXTURE26 && param != GL_TEXTURE27 && param != GL_TEXTURE28 && param != GL_TEXTURE29 && param != GL_TEXTURE30 && param != GL_TEXTURE31) {
3739 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvx(pname=0x%x)", pname);
3742 convert_param_value = 0;
3744 case GL_OPERAND0_RGB:
3745 case GL_OPERAND1_RGB:
3746 case GL_OPERAND2_RGB:
3747 if (param != GL_SRC_COLOR && param != GL_ONE_MINUS_SRC_COLOR && param != GL_SRC_ALPHA && param != GL_ONE_MINUS_SRC_ALPHA) {
3748 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvx(pname=0x%x)", pname);
3751 convert_param_value = 0;
3753 case GL_OPERAND0_ALPHA:
3754 case GL_OPERAND1_ALPHA:
3755 case GL_OPERAND2_ALPHA:
3756 if (param != GL_SRC_ALPHA && param != GL_ONE_MINUS_SRC_ALPHA) {
3757 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvx(pname=0x%x)", pname);
3760 convert_param_value = 0;
3763 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvx(pname=0x%x)", pname);
3767 if (convert_param_value) {
3768 converted_param = (GLfloat) (param / 65536.0f);
3770 converted_param = (GLfloat) param;
3773 _mesa_TexEnvf(target, pname, converted_param);
3776 extern void GL_APIENTRY _mesa_TexEnvfv(GLenum target, GLenum pname, GLfloat const * params);
3777 static void GL_APIENTRY _es_TexEnvxv(GLenum target, GLenum pname, const GLfixed *params)
3779 register unsigned int i;
3780 unsigned int n_params = 4;
3781 GLfloat converted_params[4];
3782 int convert_params_value = 1;
3785 case GL_POINT_SPRITE_OES:
3786 if (pname != GL_COORD_REPLACE_OES) {
3787 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvxv(target=0x%x)", target);
3791 case GL_TEXTURE_FILTER_CONTROL_EXT:
3792 if (pname != GL_TEXTURE_LOD_BIAS_EXT) {
3793 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvxv(target=0x%x)", target);
3797 case GL_TEXTURE_ENV:
3798 if (pname != GL_TEXTURE_ENV_MODE && pname != GL_COMBINE_RGB && pname != GL_COMBINE_ALPHA && pname != GL_RGB_SCALE && pname != GL_ALPHA_SCALE && pname != GL_SRC0_RGB && pname != GL_SRC1_RGB && pname != GL_SRC2_RGB && pname != GL_SRC0_ALPHA && pname != GL_SRC1_ALPHA && pname != GL_SRC2_ALPHA && pname != GL_OPERAND0_RGB && pname != GL_OPERAND1_RGB && pname != GL_OPERAND2_RGB && pname != GL_OPERAND0_ALPHA && pname != GL_OPERAND1_ALPHA && pname != GL_OPERAND2_ALPHA && pname != GL_TEXTURE_ENV_COLOR) {
3799 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvxv(target=0x%x)", target);
3804 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvxv(target=0x%x)", target);
3808 case GL_COORD_REPLACE_OES:
3809 if (params[0] != GL_TRUE && params[0] != GL_FALSE) {
3810 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvxv(pname=0x%x)", pname);
3813 convert_params_value = 0;
3816 case GL_TEXTURE_LOD_BIAS_EXT:
3819 case GL_TEXTURE_ENV_MODE:
3820 if (params[0] != GL_REPLACE && params[0] != GL_MODULATE && params[0] != GL_DECAL && params[0] != GL_BLEND && params[0] != GL_ADD && params[0] != GL_COMBINE) {
3821 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvxv(pname=0x%x)", pname);
3824 convert_params_value = 0;
3827 case GL_COMBINE_RGB:
3828 if (params[0] != GL_REPLACE && params[0] != GL_MODULATE && params[0] != GL_ADD && params[0] != GL_ADD_SIGNED && params[0] != GL_INTERPOLATE && params[0] != GL_SUBTRACT && params[0] != GL_DOT3_RGB && params[0] != GL_DOT3_RGBA) {
3829 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvxv(pname=0x%x)", pname);
3832 convert_params_value = 0;
3835 case GL_COMBINE_ALPHA:
3836 if (params[0] != GL_REPLACE && params[0] != GL_MODULATE && params[0] != GL_ADD && params[0] != GL_ADD_SIGNED && params[0] != GL_INTERPOLATE && params[0] != GL_SUBTRACT) {
3837 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvxv(pname=0x%x)", pname);
3840 convert_params_value = 0;
3844 case GL_ALPHA_SCALE:
3845 if (params[0] != 1.0 && params[0] != 2.0 && params[0] != 4.0) {
3846 _mesa_error(_mesa_get_current_context(), GL_INVALID_VALUE, "glTexEnvxv(pname=0x%x)", pname);
3856 if (params[0] != GL_TEXTURE && params[0] != GL_CONSTANT && params[0] != GL_PRIMARY_COLOR && params[0] != GL_PREVIOUS && params[0] != GL_TEXTURE0 && params[0] != GL_TEXTURE1 && params[0] != GL_TEXTURE2 && params[0] != GL_TEXTURE3 && params[0] != GL_TEXTURE4 && params[0] != GL_TEXTURE5 && params[0] != GL_TEXTURE6 && params[0] != GL_TEXTURE7 && params[0] != GL_TEXTURE8 && params[0] != GL_TEXTURE9 && params[0] != GL_TEXTURE10 && params[0] != GL_TEXTURE11 && params[0] != GL_TEXTURE12 && params[0] != GL_TEXTURE13 && params[0] != GL_TEXTURE14 && params[0] != GL_TEXTURE15 && params[0] != GL_TEXTURE16 && params[0] != GL_TEXTURE17 && params[0] != GL_TEXTURE18 && params[0] != GL_TEXTURE19 && params[0] != GL_TEXTURE20 && params[0] != GL_TEXTURE21 && params[0] != GL_TEXTURE22 && params[0] != GL_TEXTURE23 && params[0] != GL_TEXTURE24 && params[0] != GL_TEXTURE25 && params[0] != GL_TEXTURE26 && params[0] != GL_TEXTURE27 && params[0] != GL_TEXTURE28 && params[0] != GL_TEXTURE29 && params[0] != GL_TEXTURE30 && params[0] != GL_TEXTURE31) {
3857 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvxv(pname=0x%x)", pname);
3860 convert_params_value = 0;
3863 case GL_OPERAND0_RGB:
3864 case GL_OPERAND1_RGB:
3865 case GL_OPERAND2_RGB:
3866 if (params[0] != GL_SRC_COLOR && params[0] != GL_ONE_MINUS_SRC_COLOR && params[0] != GL_SRC_ALPHA && params[0] != GL_ONE_MINUS_SRC_ALPHA) {
3867 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvxv(pname=0x%x)", pname);
3870 convert_params_value = 0;
3873 case GL_OPERAND0_ALPHA:
3874 case GL_OPERAND1_ALPHA:
3875 case GL_OPERAND2_ALPHA:
3876 if (params[0] != GL_SRC_ALPHA && params[0] != GL_ONE_MINUS_SRC_ALPHA) {
3877 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvxv(pname=0x%x)", pname);
3880 convert_params_value = 0;
3883 case GL_TEXTURE_ENV_COLOR:
3887 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexEnvxv(pname=0x%x)", pname);
3891 if (convert_params_value) {
3892 for (i = 0; i < n_params; i++) {
3893 converted_params[i] = (GLfloat) (params[i] / 65536.0f);
3896 for (i = 0; i < n_params; i++) {
3897 converted_params[i] = (GLfloat) params[i];
3901 _mesa_TexEnvfv(target, pname, converted_params);
3904 /* this function is special and is defined elsewhere */
3905 extern void GL_APIENTRY _es_TexGenf(GLenum coord, GLenum pname, GLfloat param);
3906 static void GL_APIENTRY _check_TexGenfOES(GLenum coord, GLenum pname, GLfloat param)
3909 case GL_TEXTURE_GEN_STR_OES:
3912 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexGenfOES(coord=0x%x)", coord);
3916 case GL_TEXTURE_GEN_MODE_OES:
3917 if (param != GL_NORMAL_MAP_OES && param != GL_REFLECTION_MAP_OES) {
3918 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexGenfOES(pname=0x%x)", pname);
3923 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexGenfOES(pname=0x%x)", pname);
3927 _es_TexGenf(coord, pname, param);
3930 /* this function is special and is defined elsewhere */
3931 extern void GL_APIENTRY _es_TexGenfv(GLenum coord, GLenum pname, const GLfloat * params);
3932 static void GL_APIENTRY _check_TexGenfvOES(GLenum coord, GLenum pname, const GLfloat *params)
3935 case GL_TEXTURE_GEN_STR_OES:
3938 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexGenfvOES(coord=0x%x)", coord);
3942 case GL_TEXTURE_GEN_MODE_OES: /* size 1 */
3943 if (params[0] != GL_NORMAL_MAP_OES && params[0] != GL_REFLECTION_MAP_OES) {
3944 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexGenfvOES(pname=0x%x)", pname);
3949 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexGenfvOES(pname=0x%x)", pname);
3953 _es_TexGenfv(coord, pname, params);
3956 /* this function is special and is defined elsewhere */
3957 extern void GL_APIENTRY _es_TexGenf(GLenum coord, GLenum pname, GLfloat param);
3958 static void GL_APIENTRY _check_TexGeniOES(GLenum coord, GLenum pname, GLint param)
3960 GLfloat converted_param;
3963 case GL_TEXTURE_GEN_STR_OES:
3966 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexGeniOES(coord=0x%x)", coord);
3970 case GL_TEXTURE_GEN_MODE_OES:
3971 if (param != GL_NORMAL_MAP_OES && param != GL_REFLECTION_MAP_OES) {
3972 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexGeniOES(pname=0x%x)", pname);
3977 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexGeniOES(pname=0x%x)", pname);
3981 converted_param = (GLfloat) param;
3983 _es_TexGenf(coord, pname, converted_param);
3986 /* this function is special and is defined elsewhere */
3987 extern void GL_APIENTRY _es_TexGenfv(GLenum coord, GLenum pname, GLfloat const * params);
3988 static void GL_APIENTRY _check_TexGenivOES(GLenum coord, GLenum pname, const GLint *params)
3990 register unsigned int i;
3991 unsigned int n_params = 1;
3992 GLfloat converted_params[1];
3995 case GL_TEXTURE_GEN_STR_OES:
3998 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexGenivOES(coord=0x%x)", coord);
4002 case GL_TEXTURE_GEN_MODE_OES:
4003 if (params[0] != GL_NORMAL_MAP_OES && params[0] != GL_REFLECTION_MAP_OES) {
4004 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexGenivOES(pname=0x%x)", pname);
4010 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexGenivOES(pname=0x%x)", pname);
4014 for (i = 0; i < n_params; i++) {
4015 converted_params[i] = (GLfloat) params[i];
4018 _es_TexGenfv(coord, pname, converted_params);
4021 /* this function is special and is defined elsewhere */
4022 extern void GL_APIENTRY _es_TexGenf(GLenum coord, GLenum pname, GLfloat param);
4023 static void GL_APIENTRY _check_TexGenxOES(GLenum coord, GLenum pname, GLfixed param)
4025 GLfloat converted_param;
4028 case GL_TEXTURE_GEN_STR_OES:
4031 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexGenxOES(coord=0x%x)", coord);
4035 case GL_TEXTURE_GEN_MODE_OES:
4036 if (param != GL_NORMAL_MAP_OES && param != GL_REFLECTION_MAP_OES) {
4037 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexGenxOES(pname=0x%x)", pname);
4042 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexGenxOES(pname=0x%x)", pname);
4046 converted_param = (GLfloat) param;
4048 _es_TexGenf(coord, pname, converted_param);
4051 /* this function is special and is defined elsewhere */
4052 extern void GL_APIENTRY _es_TexGenfv(GLenum coord, GLenum pname, GLfloat const * params);
4053 static void GL_APIENTRY _check_TexGenxvOES(GLenum coord, GLenum pname, const GLfixed *params)
4055 register unsigned int i;
4056 unsigned int n_params = 1;
4057 GLfloat converted_params[1];
4060 case GL_TEXTURE_GEN_STR_OES:
4063 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexGenxvOES(coord=0x%x)", coord);
4067 case GL_TEXTURE_GEN_MODE_OES:
4068 if (params[0] != GL_NORMAL_MAP_OES && params[0] != GL_REFLECTION_MAP_OES) {
4069 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexGenxvOES(pname=0x%x)", pname);
4075 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexGenxvOES(pname=0x%x)", pname);
4079 for (i = 0; i < n_params; i++) {
4080 converted_params[i] = (GLfloat) params[i];
4083 _es_TexGenfv(coord, pname, converted_params);
4086 extern void GL_APIENTRY _mesa_TexImage2D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels);
4087 static void GL_APIENTRY _es_TexImage2D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
4091 case GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES:
4092 case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES:
4093 case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES:
4094 case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES:
4095 case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES:
4096 case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES:
4099 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexImage2D(target=0x%x)", target);
4102 switch(internalFormat) {
4104 if (format != GL_ALPHA) {
4105 _mesa_error(_mesa_get_current_context(), GL_INVALID_VALUE, "glTexImage2D(internalFormat=0x%x)", internalFormat);
4110 if (format != GL_RGB) {
4111 _mesa_error(_mesa_get_current_context(), GL_INVALID_VALUE, "glTexImage2D(internalFormat=0x%x)", internalFormat);
4116 if (format != GL_RGBA) {
4117 _mesa_error(_mesa_get_current_context(), GL_INVALID_VALUE, "glTexImage2D(internalFormat=0x%x)", internalFormat);
4122 if (format != GL_LUMINANCE) {
4123 _mesa_error(_mesa_get_current_context(), GL_INVALID_VALUE, "glTexImage2D(internalFormat=0x%x)", internalFormat);
4127 case GL_LUMINANCE_ALPHA:
4128 if (format != GL_LUMINANCE_ALPHA) {
4129 _mesa_error(_mesa_get_current_context(), GL_INVALID_VALUE, "glTexImage2D(internalFormat=0x%x)", internalFormat);
4134 _mesa_error(_mesa_get_current_context(), GL_INVALID_VALUE, "glTexImage2D(internalFormat=%d)", internalFormat);
4141 _mesa_error(_mesa_get_current_context(), GL_INVALID_VALUE, "glTexImage2D(border=%d)", border);
4146 if (type != GL_UNSIGNED_BYTE) {
4147 _mesa_error(_mesa_get_current_context(), GL_INVALID_OPERATION, "glTexImage2D(format=0x%x)", format);
4152 if (type != GL_UNSIGNED_BYTE && type != GL_UNSIGNED_SHORT_5_6_5) {
4153 _mesa_error(_mesa_get_current_context(), GL_INVALID_OPERATION, "glTexImage2D(format=0x%x)", format);
4158 if (type != GL_UNSIGNED_BYTE && type != GL_UNSIGNED_SHORT_4_4_4_4 && type != GL_UNSIGNED_SHORT_5_5_5_1) {
4159 _mesa_error(_mesa_get_current_context(), GL_INVALID_OPERATION, "glTexImage2D(format=0x%x)", format);
4164 case GL_LUMINANCE_ALPHA:
4165 if (type != GL_UNSIGNED_BYTE) {
4166 _mesa_error(_mesa_get_current_context(), GL_INVALID_OPERATION, "glTexImage2D(format=0x%x)", format);
4171 _mesa_error(_mesa_get_current_context(), GL_INVALID_OPERATION, "glTexImage2D(format=0x%x)", format);
4175 _mesa_TexImage2D(target, level, internalFormat, width, height, border, format, type, pixels);
4178 extern void GL_APIENTRY _mesa_TexParameterf(GLenum target, GLenum pname, GLfloat param);
4179 static void GL_APIENTRY _es_TexParameterf(GLenum target, GLenum pname, GLfloat param)
4183 case GL_TEXTURE_CUBE_MAP_OES:
4186 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexParameterf(target=0x%x)", target);
4190 case GL_TEXTURE_WRAP_S:
4191 case GL_TEXTURE_WRAP_T:
4192 if (param != GL_CLAMP_TO_EDGE && param != GL_REPEAT && param != GL_MIRRORED_REPEAT_OES) {
4193 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexParameterf(pname=0x%x)", pname);
4197 case GL_TEXTURE_MIN_FILTER:
4198 if (param != GL_NEAREST && param != GL_LINEAR && param != GL_NEAREST_MIPMAP_NEAREST && param != GL_NEAREST_MIPMAP_LINEAR && param != GL_LINEAR_MIPMAP_NEAREST && param != GL_LINEAR_MIPMAP_LINEAR) {
4199 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexParameterf(pname=0x%x)", pname);
4203 case GL_TEXTURE_MAG_FILTER:
4204 if (param != GL_NEAREST && param != GL_LINEAR) {
4205 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexParameterf(pname=0x%x)", pname);
4209 case GL_GENERATE_MIPMAP:
4210 if (param != GL_TRUE && param != GL_FALSE) {
4211 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexParameterf(pname=0x%x)", pname);
4215 case GL_TEXTURE_MAX_ANISOTROPY_EXT:
4218 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexParameterf(pname=0x%x)", pname);
4222 _mesa_TexParameterf(target, pname, param);
4225 extern void GL_APIENTRY _mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat * params);
4226 static void GL_APIENTRY _es_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params)
4230 case GL_TEXTURE_CUBE_MAP_OES:
4233 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexParameterfv(target=0x%x)", target);
4237 case GL_TEXTURE_WRAP_S: /* size 1 */
4238 case GL_TEXTURE_WRAP_T: /* size 1 */
4239 if (params[0] != GL_CLAMP_TO_EDGE && params[0] != GL_REPEAT && params[0] != GL_MIRRORED_REPEAT_OES) {
4240 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexParameterfv(pname=0x%x)", pname);
4244 case GL_TEXTURE_MIN_FILTER: /* size 1 */
4245 if (params[0] != GL_NEAREST && params[0] != GL_LINEAR && params[0] != GL_NEAREST_MIPMAP_NEAREST && params[0] != GL_NEAREST_MIPMAP_LINEAR && params[0] != GL_LINEAR_MIPMAP_NEAREST && params[0] != GL_LINEAR_MIPMAP_LINEAR) {
4246 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexParameterfv(pname=0x%x)", pname);
4250 case GL_TEXTURE_MAG_FILTER: /* size 1 */
4251 if (params[0] != GL_NEAREST && params[0] != GL_LINEAR) {
4252 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexParameterfv(pname=0x%x)", pname);
4256 case GL_GENERATE_MIPMAP: /* size 1 */
4257 if (params[0] != GL_TRUE && params[0] != GL_FALSE) {
4258 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexParameterfv(pname=0x%x)", pname);
4262 case GL_TEXTURE_MAX_ANISOTROPY_EXT: /* size 1 */
4263 case GL_TEXTURE_CROP_RECT_OES: /* size 4 */
4266 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexParameterfv(pname=0x%x)", pname);
4270 _mesa_TexParameterfv(target, pname, params);
4273 extern void GL_APIENTRY _mesa_TexParameteri(GLenum target, GLenum pname, GLint param);
4274 static void GL_APIENTRY _es_TexParameteri(GLenum target, GLenum pname, GLint param)
4278 case GL_TEXTURE_CUBE_MAP_OES:
4281 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexParameteri(target=0x%x)", target);
4285 case GL_TEXTURE_WRAP_S:
4286 case GL_TEXTURE_WRAP_T:
4287 if (param != GL_CLAMP_TO_EDGE && param != GL_REPEAT && param != GL_MIRRORED_REPEAT_OES) {
4288 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexParameteri(pname=0x%x)", pname);
4292 case GL_TEXTURE_MIN_FILTER:
4293 if (param != GL_NEAREST && param != GL_LINEAR && param != GL_NEAREST_MIPMAP_NEAREST && param != GL_NEAREST_MIPMAP_LINEAR && param != GL_LINEAR_MIPMAP_NEAREST && param != GL_LINEAR_MIPMAP_LINEAR) {
4294 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexParameteri(pname=0x%x)", pname);
4298 case GL_TEXTURE_MAG_FILTER:
4299 if (param != GL_NEAREST && param != GL_LINEAR) {
4300 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexParameteri(pname=0x%x)", pname);
4304 case GL_GENERATE_MIPMAP:
4305 if (param != GL_TRUE && param != GL_FALSE) {
4306 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexParameteri(pname=0x%x)", pname);
4310 case GL_TEXTURE_MAX_ANISOTROPY_EXT:
4313 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexParameteri(pname=0x%x)", pname);
4317 _mesa_TexParameteri(target, pname, param);
4320 extern void GL_APIENTRY _mesa_TexParameteriv(GLenum target, GLenum pname, const GLint * params);
4321 static void GL_APIENTRY _es_TexParameteriv(GLenum target, GLenum pname, const GLint *params)
4325 case GL_TEXTURE_CUBE_MAP_OES:
4328 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexParameteriv(target=0x%x)", target);
4332 case GL_TEXTURE_WRAP_S: /* size 1 */
4333 case GL_TEXTURE_WRAP_T: /* size 1 */
4334 if (params[0] != GL_CLAMP_TO_EDGE && params[0] != GL_REPEAT && params[0] != GL_MIRRORED_REPEAT_OES) {
4335 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexParameteriv(pname=0x%x)", pname);
4339 case GL_TEXTURE_MIN_FILTER: /* size 1 */
4340 if (params[0] != GL_NEAREST && params[0] != GL_LINEAR && params[0] != GL_NEAREST_MIPMAP_NEAREST && params[0] != GL_NEAREST_MIPMAP_LINEAR && params[0] != GL_LINEAR_MIPMAP_NEAREST && params[0] != GL_LINEAR_MIPMAP_LINEAR) {
4341 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexParameteriv(pname=0x%x)", pname);
4345 case GL_TEXTURE_MAG_FILTER: /* size 1 */
4346 if (params[0] != GL_NEAREST && params[0] != GL_LINEAR) {
4347 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexParameteriv(pname=0x%x)", pname);
4351 case GL_GENERATE_MIPMAP: /* size 1 */
4352 if (params[0] != GL_TRUE && params[0] != GL_FALSE) {
4353 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexParameteriv(pname=0x%x)", pname);
4357 case GL_TEXTURE_MAX_ANISOTROPY_EXT: /* size 1 */
4358 case GL_TEXTURE_CROP_RECT_OES: /* size 4 */
4361 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexParameteriv(pname=0x%x)", pname);
4365 _mesa_TexParameteriv(target, pname, params);
4368 extern void GL_APIENTRY _mesa_TexParameterf(GLenum target, GLenum pname, GLfloat param);
4369 static void GL_APIENTRY _es_TexParameterx(GLenum target, GLenum pname, GLfixed param)
4371 GLfloat converted_param;
4372 int convert_param_value = 1;
4376 case GL_TEXTURE_CUBE_MAP_OES:
4379 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexParameterx(target=0x%x)", target);
4383 case GL_TEXTURE_WRAP_S:
4384 case GL_TEXTURE_WRAP_T:
4385 if (param != GL_CLAMP_TO_EDGE && param != GL_REPEAT && param != GL_MIRRORED_REPEAT_OES) {
4386 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexParameterx(pname=0x%x)", pname);
4389 convert_param_value = 0;
4391 case GL_TEXTURE_MIN_FILTER:
4392 if (param != GL_NEAREST && param != GL_LINEAR && param != GL_NEAREST_MIPMAP_NEAREST && param != GL_NEAREST_MIPMAP_LINEAR && param != GL_LINEAR_MIPMAP_NEAREST && param != GL_LINEAR_MIPMAP_LINEAR) {
4393 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexParameterx(pname=0x%x)", pname);
4396 convert_param_value = 0;
4398 case GL_TEXTURE_MAG_FILTER:
4399 if (param != GL_NEAREST && param != GL_LINEAR) {
4400 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexParameterx(pname=0x%x)", pname);
4403 convert_param_value = 0;
4405 case GL_GENERATE_MIPMAP:
4406 if (param != GL_TRUE && param != GL_FALSE) {
4407 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexParameterx(pname=0x%x)", pname);
4410 convert_param_value = 0;
4412 case GL_TEXTURE_MAX_ANISOTROPY_EXT:
4415 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexParameterx(pname=0x%x)", pname);
4419 if (convert_param_value) {
4420 converted_param = (GLfloat) (param / 65536.0f);
4422 converted_param = (GLfloat) param;
4425 _mesa_TexParameterf(target, pname, converted_param);
4428 extern void GL_APIENTRY _mesa_TexParameterfv(GLenum target, GLenum pname, GLfloat const * params);
4429 static void GL_APIENTRY _es_TexParameterxv(GLenum target, GLenum pname, const GLfixed *params)
4431 register unsigned int i;
4432 unsigned int n_params = 4;
4433 GLfloat converted_params[4];
4434 int convert_params_value = 1;
4438 case GL_TEXTURE_CUBE_MAP_OES:
4441 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexParameterxv(target=0x%x)", target);
4445 case GL_TEXTURE_WRAP_S:
4446 case GL_TEXTURE_WRAP_T:
4447 if (params[0] != GL_CLAMP_TO_EDGE && params[0] != GL_REPEAT && params[0] != GL_MIRRORED_REPEAT_OES) {
4448 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexParameterxv(pname=0x%x)", pname);
4451 convert_params_value = 0;
4454 case GL_TEXTURE_MIN_FILTER:
4455 if (params[0] != GL_NEAREST && params[0] != GL_LINEAR && params[0] != GL_NEAREST_MIPMAP_NEAREST && params[0] != GL_NEAREST_MIPMAP_LINEAR && params[0] != GL_LINEAR_MIPMAP_NEAREST && params[0] != GL_LINEAR_MIPMAP_LINEAR) {
4456 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexParameterxv(pname=0x%x)", pname);
4459 convert_params_value = 0;
4462 case GL_TEXTURE_MAG_FILTER:
4463 if (params[0] != GL_NEAREST && params[0] != GL_LINEAR) {
4464 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexParameterxv(pname=0x%x)", pname);
4467 convert_params_value = 0;
4470 case GL_GENERATE_MIPMAP:
4471 if (params[0] != GL_TRUE && params[0] != GL_FALSE) {
4472 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexParameterxv(pname=0x%x)", pname);
4475 convert_params_value = 0;
4478 case GL_TEXTURE_MAX_ANISOTROPY_EXT:
4481 case GL_TEXTURE_CROP_RECT_OES:
4485 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexParameterxv(pname=0x%x)", pname);
4489 if (convert_params_value) {
4490 for (i = 0; i < n_params; i++) {
4491 converted_params[i] = (GLfloat) (params[i] / 65536.0f);
4494 for (i = 0; i < n_params; i++) {
4495 converted_params[i] = (GLfloat) params[i];
4499 _mesa_TexParameterfv(target, pname, converted_params);
4502 extern void GL_APIENTRY _mesa_TexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels);
4503 static void GL_APIENTRY _es_TexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
4507 case GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES:
4508 case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES:
4509 case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES:
4510 case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES:
4511 case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES:
4512 case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES:
4515 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glTexSubImage2D(target=0x%x)", target);
4520 if (type != GL_UNSIGNED_BYTE) {
4521 _mesa_error(_mesa_get_current_context(), GL_INVALID_OPERATION, "glTexSubImage2D(format=0x%x)", format);
4526 if (type != GL_UNSIGNED_BYTE && type != GL_UNSIGNED_SHORT_5_6_5) {
4527 _mesa_error(_mesa_get_current_context(), GL_INVALID_OPERATION, "glTexSubImage2D(format=0x%x)", format);
4532 if (type != GL_UNSIGNED_BYTE && type != GL_UNSIGNED_SHORT_4_4_4_4 && type != GL_UNSIGNED_SHORT_5_5_5_1) {
4533 _mesa_error(_mesa_get_current_context(), GL_INVALID_OPERATION, "glTexSubImage2D(format=0x%x)", format);
4538 case GL_LUMINANCE_ALPHA:
4539 if (type != GL_UNSIGNED_BYTE) {
4540 _mesa_error(_mesa_get_current_context(), GL_INVALID_OPERATION, "glTexSubImage2D(format=0x%x)", format);
4545 _mesa_error(_mesa_get_current_context(), GL_INVALID_OPERATION, "glTexSubImage2D(format=0x%x)", format);
4549 _mesa_TexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
4552 extern void GL_APIENTRY _mesa_Translatef(GLfloat x, GLfloat y, GLfloat z);
4553 #define _es_Translatef _mesa_Translatef
4555 extern void GL_APIENTRY _mesa_Translatef(GLfloat x, GLfloat y, GLfloat z);
4556 static void GL_APIENTRY _es_Translatex(GLfixed x, GLfixed y, GLfixed z)
4558 GLfloat converted_x;
4559 GLfloat converted_y;
4560 GLfloat converted_z;
4562 converted_x = (GLfloat) (x / 65536.0f);
4563 converted_y = (GLfloat) (y / 65536.0f);
4564 converted_z = (GLfloat) (z / 65536.0f);
4566 _mesa_Translatef(converted_x, converted_y, converted_z);
4569 extern GLboolean GL_APIENTRY _mesa_UnmapBufferARB(GLenum target);
4570 static GLboolean GL_APIENTRY _es_UnmapBufferOES(GLenum target)
4573 case GL_ARRAY_BUFFER:
4574 case GL_ELEMENT_ARRAY_BUFFER:
4577 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glUnmapBufferOES(target=0x%x)", target);
4581 return _mesa_UnmapBufferARB(target);
4584 extern void GL_APIENTRY _mesa_VertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer);
4585 static void GL_APIENTRY _es_VertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)
4593 _mesa_error(_mesa_get_current_context(), GL_INVALID_VALUE, "glVertexPointer(size=%d)", size);
4603 _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM, "glVertexPointer(type=0x%x)", type);
4607 _mesa_VertexPointer(size, type, stride, pointer);
4610 extern void GL_APIENTRY _mesa_Viewport(GLint x, GLint y, GLsizei width, GLsizei height);
4611 #define _es_Viewport _mesa_Viewport
4614 #include "glapi/glapi.h"
4616 #if FEATURE_remap_table
4618 /* define esLocalRemapTable */
4619 #include "es1api/main/dispatch.h"
4621 #define need_MESA_remap_table
4622 #include "es1api/main/remap_helper.h"
4625 init_remap_table(void)
4627 _glthread_DECLARE_STATIC_MUTEX(mutex);
4628 static GLboolean initialized = GL_FALSE;
4629 const struct gl_function_pool_remap *remap = MESA_remap_table_functions;
4632 _glthread_LOCK_MUTEX(mutex);
4634 _glthread_UNLOCK_MUTEX(mutex);
4638 for (i = 0; i < esLocalRemapTable_size; i++) {
4643 ASSERT(i == remap[i].remap_index);
4644 spec = _mesa_function_pool + remap[i].pool_index;
4646 offset = _mesa_map_function_spec(spec);
4647 esLocalRemapTable[i] = offset;
4649 initialized = GL_TRUE;
4650 _glthread_UNLOCK_MUTEX(mutex);
4653 #else /* FEATURE_remap_table */
4655 #include "es1api/main/dispatch.h"
4658 init_remap_table(void)
4662 #endif /* FEATURE_remap_table */
4664 struct _glapi_table *
4665 _mesa_create_exec_table_es1(void)
4667 struct _glapi_table *exec;
4669 exec = _mesa_alloc_dispatch_table(_gloffset_COUNT);
4675 SET_ActiveTexture(exec, _es_ActiveTexture);
4676 SET_AlphaFunc(exec, _es_AlphaFunc);
4677 SET_AlphaFuncx(exec, _es_AlphaFuncx);
4678 SET_BindBuffer(exec, _es_BindBuffer);
4679 SET_BindFramebufferOES(exec, _es_BindFramebufferOES);
4680 SET_BindRenderbufferOES(exec, _es_BindRenderbufferOES);
4681 SET_BindTexture(exec, _es_BindTexture);
4682 SET_BlendEquationOES(exec, _es_BlendEquationOES);
4683 SET_BlendEquationSeparateOES(exec, _es_BlendEquationSeparateOES);
4684 SET_BlendFunc(exec, _es_BlendFunc);
4685 SET_BlendFuncSeparateOES(exec, _es_BlendFuncSeparateOES);
4686 SET_BufferData(exec, _es_BufferData);
4687 SET_BufferSubData(exec, _es_BufferSubData);
4688 SET_CheckFramebufferStatusOES(exec, _es_CheckFramebufferStatusOES);
4689 SET_Clear(exec, _es_Clear);
4690 SET_ClearColor(exec, _es_ClearColor);
4691 SET_ClearColorx(exec, _es_ClearColorx);
4692 SET_ClearDepthf(exec, _es_ClearDepthf);
4693 SET_ClearDepthx(exec, _es_ClearDepthx);
4694 SET_ClearStencil(exec, _es_ClearStencil);
4695 SET_ClientActiveTexture(exec, _es_ClientActiveTexture);
4696 SET_ClipPlanef(exec, _es_ClipPlanef);
4697 SET_ClipPlanex(exec, _es_ClipPlanex);
4698 SET_Color4f(exec, _check_Color4f);
4699 SET_Color4ub(exec, _es_Color4ub);
4700 SET_Color4x(exec, _es_Color4x);
4701 SET_ColorMask(exec, _es_ColorMask);
4702 SET_ColorPointer(exec, _es_ColorPointer);
4703 SET_CompressedTexImage2D(exec, _es_CompressedTexImage2D);
4704 SET_CompressedTexSubImage2D(exec, _es_CompressedTexSubImage2D);
4705 SET_CopyTexImage2D(exec, _es_CopyTexImage2D);
4706 SET_CopyTexSubImage2D(exec, _es_CopyTexSubImage2D);
4707 SET_CullFace(exec, _es_CullFace);
4708 SET_DeleteBuffers(exec, _es_DeleteBuffers);
4709 SET_DeleteFramebuffersOES(exec, _es_DeleteFramebuffersOES);
4710 SET_DeleteRenderbuffersOES(exec, _es_DeleteRenderbuffersOES);
4711 SET_DeleteTextures(exec, _es_DeleteTextures);
4712 SET_DepthFunc(exec, _es_DepthFunc);
4713 SET_DepthMask(exec, _es_DepthMask);
4714 SET_DepthRangef(exec, _es_DepthRangef);
4715 SET_DepthRangex(exec, _es_DepthRangex);
4716 SET_Disable(exec, _es_Disable);
4717 SET_DisableClientState(exec, _es_DisableClientState);
4718 SET_DrawArrays(exec, _es_DrawArrays);
4719 SET_DrawElements(exec, _es_DrawElements);
4720 SET_DrawTexfOES(exec, _es_DrawTexfOES);
4721 SET_DrawTexfvOES(exec, _es_DrawTexfvOES);
4722 SET_DrawTexiOES(exec, _es_DrawTexiOES);
4723 SET_DrawTexivOES(exec, _es_DrawTexivOES);
4724 SET_DrawTexsOES(exec, _es_DrawTexsOES);
4725 SET_DrawTexsvOES(exec, _es_DrawTexsvOES);
4726 SET_DrawTexxOES(exec, _es_DrawTexxOES);
4727 SET_DrawTexxvOES(exec, _es_DrawTexxvOES);
4728 SET_EGLImageTargetRenderbufferStorageOES(exec, _es_EGLImageTargetRenderbufferStorageOES);
4729 SET_EGLImageTargetTexture2DOES(exec, _es_EGLImageTargetTexture2DOES);
4730 SET_Enable(exec, _es_Enable);
4731 SET_EnableClientState(exec, _es_EnableClientState);
4732 SET_Finish(exec, _es_Finish);
4733 SET_Flush(exec, _es_Flush);
4734 SET_Fogf(exec, _es_Fogf);
4735 SET_Fogfv(exec, _es_Fogfv);
4736 SET_Fogx(exec, _es_Fogx);
4737 SET_Fogxv(exec, _es_Fogxv);
4738 SET_FramebufferRenderbufferOES(exec, _es_FramebufferRenderbufferOES);
4739 SET_FramebufferTexture2DOES(exec, _es_FramebufferTexture2DOES);
4740 SET_FrontFace(exec, _es_FrontFace);
4741 SET_Frustumf(exec, _es_Frustumf);
4742 SET_Frustumx(exec, _es_Frustumx);
4743 SET_GenBuffers(exec, _es_GenBuffers);
4744 SET_GenFramebuffersOES(exec, _es_GenFramebuffersOES);
4745 SET_GenRenderbuffersOES(exec, _es_GenRenderbuffersOES);
4746 SET_GenTextures(exec, _es_GenTextures);
4747 SET_GenerateMipmapOES(exec, _es_GenerateMipmapOES);
4748 SET_GetBooleanv(exec, _es_GetBooleanv);
4749 SET_GetBufferParameteriv(exec, _es_GetBufferParameteriv);
4750 SET_GetBufferPointervOES(exec, _es_GetBufferPointervOES);
4751 SET_GetClipPlanef(exec, _es_GetClipPlanef);
4752 SET_GetClipPlanex(exec, _es_GetClipPlanex);
4753 SET_GetError(exec, _es_GetError);
4754 SET_GetFixedv(exec, _es_GetFixedv);
4755 SET_GetFloatv(exec, _es_GetFloatv);
4756 SET_GetFramebufferAttachmentParameterivOES(exec, _es_GetFramebufferAttachmentParameterivOES);
4757 SET_GetIntegerv(exec, _es_GetIntegerv);
4758 SET_GetLightfv(exec, _es_GetLightfv);
4759 SET_GetLightxv(exec, _es_GetLightxv);
4760 SET_GetMaterialfv(exec, _es_GetMaterialfv);
4761 SET_GetMaterialxv(exec, _es_GetMaterialxv);
4762 SET_GetPointerv(exec, _es_GetPointerv);
4763 SET_GetRenderbufferParameterivOES(exec, _es_GetRenderbufferParameterivOES);
4764 SET_GetString(exec, _es_GetString);
4765 SET_GetTexEnvfv(exec, _es_GetTexEnvfv);
4766 SET_GetTexEnviv(exec, _es_GetTexEnviv);
4767 SET_GetTexEnvxv(exec, _es_GetTexEnvxv);
4768 SET_GetTexGenfvOES(exec, _check_GetTexGenfvOES);
4769 SET_GetTexGenivOES(exec, _check_GetTexGenivOES);
4770 SET_GetTexGenxvOES(exec, _check_GetTexGenxvOES);
4771 SET_GetTexParameterfv(exec, _es_GetTexParameterfv);
4772 SET_GetTexParameteriv(exec, _es_GetTexParameteriv);
4773 SET_GetTexParameterxv(exec, _es_GetTexParameterxv);
4774 SET_Hint(exec, _es_Hint);
4775 SET_IsBuffer(exec, _es_IsBuffer);
4776 SET_IsEnabled(exec, _es_IsEnabled);
4777 SET_IsFramebufferOES(exec, _es_IsFramebufferOES);
4778 SET_IsRenderbufferOES(exec, _es_IsRenderbufferOES);
4779 SET_IsTexture(exec, _es_IsTexture);
4780 SET_LightModelf(exec, _es_LightModelf);
4781 SET_LightModelfv(exec, _es_LightModelfv);
4782 SET_LightModelx(exec, _es_LightModelx);
4783 SET_LightModelxv(exec, _es_LightModelxv);
4784 SET_Lightf(exec, _es_Lightf);
4785 SET_Lightfv(exec, _es_Lightfv);
4786 SET_Lightx(exec, _es_Lightx);
4787 SET_Lightxv(exec, _es_Lightxv);
4788 SET_LineWidth(exec, _es_LineWidth);
4789 SET_LineWidthx(exec, _es_LineWidthx);
4790 SET_LoadIdentity(exec, _es_LoadIdentity);
4791 SET_LoadMatrixf(exec, _es_LoadMatrixf);
4792 SET_LoadMatrixx(exec, _es_LoadMatrixx);
4793 SET_LogicOp(exec, _es_LogicOp);
4794 SET_MapBufferOES(exec, _es_MapBufferOES);
4795 SET_Materialf(exec, _check_Materialf);
4796 SET_Materialfv(exec, _check_Materialfv);
4797 SET_Materialx(exec, _es_Materialx);
4798 SET_Materialxv(exec, _es_Materialxv);
4799 SET_MatrixMode(exec, _es_MatrixMode);
4800 SET_MultMatrixf(exec, _es_MultMatrixf);
4801 SET_MultMatrixx(exec, _es_MultMatrixx);
4802 SET_MultiDrawArraysEXT(exec, _es_MultiDrawArraysEXT);
4803 SET_MultiDrawElementsEXT(exec, _es_MultiDrawElementsEXT);
4804 SET_MultiTexCoord4f(exec, _check_MultiTexCoord4f);
4805 SET_MultiTexCoord4x(exec, _es_MultiTexCoord4x);
4806 SET_Normal3f(exec, _check_Normal3f);
4807 SET_Normal3x(exec, _es_Normal3x);
4808 SET_NormalPointer(exec, _es_NormalPointer);
4809 SET_Orthof(exec, _es_Orthof);
4810 SET_Orthox(exec, _es_Orthox);
4811 SET_PixelStorei(exec, _es_PixelStorei);
4812 SET_PointParameterf(exec, _es_PointParameterf);
4813 SET_PointParameterfv(exec, _es_PointParameterfv);
4814 SET_PointParameterx(exec, _es_PointParameterx);
4815 SET_PointParameterxv(exec, _es_PointParameterxv);
4816 SET_PointSize(exec, _es_PointSize);
4817 SET_PointSizePointerOES(exec, _es_PointSizePointerOES);
4818 SET_PointSizex(exec, _es_PointSizex);
4819 SET_PolygonOffset(exec, _es_PolygonOffset);
4820 SET_PolygonOffsetx(exec, _es_PolygonOffsetx);
4821 SET_PopMatrix(exec, _es_PopMatrix);
4822 SET_PushMatrix(exec, _es_PushMatrix);
4823 SET_QueryMatrixxOES(exec, _check_QueryMatrixxOES);
4824 SET_ReadPixels(exec, _es_ReadPixels);
4825 SET_RenderbufferStorageOES(exec, _check_RenderbufferStorageOES);
4826 SET_Rotatef(exec, _es_Rotatef);
4827 SET_Rotatex(exec, _es_Rotatex);
4828 SET_SampleCoverage(exec, _es_SampleCoverage);
4829 SET_SampleCoveragex(exec, _es_SampleCoveragex);
4830 SET_Scalef(exec, _es_Scalef);
4831 SET_Scalex(exec, _es_Scalex);
4832 SET_Scissor(exec, _es_Scissor);
4833 SET_ShadeModel(exec, _es_ShadeModel);
4834 SET_StencilFunc(exec, _es_StencilFunc);
4835 SET_StencilMask(exec, _es_StencilMask);
4836 SET_StencilOp(exec, _es_StencilOp);
4837 SET_TexCoordPointer(exec, _es_TexCoordPointer);
4838 SET_TexEnvf(exec, _es_TexEnvf);
4839 SET_TexEnvfv(exec, _es_TexEnvfv);
4840 SET_TexEnvi(exec, _es_TexEnvi);
4841 SET_TexEnviv(exec, _es_TexEnviv);
4842 SET_TexEnvx(exec, _es_TexEnvx);
4843 SET_TexEnvxv(exec, _es_TexEnvxv);
4844 SET_TexGenfOES(exec, _check_TexGenfOES);
4845 SET_TexGenfvOES(exec, _check_TexGenfvOES);
4846 SET_TexGeniOES(exec, _check_TexGeniOES);
4847 SET_TexGenivOES(exec, _check_TexGenivOES);
4848 SET_TexGenxOES(exec, _check_TexGenxOES);
4849 SET_TexGenxvOES(exec, _check_TexGenxvOES);
4850 SET_TexImage2D(exec, _es_TexImage2D);
4851 SET_TexParameterf(exec, _es_TexParameterf);
4852 SET_TexParameterfv(exec, _es_TexParameterfv);
4853 SET_TexParameteri(exec, _es_TexParameteri);
4854 SET_TexParameteriv(exec, _es_TexParameteriv);
4855 SET_TexParameterx(exec, _es_TexParameterx);
4856 SET_TexParameterxv(exec, _es_TexParameterxv);
4857 SET_TexSubImage2D(exec, _es_TexSubImage2D);
4858 SET_Translatef(exec, _es_Translatef);
4859 SET_Translatex(exec, _es_Translatex);
4860 SET_UnmapBufferOES(exec, _es_UnmapBufferOES);
4861 SET_VertexPointer(exec, _es_VertexPointer);
4862 SET_Viewport(exec, _es_Viewport);
4867 #endif /* FEATURE_ES1 */