Class MapRenderer

java.lang.Object
org.oscim.renderer.MapRenderer

public class MapRenderer extends Object
  • Field Details

    • COORD_SCALE

      public static float COORD_SCALE
      scale factor used for short vertices
    • MAX_QUADS

      public static final int MAX_QUADS
      Number of Quads that can be rendered with bindQuadIndicesVBO()
      See Also:
    • MAX_INDICES

      public static final int MAX_INDICES
      Number of Indices that can be rendered with bindQuadIndicesVBO()
      See Also:
    • frametime

      public static long frametime
  • Constructor Details

    • MapRenderer

      public MapRenderer(Map map)
  • Method Details

    • setBackgroundColor

      public static void setBackgroundColor(int color)
    • setViewPortScale

      public void setViewPortScale(float scale)
      Set the scale value for map viewport.
    • onDrawFrame

      public void onDrawFrame()
    • onSurfaceChanged

      public void onSurfaceChanged(int width, int height)
    • onSurfaceCreated

      public void onSurfaceCreated()
    • bindQuadVertexVBO

      public static void bindQuadVertexVBO(int location)
      Bind VBO for a simple quad. Handy for simple custom RenderLayers Vertices: float[]{ -1, -1, -1, 1, 1, -1, 1, 1 }

      GL.drawArrays(GL20.TRIANGLE_STRIP, 0, 4);

    • bindQuadIndicesVBO

      public static void bindQuadIndicesVBO()
      Bind indices for rendering up to MAX_QUADS (512), ie. MAX_INDICES (512*6) in one draw call. Vertex order is 0-1-2 2-1-3
    • animate

      public static void animate()
      Trigger next redraw from GL-Thread. This should be used to animate LayerRenderers instead of calling Map.render().
    • getFloatBuffer

      public static FloatBuffer getFloatBuffer(int size)
    • getShortBuffer

      public static ShortBuffer getShortBuffer(int size)
    • getIntBuffer

      public static IntBuffer getIntBuffer(int size)