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


Java GL13.glCompressedTexImage2D方法代码示例

本文整理汇总了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.");
	}
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:9,代码来源:LwjglGL20.java

示例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);
}
 
开发者ID:WarpOrganization,项目名称:warp,代码行数:50,代码来源:DDSLoader.java

示例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);
}
 
开发者ID:surgeplay,项目名称:glow,代码行数:5,代码来源:GLCore.java

示例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);
}
 
开发者ID:Arcnor,项目名称:gdx-backend-jglfw,代码行数:5,代码来源:JglfwGL20.java

示例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);
}
 
开发者ID:playn,项目名称:playn,代码行数:7,代码来源:LWJGLGL20.java

示例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);
}
 
开发者ID:sunenielsen,项目名称:tribaltrouble,代码行数:7,代码来源:GLState.java


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