當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。