Path: blob/master/SLICK_HOME/src/org/newdawn/slick/opengl/EmptyImageData.java
1461 views
package org.newdawn.slick.opengl;12import java.nio.ByteBuffer;34import org.lwjgl.BufferUtils;56/**7* An image data implementation which represents an empty texture8*9* @author kevin10*/11public class EmptyImageData implements ImageData {12/** The width of the data */13private int width;14/** The height of the data */15private int height;1617/**18* Create an empty image data source19*20* @param width The width of the source21* @param height The height of the source22*/23public EmptyImageData(int width, int height) {24this.width = width;25this.height = height;26}2728/**29* @see org.newdawn.slick.opengl.ImageData#getDepth()30*/31public int getDepth() {32return 32;33}3435/**36* @see org.newdawn.slick.opengl.ImageData#getHeight()37*/38public int getHeight() {39return height;40}4142/**43* @see org.newdawn.slick.opengl.ImageData#getImageBufferData()44*/45public ByteBuffer getImageBufferData() {46return BufferUtils.createByteBuffer(getTexWidth() * getTexHeight() * 4);47}4849/**50* @see org.newdawn.slick.opengl.ImageData#getTexHeight()51*/52public int getTexHeight() {53return InternalTextureLoader.get2Fold(height);54}5556/**57* @see org.newdawn.slick.opengl.ImageData#getTexWidth()58*/59public int getTexWidth() {60return InternalTextureLoader.get2Fold(width);61}6263/**64* @see org.newdawn.slick.opengl.ImageData#getWidth()65*/66public int getWidth() {67return width;68}6970}717273