Libgdx: Applying filter to multiple Textures : how to write code...

I want to apply the same filter to multiple Textures

I have a ton of Textures and I want to apply the same filter to everyone. Currently I have code that looks something like the example bellow.
Somehow this doesn’t seem like very efficient coding especially when the amount of textures to load become more and more, but I haven’t been able to figure out how to improve my code yet. Can anyone help me and tell me how to write this donw more efficient?


	public Buttons_PreGameScreen(){
		but_play = new Texture("ui/button_play.png");
		but_view = new Texture("ui/button_view_painting.png");
		but_back = new Texture("ui/button_back.png");
		label_info = new Texture("ui/label_info.png");
                etc...
				
		but_play.setFilter(TextureFilter.Linear, TextureFilter.Linear);		
		but_view.setFilter(TextureFilter.Linear, TextureFilter.Linear);		
		but_back.setFilter(TextureFilter.Linear, TextureFilter.Linear);		
		label_info.setFilter(TextureFilter.Linear, TextureFilter.Linear);
                etc...		
	}

You can save your textures in an array or hash or linkedlist (or any structure) instead of declaring a texture variable for each of them.
Afterwards you iterate through the collection of textures and assign them the filter.

OR

Create a method like


private Texture loadTexture(String path)
{
 Texture t = new Texture(path);
t.setFilter(TextureFilter.Linear, TextureFilter.Linear); 

You can combine both methods too.
I strongly advise you to store all your textures in some kind of list. Don’t forget you would also have to dispose them , it will be very likely to forget to dispose some of them if you don’t have a list.
return t;
}

but_play = loadTexture(“ui/button_play.png”);