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


Java ARBVertexBufferObject类代码示例

本文整理汇总了Java中org.lwjgl.opengl.ARBVertexBufferObject的典型用法代码示例。如果您正苦于以下问题:Java ARBVertexBufferObject类的具体用法?Java ARBVertexBufferObject怎么用?Java ARBVertexBufferObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ARBVertexBufferObject类属于org.lwjgl.opengl包,在下文中一共展示了ARBVertexBufferObject类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: glBindBuffer

import org.lwjgl.opengl.ARBVertexBufferObject; //导入依赖的package包/类
public static void glBindBuffer(int target, int buffer)
{
    if (arbVbo)
    {
        ARBVertexBufferObject.glBindBufferARB(target, buffer);
    }
    else
    {
        GL15.glBindBuffer(target, buffer);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:12,代码来源:OpenGlHelper.java

示例2: glBufferData

import org.lwjgl.opengl.ARBVertexBufferObject; //导入依赖的package包/类
public static void glBufferData(int target, ByteBuffer data, int usage)
{
    if (arbVbo)
    {
        ARBVertexBufferObject.glBufferDataARB(target, data, usage);
    }
    else
    {
        GL15.glBufferData(target, data, usage);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:12,代码来源:OpenGlHelper.java

示例3: glDeleteBuffers

import org.lwjgl.opengl.ARBVertexBufferObject; //导入依赖的package包/类
public static void glDeleteBuffers(int buffer)
{
    if (arbVbo)
    {
        ARBVertexBufferObject.glDeleteBuffersARB(buffer);
    }
    else
    {
        GL15.glDeleteBuffers(buffer);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:12,代码来源:OpenGlHelper.java

示例4: Tesselator

import org.lwjgl.opengl.ARBVertexBufferObject; //导入依赖的package包/类
public Tesselator(int size) {
	this.size = size;

	this.byteBuffer = BufferUtils.createByteBuffer(size * 4);
	this.intBuffer = byteBuffer.asIntBuffer();
	this.floatBuffer = byteBuffer.asFloatBuffer();
	this.shortBuffer = byteBuffer.asShortBuffer();
	this.array = new int[size];

	this.vboMode = ((USE_VBO) && (GLContext.getCapabilities().GL_ARB_vertex_buffer_object));
	if (this.vboMode) {
		this.vboIds = BufferUtils.createIntBuffer(this.vboCounts);
		ARBVertexBufferObject.glGenBuffersARB(this.vboIds);
	}
}
 
开发者ID:Melanistic,项目名称:CubeShaft,代码行数:16,代码来源:Tesselator.java

示例5: Tessellator

import org.lwjgl.opengl.ARBVertexBufferObject; //导入依赖的package包/类
private Tessellator(int p_i1250_1_) {
   this.field_78388_E = p_i1250_1_;
   this.field_78394_d = GLAllocation.func_74524_c(p_i1250_1_ * 4);
   this.field_78395_e = this.field_78394_d.asIntBuffer();
   this.field_78392_f = this.field_78394_d.asFloatBuffer();
   this.field_78393_g = this.field_78394_d.asShortBuffer();
   this.field_78405_h = new int[p_i1250_1_];
   this.field_78389_A = field_78397_c && GLContext.getCapabilities().GL_ARB_vertex_buffer_object;
   if(this.field_78389_A) {
      this.field_78390_B = GLAllocation.func_74527_f(this.field_78387_D);
      ARBVertexBufferObject.glGenBuffersARB(this.field_78390_B);
   }

}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:15,代码来源:Tessellator.java

示例6: vTriFillVbo

import org.lwjgl.opengl.ARBVertexBufferObject; //导入依赖的package包/类
public void vTriFillVbo(){
	if(vTriangles.size() != 0){
		vboVertices = ByteBuffer.allocateDirect(3 * 2 * (vTriangles.size()*3) * 4).order(ByteOrder.nativeOrder()).asFloatBuffer();
		vboIndices = ByteBuffer.allocateDirect((vTriangles.size()*3) * 4).order(ByteOrder.nativeOrder()).asIntBuffer();
		for(int x = 0; x < vTriangles.size(); x++){
			((vTriangle) vTriangles.get(x)).vPut();
			vboIndices.put(x*3+0).put(x*3+1).put(x*3+2);
		}
		vboVertices.rewind();
		vboIndices.rewind();
		ARBBufferObject.glBufferDataARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, 3 * 2 * (vTriangles.size()*3) * 4, ARBBufferObject.GL_DYNAMIC_DRAW_ARB);
		ARBBufferObject.glBufferDataARB(ARBVertexBufferObject.GL_ELEMENT_ARRAY_BUFFER_ARB, 3 * 2 * (vTriangles.size()*3) * 4, ARBBufferObject.GL_DYNAMIC_DRAW_ARB);
		if(!vVBOSETONCE)vVBOSETONCE=true;
	}
}
 
开发者ID:Sivx,项目名称:Sivx-3DDesktop,代码行数:16,代码来源:engine - Copy.java

示例7: vLineFillVbo

import org.lwjgl.opengl.ARBVertexBufferObject; //导入依赖的package包/类
public void vLineFillVbo(){
	if(vLines.size() != 0){
		vboLineVertices = ByteBuffer.allocateDirect(3 * (vLines.size()*2) * 4).order(ByteOrder.nativeOrder()).asFloatBuffer();
		vboLineIndices = ByteBuffer.allocateDirect((vLines.size()*2) * 4).order(ByteOrder.nativeOrder()).asIntBuffer();
		for(int x = 0; x < vLines.size(); x++){
			((vLine) vLines.get(x)).vPut();
			vboLineIndices.put(x*2+0).put(x*2+1);
		}
		vboLineVertices.rewind();
		vboLineIndices.rewind();
		ARBBufferObject.glBufferDataARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, 3 * (vLines.size()*2) * 4, ARBBufferObject.GL_DYNAMIC_DRAW_ARB);
		ARBBufferObject.glBufferDataARB(ARBVertexBufferObject.GL_ELEMENT_ARRAY_BUFFER_ARB, 3 * (vLines.size()*2) * 4, ARBBufferObject.GL_DYNAMIC_DRAW_ARB);
		if(!vVBOSETONCE)vVBOSETONCE=true;
	}
}
 
开发者ID:Sivx,项目名称:Sivx-3DDesktop,代码行数:16,代码来源:engine - Copy.java

示例8: glGenBuffers

import org.lwjgl.opengl.ARBVertexBufferObject; //导入依赖的package包/类
public static int glGenBuffers()
{
    return arbVbo ? ARBVertexBufferObject.glGenBuffersARB() : GL15.glGenBuffers();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:5,代码来源:OpenGlHelper.java

示例9: FloatVBO

import org.lwjgl.opengl.ARBVertexBufferObject; //导入依赖的package包/类
public FloatVBO(int usage, int size) {
	super(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, usage, size<<2);
	ByteBuffer buffer = getSavedBuffer();
	if (buffer != null)
		saved_buffer = buffer.asFloatBuffer();
}
 
开发者ID:sunenielsen,项目名称:tribaltrouble,代码行数:7,代码来源:FloatVBO.java

示例10: releaseAll

import org.lwjgl.opengl.ARBVertexBufferObject; //导入依赖的package包/类
public final static void releaseAll() {
	if (Settings.getSettings().useVBO()) {
		makeCurrent(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, 0);
	}
	releaseIndexVBO();
}
 
开发者ID:sunenielsen,项目名称:tribaltrouble,代码行数:7,代码来源:VBO.java

示例11: releaseIndexVBO

import org.lwjgl.opengl.ARBVertexBufferObject; //导入依赖的package包/类
public final static void releaseIndexVBO() {
	if (Settings.getSettings().useVBO()) {
		makeCurrent(ARBVertexBufferObject.GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
	}
}
 
开发者ID:sunenielsen,项目名称:tribaltrouble,代码行数:6,代码来源:VBO.java

示例12: run

import org.lwjgl.opengl.ARBVertexBufferObject; //导入依赖的package包/类
public void run(){			debug("In the run block");			try{				debug("Setting Full Screen");				Display.setFullscreen(vFullscreen);				debug("Getting Available Display Modes");		        DisplayMode d[] = Display.getAvailableDisplayModes();		        for (int i = 0; i < d.length; i++) {		        	debug("Possible mode: w[" + d[i].getWidth() + "] h[" + d[i].getHeight() + "] pixel depth["+d[i].getBitsPerPixel()+"]");		            if (d[i].getWidth() == vScreenW		                && d[i].getHeight() == vScreenH		                && d[i].getBitsPerPixel() == vDpi) {		                vDisplayMode = d[i];		                break;		            }		        }		        Display.setDisplayMode(vDisplayMode);		        Display.setLocation(0,0);		        Display.setTitle(vTitle);		        Display.create();			}catch(Exception e){debug("Video Exception: " + e);}						GL11.glMatrixMode(GL11.GL_PROJECTION);        	GL11.glLoadIdentity();        	GLU.gluPerspective(45.0f,(float) vDisplayMode.getWidth() / (float) vDisplayMode.getHeight(),0.1f,500.0f);        	GL11.glMatrixMode(GL11.GL_MODELVIEW);        	GL11.glDisable(GL11.GL_BLEND);        	GL11.glEnable(GL11.GL_DEPTH_TEST);        	GL11.glClearColor(0.18f, .18f, 1f, 0.0f);        	        				if (!GLContext.getCapabilities().GL_ARB_vertex_buffer_object){				System.out.println("ARB VBO not supported!");				System.exit(1);			}			IntBuffer vboInt_buffer = ByteBuffer.allocateDirect(8).order(ByteOrder.nativeOrder()).asIntBuffer();			ARBBufferObject.glGenBuffersARB(vboInt_buffer);			vboBuffer_id = vboInt_buffer.get(0);			vboIndices_buffer_id = vboInt_buffer.get(1);			ARBBufferObject.glBindBufferARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, vboBuffer_id);			ARBBufferObject.glBindBufferARB(ARBVertexBufferObject.GL_ELEMENT_ARRAY_BUFFER_ARB, vboIndices_buffer_id);			GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY);			GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY);						GL11.glVertexPointer(3, GL11.GL_FLOAT, (3+2)*4, 0);			GL11.glTexCoordPointer(2, GL11.GL_FLOAT, (3+2)*4, (3)*4);						textureUtil.map.add("images/minus.bmp");			textureUtil.map.add("images/minus.bmp");						textureUtil.map.add("images/fontTest.bmp");												GL11.glEnable(GL11.GL_TEXTURE_2D);			textureUtil.addT("PNG", "textureMap.png");			textureUtil.bind(0);						        	        	GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);       			while(true){				vFrameCount++;								if (!Display.isVisible())uSleep(100);				else if(Display.isCloseRequested())System.exit(0);				GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);                GL11.glLoadIdentity();		        GL11.glRotatef(vCameraLook,1.0f,0,0);		        GL11.glRotatef(360.0f - vCameraAngle,0,1.0f,0);		        GL11.glTranslatef(-vCameraX, -vCameraY, -vCameraZ);								if(vVBOSETONCE){					vLineGrid();					vTriFillVbo();															GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY);										GL11.glVertexPointer(3, GL11.GL_FLOAT, (3+2)*4, 0);					GL11.glTexCoordPointer(2, GL11.GL_FLOAT, (3+2)*4, (3)*4);					ByteBuffer new_mapped_buffer = ARBBufferObject.glMapBufferARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB,ARBBufferObject.GL_WRITE_ONLY_ARB,vboMapped_buffer);					if (new_mapped_buffer != vboMapped_buffer)vboMapped_float_buffer = new_mapped_buffer.order(ByteOrder.nativeOrder()).asFloatBuffer();					vboMapped_buffer = new_mapped_buffer;					new_mapped_buffer = ARBBufferObject.glMapBufferARB(ARBVertexBufferObject.GL_ELEMENT_ARRAY_BUFFER_ARB,ARBBufferObject.GL_WRITE_ONLY_ARB,vboMapped_indices_buffer);					if (new_mapped_buffer != vboMapped_indices_buffer)vboMapped_indices_int_buffer = new_mapped_buffer.order(ByteOrder.nativeOrder()).asIntBuffer();					vboMapped_float_buffer.rewind();					vboVertices.rewind();					vboMapped_float_buffer.put(vboVertices);					vboMapped_indices_int_buffer.rewind();					vboIndices.rewind();					vboMapped_indices_int_buffer.put(vboIndices);					if (ARBBufferObject.glUnmapBufferARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB) && ARBBufferObject.glUnmapBufferARB(ARBVertexBufferObject.GL_ELEMENT_ARRAY_BUFFER_ARB)){						GL11.glDrawElements(GL11.GL_TRIANGLES, vTriangles.size()*3, GL11.GL_UNSIGNED_INT, 0);					}															GL11.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY);										GL11.glVertexPointer(3, GL11.GL_FLOAT,0, 0);					vLineFillVbo();										ByteBuffer new_Linemapped_buffer = ARBBufferObject.glMapBufferARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB,ARBBufferObject.GL_WRITE_ONLY_ARB,vboLineMapped_buffer);					if (new_Linemapped_buffer != vboLineMapped_buffer)vboLineMapped_float_buffer = new_Linemapped_buffer.order(ByteOrder.nativeOrder()).asFloatBuffer();					vboLineMapped_buffer = new_Linemapped_buffer;					new_Linemapped_buffer = ARBBufferObject.glMapBufferARB(ARBVertexBufferObject.GL_ELEMENT_ARRAY_BUFFER_ARB,ARBBufferObject.GL_WRITE_ONLY_ARB,vboLineMapped_indices_buffer);					if (new_Linemapped_buffer != vboLineMapped_indices_buffer)vboLineMapped_indices_int_buffer = new_Linemapped_buffer.order(ByteOrder.nativeOrder()).asIntBuffer();					vboLineMapped_float_buffer.rewind();					vboLineVertices.rewind();					vboLineMapped_float_buffer.put(vboLineVertices);					vboLineMapped_indices_int_buffer.rewind();					vboLineIndices.rewind();					vboLineMapped_indices_int_buffer.put(vboLineIndices);					if (ARBBufferObject.glUnmapBufferARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB) && ARBBufferObject.glUnmapBufferARB(ARBVertexBufferObject.GL_ELEMENT_ARRAY_BUFFER_ARB)){						GL11.glDrawElements(GL11.GL_LINES, vLines.size()*2, GL11.GL_UNSIGNED_INT, 0);					}				}				Display.update();				uSleep(1);				if(vThreadPausedHint){					vThreadPausedHint = false;					vThreadPaused = true;					while(vThreadPaused){						uSleep(1);					}				}				else{					if(vRefreshVbo){						vTriFillVbo();												vRefreshVbo = false;					}				}			}		} 
开发者ID:Sivx,项目名称:Sivx-3DDesktop,代码行数:2,代码来源:engine.java

