本文整理汇总了Java中org.lwjgl.opengl.GL11.GL_FLOAT属性的典型用法代码示例。如果您正苦于以下问题:Java GL11.GL_FLOAT属性的具体用法?Java GL11.GL_FLOAT怎么用?Java GL11.GL_FLOAT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.lwjgl.opengl.GL11
的用法示例。
在下文中一共展示了GL11.GL_FLOAT属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateData
public VBO updateData(FloatBuffer buffer, long offset)
{
if (this.type != GL11.GL_FLOAT)
{
throw new IllegalArgumentException("Cannot store mismatching type in buffer!");
}
if (offset + buffer.limit() > this.length)
{
int usage = GL15.glGetBufferParameteri(this.target, GL15.GL_BUFFER_USAGE);
this.putData(buffer, this.normalized, usage);
}
GL15.glBindBuffer(this.target, this.handle);
GL15.glBufferSubData(this.target, offset, buffer);
return this;
}
示例2: getTextureBufferType
private static int getTextureBufferType(Bitmap.Format format)
{
switch (format)
{
case GRAYSCALE:
case GRAYSCALEALPHA:
case RGB:
case RGBA:
return GL11.GL_UNSIGNED_BYTE;
case DEPTH:
return GL11.GL_FLOAT;
default:
throw new UnsupportedOperationException("Unrecognized bitmap format!");
}
}
示例3: calcBytesPerVertex
private int calcBytesPerVertex() {
if (dataType == GL11.GL_FLOAT || dataType == GL11.GL_UNSIGNED_INT || dataType == GL11.GL_INT) {
return 4 * componentCount;
} else if (dataType == GL11.GL_SHORT || dataType == GL11.GL_UNSIGNED_SHORT) {
return 2 * componentCount;
} else if (dataType == GL11.GL_BYTE || dataType == GL11.GL_UNSIGNED_BYTE) {
return 1 * componentCount;
} else if (dataType == GL12.GL_UNSIGNED_INT_2_10_10_10_REV) {
return 4;
}
System.err.println("Unsupported data type for VAO attribute: " + dataType);
return 0;
}
示例4: putData
public VBO putData(FloatBuffer buffer, boolean normalized, int usage)
{
GL15.glBindBuffer(this.target, this.handle);
GL15.glBufferData(this.target, buffer, usage);
this.type = GL11.GL_FLOAT;
this.normalized = normalized;
this.length = buffer.limit();
return this;
}
示例5: calcBytesPerVertex
private int calcBytesPerVertex() {
if (dataType == GL11.GL_FLOAT || dataType == GL11.GL_UNSIGNED_INT || dataType == GL11.GL_INT) {
return 4 * componentCount;
} else if (dataType == GL11.GL_SHORT || dataType == GL11.GL_UNSIGNED_SHORT) {
return 2 * componentCount;
} else if (dataType == GL11.GL_BYTE || dataType == GL11.GL_UNSIGNED_BYTE) {
return 1 * componentCount;
} else if (dataType == GL12.GL_UNSIGNED_INT_2_10_10_10_REV) {
return 4;
}
System.err.println("Unsupported data type for VAO attribute: " + dataType);
return 0;
}