/** Binds the underlying {@link VertexBufferObject} and {@link IndexBufferObject} if indices where given. Use this with OpenGL * ES 2.0 and when auto-bind is disabled. * * @param shader the shader (does not bind the shader) */ public void bind (final ShaderProgram shader) { bind(shader, null); }
/** Binds the underlying {@link VertexBufferObject} and {@link IndexBufferObject} if indices where given. Use this with OpenGL * ES 2.0 and when auto-bind is disabled. * * @param shader the shader (does not bind the shader) */ public void bind (final ShaderProgram shader) { bind(shader, null); }
/** Prepares the OpenGL state for SpriteCache rendering. */ public void begin () { if (drawing) throw new IllegalStateException("end must be called before begin."); if (currentCache != null) throw new IllegalStateException("endCache must be called before begin"); renderCalls = 0; combinedMatrix.set(projectionMatrix).mul(transformMatrix); Gdx.gl20.glDepthMask(false); if (customShader != null) { customShader.begin(); customShader.setUniformMatrix("u_proj", projectionMatrix); customShader.setUniformMatrix("u_trans", transformMatrix); customShader.setUniformMatrix("u_projTrans", combinedMatrix); customShader.setUniformi("u_texture", 0); mesh.bind(customShader); } else { shader.begin(); shader.setUniformMatrix("u_projectionViewMatrix", combinedMatrix); shader.setUniformi("u_texture", 0); mesh.bind(shader); } drawing = true; }
/** Prepares the OpenGL state for SpriteCache rendering. */ public void begin () { if (drawing) throw new IllegalStateException("end must be called before begin."); if (currentCache != null) throw new IllegalStateException("endCache must be called before begin"); renderCalls = 0; combinedMatrix.set(projectionMatrix).mul(transformMatrix); Gdx.gl20.glDepthMask(false); if (customShader != null) { customShader.begin(); customShader.setUniformMatrix("u_proj", projectionMatrix); customShader.setUniformMatrix("u_trans", transformMatrix); customShader.setUniformMatrix("u_projTrans", combinedMatrix); customShader.setUniformi("u_texture", 0); mesh.bind(customShader); } else { shader.begin(); shader.setUniformMatrix("u_projectionViewMatrix", combinedMatrix); shader.setUniformi("u_texture", 0); mesh.bind(shader); } drawing = true; }
public void render (Renderable renderable, final Attributes combinedAttributes) { for (int u, i = 0; i < localUniforms.size; ++i) if (setters.get(u = localUniforms.get(i)) != null) setters.get(u).set(this, u, renderable, combinedAttributes); if (currentMesh != renderable.meshPart.mesh) { if (currentMesh != null) currentMesh.unbind(program, tempArray.items); currentMesh = renderable.meshPart.mesh; currentMesh.bind(program, getAttributeLocations(renderable.meshPart.mesh.getVertexAttributes())); } renderable.meshPart.render(program, false); }
public void render (Renderable renderable, final Attributes combinedAttributes) { for (int u, i = 0; i < localUniforms.size; ++i) if (setters.get(u = localUniforms.get(i)) != null) setters.get(u).set(this, u, renderable, combinedAttributes); if (currentMesh != renderable.meshPart.mesh) { if (currentMesh != null) currentMesh.unbind(program, tempArray.items); currentMesh = renderable.meshPart.mesh; currentMesh.bind(program, getAttributeLocations(renderable.meshPart.mesh.getVertexAttributes())); } renderable.meshPart.render(program, false); }
if (count == 0) return; if (autoBind) bind(shader);
if (count == 0) return; if (autoBind) bind(shader);
/** Binds the underlying {@link VertexBufferObject} and {@link IndexBufferObject} if indices where given. Use this with OpenGL * ES 2.0 and when auto-bind is disabled. * * @param shader the shader (does not bind the shader) */ public void bind (final ShaderProgram shader) { bind(shader, null); }
/** Prepares the OpenGL state for SpriteCache rendering. */ public void begin () { if (drawing) throw new IllegalStateException("end must be called before begin."); if (currentCache != null) throw new IllegalStateException("endCache must be called before begin"); renderCalls = 0; combinedMatrix.set(projectionMatrix).mul(transformMatrix); Gdx.gl20.glDepthMask(false); if (customShader != null) { customShader.begin(); customShader.setUniformMatrix("u_proj", projectionMatrix); customShader.setUniformMatrix("u_trans", transformMatrix); customShader.setUniformMatrix("u_projTrans", combinedMatrix); customShader.setUniformi("u_texture", 0); mesh.bind(customShader); } else { shader.begin(); shader.setUniformMatrix("u_projectionViewMatrix", combinedMatrix); shader.setUniformi("u_texture", 0); mesh.bind(shader); } drawing = true; }
public void render (Renderable renderable, final Attributes combinedAttributes) { for (int u, i = 0; i < localUniforms.size; ++i) if (setters.get(u = localUniforms.get(i)) != null) setters.get(u).set(this, u, renderable, combinedAttributes); if (currentMesh != renderable.meshPart.mesh) { if (currentMesh != null) currentMesh.unbind(program, tempArray.items); currentMesh = renderable.meshPart.mesh; currentMesh.bind(program, getAttributeLocations(renderable.meshPart.mesh.getVertexAttributes())); } renderable.meshPart.render(program, false); }
if (count == 0) return; if (autoBind) bind(shader);