本文整理匯總了Java中org.lwjgl.opengl.GL20.glDeleteShader方法的典型用法代碼示例。如果您正苦於以下問題:Java GL20.glDeleteShader方法的具體用法?Java GL20.glDeleteShader怎麽用?Java GL20.glDeleteShader使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.lwjgl.opengl.GL20
的用法示例。
在下文中一共展示了GL20.glDeleteShader方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: ShaderProgram
import org.lwjgl.opengl.GL20; //導入方法依賴的package包/類
public ShaderProgram(MyFile vertexFile, MyFile geometryFile, MyFile fragmentFile, String... inVariables) {
int vertexShaderID = loadShader(vertexFile, GL20.GL_VERTEX_SHADER);
int geometryShaderID = loadShader(geometryFile, GL32.GL_GEOMETRY_SHADER);
int fragmentShaderID = loadShader(fragmentFile, GL20.GL_FRAGMENT_SHADER);
programID = GL20.glCreateProgram();
GL20.glAttachShader(programID, vertexShaderID);
GL20.glAttachShader(programID, geometryShaderID);
GL20.glAttachShader(programID, fragmentShaderID);
bindAttributes(inVariables);
GL20.glLinkProgram(programID);
GL20.glDetachShader(programID, vertexShaderID);
GL20.glDetachShader(programID, geometryShaderID);
GL20.glDetachShader(programID, fragmentShaderID);
GL20.glDeleteShader(vertexShaderID);
GL20.glDeleteShader(geometryShaderID);
GL20.glDeleteShader(fragmentShaderID);
}
示例2: Shader
import org.lwjgl.opengl.GL20; //導入方法依賴的package包/類
public Shader(String source, int type)
{
this.type = type;
this.handle = GL20.glCreateShader(this.type);
if (this.handle == 0)
{
throw new GLException("Unable to create main.shader!");
}
GL20.glShaderSource(this.handle, source);
GL20.glCompileShader(this.handle);
int status = GL20.glGetShaderi(this.handle, GL20.GL_COMPILE_STATUS);
if (status == GL11.GL_FALSE)
{
String infolog = GL20.glGetShaderInfoLog(this.handle);
GL20.glDeleteShader(this.handle);
this.handle = 0;
throw new GLException(infolog);
}
SHADERS.add(this);
}
示例3: ShaderProgram
import org.lwjgl.opengl.GL20; //導入方法依賴的package包/類
public ShaderProgram(MyFile vertexFile, MyFile geometryFile, MyFile fragmentFile, String... inVariables) {
int vertexShaderID = loadShader(vertexFile, GL20.GL_VERTEX_SHADER);
int geometryShaderID = loadShader(geometryFile, GL32.GL_GEOMETRY_SHADER);
int fragmentShaderID = loadShader(fragmentFile, GL20.GL_FRAGMENT_SHADER);
programID = GL20.glCreateProgram();
GL20.glAttachShader(programID, vertexShaderID);
GL20.glAttachShader(programID, geometryShaderID);
GL20.glAttachShader(programID, fragmentShaderID);
bindAttributes(inVariables);
GL20.glLinkProgram(programID);
GL20.glDetachShader(programID, vertexShaderID);
GL20.glDetachShader(programID, geometryShaderID);
GL20.glDetachShader(programID, fragmentShaderID);
GL20.glDeleteShader(vertexShaderID);
GL20.glDeleteShader(geometryShaderID);
GL20.glDeleteShader(fragmentShaderID);
}
示例4: cleanUp
import org.lwjgl.opengl.GL20; //導入方法依賴的package包/類
public void cleanUp() {
stop();
GL20.glDetachShader(programID, vertexShaderID);
GL20.glDetachShader(programID, fragmentShaderID);
GL20.glDeleteShader(vertexShaderID);
GL20.glDeleteShader(fragmentShaderID);
GL20.glDeleteProgram(programID);
}
示例5: cleanUp
import org.lwjgl.opengl.GL20; //導入方法依賴的package包/類
public void cleanUp() {
LOGGER.debug("Cleaning resources for program - {} vertex - {} fragment - {}", programId, vertShaderId, fragShaderId);
stop();
GL20.glDetachShader(programId, vertShaderId);
GL20.glDetachShader(programId, fragShaderId);
GL20.glDeleteShader(vertShaderId);
GL20.glDeleteShader(fragShaderId);
GL20.glDeleteProgram(programId);
}
示例6: glDeleteShader
import org.lwjgl.opengl.GL20; //導入方法依賴的package包/類
public static void glDeleteShader(int shaderIn)
{
if (arbShaders)
{
ARBShaderObjects.glDeleteObjectARB(shaderIn);
}
else
{
GL20.glDeleteShader(shaderIn);
}
}
示例7: glDeleteShader
import org.lwjgl.opengl.GL20; //導入方法依賴的package包/類
public static void glDeleteShader(int p_153180_0_)
{
if (arbShaders)
{
ARBShaderObjects.glDeleteObjectARB(p_153180_0_);
}
else
{
GL20.glDeleteShader(p_153180_0_);
}
}
示例8: cleanUp
import org.lwjgl.opengl.GL20; //導入方法依賴的package包/類
/**
* Cleans up shader when exiting.
*/
public void cleanUp() {
stop();
GL20.glDetachShader(programID, vertexShaderID);
GL20.glDetachShader(programID, fragmentShaderID);
GL20.glDeleteShader(vertexShaderID);
GL20.glDeleteShader(fragmentShaderID);
GL20.glDeleteProgram(programID);
}
示例9: close
import org.lwjgl.opengl.GL20; //導入方法依賴的package包/類
@Override
public void close() throws Exception
{
GL20.glDeleteShader(this.handle);
this.handle = 0;
SHADERS.remove(this);
}
示例10: ShaderProgram
import org.lwjgl.opengl.GL20; //導入方法依賴的package包/類
public ShaderProgram(MyFile vertexFile, MyFile fragmentFile, String... inVariables) {
int vertexShaderID = loadShader(vertexFile, GL20.GL_VERTEX_SHADER);
int fragmentShaderID = loadShader(fragmentFile, GL20.GL_FRAGMENT_SHADER);
programID = GL20.glCreateProgram();
GL20.glAttachShader(programID, vertexShaderID);
GL20.glAttachShader(programID, fragmentShaderID);
bindAttributes(inVariables);
GL20.glLinkProgram(programID);
GL20.glDetachShader(programID, vertexShaderID);
GL20.glDetachShader(programID, fragmentShaderID);
GL20.glDeleteShader(vertexShaderID);
GL20.glDeleteShader(fragmentShaderID);
}
示例11: deleteShaderProgram
import org.lwjgl.opengl.GL20; //導入方法依賴的package包/類
public void deleteShaderProgram() {
GL15.glDeleteBuffers(vbo);
GL20.glDetachShader(shaderProgram, vshader);
GL20.glDetachShader(shaderProgram, fshader);
GL20.glDeleteShader(vshader);
vshader = 0;
GL20.glDeleteShader(fshader);
fshader = 0;
GL20.glDeleteProgram(shaderProgram);
shaderProgram = 0;
}
示例12: dispose
import org.lwjgl.opengl.GL20; //導入方法依賴的package包/類
public void dispose()
{
unbind();
GL20.glDetachShader(program, vertex);
GL20.glDetachShader(program, fragment);
GL20.glDeleteShader(vertex);
GL20.glDeleteShader(fragment);
GL20.glDeleteProgram(program);
}
示例13: cleanUp
import org.lwjgl.opengl.GL20; //導入方法依賴的package包/類
public void cleanUp() {
stop();
GL20.glDetachShader(programID, vertexShaderID);
GL20.glDetachShader(programID, fragmentShaderID);
GL20.glDeleteShader(vertexShaderID);
GL20.glDeleteShader(fragmentShaderID);
GL20.glDeleteProgram(programID);
}
示例14: createShaderProgram
import org.lwjgl.opengl.GL20; //導入方法依賴的package包/類
public void createShaderProgram() {
shaderProgram = GL20.glCreateProgram();
vShader = createShader(vertexShader, GL20.GL_VERTEX_SHADER);
fShader = createShader(fragmentShader, GL20.GL_FRAGMENT_SHADER);
GL20.glAttachShader(shaderProgram, vShader);
GL20.glAttachShader(shaderProgram, fShader);
GL20.glBindAttribLocation(shaderProgram, 0, "vertex");
GL30.glBindFragDataLocation(shaderProgram, 0, "color");
GL20.glLinkProgram(shaderProgram);
GL20.glDetachShader(shaderProgram, vShader);
GL20.glDetachShader(shaderProgram, fShader);
GL20.glDeleteShader(vShader);
vShader = 0;
GL20.glDeleteShader(fShader);
fShader = 0;
int linked = GL20.glGetProgrami(shaderProgram, GL20.GL_LINK_STATUS);
String programLog = GL20.glGetProgramInfoLog(shaderProgram, GL20.glGetProgrami(shaderProgram, GL20.GL_INFO_LOG_LENGTH));
if (programLog.trim().length() > 0) {
System.err.println(programLog);
}
if (linked == 0) {
throw new AssertionError("Could not link program");
}
//init vbo
vbo = GL15.glGenBuffers();
GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, vbo);
ByteBuffer bb = BufferUtils.createByteBuffer(2 * 6);
bb.put((byte) -1).put((byte) -1);
bb.put((byte) 1).put((byte) -1);
bb.put((byte) 1).put((byte) 1);
bb.put((byte) 1).put((byte) 1);
bb.put((byte) -1).put((byte) 1);
bb.put((byte) -1).put((byte) -1);
bb.flip();
GL15.glBufferData(GL15.GL_ARRAY_BUFFER, bb, GL15.GL_STATIC_DRAW);
GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, 0);
worldChunkSsbo = GL15.glGenBuffers();
chunkSsbo = GL15.glGenBuffers();
worldMetadataSsbo = GL15.glGenBuffers();
metadataSsbo = GL15.glGenBuffers();
GL15.glBindBuffer(GL43.GL_SHADER_STORAGE_BUFFER, worldChunkSsbo);
GL15.glBufferData(GL43.GL_SHADER_STORAGE_BUFFER, 0, GL15.GL_DYNAMIC_DRAW);
GL30.glBindBufferBase(GL43.GL_SHADER_STORAGE_BUFFER, 2, worldChunkSsbo);
GL15.glBindBuffer(GL43.GL_SHADER_STORAGE_BUFFER, chunkSsbo);
GL15.glBufferData(GL43.GL_SHADER_STORAGE_BUFFER, 0, GL15.GL_DYNAMIC_DRAW);
GL30.glBindBufferBase(GL43.GL_SHADER_STORAGE_BUFFER, 3, chunkSsbo);
GL15.glBindBuffer(GL43.GL_SHADER_STORAGE_BUFFER, worldMetadataSsbo);
GL15.glBufferData(GL43.GL_SHADER_STORAGE_BUFFER, 0, GL15.GL_DYNAMIC_DRAW);
GL30.glBindBufferBase(GL43.GL_SHADER_STORAGE_BUFFER, 4, worldMetadataSsbo);
GL15.glBindBuffer(GL43.GL_SHADER_STORAGE_BUFFER, metadataSsbo);
GL15.glBufferData(GL43.GL_SHADER_STORAGE_BUFFER, 0, GL15.GL_DYNAMIC_DRAW);
GL30.glBindBufferBase(GL43.GL_SHADER_STORAGE_BUFFER, 5, metadataSsbo);
GL15.glBindBuffer(GL43.GL_SHADER_STORAGE_BUFFER, 0);
}