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


Java GL30类代码示例

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


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

示例1: add

import org.lwjgl.opengl.GL30; //导入依赖的package包/类
public void add(float[] vertices, float[] texCoords, int[] indices) {
	indicesSize = indices.length;

	GL30.glBindVertexArray(vao);

	GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, vbo);
	GL15.glBufferData(GL15.GL_ARRAY_BUFFER, Util.flip(vertices), GL15.GL_STATIC_DRAW);
	GL20.glVertexAttribPointer(0, 3, GL11.GL_FLOAT, false, 0, 0);
	GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, 0);

	GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, vboTexture);
	GL15.glBufferData(GL15.GL_ARRAY_BUFFER, Util.flip(texCoords), GL15.GL_STATIC_DRAW);
	GL20.glVertexAttribPointer(1, 2, GL11.GL_FLOAT, false, 0, 0);
	GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, 0);

	GL30.glBindVertexArray(0);

	GL15.glBindBuffer(GL15.GL_ELEMENT_ARRAY_BUFFER, vboi);
	GL15.glBufferData(GL15.GL_ELEMENT_ARRAY_BUFFER, Util.flip(indices), GL15.GL_STATIC_DRAW);
	GL15.glBindBuffer(GL15.GL_ELEMENT_ARRAY_BUFFER, 0);
}
 
开发者ID:ComunityEngine,项目名称:CommunityEngine-Java,代码行数:22,代码来源:Mesh.java

示例2: prepareTexturedModel

import org.lwjgl.opengl.GL30; //导入依赖的package包/类
private void prepareTexturedModel(TexturedModel model) {
	RawModel rawModel = model.getRawModel();
	GL30.glBindVertexArray(rawModel.getVaoID());
	GL20.glEnableVertexAttribArray(0);
	GL20.glEnableVertexAttribArray(1);
	GL20.glEnableVertexAttribArray(2);
	
	ModelTexture texture = model.getTexture();
	
	if(texture.isHasTransparency()) {
		MasterRenderer.disableCulling();
	}
	
	shader.loadFakeLightingVariable(texture.isUseFakeLighting());
	shader.loadShineVariables(texture.getShineDamper(), texture.getReflectivity());
	
	GL13.glActiveTexture(GL13.GL_TEXTURE0);
	GL11.glBindTexture(GL11.GL_TEXTURE_2D, model.getTexture().getID());
}
 
开发者ID:marcioz98,项目名称:MRCEngine,代码行数:20,代码来源:EntityRenderer.java

示例3: glFramebufferTexture2D

