本文整理汇总了Java中com.badlogic.gdx.graphics.VertexAttributes.get方法的典型用法代码示例。如果您正苦于以下问题:Java VertexAttributes.get方法的具体用法?Java VertexAttributes.get怎么用?Java VertexAttributes.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.graphics.VertexAttributes
的用法示例。
在下文中一共展示了VertexAttributes.get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAttributeLocations
import com.badlogic.gdx.graphics.VertexAttributes; //导入方法依赖的package包/类
protected final int[] getAttributeLocations(Renderable renderable) {
final IntIntMap attributes = new IntIntMap();
final VertexAttributes attrs = renderable.meshPart.mesh.getVertexAttributes();
final int c = attrs.size();
for (int i = 0; i < c; i++) {
final VertexAttribute attr = attrs.get(i);
final int location = program.getAttributeLocation(attr.alias);
if (location >= 0)
attributes.put(attr.getKey(), location);
}
tempArray.clear();
final int n = attrs.size();
for (int i = 0; i < n; i++) {
tempArray.add(attributes.get(attrs.get(i).getKey(), -1));
}
return tempArray.items;
}
示例2: init
import com.badlogic.gdx.graphics.VertexAttributes; //导入方法依赖的package包/类
/** Initialize this shader, causing all registered uniforms/attributes to be fetched. */
public void init (final ShaderProgram program, final Renderable renderable) {
if (locations != null) throw new GdxRuntimeException("Already initialized");
if (!program.isCompiled()) throw new GdxRuntimeException(program.getLog());
this.program = program;
final int n = uniforms.size;
locations = new int[n];
for (int i = 0; i < n; i++) {
final String input = uniforms.get(i);
final Validator validator = validators.get(i);
final Setter setter = setters.get(i);
if (validator != null && !validator.validate(this, i, renderable))
locations[i] = -1;
else {
locations[i] = program.fetchUniformLocation(input, false);
if (locations[i] >= 0 && setter != null) {
if (setter.isGlobal(this, i))
globalUniforms.add(i);
else
localUniforms.add(i);
}
}
if (locations[i] < 0) {
validators.set(i, null);
setters.set(i, null);
}
}
if (renderable != null) {
final VertexAttributes attrs = renderable.mesh.getVertexAttributes();
final int c = attrs.size();
for (int i = 0; i < c; i++) {
final VertexAttribute attr = attrs.get(i);
final int location = program.getAttributeLocation(attr.alias);
if (location >= 0) attributes.put(attr.getKey(), location);
}
}
}
示例3: a
import com.badlogic.gdx.graphics.VertexAttributes; //导入方法依赖的package包/类
public static VertexAttribute a(VertexAttributes paramVertexAttributes)
{
for (int i = 0; i < paramVertexAttributes.size(); i++)
{
VertexAttribute localVertexAttribute = paramVertexAttributes.get(i);
if (localVertexAttribute.usage == 0)
return localVertexAttribute;
}
return null;
}