Package org.gbcpainter.loaders.textures

Examples of org.gbcpainter.loaders.textures.TextureLoader.loadTexture()


  @Test
  public void transparentTextureLoading() throws Exception {
    final TextureLoader loader = GraphicsEnv.getInstance().getTextureLoader();

    BufferedImage loaded = (BufferedImage) loader.loadTexture( "Transparent", false );

    assertNotSame(loaded.getTransparency(), Transparency.OPAQUE);
  }

  @Test
View Full Code Here


  @Test
  public void opaqueTextureLoading() throws Exception {
    final TextureLoader loader = GraphicsEnv.getInstance().getTextureLoader();

    BufferedImage loaded = (BufferedImage) loader.loadTexture( "Opaque", false );

    assertEquals(loaded.getTransparency(), Transparency.OPAQUE);

    loaded = (BufferedImage) loader.loadTexture( "Opaque_with_alpha", false );
View Full Code Here

    BufferedImage loaded = (BufferedImage) loader.loadTexture( "Opaque", false );

    assertEquals(loaded.getTransparency(), Transparency.OPAQUE);

    loaded = (BufferedImage) loader.loadTexture( "Opaque_with_alpha", false );

    assertNotSame(loaded.getTransparency(), Transparency.OPAQUE);
  }
}
View Full Code Here

  @Test
  public void testLoadNonAcceleratedTexture() throws Exception {
    final TextureLoader loader = GraphicsEnv.getInstance().getTextureLoader();

    loader.loadTexture( "Header", false );

    try {
      loader.mustReload( "Header", true );
      fail();
    } catch ( NoSuchElementException e ){}
View Full Code Here

      fail();
    } catch ( NoSuchElementException e ){}

    assertEquals( loader.getTexture( "Header", false ), null );

    Image oldTexture = loader.loadTexture( "Header", false );

    loader.reloadTextures();

    Image newTexture = loader.getTexture( "Header", false );
View Full Code Here

  @Test
  public void testLoadAcceleratedTexture() throws Exception {
    final TextureLoader loader = GraphicsEnv.getInstance().getTextureLoader();

    loader.loadTexture( "Header", true);

    loader.mustReload( "Header", false );
    loader.mustReload( "Header", true );

    loader.clear();
View Full Code Here

    } catch ( NoSuchElementException e ){}

    assertEquals( loader.getTexture( "Header", false ), null );
    assertEquals( loader.getTexture( "Header", true ), null );

    Image oldTexture = loader.loadTexture( "Header", true );

    loader.reloadTextures();

    Image newTexture = loader.getTexture( "Header", true );
View Full Code Here

  @Test
  public void testLoadInvalidTexture() throws Exception {
    final TextureLoader loader = GraphicsEnv.getInstance().getTextureLoader();

    try {
      loader.loadTexture( "1234509876", false );
      fail();
    } catch ( TextureNotFoundException e ){}

    try {
      loader.loadTexture( "FakePngExtension", false );
View Full Code Here

      loader.loadTexture( "1234509876", false );
      fail();
    } catch ( TextureNotFoundException e ){}

    try {
      loader.loadTexture( "FakePngExtension", false );
      fail();
    } catch ( IOException e ){}
  }
}
View Full Code Here

    final TextureLoader loader = GraphicsEnv.getInstance().getTextureLoader();

    for (Iterable<String> slotList : resources.values()) {
      for (String resource : slotList) {
        try {
          loader.loadTexture( resource, true );
        } catch ( Exception e ) {
          throw new TextureNotFoundException( e );
        }
      }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.