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


Java GL11.glTexSubImage2D方法代码示例

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


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

示例1: uploadTextureImageSubImpl

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
private static void uploadTextureImageSubImpl(BufferedImage p_110993_0_, int p_110993_1_, int p_110993_2_, boolean p_110993_3_, boolean p_110993_4_)
{
    int i = p_110993_0_.getWidth();
    int j = p_110993_0_.getHeight();
    int k = 4194304 / i;
    int[] aint = new int[k * i];
    setTextureBlurred(p_110993_3_);
    setTextureClamped(p_110993_4_);

    for (int l = 0; l < i * j; l += i * k)
    {
        int i1 = l / i;
        int j1 = Math.min(k, j - i1);
        int k1 = i * j1;
        p_110993_0_.getRGB(0, i1, i, j1, aint, 0, i);
        copyToBuffer(aint, k1);
        GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, p_110993_1_, p_110993_2_ + i1, i, j1, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)dataBuffer);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:20,代码来源:TextureUtil.java

示例2: uploadTextureSub

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
private static void uploadTextureSub(int p_147947_0_, int[] p_147947_1_, int p_147947_2_, int p_147947_3_, int p_147947_4_, int p_147947_5_, boolean p_147947_6_, boolean p_147947_7_, boolean p_147947_8_)
{
    int i = 4194304 / p_147947_2_;
    setTextureBlurMipmap(p_147947_6_, p_147947_8_);
    setTextureClamped(p_147947_7_);
    int j;

    for (int k = 0; k < p_147947_2_ * p_147947_3_; k += p_147947_2_ * j)
    {
        int l = k / p_147947_2_;
        j = Math.min(i, p_147947_3_ - l);
        int i1 = p_147947_2_ * j;
        copyToBufferPos(p_147947_1_, k, i1);
        GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, p_147947_0_, p_147947_4_, p_147947_5_ + l, p_147947_2_, j, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)dataBuffer);
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:17,代码来源:TextureUtil.java

示例3: uploadTextureSub

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
private static void uploadTextureSub(int p_147947_0_, int[] p_147947_1_, int p_147947_2_, int p_147947_3_, int p_147947_4_, int p_147947_5_, boolean p_147947_6_, boolean p_147947_7_, boolean p_147947_8_)
{
    int i = 4194304 / p_147947_2_;
    setTextureBlurMipmap(p_147947_6_, p_147947_8_);
    setTextureClamped(p_147947_7_);
    int l;

    for (int j = 0; j < p_147947_2_ * p_147947_3_; j += p_147947_2_ * l)
    {
        int k = j / p_147947_2_;
        l = Math.min(i, p_147947_3_ - k);
        int i1 = p_147947_2_ * l;
        copyToBufferPos(p_147947_1_, j, i1);
        GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, p_147947_0_, p_147947_4_, p_147947_5_ + k, p_147947_2_, l, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)dataBuffer);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:17,代码来源:TextureUtil.java

示例4: uploadTexSub1

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void uploadTexSub1(int[][] src, int width, int height, int posX, int posY, int page)
{
    int i = width * height;
    IntBuffer intbuffer = getIntBuffer(i);
    int j = src.length;
    int k = 0;
    int l = width;
    int i1 = height;
    int j1 = posX;

    for (int k1 = posY; l > 0 && i1 > 0 && k < j; ++k)
    {
        int l1 = l * i1;
        int[] aint = src[k];
        intbuffer.clear();

        if (aint.length >= l1 * (page + 1))
        {
            intbuffer.put(aint, l1 * page, l1).position(0).limit(l1);
            GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, k, j1, k1, l, i1, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)intbuffer);
        }

        l >>= 1;
        i1 >>= 1;
        j1 >>= 1;
        k1 >>= 1;
    }

    intbuffer.clear();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:31,代码来源:ShadersTex.java

