Example usage for org.lwjgl.opengl GL11 glGetTexImage

List of usage examples for org.lwjgl.opengl GL11 glGetTexImage

Introduction

In this page you can find the example usage for org.lwjgl.opengl GL11 glGetTexImage.

Prototype

public static void glGetTexImage(@NativeType("GLenum") int tex, @NativeType("GLint") int level,
        @NativeType("GLenum") int format, @NativeType("GLenum") int type,
        @NativeType("void *") double[] pixels) 

Source Link

Document

Array version of: #glGetTexImage GetTexImage

Usage

From source file:tk.ivybits.engine.gl.GL.java

License:Open Source License

public static void glGetTexImage(int a, int b, int c, int d, DoubleBuffer e) {
    GL11.glGetTexImage(a, b, c, d, e);
}

From source file:tk.ivybits.engine.gl.GL.java

License:Open Source License

public static void glGetTexImage(int a, int b, int c, int d, IntBuffer e) {
    GL11.glGetTexImage(a, b, c, d, e);
}

From source file:tk.ivybits.engine.gl.GL.java

License:Open Source License

public static void glGetTexImage(int a, int b, int c, int d, ShortBuffer e) {
    GL11.glGetTexImage(a, b, c, d, e);
}

From source file:tk.ivybits.engine.gl.GL.java

License:Open Source License

public static void glGetTexImage(int a, int b, int c, int d, long e) {
    GL11.glGetTexImage(a, b, c, d, e);
}

From source file:vazkii.botania.client.core.handler.MiscellaneousIcons.java

License:Open Source License

@SubscribeEvent
public void dumpAtlas(ArrowLooseEvent evt) {
    if (!evt.getEntityPlayer().worldObj.isRemote
            || !((Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment"))
            || !evt.getEntityPlayer().isSneaking())
        return;/*from w  w w .j a v a2  s. co m*/
    Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);

    int width = GL11.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_WIDTH);
    int height = GL11.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_HEIGHT);

    Botania.LOGGER.debug("Dumped atlas %d wide by %d tall%n", width, height);

    int pixels = width * height;

    IntBuffer buffer = BufferUtils.createIntBuffer(pixels);
    int[] pixelValues = new int[pixels];

    GL11.glPixelStorei(GL11.GL_PACK_ALIGNMENT, 1);
    GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, 1);

    GL11.glGetTexImage(GL11.GL_TEXTURE_2D, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, buffer);

    buffer.get(pixelValues);

    BufferedImage bufferedimage = new BufferedImage(width, height, 2);

    for (int k = 0; k < height; ++k) {
        for (int l = 0; l < width; ++l) {
            bufferedimage.setRGB(l, k, pixelValues[k * width + l]);
        }
    }

    File mcFolder = Minecraft.getMinecraft().mcDataDir;
    File result = new File(mcFolder, "atlas.png");

    try {
        ImageIO.write(bufferedimage, "png", result);
    } catch (IOException e) {
        Botania.LOGGER.warn("Failed to dump debug atlas");
    }
}

From source file:zildo.fwk.gfx.engine.TextureEngine.java

License:Open Source License

public void getTextureImage(int p_texId) {
    GL11.glBindTexture(GL11.GL_TEXTURE_2D, p_texId);
    GL11.glGetTexImage(GL11.GL_TEXTURE_2D, 0, textureFormat, GL11.GL_UNSIGNED_BYTE, scratch);
}

From source file:zildo.platform.engine.LwjglTextureEngine.java

License:Open Source License

@Override
public void getTextureImage(int p_nthTex) {
    GL11.glBindTexture(GL11.GL_TEXTURE_2D, getNthTexture(p_nthTex));
    scratch.position(0);//from   www .  j  a v a2 s  . co  m
    alphaChannel = alphaTab[p_nthTex];
    GL11.glGetTexImage(GL11.GL_TEXTURE_2D, 0, getTextureFormat(), GL11.GL_UNSIGNED_BYTE, scratch);
}