本文整理汇总了Java中org.lwjgl.opengl.GL13.glCompressedTexImage2D方法的典型用法代码示例。如果您正苦于以下问题:Java GL13.glCompressedTexImage2D方法的具体用法?Java GL13.glCompressedTexImage2D怎么用?Java GL13.glCompressedTexImage2D使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.lwjgl.opengl.GL13
的用法示例。
在下文中一共展示了GL13.glCompressedTexImage2D方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: glCompressedTexImage2D
import org.lwjgl.opengl.GL13; //导入方法依赖的package包/类
public void glCompressedTexImage2D (int target, int level, int internalformat, int width, int height, int border,
int imageSize, Buffer data) {
if (data instanceof ByteBuffer) {
GL13.glCompressedTexImage2D(target, level, internalformat, width, height, border, (ByteBuffer)data);
} else {
throw new GdxRuntimeException("Can't use " + data.getClass().getName() + " with this method. Use ByteBuffer instead.");
}
}
示例2: readFileData
import org.lwjgl.opengl.GL13; //导入方法依赖的package包/类
private int readFileData() {
final DDPixelFormat ddpf = ddsDesc2.getDDPixelformat();
int imageSize = 0;
int dxtFormat = 0;
/* calculate the image size depending on the used blocksize
and set the used DXT format */
if (ddpf.isCompressed && ddpf.getFourCCString().equalsIgnoreCase("DXT1")) {
imageSize = calculateSize(DXT1_BLOCKSIZE);
// at the moment we treat any DXT1 image as RGBA,
// maybe this can be switched dynamically in future...
dxtFormat = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
} else {
imageSize = calculateSize(DEFAULT_DXT_BLOCKSIZE);
if (ddpf.getFourCCString().equalsIgnoreCase("DXT3"))
dxtFormat = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT;
else if (ddpf.getFourCCString().equals("DXT5"))
dxtFormat = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
}
// read the dds file data itself
ByteBuffer imageData = BufferUtils.createByteBuffer(ddsDesc2.pitchOrLinearSize);
try {
ddsFileChannel.read(imageData);
imageData.rewind();
} catch (IOException ioe) {
ioe.printStackTrace();
}
// create the GL Name
IntBuffer glName = BufferUtils.createIntBuffer(1);
// create the texture
GL11.glGenTextures(glName);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, glName.get(0));
/* Implement the filtering stuff anywhere you want, this is only here to
have at least one filter applied on the texture */
// Linear Filtering
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
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);
GL13.glCompressedTexImage2D(GL11.GL_TEXTURE_2D, 0, dxtFormat, ddsDesc2.width, ddsDesc2.height, 0, imageData);
return glName.get(0);
}
示例3: glCompressedTexImage2D
import org.lwjgl.opengl.GL13; //导入方法依赖的package包/类
@Override
public void glCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, int imageSize, ByteBuffer data) {
GL13.glCompressedTexImage2D(target, level, internalformat, width, height, border, data);
}
示例4: glCompressedTexImage2D
import org.lwjgl.opengl.GL13; //导入方法依赖的package包/类
public void glCompressedTexImage2D (int target, int level, int internalformat, int width, int height, int border,
int imageSize, Buffer data) {
GL13.glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, (ByteBuffer)data);
}
示例5: glCompressedTexImage2D
import org.lwjgl.opengl.GL13; //导入方法依赖的package包/类
@Override
public void glCompressedTexImage2D(int target, int level, int internalformat,
int width, int height, int border,
int data_imageSize, int data) {
GL13.glCompressedTexImage2D(target, level, internalformat, width, height, border, data_imageSize, data);
}
示例6: glCompressedTexImage2D
import org.lwjgl.opengl.GL13; //导入方法依赖的package包/类
public final static void glCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, ByteBuffer pData) {
if (GLContext.getCapabilities().OpenGL13)
GL13.glCompressedTexImage2D(target, level, internalformat, width, height, border, pData);
else
ARBTextureCompression.glCompressedTexImage2DARB(target, level, internalformat, width, height, border, pData);
}