Rogue: Savage Rats, a retro-themed dungeon crawler
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
rogue-savage-rats/src/mightypork/gamecore/resources/textures/ITexture.java

92 lines
1.4 KiB

package mightypork.gamecore.resources.textures;
import mightypork.utils.interfaces.Destroyable;
import mightypork.utils.math.constraints.rect.Rect;
/**
* Texture with filter and wrap mode
*
* @author Ondřej Hruška (MightyPork)
*/
public interface ITexture extends Destroyable {
/**
* Set filter for scaling
*
* @param filter filter
*/
void setFilter(FilterMode filter);
/**
* @param wrapping wrap mode
*/
void setWrap(WrapMode wrapping);
/**
* Get a quad from this texture of given position/size
*
* @param uvs quad rect
* @return the quad
*/
TxQuad makeQuad(Rect uvs);
/**
* Get a grid for given number of tiles
*
* @param x horizontal tile count
* @param y vertical tile count
* @return grid
*/
QuadGrid grid(int x, int y);
/**
* @return OpenGL texture ID
*/
int getTextureID();
/**
* Get the height of the texture, 0..1.<br>
*
* @return height 0..1
*/
float getHeight01();
/**
* Get the width of the texture, 0..1.<br>
*
* @return width 0..1
*/
float getWidth01();
/**
* @return source image width (corresponding to width01)
*/
int getImageWidth();
/**
* @return source image height (corresponding to height01)
*/
int getImageHeight();
/**
* Bind to GL context, applying the filters prescribed.
*/
void bind();
/**
* @return true if the image is RGBA
*/
boolean hasAlpha();
}