v0.6.3: moved opengl code out of fog of war class, into BufferTexture

This commit is contained in:
Evan Debenham
2017-12-28 00:33:56 -05:00
parent 902caaafc7
commit 2b342dfe89
3 changed files with 139 additions and 98 deletions
@@ -87,6 +87,26 @@ public class TextureCache {
}
//creates a smarttexture backed by a native intbuffer, not a bitmap.
//This is much faster is the texture needs to be frequently edited.
//texture is all black by default
public static SmartTexture createBufferTex( String key, int w, int h ){
key += "w" + w + "h" + h;
if (all.containsKey( key )){
return all.get( key );
} else {
BufferTexture tx = new BufferTexture(w, h);
all.put( key, tx);
return tx;
}
}
public static void add( Object key, SmartTexture tx ) {
all.put( key, tx );
}