use of gnu.trove.iterator.TIntIntIterator in project Terasology by MovingBlocks.
the class GLSLMaterial method setMatrix3.
@Override
public void setMatrix3(String desc, FloatBuffer value, boolean currentOnly) {
if (isDisposed()) {
return;
}
if (currentOnly) {
enable();
int id = getUniformLocation(getActiveShaderProgramId(), desc);
GL20.glUniformMatrix3(id, false, value);
} else {
TIntIntIterator it = disposalAction.shaderPrograms.iterator();
while (it.hasNext()) {
it.advance();
GL20.glUseProgram(it.value());
int id = getUniformLocation(it.value(), desc);
GL20.glUniformMatrix3(id, false, value);
}
restoreStateAfterUniformsSet();
}
}
use of gnu.trove.iterator.TIntIntIterator in project Terasology by MovingBlocks.
the class GLSLMaterial method setFloat2.
@Override
public void setFloat2(String desc, FloatBuffer buffer, boolean currentOnly) {
if (isDisposed()) {
return;
}
if (currentOnly) {
enable();
int id = getUniformLocation(getActiveShaderProgramId(), desc);
GL20.glUniform2(id, buffer);
} else {
TIntIntIterator it = disposalAction.shaderPrograms.iterator();
while (it.hasNext()) {
it.advance();
GL20.glUseProgram(it.value());
int id = getUniformLocation(it.value(), desc);
GL20.glUniform2(id, buffer);
}
restoreStateAfterUniformsSet();
}
}
use of gnu.trove.iterator.TIntIntIterator in project Terasology by MovingBlocks.
the class GLSLMaterial method setFloat1.
@Override
public void setFloat1(String desc, FloatBuffer buffer, boolean currentOnly) {
if (isDisposed()) {
return;
}
if (currentOnly) {
enable();
int id = getUniformLocation(getActiveShaderProgramId(), desc);
GL20.glUniform1(id, buffer);
} else {
TIntIntIterator it = disposalAction.shaderPrograms.iterator();
while (it.hasNext()) {
it.advance();
GL20.glUseProgram(it.value());
int id = getUniformLocation(it.value(), desc);
GL20.glUniform1(id, buffer);
}
restoreStateAfterUniformsSet();
}
}
use of gnu.trove.iterator.TIntIntIterator in project Terasology by MovingBlocks.
the class GLSLMaterial method setFloat3.
@Override
public void setFloat3(String desc, float f1, float f2, float f3, boolean currentOnly) {
if (isDisposed()) {
return;
}
if (currentOnly) {
enable();
int id = getUniformLocation(getActiveShaderProgramId(), desc);
GL20.glUniform3f(id, f1, f2, f3);
} else {
TIntIntIterator it = disposalAction.shaderPrograms.iterator();
while (it.hasNext()) {
it.advance();
GL20.glUseProgram(it.value());
int id = getUniformLocation(it.value(), desc);
GL20.glUniform3f(id, f1, f2, f3);
}
restoreStateAfterUniformsSet();
}
}
use of gnu.trove.iterator.TIntIntIterator in project Terasology by MovingBlocks.
the class GLSLMaterial method setBoolean.
@Override
public void setBoolean(String desc, boolean value, boolean currentOnly) {
if (isDisposed()) {
return;
}
if (currentOnly) {
enable();
int id = getUniformLocation(getActiveShaderProgramId(), desc);
GL20.glUniform1i(id, value ? 1 : 0);
} else {
TIntIntIterator it = disposalAction.shaderPrograms.iterator();
while (it.hasNext()) {
it.advance();
GL20.glUseProgram(it.value());
int id = getUniformLocation(it.value(), desc);
GL20.glUniform1i(id, value ? 1 : 0);
}
restoreStateAfterUniformsSet();
}
}
Aggregations