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


Java GL11.glVertexPointer方法代码示例

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


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

示例1: bind

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
 * The first stage of rendering.
 * Binds (finalizes) the current rendering data stored in the buffer for drawing.
 * This must be executed before you perform a rendering pass.
 *
 * @return The original Tessellator Object
 */
@Override
public Tessellator bind() {
	final int dex = this.index * 6;
	this.iBuffer.put(this.raw, 0, dex);
	this.buffer.position(0);
	this.buffer.limit(dex * 4);
	if (this.color) {                           // if we've entered color data, push color data down the pipeline.
		this.buffer.position(12);
		GL11.glColorPointer(4, true, 24, this.buffer);
	}
	if (this.texture) {                         // if we've entered texture data, push texture data down the pipeline.
		this.fBuffer.position(4);
		GL11.glTexCoordPointer(2, 24, this.fBuffer);
	}
	this.fBuffer.position(0);
	GL11.glVertexPointer(3, 24, this.fBuffer); // pushing bare minimum vertex data.
	return this;
}
 
开发者ID:ImpactDevelopment,项目名称:ClientAPI,代码行数:26,代码来源:BasicTess.java

示例2: setupArrayPointers

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
private void setupArrayPointers()
{
    if (Config.isShaders())
    {
        ShadersRender.setupArrayPointersVbo();
    }
    else
    {
        GL11.glVertexPointer(3, GL11.GL_FLOAT, 28, 0L);
        GL11.glColorPointer(4, GL11.GL_UNSIGNED_BYTE, 28, 12L);
        GL11.glTexCoordPointer(2, GL11.GL_FLOAT, 28, 16L);
        OpenGlHelper.setClientActiveTexture(OpenGlHelper.lightmapTexUnit);
        GL11.glTexCoordPointer(2, GL11.GL_SHORT, 28, 24L);
        OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit);
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:17,代码来源:VboRenderList.java

示例3: flushBuffer

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
 * Flush the currently cached data down to the card 
 */
private void flushBuffer() {	
	if (vertIndex == 0) {
		return;
	}
	if (currentType == NONE) {
		return;
	}
	
	if (vertIndex < TOLERANCE) {
		GL11.glBegin(currentType);
		for (int i=0;i<vertIndex;i++) {
			GL11.glColor4f(cols[(i*4)+0], cols[(i*4)+1], cols[(i*4)+2], cols[(i*4)+3]);
			GL11.glTexCoord2f(texs[(i*2)+0], texs[(i*2)+1]);
			GL11.glVertex3f(verts[(i*3)+0], verts[(i*3)+1], verts[(i*3)+2]);
		}
		GL11.glEnd();
		currentType = NONE;
		return;
	}
	vertices.clear();
	colors.clear();
	textures.clear();
	
	vertices.put(verts,0,vertIndex*3);
	colors.put(cols,0,vertIndex*4);
	textures.put(texs,0,vertIndex*2);
	
	vertices.flip(); 
	colors.flip(); 
	textures.flip(); 
	
	GL11.glVertexPointer(3,0,vertices);     
	GL11.glColorPointer(4,0,colors);     
	GL11.glTexCoordPointer(2,0,textures);     
	
	GL11.glDrawArrays(currentType, 0, vertIndex);
	currentType = NONE;
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:42,代码来源:VAOGLRenderer.java

示例4: bind

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
 * Binds OpenGL to our VBO for rendering.
 *
 * @return The original VBO
 */
public VBO bind() {
	FEATHER.bindBuffer(this.id);
	GL11.glVertexPointer(this.dimensions, GL11.GL_FLOAT, 0, 0L);
	GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY);
	return this;
}
 
开发者ID:ImpactDevelopment,项目名称:ClientAPI,代码行数:12,代码来源:VBO.java

示例5: setupArrayPointers

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
private void setupArrayPointers()
{
    GL11.glVertexPointer(3, GL11.GL_FLOAT, 28, 0L);
    GL11.glColorPointer(4, GL11.GL_UNSIGNED_BYTE, 28, 12L);
    GL11.glTexCoordPointer(2, GL11.GL_FLOAT, 28, 16L);
    OpenGlHelper.setClientActiveTexture(OpenGlHelper.lightmapTexUnit);
    GL11.glTexCoordPointer(2, GL11.GL_SHORT, 28, 24L);
    OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:10,代码来源:VboRenderList.java

示例6: setupArrayPointersVbo

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void setupArrayPointersVbo()
{
    int i = 14;
    GL11.glVertexPointer(3, GL11.GL_FLOAT, 56, 0L);
    GL11.glColorPointer(4, GL11.GL_UNSIGNED_BYTE, 56, 12L);
    GL11.glTexCoordPointer(2, GL11.GL_FLOAT, 56, 16L);
    OpenGlHelper.setClientActiveTexture(OpenGlHelper.lightmapTexUnit);
    GL11.glTexCoordPointer(2, GL11.GL_SHORT, 56, 24L);
    OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit);
    GL11.glNormalPointer(GL11.GL_BYTE, 56, 28L);
    GL20.glVertexAttribPointer(Shaders.midTexCoordAttrib, 2, GL11.GL_FLOAT, false, 56, 32L);
    GL20.glVertexAttribPointer(Shaders.tangentAttrib, 4, GL11.GL_SHORT, false, 56, 40L);
    GL20.glVertexAttribPointer(Shaders.entityAttrib, 3, GL11.GL_SHORT, false, 56, 48L);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:15,代码来源:ShadersRender.java

示例7: func_181679_a

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@SuppressWarnings("incomplete-switch")
public void func_181679_a(WorldRenderer p_181679_1_)
{
    if (p_181679_1_.getVertexCount() > 0)
    {
        VertexFormat vertexformat = p_181679_1_.getVertexFormat();
        int i = vertexformat.getNextOffset();
        ByteBuffer bytebuffer = p_181679_1_.getByteBuffer();
        List<VertexFormatElement> list = vertexformat.getElements();

        for (int j = 0; j < list.size(); ++j)
        {
            VertexFormatElement vertexformatelement = (VertexFormatElement)list.get(j);
            VertexFormatElement.EnumUsage vertexformatelement$enumusage = vertexformatelement.getUsage();
            int k = vertexformatelement.getType().getGlConstant();
            int l = vertexformatelement.getIndex();
            bytebuffer.position(vertexformat.func_181720_d(j));

            switch (vertexformatelement$enumusage)
            {
                case POSITION:
                    GL11.glVertexPointer(vertexformatelement.getElementCount(), k, i, bytebuffer);
                    GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY);
                    break;

                case UV:
                    OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit + l);
                    GL11.glTexCoordPointer(vertexformatelement.getElementCount(), k, i, bytebuffer);
                    GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
                    OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit);
                    break;

                case COLOR:
                    GL11.glColorPointer(vertexformatelement.getElementCount(), k, i, bytebuffer);
                    GL11.glEnableClientState(GL11.GL_COLOR_ARRAY);
                    break;

                case NORMAL:
                    GL11.glNormalPointer(k, i, bytebuffer);
                    GL11.glEnableClientState(GL11.GL_NORMAL_ARRAY);
            }
        }

        GL11.glDrawArrays(p_181679_1_.getDrawMode(), 0, p_181679_1_.getVertexCount());
        int i1 = 0;

        for (int j1 = list.size(); i1 < j1; ++i1)
        {
            VertexFormatElement vertexformatelement1 = (VertexFormatElement)list.get(i1);
            VertexFormatElement.EnumUsage vertexformatelement$enumusage1 = vertexformatelement1.getUsage();
            int k1 = vertexformatelement1.getIndex();

            switch (vertexformatelement$enumusage1)
            {
                case POSITION:
                    GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY);
                    break;

                case UV:
                    OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit + k1);
                    GL11.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
                    OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit);
                    break;

                case COLOR:
                    GL11.glDisableClientState(GL11.GL_COLOR_ARRAY);
                    GlStateManager.resetColor();
                    break;

                case NORMAL:
                    GL11.glDisableClientState(GL11.GL_NORMAL_ARRAY);
            }
        }
    }

    p_181679_1_.reset();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:78,代码来源:WorldVertexBufferUploader.java

示例8: glVertexPointer

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void glVertexPointer(int p_187420_0_, int p_187420_1_, int p_187420_2_, int p_187420_3_)
{
    GL11.glVertexPointer(p_187420_0_, p_187420_1_, p_187420_2_, (long)p_187420_3_);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:5,代码来源:GlStateManager.java


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