package org.newdawn.slick.geom; import org.newdawn.slick.Image; import org.newdawn.slick.ShapeFill; import org.newdawn.slick.opengl.Texture; import org.newdawn.slick.opengl.TextureImpl; import org.newdawn.slick.opengl.renderer.LineStripRenderer; import org.newdawn.slick.opengl.renderer.Renderer; import org.newdawn.slick.opengl.renderer.SGL; /** * @author Mark Bernard * * Use this class to render shpaes directly to OpenGL. Allows you to bypass the Graphics class. */ public final class ShapeRenderer { /** The renderer to use for all GL operations */ private static SGL GL = Renderer.get(); /** The renderer to use line strips */ private static LineStripRenderer LSR = Renderer.getLineStripRenderer(); /** * Draw the outline of the given shape. Only the vertices are set. * The colour has to be set independently of this method. * * @param shape The shape to draw. */ public static final void draw(Shape shape) { Texture t = TextureImpl.getLastBind(); TextureImpl.bindNone(); float points[] = shape.getPoints(); LSR.start(); for(int i=0;i