/// <summary> /// Installs a given program as part of the current rendering state, then draws this array object. /// </summary> /// <typeparam name="TAttr1">The type of the 1st attribute buffer object of the VAO.</typeparam> /// <param name="vao">The VAO to use.</param> /// <param name="program">The program to use.</param> /// <param name="count">The number of vertices to draw, or -1 to draw all vertices.</param> public static void Draw <TAttr1>( this IVertexArrayObject <TAttr1> vao, GlProgram program, int count = -1) where TAttr1 : struct { program.Use(); vao.Draw(count); }
/// <summary> /// Installs a given program as part of the current rendering state, then draws this array object. /// </summary> /// <typeparam name="TAttr1">The type of the 1st attribute buffer object of the VAO.</typeparam> /// <typeparam name="TAttr2">The type of the 2nd attribute buffer object of the VAO.</typeparam> /// <typeparam name="TUbo1">The type of the 1st uniform buffer object of the program.</typeparam> /// <param name="vao">The VAO to use.</param> /// <param name="program">The program to use.</param> /// <param name="count">The number of vertices to draw, or -1 to draw all vertices.</param> public static void Draw <TAttr1, TAttr2, TUbo1>( this IVertexArrayObject <TAttr1, TAttr2> vao, GlProgram <TUbo1> program, int count = -1) where TAttr1 : struct where TAttr2 : struct where TUbo1 : struct { program.Use(); vao.Draw(count); }
public void Write(string txt, float x, float y, float size, Color cl) { _pgm.Use(); _uColor.Set((float)cl.R / byte.MaxValue, (float)cl.G / byte.MaxValue, (float)cl.B / byte.MaxValue, (float)cl.A / byte.MaxValue); _font.Render(this, txt, x, y, size); }