1 package com.badlogic.gdx.graphics.g3d.attributes;
3 import com.badlogic.gdx.graphics.Cubemap;
4 import com.badlogic.gdx.graphics.Texture;
5 import com.badlogic.gdx.graphics.g3d.Attribute;
6 import com.badlogic.gdx.graphics.g3d.utils.TextureDescriptor;
7 import com.badlogic.gdx.utils.GdxRuntimeException;
9 public class CubemapAttribute extends Attribute {
10 public final static String EnvironmentMapAlias = "environmentMapTexture";
11 public final static long EnvironmentMap = register(EnvironmentMapAlias);
13 // FIXME add more types!
14 // FIXME add scaling + offset?
15 // FIXME add filter settings? MipMap needs to be obeyed during loading :/
17 protected static long Mask = EnvironmentMap;
19 public final static boolean is(final long mask) {
20 return (mask & Mask) != 0;
23 public final TextureDescriptor<Cubemap> textureDescription;
25 public CubemapAttribute(final long type) {
28 throw new GdxRuntimeException("Invalid type specified");
29 textureDescription = new TextureDescriptor<Cubemap>();
32 public <T extends Cubemap> CubemapAttribute(final long type, final TextureDescriptor<T> textureDescription) {
34 this.textureDescription.set(textureDescription);
37 public CubemapAttribute(final long type, final Cubemap texture) {
39 textureDescription.texture = texture;
42 public CubemapAttribute(final CubemapAttribute copyFrom) {
43 this(copyFrom.type, copyFrom.textureDescription);
47 public Attribute copy () {
48 return new CubemapAttribute(this);
52 protected boolean equals (Attribute other) {
53 return ((CubemapAttribute)other).textureDescription.equals(textureDescription);