549

Controlling the appearance of textures
Texture filter example code

  • Load a texture image
    TextureLoader myLoader = new TextureLoader( "brick.jpg", this );
    ImageComponent2D myImage = myLoader.getImage( );

  • Create a Texture2D using the image, and turn it on
    Texture2D myTex = new Texture2D( );
    myTex.setImage( 0, myImage );
    myTex.setEnable( true );

  • Set the filtering types
    myTex.setMagFilter( Texture.BASE_LEVEL_POINT );
    myTex.setMinFilter( Texture.BASE_LEVEL_POINT );

  • Create an Appearance and set the texture in it
    Appearance myAppear = new Appearance( );
    myAppear.setTexture( myTex );