public Sprite(TextureLoader loader, String ref, int x, int y, int w, int h) { try { texture = loader.getTexture(ref, GL_TEXTURE_2D, GL_RGBA, GL_LINEAR, GL_LINEAR, x, y, w, h); width = texture.getImageWidth(); height = texture.getImageHeight(); } catch (IOException ioe) { ioe.printStackTrace(); System.exit(-1); } }
/** * Create a new sprite from a specified image. * * @param loader the texture loader to use * @param ref A reference to the image on which this sprite should be based */ public Sprite(TextureLoader loader, String ref) { try { texture = loader.getTexture(ref); width = texture.getImageWidth(); height = texture.getImageHeight(); } catch (IOException ioe) { ioe.printStackTrace(); System.exit(-1); } }
/** * Initializes the skybox by loading the specified texture * * @param drawable current rendering context */ public static void init(GLAutoDrawable drawable, String textureFile) { TextureLoader texLoader = new TextureLoader(); texture = texLoader.getTexture(textureFile, true); texture.create(drawable); }
public static void main(String[] args) { TextureLoader.load(); AnimationLoader.load(); Arcadia.display(new Arcadia(new Darklight2())); }