本文整理汇总了Java中org.lwjgl.opengl.GL11.glGetTexImage方法的典型用法代码示例。如果您正苦于以下问题:Java GL11.glGetTexImage方法的具体用法?Java GL11.glGetTexImage怎么用?Java GL11.glGetTexImage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.lwjgl.opengl.GL11
的用法示例。
在下文中一共展示了GL11.glGetTexImage方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: saveGlTexture
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void saveGlTexture(String p_saveGlTexture_0_, int p_saveGlTexture_1_, int p_saveGlTexture_2_, int p_saveGlTexture_3_, int p_saveGlTexture_4_)
{
bindTexture(p_saveGlTexture_1_);
GL11.glPixelStorei(GL11.GL_PACK_ALIGNMENT, 1);
GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, 1);
for (int i = 0; i <= p_saveGlTexture_2_; ++i)
{
File file1 = new File(p_saveGlTexture_0_ + "_" + i + ".png");
int j = p_saveGlTexture_3_ >> i;
int k = p_saveGlTexture_4_ >> i;
int l = j * k;
IntBuffer intbuffer = BufferUtils.createIntBuffer(l);
int[] aint = new int[l];
GL11.glGetTexImage(GL11.GL_TEXTURE_2D, i, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)intbuffer);
intbuffer.get(aint);
BufferedImage bufferedimage = new BufferedImage(j, k, 2);
bufferedimage.setRGB(0, 0, j, k, aint, 0, j);
try
{
ImageIO.write(bufferedimage, "png", (File)file1);
logger.debug("Exported png to: {}", new Object[] {file1.getAbsolutePath()});
}
catch (Exception exception)
{
logger.debug((String)"Unable to write: ", (Throwable)exception);
}
}
}
示例2: glGetTexImage
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
* @see org.newdawn.slick.opengl.renderer.SGL#glGetTexImage(int, int, int, int, java.nio.ByteBuffer)
*/
public void glGetTexImage(int target, int level, int format, int type, ByteBuffer pixels) {
GL11.glGetTexImage(target, level, format, type, pixels);
}
示例3: getPixels
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static IntBuffer getPixels(int textureId, int width, int height) {
GL11.glBindTexture(GL11.GL_TEXTURE_2D, textureId);
IntBuffer result = BufferUtils.createIntBuffer(width * height);
GL11.glGetTexImage(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA, GL12.GL_UNSIGNED_SHORT_4_4_4_4, result);
return result;
}
示例4: glGetTexImage
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void glGetTexImage(int p_187433_0_, int p_187433_1_, int p_187433_2_, int p_187433_3_, IntBuffer p_187433_4_)
{
GL11.glGetTexImage(p_187433_0_, p_187433_1_, p_187433_2_, p_187433_3_, p_187433_4_);
}
示例5: saveGlTexture
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void saveGlTexture(String p_saveGlTexture_0_, int p_saveGlTexture_1_, int p_saveGlTexture_2_, int p_saveGlTexture_3_, int p_saveGlTexture_4_)
{
bindTexture(p_saveGlTexture_1_);
GL11.glPixelStorei(GL11.GL_PACK_ALIGNMENT, 1);
GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, 1);
File file1 = new File(p_saveGlTexture_0_);
File file2 = file1.getParentFile();
if (file2 != null)
{
file2.mkdirs();
}
for (int i = 0; i < 16; ++i)
{
File file3 = new File(p_saveGlTexture_0_ + "_" + i + ".png");
file3.delete();
}
for (int i1 = 0; i1 <= p_saveGlTexture_2_; ++i1)
{
File file4 = new File(p_saveGlTexture_0_ + "_" + i1 + ".png");
int j = p_saveGlTexture_3_ >> i1;
int k = p_saveGlTexture_4_ >> i1;
int l = j * k;
IntBuffer intbuffer = BufferUtils.createIntBuffer(l);
int[] aint = new int[l];
GL11.glGetTexImage(GL11.GL_TEXTURE_2D, i1, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)intbuffer);
intbuffer.get(aint);
BufferedImage bufferedimage = new BufferedImage(j, k, 2);
bufferedimage.setRGB(0, 0, j, k, aint, 0, j);
try
{
ImageIO.write(bufferedimage, "png", (File)file4);
Config.dbg("Exported: " + file4);
}
catch (Exception exception)
{
Config.warn("Error writing: " + file4);
Config.warn("" + exception.getClass().getName() + ": " + exception.getMessage());
}
}
}