当前位置: 首页>>代码示例>>Java>>正文


Java VertexBuffer.getId方法代码示例

本文整理汇总了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();
    }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:11,代码来源:LwjglRenderer.java

示例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();
    }
}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:15,代码来源:GdxRenderer.java

示例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();
}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:37,代码来源:JoglRenderer.java

示例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();
    }
}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:11,代码来源:JoglRenderer.java

示例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();
    }
}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:15,代码来源:OGLESShaderRenderer.java

示例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();
    }
}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:11,代码来源:AbstractRenderer.java

示例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();
}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:36,代码来源:JoglRenderer.java

示例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();
    }
}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:13,代码来源:LwjglRenderer.java

示例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;
    }
}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:48,代码来源:JoglRenderer.java

示例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;
    }
}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:52,代码来源:JoglRenderer.java


注:本文中的com.jme3.scene.VertexBuffer.getId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。