textureimage.java

来自「NeHe用java与OpenGL结合教程源码」· Java 代码 · 共 49 行

JAVA
49
字号
package demos.nehe.lesson32;

import java.nio.ByteBuffer;

class TextureImage {
    // Create A Structure
    private ByteBuffer imageData; // Image Data (Up To 32 Bits)

    private int bpp; // Image Color Depth In Bits Per Pixel.

    private int width; // Image Width

    private int height; // Image Height

    private int texID; // Texture ID Used To Select A Texture

    TextureImage(int texID, int width, int height, int bpp, ByteBuffer imageData) {
        this.texID = texID;
        this.width = width;
        this.height = height;
        this.bpp = bpp;
        this.imageData = imageData;
    }

    public int getBpp() {
        return bpp;
    }

    public int getHeight() {
        return height;
    }

    public ByteBuffer getImageData() {
        return imageData;
    }

    public int getTexID() {
        return texID;
    }

    public int getWidth() {
        return width;
    }

    public void printInfo() {
        System.out.println("Byte per Pixel: " + bpp + "\n" + "Image Width: " + width + "\n" + "Image Height:" + height + "\n");
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?