示例5: updateDynTexSubImage1

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void updateDynTexSubImage1(int[] src, int width, int height, int posX, int posY, int page)
{
    int i = width * height;
    IntBuffer intbuffer = getIntBuffer(i);
    intbuffer.clear();
    int j = page * i;

    if (src.length >= j + i)
    {
        intbuffer.put(src, j, i).position(0).limit(i);
        GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, posX, posY, width, height, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)intbuffer);
        intbuffer.clear();
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:15,代码来源:ShadersTex.java

示例6: update

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public void update(ByteBuffer pixelBuffer, int width, int height, Bitmap.Format format)
{
	this.bitmap = null;
	this.width = width;
	this.height = height;
	GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, 0, 0, this.width, this.height, getTextureFormat(format), getTextureBufferType(format), pixelBuffer);
}
 
开发者ID:andykuo1,项目名称:candlelight,代码行数:8,代码来源:Texture.java

示例7: glTexSubImage2D

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public void glTexSubImage2D(int glTexture2d, int i, int pageX, int pageY,
		int width, int height, int glBgra, int glUnsignedByte,
		ByteBuffer scratchByteBuffer) {
	GL11.glTexSubImage2D(glTexture2d, i, pageX, pageY, width, height, glBgra, glUnsignedByte, scratchByteBuffer);
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:6,代码来源:ImmediateModeOGLRenderer.java

示例8: updateTexture

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public boolean updateTexture()
{
    if (this.dstTextId < 0)
    {
        ITextureObject itextureobject = TextureUtils.getTexture(this.dstTexLoc);

        if (itextureobject == null)
        {
            return false;
        }

        this.dstTextId = itextureobject.getGlTextureId();
    }

    if (this.imageData == null)
    {
        this.imageData = GLAllocation.createDirectByteBuffer(this.srcData.length);
        this.imageData.put(this.srcData);
        this.srcData = null;
    }

    if (!this.nextFrame())
    {
        return false;
    }
    else
    {
        int k = this.frameWidth * this.frameHeight * 4;
        int i = this.getActiveFrameIndex();
        int j = k * i;

        if (j + k > this.imageData.capacity())
        {
            return false;
        }
        else
        {
            this.imageData.position(j);
            GlStateManager.bindTexture(this.dstTextId);
            GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, this.dstX, this.dstY, this.frameWidth, this.frameHeight, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (ByteBuffer)this.imageData);
            return true;
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:45,代码来源:TextureAnimation.java

示例9: glTexSubImage2D

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void glTexSubImage2D(int p_187414_0_, int p_187414_1_, int p_187414_2_, int p_187414_3_, int p_187414_4_, int p_187414_5_, int p_187414_6_, int p_187414_7_, IntBuffer p_187414_8_)
{
    GL11.glTexSubImage2D(p_187414_0_, p_187414_1_, p_187414_2_, p_187414_3_, p_187414_4_, p_187414_5_, p_187414_6_, p_187414_7_, p_187414_8_);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:5,代码来源:GlStateManager.java

示例10: updateDynamicTextures

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public void updateDynamicTextures()
    {
        for(int i = 0; i < textureList.size(); i++)
        {
            TextureFX texturefx = (TextureFX)textureList.get(i);
            texturefx.anaglyphEnabled = options.anaglyph;
            texturefx.onTick();
            imageData.clear();
            imageData.put(texturefx.imageData);
            imageData.position(0).limit(texturefx.imageData.length);
            texturefx.bindImage(this);
            int l = 16;
            int x = l;
            if(texturefx.tileImage == 0)
            {
                l = (Integer)textureSizeIdMap.get(getTexture("/terrain.png"))/16;
            } else
            if(texturefx.tileImage == 1)
            {
                l = (Integer)textureSizeIdMap.get(getTexture("/gui/items.png"))/16;
            }
            if(texturefx.isCustom)
            {
            	x = l;
            }
            for(int k = 0; k < texturefx.tileSize; k++)
            {
label0:
                for(int i1 = 0; i1 < texturefx.tileSize; i1++)
                {
                    GL11.glTexSubImage2D(3553 /*GL_TEXTURE_2D*/, 0, (texturefx.iconIndex % 16) * l + k * l, (texturefx.iconIndex / 16) * l + i1 * l, x, x, 6408 /*GL_RGBA*/, 5121 /*GL_UNSIGNED_BYTE*/, imageData);
                    if(!useMipmaps)
                    {
                        continue;
                    }
                    int k1 = 1;
                    do
                    {
                        if(k1 > 4)
                        {
                            continue label0;
                        }
                        int i2 = 16 >> k1 - 1;
                        int k2 = 16 >> k1;
                        for(int i3 = 0; i3 < k2; i3++)
                        {
                            for(int k3 = 0; k3 < k2; k3++)
                            {
                                int i4 = imageData.getInt((i3 * 2 + 0 + (k3 * 2 + 0) * i2) * 4);
                                int k4 = imageData.getInt((i3 * 2 + 1 + (k3 * 2 + 0) * i2) * 4);
                                int i5 = imageData.getInt((i3 * 2 + 1 + (k3 * 2 + 1) * i2) * 4);
                                int k5 = imageData.getInt((i3 * 2 + 0 + (k3 * 2 + 1) * i2) * 4);
                                int l5 = averageColor(averageColor(i4, k4), averageColor(i5, k5));
                                imageData.putInt((i3 + k3 * k2) * 4, l5);
                            }

                        }

                        GL11.glTexSubImage2D(3553 /*GL_TEXTURE_2D*/, k1, (texturefx.iconIndex % 16) * k2, (texturefx.iconIndex / 16) * k2, k2, k2, 6408 /*GL_RGBA*/, 5121 /*GL_UNSIGNED_BYTE*/, imageData);
                        k1++;
                    } while(true);
                }
            }
        }
    }
 
开发者ID:jd-lang,项目名称:betaexpansion,代码行数:66,代码来源:RenderEngine.java

示例11: texSubImage2D

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public void texSubImage2D(int xOffset, int yOffset, int width, int height, ByteBuffer buffer)
{
	GL11.glEnable(GL11.GL_TEXTURE_2D);
	GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, xOffset, yOffset, width, height, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, buffer);
	GL11.glDisable(GL11.GL_TEXTURE_2D);
}
 
开发者ID:ec-europa,项目名称:sumo,代码行数:7,代码来源:LWJGLTexture.java

示例12: updateSubImage

import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void updateSubImage(MultiTexID multiTex, int[] src, int width, int height, int posX, int posY, boolean linear, boolean clamp)
{
    int i = width * height;
    IntBuffer intbuffer = getIntBuffer(i);
    intbuffer.clear();
    intbuffer.put(src, 0, i);
    intbuffer.position(0).limit(i);
    GlStateManager.bindTexture(multiTex.base);
    GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST);
    GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
    GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_REPEAT);
    GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_REPEAT);
    GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, posX, posY, width, height, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)intbuffer);

    if (src.length == i * 3)
    {
        intbuffer.clear();
        intbuffer.put(src, i, i).position(0);
        intbuffer.position(0).limit(i);
    }

    GlStateManager.bindTexture(multiTex.norm);
    GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST);
    GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
    GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_REPEAT);
    GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_REPEAT);
    GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, posX, posY, width, height, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)intbuffer);

    if (src.length == i * 3)
    {
        intbuffer.clear();
        intbuffer.put(src, i * 2, i);
        intbuffer.position(0).limit(i);
    }

    GlStateManager.bindTexture(multiTex.spec);
    GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST);
    GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
    GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_REPEAT);
    GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_REPEAT);
    GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, posX, posY, width, height, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)intbuffer);
    GlStateManager.setActiveTexture(33984);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:44,代码来源:ShadersTex.java


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