Code example for ShortBuffer

Methods: clear, position

0
        if (GLFrame.textureCur == null || GLFrame.framesCount == 0) {
            return; 
        } 
        int texture_id = GLFrame.textureCur.getTextureID();
 
        GLFrame.vertexBuffer.position(0);
        gl.glVertexPointer(2, GL10.GL_SHORT, 0, vertexBuffer);//FloatBuffer.wrap(vertices)); IllegalArgumentException: Must use a native order direct Buffer
 
        if (texture_id != -1) {
            textureBuffer.position(0);
            gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, textureBuffer);
            gl.glBindTexture(GL10.GL_TEXTURE_2D, texture_id);
        } 
 
        gl.glDrawArrays(GL10.GL_TRIANGLES, 0, VERTEX_COUNT / 2 * GLFrame.framesCount);
 
        int error = gl.glGetError();
        if (error != GL10.GL_NO_ERROR) {
            //Debug.logEx(new IllegalArgumentException("GLFrame.draw.Error: " + error)); 
        } 
 
        clean(gl);
        drawCount++;
    } 
 
    private static void clean(GL10 gl) {
        //послеотрисовочная очистка 
        GLFrame.framesCount = 0;
        GLFrame.vertexBuffer.clear();
        GLFrame.textureBuffer.clear();
        gl.glColor4f(GLFrame.transparency, GLFrame.transparency, GLFrame.transparency, GLFrame.transparency);
    } 
 
    public static void setTransparency(float transparency) {