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


Java GlStateManager.glTexImage2D方法代码示例

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


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

示例1: getGLMaximumTextureSize

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
/**
 * Used in the usage snooper.
 */
public static int getGLMaximumTextureSize()
{
    for (int i = 16384; i > 0; i >>= 1)
    {
        GlStateManager.glTexImage2D(32868, 0, 6408, i, i, 0, 6408, 5121, (IntBuffer)null);
        int j = GlStateManager.glGetTexLevelParameteri(32868, 0, 4096);

        if (j != 0)
        {
            return i;
        }
    }

    return -1;
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:19,代码来源:Minecraft.java

示例2: getGLMaximumTextureSize

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public static int getGLMaximumTextureSize()
{
    for (int i = 65536; i > 0; i >>= 1)
    {
        GlStateManager.glTexImage2D(32868, 0, 6408, i, i, 0, 6408, 5121, (IntBuffer)null);
        int j = GL11.glGetError();
        int k = GlStateManager.glGetTexLevelParameteri(32868, 0, 4096);

        if (k != 0)
        {
            return i;
        }
    }

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

示例3: allocateTextureImpl

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public static void allocateTextureImpl(int glTextureId, int mipmapLevels, int width, int height)
{
    synchronized (net.minecraftforge.fml.client.SplashProgress.class)
    {
    deleteTexture(glTextureId);
    bindTexture(glTextureId);
    }
    if (mipmapLevels >= 0)
    {
        GlStateManager.glTexParameteri(3553, 33085, mipmapLevels);
        GlStateManager.glTexParameteri(3553, 33082, 0);
        GlStateManager.glTexParameteri(3553, 33083, mipmapLevels);
        GlStateManager.glTexParameterf(3553, 34049, 0.0F);
    }

    for (int i = 0; i <= mipmapLevels; ++i)
    {
        GlStateManager.glTexImage2D(3553, i, 6408, width >> i, height >> i, 0, 32993, 33639, (IntBuffer)null);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:21,代码来源:TextureUtil.java

示例4: createFramebuffer

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void createFramebuffer(int width, int height)
{
    this.framebufferWidth = width;
    this.framebufferHeight = height;
    this.framebufferTextureWidth = width;
    this.framebufferTextureHeight = height;

    if (!OpenGlHelper.isFramebufferEnabled())
    {
        this.framebufferClear();
    }
    else
    {
        this.framebufferObject = OpenGlHelper.glGenFramebuffers();
        this.framebufferTexture = TextureUtil.glGenTextures();

        if (this.useDepth)
        {
            this.depthBuffer = OpenGlHelper.glGenRenderbuffers();
        }

        this.setFramebufferFilter(9728);
        GlStateManager.bindTexture(this.framebufferTexture);
        GlStateManager.glTexImage2D(3553, 0, 32856, this.framebufferTextureWidth, this.framebufferTextureHeight, 0, 6408, 5121, (IntBuffer)null);
        OpenGlHelper.glBindFramebuffer(OpenGlHelper.GL_FRAMEBUFFER, this.framebufferObject);
        OpenGlHelper.glFramebufferTexture2D(OpenGlHelper.GL_FRAMEBUFFER, OpenGlHelper.GL_COLOR_ATTACHMENT0, 3553, this.framebufferTexture, 0);

        if (this.useDepth)
        {
            OpenGlHelper.glBindRenderbuffer(OpenGlHelper.GL_RENDERBUFFER, this.depthBuffer);
            OpenGlHelper.glRenderbufferStorage(OpenGlHelper.GL_RENDERBUFFER, 33190, this.framebufferTextureWidth, this.framebufferTextureHeight);
            OpenGlHelper.glFramebufferRenderbuffer(OpenGlHelper.GL_FRAMEBUFFER, OpenGlHelper.GL_DEPTH_ATTACHMENT, OpenGlHelper.GL_RENDERBUFFER, this.depthBuffer);
        }

        this.framebufferClear();
        this.unbindFramebufferTexture();
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:39,代码来源:Framebuffer.java

示例5: allocateTextureImpl

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public static void allocateTextureImpl(int glTextureId, int mipmapLevels, int width, int height)
{
    Object object = TextureUtil.class;

    if (Reflector.SplashScreen.exists())
    {
        object = Reflector.SplashScreen.getTargetClass();
    }

    synchronized (object)
    {
        deleteTexture(glTextureId);
        bindTexture(glTextureId);
    }

    if (mipmapLevels >= 0)
    {
        GlStateManager.glTexParameteri(3553, 33085, mipmapLevels);
        GlStateManager.glTexParameteri(3553, 33082, 0);
        GlStateManager.glTexParameteri(3553, 33083, mipmapLevels);
        GlStateManager.glTexParameterf(3553, 34049, 0.0F);
    }

    for (int i = 0; i <= mipmapLevels; ++i)
    {
        GlStateManager.glTexImage2D(3553, i, 6408, width >> i, height >> i, 0, 32993, 33639, (IntBuffer)null);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:29,代码来源:TextureUtil.java

示例6: getMaxTextureSize

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public static int getMaxTextureSize()
{
    if (max_texture_size != -1) return max_texture_size;
    for (int i = 0x4000; i > 0; i >>= 1)
    {
        GlStateManager.glTexImage2D(GL_PROXY_TEXTURE_2D, 0, GL_RGBA, i, i, 0, GL_RGBA, GL_UNSIGNED_BYTE, null);
        if (GlStateManager.glGetTexLevelParameteri(GL_PROXY_TEXTURE_2D, 0, GL_TEXTURE_WIDTH) != 0)
        {
            max_texture_size = i;
            return i;
        }
    }
    return -1;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:15,代码来源:SplashProgress.java

示例7: createFramebuffer

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void createFramebuffer(int width, int height)
{
    this.framebufferWidth = width;
    this.framebufferHeight = height;
    this.framebufferTextureWidth = width;
    this.framebufferTextureHeight = height;

    if (!OpenGlHelper.isFramebufferEnabled())
    {
        this.framebufferClear();
    }
    else
    {
        this.framebufferObject = OpenGlHelper.glGenFramebuffers();
        this.framebufferTexture = TextureUtil.glGenTextures();

        if (this.useDepth)
        {
            this.depthBuffer = OpenGlHelper.glGenRenderbuffers();
        }

        this.setFramebufferFilter(9728);
        GlStateManager.bindTexture(this.framebufferTexture);
        GlStateManager.glTexImage2D(3553, 0, 32856, this.framebufferTextureWidth, this.framebufferTextureHeight, 0, 6408, 5121, (IntBuffer)null);
        OpenGlHelper.glBindFramebuffer(OpenGlHelper.GL_FRAMEBUFFER, this.framebufferObject);
        OpenGlHelper.glFramebufferTexture2D(OpenGlHelper.GL_FRAMEBUFFER, OpenGlHelper.GL_COLOR_ATTACHMENT0, 3553, this.framebufferTexture, 0);

        if (this.useDepth)
        {
            OpenGlHelper.glBindRenderbuffer(OpenGlHelper.GL_RENDERBUFFER, this.depthBuffer);
            if (!this.stencilEnabled)
            {
            OpenGlHelper.glRenderbufferStorage(OpenGlHelper.GL_RENDERBUFFER, 33190, this.framebufferTextureWidth, this.framebufferTextureHeight);
            OpenGlHelper.glFramebufferRenderbuffer(OpenGlHelper.GL_FRAMEBUFFER, OpenGlHelper.GL_DEPTH_ATTACHMENT, OpenGlHelper.GL_RENDERBUFFER, this.depthBuffer);
            }
            else
            {
                OpenGlHelper.glRenderbufferStorage(OpenGlHelper.GL_RENDERBUFFER, org.lwjgl.opengl.EXTPackedDepthStencil.GL_DEPTH24_STENCIL8_EXT, this.framebufferTextureWidth, this.framebufferTextureHeight);
                OpenGlHelper.glFramebufferRenderbuffer(OpenGlHelper.GL_FRAMEBUFFER, org.lwjgl.opengl.EXTFramebufferObject.GL_DEPTH_ATTACHMENT_EXT, OpenGlHelper.GL_RENDERBUFFER, this.depthBuffer);
                OpenGlHelper.glFramebufferRenderbuffer(OpenGlHelper.GL_FRAMEBUFFER, org.lwjgl.opengl.EXTFramebufferObject.GL_STENCIL_ATTACHMENT_EXT, OpenGlHelper.GL_RENDERBUFFER, this.depthBuffer);
            }
        }

        this.framebufferClear();
        this.unbindFramebufferTexture();
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:48,代码来源:Framebuffer.java


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