package de.frajul.particlelab.entities.textures;

import android.content.Context;

import de.frajul.particlelab.R;

/**
 * Created by Julian on 05.12.2015.
 */
public class TexturePack {

    private TextureLoader loader;

    public final Texture star;
    public final Texture yellowParticle;
    public final Texture redParticle;

    public TexturePack(Context context) {
        loader = new TextureLoader(context);
        star = loadTexture(R.drawable.star);

        yellowParticle = loadTexture(R.drawable.yellowparticle);
        redParticle = loadTexture(R.drawable.redparticle);
    }

    private Texture loadTexture(int id) {
        int texId = loader.loadTextureId(id, false);
        return new Texture(texId, 1, 1);
    }

    public Texture loadAtlas(int id, int atlasWidth, int atlasHeight) {
        int texId = loader.loadTextureId(id, true);
        return new Texture(texId, atlasWidth, atlasHeight);
    }
}
