本文整理汇总了Java中org.lwjgl.opengl.GL20.glUniform2f方法的典型用法代码示例。如果您正苦于以下问题:Java GL20.glUniform2f方法的具体用法?Java GL20.glUniform2f怎么用?Java GL20.glUniform2f使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.lwjgl.opengl.GL20
的用法示例。
在下文中一共展示了GL20.glUniform2f方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadVec2
import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
public void loadVec2(float x, float y) {
if (!used || x != currentX || y != currentY) {
this.currentX = x;
this.currentY = y;
used = true;
GL20.glUniform2f(super.getLocation(), x, y);
}
}
示例2: set
import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
/** Set an array or individual float(s)
*
* @param uniform name of a uniform
* @param floats float(s) to set
*/
public void set(String uniform, float...floats){
if(floats.length == 1){
GL20.glUniform1f(getUniform(uniform), floats[0]);
}else if(floats.length == 2){
GL20.glUniform2f(getUniform(uniform), floats[0], floats[1]);
}else if(floats.length == 3){
GL20.glUniform3f(getUniform(uniform), floats[0], floats[1], floats[2]);
}else if(floats.length >= 4){
GL20.glUniform4f(getUniform(uniform), floats[0], floats[1], floats[2], floats[3]);
}
}
示例3: loadVec2
import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
public void loadVec2(float x, float y) {
if (!used || x != currentX || y != currentY) {
this.currentX = x;
this.currentY = y;
used = true;
GL20.glUniform2f(super.getLocation(), x, y);
}
}
示例4: loadData
import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
public void loadData(Vector2f value) {
GL20.glUniform2f(uniformLocation, value.x, value.y);
}
示例5: setUniform
import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
public void setUniform(String uniformName, Vector2fc vec)
{
GL20.glUniform2f(this.findUniformLocation(uniformName), vec.x(), vec.y());
}
示例6: apply
import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
@Override
public void apply(Program program, Vector2fc value)
{
int location = program.findUniformLocation(this.getName());
GL20.glUniform2f(location, value.x(), value.y());
}
示例7: setVector
import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
public void setVector(String label, Vector2f value) {
GL20.glUniform2f(getUniform(label), value.x, value.y);
}
示例8: load2DVector
import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
protected void load2DVector(int location, Vector2f vector) {
GL20.glUniform2f(location, vector.x, vector.y);
}