mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
parent
06b532504d
commit
fef881730d
@ -250,11 +250,9 @@ public class NormalMapTest extends ApplicationAdapter {
|
|||||||
ShaderProgram.pedantic = false;
|
ShaderProgram.pedantic = false;
|
||||||
if (!program.isCompiled()) throw new IllegalArgumentException("Error compiling shader: " + program.getLog());
|
if (!program.isCompiled()) throw new IllegalArgumentException("Error compiling shader: " + program.getLog());
|
||||||
|
|
||||||
program.begin();
|
program.bind();
|
||||||
program.setUniformi("u_texture", 0);
|
program.setUniformi("u_texture", 0);
|
||||||
program.setUniformi("u_normals", 1);
|
program.setUniformi("u_normals", 1);
|
||||||
program.end();
|
|
||||||
|
|
||||||
return program;
|
return program;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -118,7 +118,7 @@ public class TwoColorPolygonBatch implements PolygonBatch {
|
|||||||
public void begin () {
|
public void begin () {
|
||||||
if (drawing) throw new IllegalStateException("end must be called before begin.");
|
if (drawing) throw new IllegalStateException("end must be called before begin.");
|
||||||
Gdx.gl.glDepthMask(false);
|
Gdx.gl.glDepthMask(false);
|
||||||
shader.begin();
|
shader.bind();
|
||||||
setupMatrices();
|
setupMatrices();
|
||||||
drawing = true;
|
drawing = true;
|
||||||
}
|
}
|
||||||
@ -127,7 +127,6 @@ public class TwoColorPolygonBatch implements PolygonBatch {
|
|||||||
public void end () {
|
public void end () {
|
||||||
if (!drawing) throw new IllegalStateException("begin must be called before end.");
|
if (!drawing) throw new IllegalStateException("begin must be called before end.");
|
||||||
if (vertexIndex > 0) flush();
|
if (vertexIndex > 0) flush();
|
||||||
shader.end();
|
|
||||||
Gdx.gl.glDepthMask(true);
|
Gdx.gl.glDepthMask(true);
|
||||||
if (isBlendingEnabled()) Gdx.gl.glDisable(GL20.GL_BLEND);
|
if (isBlendingEnabled()) Gdx.gl.glDisable(GL20.GL_BLEND);
|
||||||
|
|
||||||
@ -1384,13 +1383,10 @@ public class TwoColorPolygonBatch implements PolygonBatch {
|
|||||||
@Override
|
@Override
|
||||||
public void setShader (ShaderProgram newShader) {
|
public void setShader (ShaderProgram newShader) {
|
||||||
if (shader == newShader) return;
|
if (shader == newShader) return;
|
||||||
if (drawing) {
|
if (drawing) flush();
|
||||||
flush();
|
|
||||||
shader.end();
|
|
||||||
}
|
|
||||||
shader = newShader == null ? defaultShader : newShader;
|
shader = newShader == null ? defaultShader : newShader;
|
||||||
if (drawing) {
|
if (drawing) {
|
||||||
shader.begin();
|
shader.bind();
|
||||||
setupMatrices();
|
setupMatrices();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user