GLRenderer, add function to set clear color

This commit is contained in:
Hannes Janetzek 2013-07-24 01:40:39 +02:00
parent 9043188f94
commit 1481f4b508
2 changed files with 10 additions and 6 deletions

View File

@ -27,7 +27,6 @@ import org.oscim.core.MapPosition;
import org.oscim.core.Tile;
import org.oscim.layers.tile.MapTile;
import org.oscim.renderer.sublayers.Layers;
import org.oscim.theme.IRenderTheme;
import org.oscim.utils.GlUtils;
import org.oscim.utils.Matrix4;
import org.oscim.utils.pool.Inlist;
@ -56,13 +55,17 @@ public class GLRenderer {
private static short[] mFillCoords;
public class Matrices {
// do not modify any of these
/** do not modify! */
public final Matrix4 viewproj = new Matrix4();
/** do not modify! */
public final Matrix4 proj = new Matrix4();
/** do not modify! */
public final Matrix4 view = new Matrix4();
/** do not modify! */
public final float[] mapPlane = new float[8];
// for temporary use by callee
/** for temporary use by callee */
public final Matrix4 mvp = new Matrix4();
/**
@ -124,8 +127,8 @@ public class GLRenderer {
mFillCoords[7] = min;
}
public static void setRenderTheme(IRenderTheme t) {
mClearColor = GlUtils.colorToFloat(t.getMapBackground());
public static void setBackgroundColor(int color){
mClearColor = GlUtils.colorToFloat(color);
mUpdateColor = true;
}

View File

@ -31,6 +31,7 @@ import org.oscim.theme.IRenderTheme;
import org.oscim.theme.InternalRenderTheme;
import org.oscim.theme.ThemeLoader;
import org.oscim.tilesource.TileSource;
import org.oscim.utils.GlUtils;
public class MapView {
@ -96,7 +97,7 @@ public class MapView {
throw new IllegalStateException();
}
mBaseLayer.setRenderTheme(t);
GLRenderer.setRenderTheme(t);
GLRenderer.setBackgroundColor(t.getMapBackground());
}
public void destroy() {