當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。