public void addTexture ( int unit , Texture texture ) { if ( texture == null ) { throw new IllegalStateException ( "Texture cannot be null" ) ; } texture . checkCreated ( ) ; if ( textures == null ) { textures = new TIntObjectHashMap <> ( ) ; } textures . put ( unit , texture ) ; }
Adds a texture to the material . If a texture is a already present in the same unit as this one it will be replaced .