Exemplo n.º 1
0
        protected void Draw(SpriteBatch sb, float t, uint textureId, float[] data)
        {
            // Data can be null for empty text.
            if (data == null)
            {
                return;
            }

            Recompute(t);
            sb.BindTexture(textureId);

            if (Shader != null)
            {
                sb.Apply(Shader, GL_TRIANGLE_STRIP);
            }
            else
            {
                sb.Mode = GL_TRIANGLE_STRIP;
            }

            // Strings need to buffer each character individually in order to add the primitive restart index each
            // time.
            var quads   = data.Length / QuadSize;
            var indices = new ushort[] { 0, 1, 2, 3 };

            for (int i = 0; i < quads; i++)
            {
                sb.Buffer(data, indices, i * QuadSize, QuadSize);
            }
        }