本文整理匯總了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);
}