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.Alternate;
36 import org.lwjgl.util.generator.opengl.*;
37 
38 import java.nio.ByteBuffer;
39 import java.nio.IntBuffer;
40 
41 @Extension(postfix = "")
42 public interface ARB_shader_subroutine {
43 
44 	/** Accepted by the <pname> parameter of GetProgramStageiv: */
45 	int GL_ACTIVE_SUBROUTINES = 0x8DE5;
46 	int GL_ACTIVE_SUBROUTINE_UNIFORMS = 0x8DE6;
47 	int GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS = 0x8E47;
48 	int GL_ACTIVE_SUBROUTINE_MAX_LENGTH = 0x8E48;
49 	int GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH = 0x8E49;
50 
51 	/**
52 	 * Accepted by the <pname> parameter of GetBooleanv, GetIntegerv,
53 	 * GetFloatv, GetDoublev, and GetInteger64v:
54 	 */
55 	int GL_MAX_SUBROUTINES = 0x8DE7;
56 	int GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS = 0x8DE8;
57 
58 	/** Accepted by the <pname> parameter of GetActiveSubroutineUniformiv: */
59 	int GL_NUM_COMPATIBLE_SUBROUTINES = 0x8E4A;
60 	int GL_COMPATIBLE_SUBROUTINES = 0x8E4B;
61 
62 	@Reuse("GL40")
glGetSubroutineUniformLocation(@Luint int program, @GLenum int shadertype, @Const @NullTerminated ByteBuffer name)63 	int glGetSubroutineUniformLocation(@GLuint int program, @GLenum int shadertype, @Const @NullTerminated ByteBuffer name);
64 
65 	@Alternate("glGetSubroutineUniformLocation")
66 	@Reuse("GL40")
glGetSubroutineUniformLocation(@Luint int program, @GLenum int shadertype, @NullTerminated CharSequence name)67 	int glGetSubroutineUniformLocation(@GLuint int program, @GLenum int shadertype, @NullTerminated CharSequence name);
68 
69 	@Reuse("GL40")
70 	@GLuint
glGetSubroutineIndex(@Luint int program, @GLenum int shadertype, @Const @NullTerminated ByteBuffer name)71 	int glGetSubroutineIndex(@GLuint int program, @GLenum int shadertype, @Const @NullTerminated ByteBuffer name);
72 
73 	@Alternate("glGetSubroutineIndex")
74 	@Reuse("GL40")
glGetSubroutineIndex(@Luint int program, @GLenum int shadertype, @NullTerminated CharSequence name)75 	int glGetSubroutineIndex(@GLuint int program, @GLenum int shadertype, @NullTerminated CharSequence name);
76 
77 	@Reuse("GL40")
78 	@StripPostfix("values")
glGetActiveSubroutineUniformiv(@Luint int program, @GLenum int shadertype, @GLuint int index, @GLenum int pname, @Check(R) @OutParameter IntBuffer values)79 	void glGetActiveSubroutineUniformiv(@GLuint int program, @GLenum int shadertype, @GLuint int index, @GLenum int pname,
80 	                                    @Check("1") @OutParameter IntBuffer values);
81 
82 	@Reuse("GL40")
83 	@Alternate("glGetActiveSubroutineUniformiv")
84 	@GLreturn("values")
85 	@StripPostfix(value = "values", hasPostfix = false)
glGetActiveSubroutineUniformiv2(@Luint int program, @GLenum int shadertype, @GLuint int index, @GLenum int pname, @OutParameter IntBuffer values)86 	void glGetActiveSubroutineUniformiv2(@GLuint int program, @GLenum int shadertype, @GLuint int index, @GLenum int pname,
87 	                                     @OutParameter IntBuffer values);
88 
89 	@Reuse("GL40")
glGetActiveSubroutineUniformName(@Luint int program, @GLenum int shadertype, @GLuint int index, @AutoSize(R) @GLsizei int bufsize, @OutParameter @Check(value = R, canBeNull = true) @GLsizei IntBuffer length, @OutParameter ByteBuffer name)90 	void glGetActiveSubroutineUniformName(@GLuint int program, @GLenum int shadertype, @GLuint int index, @AutoSize("name") @GLsizei int bufsize,
91 	                                      @OutParameter @Check(value = "1", canBeNull = true) @GLsizei IntBuffer length,
92 	                                      @OutParameter ByteBuffer name);
93 
94 	@Reuse("GL40")
95 	@Alternate("glGetActiveSubroutineUniformName")
96 	@GLreturn(value = "name", maxLength = "bufsize")
glGetActiveSubroutineUniformName2(@Luint int program, @GLenum int shadertype, @GLuint int index, @GLsizei int bufsize, @OutParameter @Constant(R) @GLsizei IntBuffer length, @OutParameter @GLchar ByteBuffer name)97 	void glGetActiveSubroutineUniformName2(@GLuint int program, @GLenum int shadertype, @GLuint int index, @GLsizei int bufsize,
98 	                                       @OutParameter @Constant("MemoryUtil.getAddress0(name_length)") @GLsizei IntBuffer length,
99 	                                       @OutParameter @GLchar ByteBuffer name);
100 
101 	@Reuse("GL40")
glGetActiveSubroutineName(@Luint int program, @GLenum int shadertype, @GLuint int index, @AutoSize(R) @GLsizei int bufsize, @OutParameter @Check(value = R, canBeNull = true) @GLsizei IntBuffer length, @OutParameter ByteBuffer name)102 	void glGetActiveSubroutineName(@GLuint int program, @GLenum int shadertype, @GLuint int index, @AutoSize("name") @GLsizei int bufsize,
103 	                               @OutParameter @Check(value = "1", canBeNull = true) @GLsizei IntBuffer length,
104 	                               @OutParameter ByteBuffer name);
105 
106 	@Reuse("GL40")
107 	@Alternate("glGetActiveSubroutineName")
108 	@GLreturn(value = "name", maxLength = "bufsize")
glGetActiveSubroutineName2(@Luint int program, @GLenum int shadertype, @GLuint int index, @GLsizei int bufsize, @OutParameter @Constant(R) @GLsizei IntBuffer length, @OutParameter @GLchar ByteBuffer name)109 	void glGetActiveSubroutineName2(@GLuint int program, @GLenum int shadertype, @GLuint int index, @GLsizei int bufsize,
110 	                                @OutParameter @Constant("MemoryUtil.getAddress0(name_length)") @GLsizei IntBuffer length,
111 	                                @OutParameter @GLchar ByteBuffer name);
112 
113 	@Reuse("GL40")
114 	@StripPostfix("indices")
glUniformSubroutinesuiv(@Lenum int shadertype, @AutoSize(R) @GLsizei int count, @Const @GLuint IntBuffer indices)115 	void glUniformSubroutinesuiv(@GLenum int shadertype, @AutoSize("indices") @GLsizei int count, @Const @GLuint IntBuffer indices);
116 
117 	@Reuse("GL40")
118 	@StripPostfix("params")
glGetUniformSubroutineuiv(@Lenum int shadertype, int location, @Check(R) @OutParameter @GLuint IntBuffer params)119 	void glGetUniformSubroutineuiv(@GLenum int shadertype, int location, @Check("1") @OutParameter @GLuint IntBuffer params);
120 
121 	@Reuse("GL40")
122 	@Alternate("glGetUniformSubroutineuiv")
123 	@GLreturn("params")
124 	@StripPostfix(value = "params", hasPostfix = false)
glGetUniformSubroutineuiv2(@Lenum int shadertype, int location, @OutParameter @GLuint IntBuffer params)125 	void glGetUniformSubroutineuiv2(@GLenum int shadertype, int location, @OutParameter @GLuint IntBuffer params);
126 
127 	@Reuse("GL40")
128 	@StripPostfix("values")
glGetProgramStageiv(@Luint int program, @GLenum int shadertype, @GLenum int pname, @Check(R) @OutParameter IntBuffer values)129 	void glGetProgramStageiv(@GLuint int program, @GLenum int shadertype, @GLenum int pname, @Check("1") @OutParameter IntBuffer values);
130 
131 	@Reuse("GL40")
132 	@Alternate("glGetProgramStageiv")
133 	@GLreturn("values")
134 	@StripPostfix(value = "values", hasPostfix = false)
glGetProgramStageiv2(@Luint int program, @GLenum int shadertype, @GLenum int pname, @OutParameter IntBuffer values)135 	void glGetProgramStageiv2(@GLuint int program, @GLenum int shadertype, @GLenum int pname, @OutParameter IntBuffer values);
136 
137 }