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.
60 lines
1.1 KiB
60 lines
1.1 KiB
package mightypork.gamecore.graphics.textures;
|
|
|
|
|
|
import mightypork.gamecore.resources.BaseDeferredResource;
|
|
import mightypork.gamecore.resources.loading.MustLoadInRenderingContext;
|
|
import mightypork.utils.annotations.Alias;
|
|
import mightypork.utils.math.constraints.rect.Rect;
|
|
|
|
|
|
/**
|
|
* Deferred texture (to be extended by backend texture)
|
|
*
|
|
* @author Ondřej Hruška (MightyPork)
|
|
*/
|
|
@Alias(name = "Texture")
|
|
@MustLoadInRenderingContext
|
|
public abstract class DeferredTexture extends BaseDeferredResource implements ITexture {
|
|
|
|
/** Used filtering mode */
|
|
protected FilterMode filter = FilterMode.NEAREST;
|
|
/** Used wrapping mode */
|
|
protected WrapMode wrap = WrapMode.CLAMP;
|
|
|
|
|
|
/**
|
|
* @param resourcePath resource path
|
|
*/
|
|
public DeferredTexture(String resourcePath)
|
|
{
|
|
super(resourcePath);
|
|
}
|
|
|
|
|
|
@Override
|
|
public TxQuad makeQuad(Rect uvs)
|
|
{
|
|
return new TxQuad(this, uvs);
|
|
}
|
|
|
|
|
|
@Override
|
|
public void setFilter(FilterMode filterMin)
|
|
{
|
|
this.filter = filterMin;
|
|
}
|
|
|
|
|
|
@Override
|
|
public void setWrap(WrapMode wrapping)
|
|
{
|
|
this.wrap = wrapping;
|
|
}
|
|
|
|
|
|
@Override
|
|
public QuadGrid grid(int x, int y)
|
|
{
|
|
return new QuadGrid(this, x, y);
|
|
}
|
|
}
|
|
|