示例13: vTriFillVbo

import org.lwjgl.opengl.ARBVertexBufferObject; //导入依赖的package包/类
public void vTriFillVbo(){			if(vTriangles.size() != 0){				vboVertices = ByteBuffer.allocateDirect(3 * 2 * (vTriangles.size()*3) * 4).order(ByteOrder.nativeOrder()).asFloatBuffer();				vboIndices = ByteBuffer.allocateDirect((vTriangles.size()*3) * 4).order(ByteOrder.nativeOrder()).asIntBuffer();				for(int x = 0; x < vTriangles.size(); x++){					((vTriangle) vTriangles.get(x)).vPut();					vboIndices.put(x*3+0).put(x*3+1).put(x*3+2);				}				vboVertices.rewind();				vboIndices.rewind();				ARBBufferObject.glBufferDataARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, 3 * 2 * (vTriangles.size()*3) * 4, ARBBufferObject.GL_DYNAMIC_DRAW_ARB);				ARBBufferObject.glBufferDataARB(ARBVertexBufferObject.GL_ELEMENT_ARRAY_BUFFER_ARB, 3 * 2 * (vTriangles.size()*3) * 4, ARBBufferObject.GL_DYNAMIC_DRAW_ARB);				if(!vVBOSETONCE)vVBOSETONCE=true;			}		} 
开发者ID:Sivx,项目名称:Sivx-3DDesktop,代码行数:2,代码来源:engine.java

