Merge remote branch 'origin/7.8'
[mesa.git] / src / mesa / es / main / stubs.c
1 /**************************************************************************
2 *
3 * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * TUNGSTEN GRAPHICS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
21 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * SOFTWARE.
23 **************************************************************************/
24
25
26 /**
27 * Temporary stubs for "missing" mesa functions.
28 */
29
30
31 #include "main/mtypes.h"
32 #include "main/imports.h"
33 #include "vbo/vbo.h"
34
35 #define NEED_IMPLEMENT() do { \
36 GET_CURRENT_CONTEXT(ctx); \
37 _mesa_error(ctx, GL_INVALID_OPERATION, __FUNCTION__); \
38 } while (0)
39
40
41 /* silence compiler warnings */
42 extern void GLAPIENTRY _vbo_Materialf(GLenum face, GLenum pname, GLfloat param);
43 extern void GLAPIENTRY _mesa_GetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
44 extern void GLAPIENTRY _mesa_ReleaseShaderCompiler(void);
45 extern void GLAPIENTRY _mesa_ShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLint length);
46 extern void GLAPIENTRY _vbo_VertexAttrib1f(GLuint indx, GLfloat x);
47 extern void GLAPIENTRY _vbo_VertexAttrib1fv(GLuint indx, const GLfloat* values);
48 extern void GLAPIENTRY _vbo_VertexAttrib2f(GLuint indx, GLfloat x, GLfloat y);
49 extern void GLAPIENTRY _vbo_VertexAttrib2fv(GLuint indx, const GLfloat* values);
50 extern void GLAPIENTRY _vbo_VertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
51 extern void GLAPIENTRY _vbo_VertexAttrib3fv(GLuint indx, const GLfloat* values);
52 extern void GLAPIENTRY _vbo_VertexAttrib4fv(GLuint indx, const GLfloat* values);
53
54
55 void GLAPIENTRY
56 _vbo_Materialf(GLenum face, GLenum pname, GLfloat param)
57 {
58 _vbo_Materialfv(face, pname, &param);
59 }
60
61
62 void GLAPIENTRY
63 _mesa_GetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype,
64 GLint* range, GLint* precision)
65 {
66 NEED_IMPLEMENT();
67 }
68
69
70 void GLAPIENTRY
71 _mesa_ReleaseShaderCompiler(void)
72 {
73 NEED_IMPLEMENT();
74 }
75
76
77 void GLAPIENTRY
78 _mesa_ShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat,
79 const void* binary, GLint length)
80 {
81 NEED_IMPLEMENT();
82 }
83
84
85 void GLAPIENTRY
86 _vbo_VertexAttrib1f(GLuint indx, GLfloat x)
87 {
88 _vbo_VertexAttrib4f(indx, x, 0.0, 0.0, 1.0f);
89 }
90
91
92 void GLAPIENTRY
93 _vbo_VertexAttrib1fv(GLuint indx, const GLfloat* values)
94 {
95 _vbo_VertexAttrib4f(indx, values[0], 0.0, 0.0, 1.0f);
96 }
97
98
99 void GLAPIENTRY
100 _vbo_VertexAttrib2f(GLuint indx, GLfloat x, GLfloat y)
101 {
102 _vbo_VertexAttrib4f(indx, x, y, 0.0, 1.0f);
103 }
104
105
106 void GLAPIENTRY
107 _vbo_VertexAttrib2fv(GLuint indx, const GLfloat* values)
108 {
109 _vbo_VertexAttrib4f(indx, values[0], values[1], 0.0, 1.0f);
110 }
111
112
113 void GLAPIENTRY
114 _vbo_VertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z)
115 {
116 _vbo_VertexAttrib4f(indx, x, y, z, 1.0f);
117 }
118
119
120 void GLAPIENTRY
121 _vbo_VertexAttrib3fv(GLuint indx, const GLfloat* values)
122 {
123 _vbo_VertexAttrib4f(indx, values[0], values[1], values[2], 1.0f);
124 }
125
126
127 void GLAPIENTRY
128 _vbo_VertexAttrib4fv(GLuint indx, const GLfloat* values)
129 {
130 _vbo_VertexAttrib4f(indx, values[0], values[1], values[2], values[3]);
131 }