本文整理汇总了Java中com.jme3.scene.VertexBuffer.getId方法的典型用法代码示例。如果您正苦于以下问题:Java VertexBuffer.getId方法的具体用法?Java VertexBuffer.getId怎么用?Java VertexBuffer.getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.scene.VertexBuffer
的用法示例。
在下文中一共展示了VertexBuffer.getId方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deleteBuffer
import com.jme3.scene.VertexBuffer; //导入方法依赖的package包/类
public void deleteBuffer(VertexBuffer vb) {
int bufId = vb.getId();
if (bufId != -1) {
// delete buffer
intBuf1.put(0, bufId);
intBuf1.position(0).limit(1);
glDeleteBuffers(intBuf1);
vb.resetObject();
}
}
示例2: deleteBuffer
import com.jme3.scene.VertexBuffer; //导入方法依赖的package包/类
public void deleteBuffer(VertexBuffer vb) {
int bufId = vb.getId();
if (bufId != -1) {
// delete buffer
intBuf1.put(0, bufId);
intBuf1.position(0).limit(1);
if (verboseLogging) {
logger.info("GLES20.glDeleteBuffers(1, buffer)");
}
Gdx.gl20.glDeleteBuffers(1, intBuf1);
vb.resetObject();
}
}
示例3: updateBufferData
import com.jme3.scene.VertexBuffer; //导入方法依赖的package包/类
public void updateBufferData(VertexBuffer vb) {
int bufId = vb.getId();
if (bufId == -1) {
// create buffer
gl.glGenBuffers(1, ib1);
bufId = ib1.get(0);
vb.setId(bufId);
objManager.registerForCleanup(vb);
}
int target;
if (vb.getBufferType() == VertexBuffer.Type.Index) {
target = gl.GL_ELEMENT_ARRAY_BUFFER;
if (context.boundElementArrayVBO != bufId) {
gl.glBindBuffer(target, bufId);
context.boundElementArrayVBO = bufId;
}
} else {
target = gl.GL_ARRAY_BUFFER;
if (context.boundArrayVBO != bufId) {
gl.glBindBuffer(target, bufId);
context.boundArrayVBO = bufId;
}
}
int usage = convertUsage(vb.getUsage());
Buffer data = vb.getData();
data.rewind();
gl.glBufferData(target,
data.capacity() * vb.getFormat().getComponentSize(),
data,
usage);
vb.clearUpdateNeeded();
}
示例4: deleteBuffer
import com.jme3.scene.VertexBuffer; //导入方法依赖的package包/类
public void deleteBuffer(VertexBuffer vb) {
int bufId = vb.getId();
if (bufId != -1) {
// delete buffer
ib1.put(0, bufId);
ib1.position(0).limit(1);
gl.glDeleteBuffers(1, ib1);
vb.resetObject();
}
}
示例5: deleteBuffer
import com.jme3.scene.VertexBuffer; //导入方法依赖的package包/类
public void deleteBuffer(VertexBuffer vb) {
int bufId = vb.getId();
if (bufId != -1) {
// delete buffer
intBuf1.put(0, bufId);
intBuf1.position(0).limit(1);
if (verboseLogging) {
logger.info("GLES20.glDeleteBuffers(1, buffer)");
}
GLES20.glDeleteBuffers(1, intBuf1);
vb.resetObject();
}
}
示例6: deleteBuffer
import com.jme3.scene.VertexBuffer; //导入方法依赖的package包/类
public void deleteBuffer(VertexBuffer vb) {
int bufId = vb.getId();
if (bufId != -1) {
// delete buffer
intBuf1.put(0, bufId);
intBuf1.position(0).limit(1);
deleteBuffer();
vb.resetObject();
}
}
示例7: updateBufferData
import com.jme3.scene.VertexBuffer; //导入方法依赖的package包/类
public void updateBufferData(VertexBuffer vb) {
GL gl = GLContext.getCurrentGL();
int bufId = vb.getId();
if (bufId == -1) {
// create buffer
gl.glGenBuffers(1, intBuf1);
bufId = intBuf1.get(0);
vb.setId(bufId);
objManager.registerForCleanup(vb);
}
int target;
if (vb.getBufferType() == VertexBuffer.Type.Index) {
target = GL.GL_ELEMENT_ARRAY_BUFFER;
if (context.boundElementArrayVBO != bufId) {
gl.glBindBuffer(target, bufId);
context.boundElementArrayVBO = bufId;
}
}
else {
target = GL.GL_ARRAY_BUFFER;
if (context.boundArrayVBO != bufId) {
gl.glBindBuffer(target, bufId);
context.boundArrayVBO = bufId;
}
}
int usage = convertUsage(vb.getUsage());
Buffer data = vb.getData();
data.rewind();
gl.glBufferData(target, data.capacity() * vb.getFormat().getComponentSize(), data, usage);
vb.clearUpdateNeeded();
}
示例8: deleteBuffer
import com.jme3.scene.VertexBuffer; //导入方法依赖的package包/类
public void deleteBuffer(VertexBuffer vb) {
int bufId = vb.getId();
if (bufId != -1) {
// delete buffer
intBuf1.put(0, bufId);
intBuf1.position(0).limit(1);
glDeleteBuffers(intBuf1);
vb.resetObject();
//statistics.onDeleteVertexBuffer();
}
}
示例9: setVertexAttribVBO
import com.jme3.scene.VertexBuffer; //导入方法依赖的package包/类
private void setVertexAttribVBO(VertexBuffer vb, VertexBuffer idb) {
int arrayType = convertArrayType(vb.getBufferType());
if (arrayType == -1) {
return; // unsupported
}
if (vb.isUpdateNeeded() && idb == null) {
updateBufferData(vb);
}
int bufId = idb != null ? idb.getId() : vb.getId();
if (context.boundArrayVBO != bufId) {
gl.glBindBuffer(gl.GL_ARRAY_BUFFER, bufId);
context.boundArrayVBO = bufId;
}
gl.glEnableClientState(arrayType);
context.boundAttribs[vb.getBufferType().ordinal()] = vb;
if (vb.getBufferType() == Type.Normal) {
// normalize if requested
if (vb.isNormalized() && !context.normalizeEnabled) {
gl.glEnable(gl.GL_NORMALIZE);
context.normalizeEnabled = true;
} else if (!vb.isNormalized() && context.normalizeEnabled) {
gl.glDisable(gl.GL_NORMALIZE);
context.normalizeEnabled = false;
}
}
int comps = vb.getNumComponents();
int type = convertVertexFormat(vb.getFormat());
switch (vb.getBufferType()) {
case Position:
gl.glVertexPointer(comps, type, vb.getStride(), vb.getOffset());
break;
case Normal:
gl.glNormalPointer(type, vb.getStride(), vb.getOffset());
break;
case Color:
gl.glColorPointer(comps, type, vb.getStride(), vb.getOffset());
break;
case TexCoord:
gl.glTexCoordPointer(comps, type, vb.getStride(), vb.getOffset());
break;
}
}
示例10: setVertexAttribVBO
import com.jme3.scene.VertexBuffer; //导入方法依赖的package包/类
@Override
protected void setVertexAttribVBO(VertexBuffer vb, VertexBuffer idb) {
GL gl = GLContext.getCurrentGL();
int arrayType = convertArrayType(vb.getBufferType());
if (arrayType == -1) {
return; // unsupported
}
if (vb.isUpdateNeeded() && idb == null) {
updateBufferData(vb);
}
int bufId = idb != null ? idb.getId() : vb.getId();
if (context.boundArrayVBO != bufId) {
gl.glBindBuffer(GL.GL_ARRAY_BUFFER, bufId);
context.boundArrayVBO = bufId;
}
gl.getGL2().glEnableClientState(arrayType);
context.boundAttribs[vb.getBufferType().ordinal()] = vb;
if (vb.getBufferType() == Type.Normal) {
// normalize if requested
if (vb.isNormalized() && !context.normalizeEnabled) {
gl.glEnable(GLLightingFunc.GL_NORMALIZE);
context.normalizeEnabled = true;
}
else if (!vb.isNormalized() && context.normalizeEnabled) {
gl.glDisable(GLLightingFunc.GL_NORMALIZE);
context.normalizeEnabled = false;
}
}
int comps = vb.getNumComponents();
int type = convertVertexFormat(vb.getFormat());
switch (vb.getBufferType()) {
case Position:
gl.getGL2().glVertexPointer(comps, type, vb.getStride(), vb.getOffset());
break;
case Normal:
gl.getGL2().glNormalPointer(type, vb.getStride(), vb.getOffset());
break;
case Color:
gl.getGL2().glColorPointer(comps, type, vb.getStride(), vb.getOffset());
break;
case TexCoord:
gl.getGL2().glTexCoordPointer(comps, type, vb.getStride(), vb.getOffset());
break;
}
}