public IndexedVerticesScreen(IGame g) : base(g) { _glGraphics = ((AndroidGLGame)g).GLGraphics; ByteBuffer bb = ByteBuffer.AllocateDirect(_vertexSize * 4); bb.Order(ByteOrder.NativeOrder()); _vertices = bb.AsFloatBuffer(); _vertices.Put(new float[] { 100f, 100f, 0f, 1f, 428f, 100f, 1f, 1f, 428f, 428f, 1f, 0f, 100f, 428f, 0f, 0f }); _vertices.Flip(); bb = ByteBuffer.AllocateDirect(6 * 2); bb.Order(ByteOrder.NativeOrder()); _indices = bb.AsShortBuffer(); _indices.Put(new short[] { 0, 1, 2, 2, 3, 0 }); _indices.Flip(); _texture = new AndroidTexture((AndroidGLGame)g, "bobrgb888.png"); }
public void SetIndices(short[] indices, int offset, int length) { _indices.Clear(); _indices.Put(indices, offset, length); _indices.Flip(); }