List of usage examples for org.lwjgl.opengl GL20 glUniform1i
public static void glUniform1i(@NativeType("GLint") int location, @NativeType("GLint") int v0)
From source file:net.neilcsmith.praxis.video.opengl.internal.ShaderProgram.java
License:Apache License
/** Sets the uniform with the given name. Throws an IllegalArgumentException in case it is not called in between a * {@link #begin()}/{@link #end()} block. * /*w w w .jav a 2 s . c om*/ * @param name the name of the uniform * @param value the value */ public void setUniformi(String name, int value) { checkContext(); int location = fetchUniformLocation(name); GL20.glUniform1i(location, value); }
From source file:net.smert.frameworkgl.opengl.helpers.ShaderUniformHelper.java
License:Apache License
public void setUniform(int uniformID, int value1) { GL20.glUniform1i(uniformID, value1); }
From source file:opengl.test.object.CaroTable.java
@Override protected void initUniformValues() { this.bind();/*from w ww .j ava 2s.co m*/ modelID = GL20.glGetUniformLocation(this.getProgramID(), "model"); Matrix4F m = new Matrix4F(); GL20.glUniformMatrix4fv(modelID, false, m.toFloatBuffer()); viewID = GL20.glGetUniformLocation(this.getProgramID(), "view"); Matrix4F v = new Matrix4F(); GL20.glUniformMatrix4fv(viewID, false, v.toFloatBuffer()); projectionID = GL20.glGetUniformLocation(this.getProgramID(), "projection"); Matrix4F p = new Matrix4F(); GL20.glUniformMatrix4fv(projectionID, false, p.toFloatBuffer()); //--------------------------- int uniTex = GL20.glGetUniformLocation(this.getProgramID(), "texImage"); GL20.glUniform1i(uniTex, 0); this.unbind(); }
From source file:org.jogamp.glg2d.impl.shader.GeometryShaderStrokePipeline.java
License:Apache License
public void setStroke(BasicStroke stroke) { if (lineWidthLocation >= 0) { GL20.glUniform1f(lineWidthLocation, stroke.getLineWidth()); }//ww w .j a va 2 s . c om if (miterLimitLocation >= 0) { GL20.glUniform1f(miterLimitLocation, stroke.getMiterLimit()); } if (joinTypeLocation >= 0) { GL20.glUniform1i(joinTypeLocation, stroke.getLineJoin()); } if (capTypeLocation >= 0) { GL20.glUniform1i(capTypeLocation, stroke.getEndCap()); } }
From source file:org.jogamp.glg2d.impl.shader.GeometryShaderStrokePipeline.java
License:Apache License
protected void setDrawEnd(int drawType) { if (drawEndLocation >= 0) { GL20.glUniform1i(drawEndLocation, drawType); } }
From source file:org.jogamp.glg2d.impl.shader.GL2ES2ImagePipeline.java
License:Apache License
public void setTextureUnit(int unit) { if (textureLocation >= 0) { GL20.glUniform1i(textureLocation, unit); } }
From source file:org.oscim.gdx.LwjglGL20.java
License:Apache License
public void uniform1i(int location, int x) { GL20.glUniform1i(location, x); }
From source file:org.spout.engine.renderer.shader.variables.IntShaderVariable.java
License:Open Source License
@Override public void assign() { GL20.glUniform1i(location, value); }
From source file:org.spout.engine.renderer.shader.variables.TextureSamplerShaderVariable.java
License:Open Source License
public void bind(int unit) { GL13.glActiveTexture(GL13.GL_TEXTURE0 + unit); GL11.glBindTexture(GL11.GL_TEXTURE_2D, textureID); if (((Client) Spout.getEngine()).getRenderMode() != RenderMode.GL30) { GL20.glUniform1i(location, textureID); } else {//from ww w.j a va2s. c o m GL30.glUniform1ui(location, textureID); } }
From source file:org.spout.renderer.lwjgl.gl20.GL20Program.java
License:Open Source License
@Override public void setUniform(String name, boolean b) { checkCreated();//from ww w . ja v a 2 s. c o m if (!uniforms.containsKey(name)) { return; } GL20.glUniform1i(uniforms.get(name), b ? 1 : 0); LWJGLUtil.checkForGLError(); }