1 /*
2  * Copyright (c) 2002-2008 LWJGL Project
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are
7  * met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  *   notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  *   notice, this list of conditions and the following disclaimer in the
14  *   documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of 'LWJGL' nor the names of
17  *   its contributors may be used to endorse or promote products derived
18  *   from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 package org.lwjgl.opengl;
33 
34 import org.lwjgl.util.generator.*;
35 import org.lwjgl.util.generator.opengl.*;
36 
37 import java.nio.*;
38 
39 public interface ARB_vertex_shader {
40 
41 	/**
42 	 * Accepted by the <shaderType> argument of CreateShaderObjectARB and
43 	 * returned by the <params> parameter of GetObjectParameter{if}vARB:
44 	 */
45 	int GL_VERTEX_SHADER_ARB = 0x8B31;
46 
47 	/**
48 	 * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
49 	 * GetFloatv, and GetDoublev:
50 	 */
51 	int GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB    = 0x8B4A;
52 	int GL_MAX_VARYING_FLOATS_ARB               = 0x8B4B;
53 	int GL_MAX_VERTEX_ATTRIBS_ARB               = 0x8869;
54 	int GL_MAX_TEXTURE_IMAGE_UNITS_ARB          = 0x8872;
55 	int GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB   = 0x8B4C;
56 	int GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB = 0x8B4D;
57 	int GL_MAX_TEXTURE_COORDS_ARB               = 0x8871;
58 
59 	/**
60 	 * Accepted by the <cap> parameter of Disable, Enable, and IsEnabled, and
61 	 * by the <pname> parameter of GetBooleanv, GetIntegerv, GetFloatv, and
62 	 * GetDoublev:
63 	 */
64 	int GL_VERTEX_PROGRAM_POINT_SIZE_ARB = 0x8642;
65 	int GL_VERTEX_PROGRAM_TWO_SIDE_ARB   = 0x8643;
66 
67 	/** Accepted by the <pname> parameter GetObjectParameter{if}vARB: */
68 	int GL_OBJECT_ACTIVE_ATTRIBUTES_ARB           = 0x8B89;
69 	int GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB = 0x8B8A;
70 
71 	/** Accepted by the <pname> parameter of GetVertexAttrib{dfi}vARB: */
72 	int GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB    = 0x8622;
73 	int GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB       = 0x8623;
74 	int GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB     = 0x8624;
75 	int GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB       = 0x8625;
76 	int GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB = 0x886A;
77 	int GL_CURRENT_VERTEX_ATTRIB_ARB          = 0x8626;
78 
79 	/** Accepted by the <pname> parameter of GetVertexAttribPointervARB: */
80 	int GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB = 0x8645;
81 
82 	/** Returned by the <type> parameter of GetActiveAttribARB: */
83 	int GL_FLOAT_VEC2_ARB = 0x8B50;
84 	int GL_FLOAT_VEC3_ARB = 0x8B51;
85 	int GL_FLOAT_VEC4_ARB = 0x8B52;
86 	int GL_FLOAT_MAT2_ARB = 0x8B5A;
87 	int GL_FLOAT_MAT3_ARB = 0x8B5B;
88 	int GL_FLOAT_MAT4_ARB = 0x8B5C;
89 
90 	@NoErrorCheck
glVertexAttrib1sARB(@Luint int index, short v0)91 	void glVertexAttrib1sARB(@GLuint int index, short v0);
92 
93 	@NoErrorCheck
glVertexAttrib1fARB(@Luint int index, float v0)94 	void glVertexAttrib1fARB(@GLuint int index, float v0);
95 
96 	@NoErrorCheck
glVertexAttrib1dARB(@Luint int index, double v0)97 	void glVertexAttrib1dARB(@GLuint int index, double v0);
98 
99 	@NoErrorCheck
glVertexAttrib2sARB(@Luint int index, short v0, short v1)100 	void glVertexAttrib2sARB(@GLuint int index, short v0, short v1);
101 
102 	@NoErrorCheck
glVertexAttrib2fARB(@Luint int index, float v0, float v1)103 	void glVertexAttrib2fARB(@GLuint int index, float v0, float v1);
104 
105 	@NoErrorCheck
glVertexAttrib2dARB(@Luint int index, double v0, double v1)106 	void glVertexAttrib2dARB(@GLuint int index, double v0, double v1);
107 
108 	@NoErrorCheck
glVertexAttrib3sARB(@Luint int index, short v0, short v1, short v2)109 	void glVertexAttrib3sARB(@GLuint int index, short v0, short v1, short v2);
110 
111 	@NoErrorCheck
glVertexAttrib3fARB(@Luint int index, float v0, float v1, float v2)112 	void glVertexAttrib3fARB(@GLuint int index, float v0, float v1, float v2);
113 
114 	@NoErrorCheck
glVertexAttrib3dARB(@Luint int index, double v0, double v1, double v2)115 	void glVertexAttrib3dARB(@GLuint int index, double v0, double v1, double v2);
116 
117 	@NoErrorCheck
glVertexAttrib4sARB(@Luint int index, short v0, short v1, short v2, short v3)118 	void glVertexAttrib4sARB(@GLuint int index, short v0, short v1, short v2, short v3);
119 
120 	@NoErrorCheck
glVertexAttrib4fARB(@Luint int index, float v0, float v1, float v2, float v3)121 	void glVertexAttrib4fARB(@GLuint int index, float v0, float v1, float v2, float v3);
122 
123 	@NoErrorCheck
glVertexAttrib4dARB(@Luint int index, double v0, double v1, double v2, double v3)124 	void glVertexAttrib4dARB(@GLuint int index, double v0, double v1, double v2, double v3);
125 
126 	@NoErrorCheck
glVertexAttrib4NubARB(@Luint int index, @GLubyte byte x, @GLubyte byte y, @GLubyte byte z, @GLubyte byte w)127 	void glVertexAttrib4NubARB(@GLuint int index, @GLubyte byte x, @GLubyte byte y, @GLubyte byte z, @GLubyte byte w);
128 
glVertexAttribPointerARB(@Luint int index, int size, @AutoType(R) @GLenum int type, boolean normalized, @GLsizei int stride, @CachedReference(index = R, name = R) @BufferObject(BufferKind.ArrayVBO) @Check @Const @GLbyte @GLubyte @GLshort @GLushort @GLint @GLuint @GLfloat @GLdouble Buffer buffer)129 	void glVertexAttribPointerARB(@GLuint int index, int size, @AutoType("buffer") @GLenum int type, boolean normalized, @GLsizei int stride,
130 	                              @CachedReference(index = "index", name = "glVertexAttribPointer_buffer")
131 	                              @BufferObject(BufferKind.ArrayVBO)
132 	                              @Check
133 	                              @Const
134 	                              @GLbyte
135 	                              @GLubyte
136 	                              @GLshort
137 	                              @GLushort
138 	                              @GLint
139 	                              @GLuint
140 	                              @GLfloat
141 	                              @GLdouble Buffer buffer);
142 
143 	@Alternate("glVertexAttribPointerARB")
glVertexAttribPointerARB(@Luint int index, int size, @GLenum int type, boolean normalized, @GLsizei int stride, @CachedReference(index = R, name = R) @BufferObject(BufferKind.ArrayVBO) @Check @Const ByteBuffer buffer)144 	void glVertexAttribPointerARB(@GLuint int index, int size, @GLenum int type, boolean normalized, @GLsizei int stride,
145 	                              @CachedReference(index = "index", name = "glVertexAttribPointer_buffer")
146 	                              @BufferObject(BufferKind.ArrayVBO)
147 	                              @Check
148 	                              @Const ByteBuffer buffer);
149 
glEnableVertexAttribArrayARB(@Luint int index)150 	void glEnableVertexAttribArrayARB(@GLuint int index);
151 
glDisableVertexAttribArrayARB(@Luint int index)152 	void glDisableVertexAttribArrayARB(@GLuint int index);
153 
glBindAttribLocationARB(@LhandleARB int programObj, @GLuint int index, @NullTerminated @Const @GLcharARB ByteBuffer name)154 	void glBindAttribLocationARB(@GLhandleARB int programObj, @GLuint int index, @NullTerminated @Const @GLcharARB ByteBuffer name);
155 
156 	@Alternate("glBindAttribLocationARB")
glBindAttribLocationARB(@LhandleARB int programObj, @GLuint int index, @NullTerminated CharSequence name)157 	void glBindAttribLocationARB(@GLhandleARB int programObj, @GLuint int index, @NullTerminated CharSequence name);
158 
glGetActiveAttribARB(@LhandleARB int programObj, @GLuint int index, @AutoSize(R) @GLsizei int maxLength, @OutParameter @GLsizei @Check(value = R, canBeNull = true) IntBuffer length, @OutParameter @Check(R) IntBuffer size, @OutParameter @GLenum @Check(R) IntBuffer type, @OutParameter @GLcharARB ByteBuffer name)159 	void glGetActiveAttribARB(@GLhandleARB int programObj, @GLuint int index, @AutoSize("name") @GLsizei int maxLength,
160 	                          @OutParameter @GLsizei @Check(value = "1", canBeNull = true) IntBuffer length,
161 	                          @OutParameter @Check("1") IntBuffer size,
162 	                          @OutParameter @GLenum @Check("1") IntBuffer type,
163 	                          @OutParameter @GLcharARB ByteBuffer name);
164 
165 	/** Overloads glGetActiveAttribARB. This version returns both size and type in the sizeType buffer (at .position() and .position() + 1). */
166 	@Alternate("glGetActiveAttribARB")
167 	@GLreturn(value = "name", maxLength = "maxLength")
glGetActiveAttribARB2(@LhandleARB int programObj, @GLuint int index, @GLsizei int maxLength, @OutParameter @GLsizei @Constant(R) IntBuffer length, @OutParameter @Check(R) IntBuffer sizeType, @OutParameter @GLenum @Constant(R) IntBuffer type, @OutParameter @GLcharARB ByteBuffer name)168 	void glGetActiveAttribARB2(@GLhandleARB int programObj, @GLuint int index, @GLsizei int maxLength,
169 	                           @OutParameter @GLsizei @Constant("MemoryUtil.getAddress0(name_length)") IntBuffer length,
170 	                           @OutParameter @Check("2") IntBuffer sizeType,
171 	                           @OutParameter @GLenum @Constant("MemoryUtil.getAddress(sizeType, sizeType.position() + 1)") IntBuffer type,
172 	                           @OutParameter @GLcharARB ByteBuffer name);
173 
174 	/** Overloads glGetActiveAttribARB. This version returns only the attrib name. */
175 	@Alternate(value = "glGetActiveAttribARB", javaAlt = true)
176 	@GLreturn(value = "name", maxLength = "maxLength")
glGetActiveAttribARB(@LhandleARB int programObj, @GLuint int index, @GLsizei int maxLength, @OutParameter @GLsizei @Constant(R) IntBuffer length, @OutParameter @GLcharARB ByteBuffer name)177 	void glGetActiveAttribARB(@GLhandleARB int programObj, @GLuint int index, @GLsizei int maxLength,
178 	                          @OutParameter @GLsizei @Constant("MemoryUtil.getAddress0(name_length), MemoryUtil.getAddress0(APIUtil.getBufferInt(caps)), MemoryUtil.getAddress(APIUtil.getBufferInt(caps), 1)") IntBuffer length,
179 	                          @OutParameter @GLcharARB ByteBuffer name);
180 
181 	/** Overloads glGetActiveAttribARB. This version returns only the attrib size. */
182 	@Alternate(value = "glGetActiveAttribARB", javaAlt = true)
183 	@GLreturn(value = "size")
glGetActiveAttribSizeARB(@LhandleARB int programObj, @GLuint int index, @Constant(R) @GLsizei int maxLength, @OutParameter @GLsizei @Constant(R) IntBuffer length, @OutParameter IntBuffer size, @OutParameter @GLenum @Constant(R) IntBuffer type, @OutParameter @GLcharARB @Constant(R) ByteBuffer name)184 	void glGetActiveAttribSizeARB(@GLhandleARB int programObj, @GLuint int index, @Constant("0") @GLsizei int maxLength,
185 	                              @OutParameter @GLsizei @Constant("0L") IntBuffer length,
186 	                              @OutParameter IntBuffer size,
187 	                              @OutParameter @GLenum @Constant("MemoryUtil.getAddress(size, 1)") IntBuffer type, // Reuse size buffer and ignore
188 	                              @OutParameter @GLcharARB @Constant("APIUtil.getBufferByte0(caps)") ByteBuffer name);
189 
190 	/** Overloads glGetActiveAttribARB. This version returns only the attrib type. */
191 	@Alternate(value = "glGetActiveAttribARB", javaAlt = true)
192 	@GLreturn(value = "type")
glGetActiveAttribTypeARB(@LhandleARB int programObj, @GLuint int index, @Constant(R) @GLsizei int maxLength, @OutParameter @GLsizei @Constant(R) IntBuffer length, @OutParameter @Constant(R) IntBuffer size, @OutParameter @GLenum IntBuffer type, @OutParameter @GLcharARB @Constant(R) ByteBuffer name)193 	void glGetActiveAttribTypeARB(@GLhandleARB int programObj, @GLuint int index, @Constant("0") @GLsizei int maxLength,
194 	                              @OutParameter @GLsizei @Constant("0L") IntBuffer length,
195 	                              @OutParameter @Constant("MemoryUtil.getAddress(type, 1)") IntBuffer size, // Reuse type buffer and ignore
196 	                              @OutParameter @GLenum IntBuffer type,
197 	                              @OutParameter @GLcharARB @Constant("APIUtil.getBufferByte0(caps)") ByteBuffer name);
198 
glGetAttribLocationARB(@LhandleARB int programObj, @NullTerminated @Const @GLcharARB ByteBuffer name)199 	int glGetAttribLocationARB(@GLhandleARB int programObj, @NullTerminated @Const @GLcharARB ByteBuffer name);
200 
201 	@Alternate("glGetAttribLocationARB")
glGetAttribLocationARB(@LhandleARB int programObj, @NullTerminated CharSequence name)202 	int glGetAttribLocationARB(@GLhandleARB int programObj, @NullTerminated CharSequence name);
203 
204 	@StripPostfix("params")
glGetVertexAttribfvARB(@Luint int index, @GLenum int pname, @OutParameter @Check(R) FloatBuffer params)205 	void glGetVertexAttribfvARB(@GLuint int index, @GLenum int pname, @OutParameter @Check("4") FloatBuffer params);
206 
207 	@StripPostfix("params")
glGetVertexAttribdvARB(@Luint int index, @GLenum int pname, @OutParameter @Check(R) DoubleBuffer params)208 	void glGetVertexAttribdvARB(@GLuint int index, @GLenum int pname, @OutParameter @Check("4") DoubleBuffer params);
209 
210 	@StripPostfix("params")
glGetVertexAttribivARB(@Luint int index, @GLenum int pname, @OutParameter @Check(R) IntBuffer params)211 	void glGetVertexAttribivARB(@GLuint int index, @GLenum int pname, @OutParameter @Check("4") IntBuffer params);
212 
213 	@StripPostfix("result")
glGetVertexAttribPointervARB(@Luint int index, @GLenum int pname, @Result @GLvoid ByteBuffer result)214 	void glGetVertexAttribPointervARB(@GLuint int index, @GLenum int pname, @Result @GLvoid ByteBuffer result);
215 
216 }
217