Renderer/src/main/java/electrosphere/engine/assetmanager/queue/QueuedTexture.java
austin ac12b3f5a8
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
async load texture atlas
2024-05-07 21:39:20 -04:00

52 lines
966 B
Java

package electrosphere.engine.assetmanager.queue;
import java.awt.image.BufferedImage;
import electrosphere.renderer.texture.Texture;
/**
* A texture queued to be sent to the gpu
*/
public class QueuedTexture implements QueuedAsset {
//true if loaded
boolean hasLoaded = false;
//the resulting texture object
Texture texture = null;
//data to be loaded
BufferedImage data;
/**
* Creates the queued texture object
* @param image the image to load to gpu
*/
public QueuedTexture(BufferedImage image){
this.data = image;
}
@Override
public void load() {
texture = new Texture(data);
hasLoaded = true;
}
@Override
public boolean hasLoaded() {
return hasLoaded;
}
/**
* Gets the texture object
* @return The texture if it has been loaded, otherwise null
*/
public Texture getTexture(){
return texture;
}
}