26 lines
475 B
Java
Executable file
26 lines
475 B
Java
Executable file
package client.renderer.texture;
|
|
|
|
import java.io.IOException;
|
|
|
|
import org.lwjgl.opengl.GL46;
|
|
|
|
import client.renderer.GlState;
|
|
|
|
public abstract class Texture {
|
|
private int id = -1;
|
|
|
|
public final int getGlTextureId() {
|
|
if(this.id == -1)
|
|
this.id = GL46.glGenTextures();
|
|
return this.id;
|
|
}
|
|
|
|
public final void deleteGlTexture() {
|
|
if(this.id != -1) {
|
|
GlState.deleteTexture(this.id);
|
|
this.id = -1;
|
|
}
|
|
}
|
|
|
|
public abstract void loadTexture() throws IOException;
|
|
}
|