org.newdawn.slick.opengl.ImageData Java Examples

The following examples show how to use org.newdawn.slick.opengl.ImageData. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Image.java    From opsu-dance with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Create an image from a image data source. Note that this method uses 
 * 
 * @param data The pixelData to use to create the image
 * @param f The filter to use when scaling this image
 */
public Image(ImageData data, int f) {
	try {
		this.filter = f == FILTER_LINEAR ? SGL.GL_LINEAR : SGL.GL_NEAREST;
		texture = InternalTextureLoader.get().getTexture(data, this.filter);
		ref = texture.toString();
	} catch (IOException e) {
		Log.error(e);
	}
}
 
Example #2
Source File: Image.java    From opsu with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Create an image from a image data source. Note that this method uses 
 * 
 * @param data The pixelData to use to create the image
 * @param f The filter to use when scaling this image
 */
public Image(ImageData data, int f) {
	try {
		this.filter = f == FILTER_LINEAR ? SGL.GL_LINEAR : SGL.GL_NEAREST;
		texture = InternalTextureLoader.get().getTexture(data, this.filter);
		ref = texture.toString();
	} catch (IOException e) {
		Log.error(e);
	}
}
 
Example #3
Source File: AppletGameContainer.java    From slick2d-maven with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
    * @see org.newdawn.slick.GameContainer#setMouseCursor(org.newdawn.slick.opengl.ImageData, int, int)
    */
   public void setMouseCursor(ImageData data, int hotSpotX, int hotSpotY) throws SlickException {
      try {
         Cursor cursor = CursorLoader.get().getCursor(data, hotSpotX, hotSpotY);
         Mouse.setNativeCursor(cursor);
      } catch (Throwable e) {
         Log.error("Failed to load and apply cursor.", e);
throw new SlickException("Failed to set mouse cursor", e);
      }
   }
 
Example #4
Source File: AppGameContainer.java    From slick2d-maven with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * @see org.newdawn.slick.GameContainer#setMouseCursor(org.newdawn.slick.opengl.ImageData, int, int)
 */
public void setMouseCursor(ImageData data, int hotSpotX, int hotSpotY) throws SlickException {
	try {
		Cursor cursor = CursorLoader.get().getCursor(data, hotSpotX, hotSpotY);
		Mouse.setNativeCursor(cursor);
	} catch (Throwable e) {
		Log.error("Failed to load and apply cursor.", e);
		throw new SlickException("Failed to set mouse cursor", e);
	}
}
 
Example #5
Source File: Image.java    From slick2d-maven with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/**
 * Create an image from a image data source. Note that this method uses 
 * 
 * @param data The pixelData to use to create the image
 * @param f The filter to use when scaling this image
 */
public Image(ImageData data, int f) {
	try {
		this.filter = f == FILTER_LINEAR ? SGL.GL_LINEAR : SGL.GL_NEAREST;
		texture = InternalTextureLoader.get().getTexture(data, this.filter);
		ref = texture.toString();
	} catch (IOException e) {
		Log.error(e);
	}
}
 
Example #6
Source File: Image.java    From opsu-dance with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Create an image from a pixelData of pixels
 * 
 * @param buffer The pixelData to use to create the image
 * @param filter The filter to use when scaling this image
 */
Image(ImageBuffer buffer, int filter) {
	this((ImageData) buffer, filter);
       TextureImpl.bindNone();
}
 
Example #7
Source File: Image.java    From opsu-dance with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Create an image from a image data source
 * 
 * @param data The pixelData to use to create the image
 */
public Image(ImageData data) {
	this(data, FILTER_LINEAR);
}
 
Example #8
Source File: ImageLoader.java    From opsu-dance with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Constructor.
 * @param imageData the class holding the image properties
 * @param buffer the stored image
 */
public LoadedImageData(ImageData imageData, ByteBuffer buffer) {
	this.imageData = imageData;
	this.buffer = buffer;
}
 
Example #9
Source File: GameContainer.java    From opsu with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Set the mouse cursor to be displayed - this is a hardware cursor and hence
 * shouldn't have any impact on FPS.
 * 
 * @param data The image data from which the cursor can be construted
 * @param hotSpotX The x coordinate of the hotspot within the cursor image
 * @param hotSpotY The y coordinate of the hotspot within the cursor image
 * @throws SlickException Indicates a failure to load the cursor image or create the hardware cursor
 */
@Override
public abstract void setMouseCursor(ImageData data, int hotSpotX, int hotSpotY) throws SlickException;
 
Example #10
Source File: Image.java    From opsu with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Create an image from a pixelData of pixels
 * 
 * @param buffer The pixelData to use to create the image
 * @param filter The filter to use when scaling this image
 */
Image(ImageBuffer buffer, int filter) {
	this((ImageData) buffer, filter);
       TextureImpl.bindNone();
}
 
Example #11
Source File: Image.java    From opsu with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Create an image from a image data source
 * 
 * @param data The pixelData to use to create the image
 */
public Image(ImageData data) {
	this(data, FILTER_LINEAR);
}
 
Example #12
Source File: ImageLoader.java    From opsu with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Constructor.
 * @param imageData the class holding the image properties
 * @param buffer the stored image
 */
public LoadedImageData(ImageData imageData, ByteBuffer buffer) {
	this.imageData = imageData;
	this.buffer = buffer;
}
 
Example #13
Source File: GameContainer.java    From slick2d-maven with BSD 3-Clause "New" or "Revised" License 2 votes vote down vote up
/**
 * Set the mouse cursor to be displayed - this is a hardware cursor and hence
 * shouldn't have any impact on FPS.
 * 
 * @param data The image data from which the cursor can be construted
 * @param hotSpotX The x coordinate of the hotspot within the cursor image
 * @param hotSpotY The y coordinate of the hotspot within the cursor image
 * @throws SlickException Indicates a failure to load the cursor image or create the hardware cursor
 */
public abstract void setMouseCursor(ImageData data, int hotSpotX, int hotSpotY) throws SlickException;
 
Example #14
Source File: Image.java    From slick2d-maven with BSD 3-Clause "New" or "Revised" License 2 votes vote down vote up
/**
 * Create an image from a pixelData of pixels
 * 
 * @param buffer The pixelData to use to create the image
 * @param filter The filter to use when scaling this image
 */
Image(ImageBuffer buffer, int filter) {
	this((ImageData) buffer, filter);
       TextureImpl.bindNone();
}
 
Example #15
Source File: Image.java    From slick2d-maven with BSD 3-Clause "New" or "Revised" License 2 votes vote down vote up
/**
 * Create an image from a image data source
 * 
 * @param data The pixelData to use to create the image
 */
public Image(ImageData data) {
	this(data, FILTER_LINEAR);
}
 
Example #16
Source File: GUIContext.java    From slick2d-maven with BSD 3-Clause "New" or "Revised" License 2 votes vote down vote up
/**
 * Set the mouse cursor to be displayed - this is a hardware cursor and hence
 * shouldn't have any impact on FPS.
 * 
 * @param data The image data from which the cursor can be construted
 * @param hotSpotX The x coordinate of the hotspot within the cursor image
 * @param hotSpotY The y coordinate of the hotspot within the cursor image
 * @throws SlickException Indicates a failure to load the cursor image or create the hardware cursor
 */
public abstract void setMouseCursor(ImageData data, int hotSpotX, int hotSpotY) throws SlickException;