示例14: vLineFillVbo

import org.lwjgl.opengl.ARBVertexBufferObject; //导入依赖的package包/类
public void vLineFillVbo(){			if(vLines.size() != 0){				vboLineVertices = ByteBuffer.allocateDirect(3 * (vLines.size()*2) * 4).order(ByteOrder.nativeOrder()).asFloatBuffer();				vboLineIndices = ByteBuffer.allocateDirect((vLines.size()*2) * 4).order(ByteOrder.nativeOrder()).asIntBuffer();				for(int x = 0; x < vLines.size(); x++){					((vLine) vLines.get(x)).vPut();					vboLineIndices.put(x*2+0).put(x*2+1);				}				vboLineVertices.rewind();				vboLineIndices.rewind();				ARBBufferObject.glBufferDataARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, 3 * (vLines.size()*2) * 4, ARBBufferObject.GL_DYNAMIC_DRAW_ARB);				ARBBufferObject.glBufferDataARB(ARBVertexBufferObject.GL_ELEMENT_ARRAY_BUFFER_ARB, 3 * (vLines.size()*2) * 4, ARBBufferObject.GL_DYNAMIC_DRAW_ARB);				if(!vVBOSETONCE)vVBOSETONCE=true;			}		} 
开发者ID:Sivx,项目名称:Sivx-3DDesktop,代码行数:2,代码来源:engine.java


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