import org.lwjgl.opengl.GL30; //导入依赖的package包/类
public static void glFramebufferTexture2D(int target, int attachment, int textarget, int texture, int level)
{
    if (framebufferSupported)
    {
        switch (framebufferType)
        {
            case BASE:
                GL30.glFramebufferTexture2D(target, attachment, textarget, texture, level);
                break;

            case ARB:
                ARBFramebufferObject.glFramebufferTexture2D(target, attachment, textarget, texture, level);
                break;

            case EXT:
                EXTFramebufferObject.glFramebufferTexture2DEXT(target, attachment, textarget, texture, level);
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:20,代码来源:OpenGlHelper.java

示例4: preRender

import org.lwjgl.opengl.GL30; //导入依赖的package包/类
/**
    * Renders the world to the water framebuffer.
    * @param worldCamera
    * @param world
    */
   public void preRender(final PerspectiveCamera camera, final World world) {
GL11.glEnable(GL30.GL_CLIP_DISTANCE0);
framebuffer.bind();
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);

// Render to reflection texture.
float verticalDistance = camera.getPosition().y - WATER_HEIGHT;
camera.getPosition().y -= verticalDistance * 2;
camera.invertPitch();
camera.update();
world.renderWithoutWater(camera, true);
camera.invertPitch();
camera.getPosition().y += verticalDistance * 2;
camera.update();

FrameBuffer.unbind();
GL11.glDisable(GL30.GL_CLIP_DISTANCE0);
   }
 
开发者ID:camilne,项目名称:open-world,代码行数:24,代码来源:WaterRegion.java

示例5: glGenFramebuffers

import org.lwjgl.opengl.GL30; //导入依赖的package包/类
/**
 * Calls the appropriate glGenFramebuffers method and returns the newly created fbo, or returns -1 if not supported.
 */
public static int glGenFramebuffers()
{
    if (!framebufferSupported)
    {
        return -1;
    }
    else
    {
        switch (framebufferType)
        {
            case BASE:
                return GL30.glGenFramebuffers();
            case ARB:
                return ARBFramebufferObject.glGenFramebuffers();
            case EXT:
                return EXTFramebufferObject.glGenFramebuffersEXT();
            default:
                return -1;
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:25,代码来源:OpenGlHelper.java

示例6: glDeleteRenderbuffers

import org.lwjgl.opengl.GL30; //导入依赖的package包/类
public static void glDeleteRenderbuffers(int renderbuffer)
{
    if (framebufferSupported)
    {
        switch (framebufferType)
        {
            case BASE:
                GL30.glDeleteRenderbuffers(renderbuffer);
                break;

            case ARB:
                ARBFramebufferObject.glDeleteRenderbuffers(renderbuffer);
                break;

            case EXT:
                EXTFramebufferObject.glDeleteRenderbuffersEXT(renderbuffer);
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:20,代码来源:OpenGlHelper.java

示例7: prepareTexturedModel

import org.lwjgl.opengl.GL30; //导入依赖的package包/类
private void prepareTexturedModel(final TexturedModel model) {
    GL30.glBindVertexArray(model.getRawModel().getVaoId());
    GL20.glEnableVertexAttribArray(0);
    GL20.glEnableVertexAttribArray(1);
    GL20.glEnableVertexAttribArray(2);
    if (model.getTexture().isHasTransparency()) {
        MasterRenderer.disableCulling();
    }
    shader.loadFakeLightingVariable(model.getTexture().isUseFakeLighting());
    shader.loadShineVariables(
            model.getTexture().getShineDamper(),
            model.getTexture().getReflectivity()
    );
    GL13.glActiveTexture(GL13.GL_TEXTURE0);
    GL11.glBindTexture(GL11.GL_TEXTURE_2D, model.getTexture().getTextureId());
}
 
开发者ID:Biacode,项目名称:bia-engine,代码行数:17,代码来源:EntityRenderer.java

示例8: glGenFramebuffers

import org.lwjgl.opengl.GL30; //导入依赖的package包/类
/**
 * Calls the appropriate glGenFramebuffers method and returns the newly created fbo, or returns -1 if not supported.
 */
public static int glGenFramebuffers()
{
    if (!framebufferSupported)
    {
        return -1;
    }
    else
    {
        switch (framebufferType)
        {
            case BASE:
                return GL30.glGenFramebuffers();

            case ARB:
                return ARBFramebufferObject.glGenFramebuffers();

            case EXT:
                return EXTFramebufferObject.glGenFramebuffersEXT();

            default:
                return -1;
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:28,代码来源:OpenGlHelper.java

示例9: glBindFramebuffer

import org.lwjgl.opengl.GL30; //导入依赖的package包/类
public static void glBindFramebuffer(int target, int framebufferIn)
{
    if (framebufferSupported)
    {
        switch (framebufferType)
        {
            case BASE:
                GL30.glBindFramebuffer(target, framebufferIn);
                break;

            case ARB:
                ARBFramebufferObject.glBindFramebuffer(target, framebufferIn);
                break;

            case EXT:
                EXTFramebufferObject.glBindFramebufferEXT(target, framebufferIn);
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:20,代码来源:OpenGlHelper.java

示例10: glBindFramebuffer

import org.lwjgl.opengl.GL30; //导入依赖的package包/类
public static void glBindFramebuffer(int target, int framebufferIn)
{
    if (framebufferSupported)
    {
        switch (framebufferType)
        {
            case BASE:
                GL30.glBindFramebuffer(target, framebufferIn);
                break;
            case ARB:
                ARBFramebufferObject.glBindFramebuffer(target, framebufferIn);
                break;
            case EXT:
                EXTFramebufferObject.glBindFramebufferEXT(target, framebufferIn);
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:18,代码来源:OpenGlHelper.java

示例11: glRenderbufferStorage

import org.lwjgl.opengl.GL30; //导入依赖的package包/类
public static void glRenderbufferStorage(int target, int internalFormat, int width, int height)
{
    if (framebufferSupported)
    {
        switch (framebufferType)
        {
            case BASE:
                GL30.glRenderbufferStorage(target, internalFormat, width, height);
                break;

            case ARB:
                ARBFramebufferObject.glRenderbufferStorage(target, internalFormat, width, height);
                break;

            case EXT:
                EXTFramebufferObject.glRenderbufferStorageEXT(target, internalFormat, width, height);
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:20,代码来源:OpenGlHelper.java

示例12: glFramebufferRenderbuffer

import org.lwjgl.opengl.GL30; //导入依赖的package包/类
public static void glFramebufferRenderbuffer(int target, int attachment, int renderBufferTarget, int renderBuffer)
{
    if (framebufferSupported)
    {
        switch (framebufferType)
        {
            case BASE:
                GL30.glFramebufferRenderbuffer(target, attachment, renderBufferTarget, renderBuffer);
                break;
            case ARB:
                ARBFramebufferObject.glFramebufferRenderbuffer(target, attachment, renderBufferTarget, renderBuffer);
                break;
            case EXT:
                EXTFramebufferObject.glFramebufferRenderbufferEXT(target, attachment, renderBufferTarget, renderBuffer);
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:18,代码来源:OpenGlHelper.java

示例13: glBindRenderbuffer

import org.lwjgl.opengl.GL30; //导入依赖的package包/类
public static void glBindRenderbuffer(int target, int renderbuffer)
{
    if (framebufferSupported)
    {
        switch (framebufferType)
        {
            case 0:
                GL30.glBindRenderbuffer(target, renderbuffer);
                break;

            case 1:
                ARBFramebufferObject.glBindRenderbuffer(target, renderbuffer);
                break;

            case 2:
                EXTFramebufferObject.glBindRenderbufferEXT(target, renderbuffer);
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:20,代码来源:OpenGlHelper.java

示例14: glDeleteRenderbuffers

import org.lwjgl.opengl.GL30; //导入依赖的package包/类
public static void glDeleteRenderbuffers(int renderbuffer)
{
    if (framebufferSupported)
    {
        switch (framebufferType)
        {
            case 0:
                GL30.glDeleteRenderbuffers(renderbuffer);
                break;

            case 1:
                ARBFramebufferObject.glDeleteRenderbuffers(renderbuffer);
                break;

            case 2:
                EXTFramebufferObject.glDeleteRenderbuffersEXT(renderbuffer);
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:20,代码来源:OpenGlHelper.java

示例15: glDeleteFramebuffers

import org.lwjgl.opengl.GL30; //导入依赖的package包/类
public static void glDeleteFramebuffers(int framebufferIn)
{
    if (framebufferSupported)
    {
        switch (framebufferType)
        {
            case 0:
                GL30.glDeleteFramebuffers(framebufferIn);
                break;

            case 1:
                ARBFramebufferObject.glDeleteFramebuffers(framebufferIn);
                break;

            case 2:
                EXTFramebufferObject.glDeleteFramebuffersEXT(framebufferIn);
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:20,代码来源:OpenGlHelper.java


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