Interface TextureSource

All Known Implementing Classes:
ArrayTextureSource, AwtTextureSource, ImageTextureSource, InMemoryTextureSource, ProceduralNormalMapSource, ProceduralTextureSource, SimpleArrayTextureSource

public interface TextureSource
Feeds texture data to a TextureCache
  • Method Summary

    Modifier and Type
    Method
    Description
    Called to initialize and setup the texture clipmap.
    int
    getContributorId(int clipmapLevel, Tile tile)
    Returns the contributing source id for the requested tile.
    getInvalidTiles(int clipmapLevel, int tileX, int tileY, int numTilesX, int numTilesY)
    Returns which tiles that should be marked as invalid and updated in the requested region.
    getTile(int clipmapLevel, Tile tile)
    Request for texture data for a tile.
    getValidTiles(int clipmapLevel, int tileX, int tileY, int numTilesX, int numTilesY)
    Returns which tiles that contain data in the requested region.
  • Method Details

    • getConfiguration

      TextureConfiguration getConfiguration() throws Exception
      Called to initialize and setup the texture clipmap.
      Returns:
      the configuration
      Throws:
      Exception - exception
    • getValidTiles

      Set<Tile> getValidTiles(int clipmapLevel, int tileX, int tileY, int numTilesX, int numTilesY) throws Exception
      Returns which tiles that contain data in the requested region.
      Parameters:
      clipmapLevel - the clipmap level
      tileX - the tile abscissa
      tileY - the tile ordinate
      numTilesX - the number of tiles on X
      numTilesY - the number of tiles on Y
      Returns:
      the tiles that contain data in the requested region
      Throws:
      Exception - exception
    • getInvalidTiles

      Set<Tile> getInvalidTiles(int clipmapLevel, int tileX, int tileY, int numTilesX, int numTilesY) throws Exception
      Returns which tiles that should be marked as invalid and updated in the requested region.
      Parameters:
      clipmapLevel - the clipmap level
      tileX - the tile abscissa
      tileY - the tile ordinate
      numTilesX - the number of tiles on X
      numTilesY - the number of tiles on Y
      Returns:
      the tiles that should be marked as invalid and updated in the requested region
      Throws:
      Exception - exception
    • getContributorId

      int getContributorId(int clipmapLevel, Tile tile)
      Returns the contributing source id for the requested tile.
      Parameters:
      clipmapLevel - the clipmap level
      tile - the tile
      Returns:
      the contributing source id for the requested tile
    • getTile

      ByteBuffer getTile(int clipmapLevel, Tile tile) throws Exception
      Request for texture data for a tile.
      Parameters:
      clipmapLevel - the clipmap level
      tile - the tile
      Returns:
      the texture data for a tile
      Throws:
      Exception - exception