/// <summary> /// Renders multiple instances from array via indices with a per-element offset and an offset to all instanced vertex attributes. /// </summary> /// <param name="mode">A <see cref="glDrawMode"/> specifying the type of primitive to be rendered.</param> /// <param name="count">Number of indices.</param> /// <param name="type">A <see cref="glDrawElementsType"/> specifying the data type of the indices.</param> /// <param name="offset">The offset into the array bound to <see cref="glBufferTarget.ELEMENT_ARRAY_BUFFER"/>.</param> /// <param name="instancecount">Number of instances to be rendered.</param> /// <param name="basevertex">The per-element offset.</param> /// <param name="baseinstance">Offset to all instanced vertex attributes.</param> public static void DrawElementsInstancedBaseVertexBaseInstance(glDrawMode mode, int count, glDrawElementsType type, long offset, int instancecount, int basevertex, uint baseinstance) { if (IntPtr.Size == 4 && ((long)offset >> 32) != 0) { throw new ArgumentOutOfRangeException("offset", PlatformErrorString); } _DrawElementsInstancedBaseVertexBaseInstance(mode, count, type, (IntPtr)offset, instancecount, basevertex, baseinstance); }
/// <summary> /// Render primitives from array via a range of indices. /// </summary> /// <param name="mode">A <see cref="glDrawMode"/> specifying the type of primitive to render.</param> /// <param name="start">Start of the range.</param> /// <param name="end">End of the range.</param> /// <param name="count">Number of indices.</param> /// <param name="type">A <see cref="glDrawElementsType"/> specifying the data type of the indices.</param> /// <param name="offset">The offset into the array bound to <see cref="glBufferTarget.ELEMENT_ARRAY_BUFFER"/>.</param> public static void DrawRangeElements(glDrawMode mode, uint start, uint end, int count, glDrawElementsType type, long offset) { if (IntPtr.Size == 4 && ((long)offset >> 32) != 0) { throw new ArgumentOutOfRangeException("offset", PlatformErrorString); } _DrawRangeElements(mode, start, end, count, type, (IntPtr)offset); }
/// <summary> /// Renders primitives from array via indices with a per-element offset. /// </summary> /// <param name="mode">A <see cref="glDrawMode"/> specifying the type of primitive to render.</param> /// <param name="count">Numbers of indices.</param> /// <param name="type">A <see cref="glDrawElementsType"/> specifying the data type of the indices.</param> /// <param name="offsets">The offsets into the array bound to <see cref="glBufferTarget.ELEMENT_ARRAY_BUFFER"/>.</param> /// <param name="drawcount">Number of draws (Length of <paramref name="count"/> and <paramref name="offsets"/>.</param> /// <param name="basevertex">The per-element offset.</param> public static void MultiDrawElementsBaseVertex(glDrawMode mode, int[] count, glDrawElementsType type, int[] offsets, int drawcount, int[] basevertex) { IntPtr[] iOffsets = new IntPtr[drawcount]; for (int i = 0; i < drawcount; i++) { iOffsets[i] = (IntPtr)offsets[i]; } _MultiDrawElementsBaseVertex(mode, count, type, iOffsets, drawcount, basevertex); }
/// <summary> /// Renders primitives from array via indices with a per-element offset. /// </summary> /// <param name="mode">A <see cref="glDrawMode"/> specifying the type of primitive to render.</param> /// <param name="count">Numbers of indices.</param> /// <param name="type">A <see cref="glDrawElementsType"/> specifying the data type of the indices.</param> /// <param name="offsets">The offsets into the array bound to <see cref="glBufferTarget.ELEMENT_ARRAY_BUFFER"/>.</param> /// <param name="drawcount">Number of draws (Length of <paramref name="count"/> and <paramref name="offsets"/>.</param> /// <param name="basevertex">The per-element offset.</param> public static void MultiDrawElementsBaseVertex(glDrawMode mode, int[] count, glDrawElementsType type, long[] offsets, int drawcount, int[] basevertex) { IntPtr[] iOffsets = new IntPtr[drawcount]; for (int i = 0; i < drawcount; i++) { if (IntPtr.Size == 4 && ((long)offsets[i] >> 32) != 0) { throw new ArgumentOutOfRangeException("offsets", PlatformArrayErrorString); } iOffsets[i] = (IntPtr)offsets[i]; } _MultiDrawElementsBaseVertex(mode, count, type, iOffsets, drawcount, basevertex); }
/// <summary> /// Render primitives from array via a range of indices. /// </summary> /// <param name="mode">A <see cref="glDrawMode"/> specifying the type of primitive to render.</param> /// <param name="start">Start of the range.</param> /// <param name="end">End of the range.</param> /// <param name="count">Number of indices.</param> /// <param name="type">A <see cref="glDrawElementsType"/> specifying the data type of the indices.</param> /// <param name="offset">The offset into the array bound to <see cref="glBufferTarget.ELEMENT_ARRAY_BUFFER"/>.</param> public static void DrawRangeElements(glDrawMode mode, uint start, uint end, int count, glDrawElementsType type, int offset) { _DrawRangeElements(mode, start, end, count, type, (IntPtr)offset); }
/// <summary> /// Renders multiple instances from array via indices with a per-element offset and an offset to all instanced vertex attributes. /// </summary> /// <param name="mode">A <see cref="glDrawMode"/> specifying the type of primitive to be rendered.</param> /// <param name="count">Number of indices.</param> /// <param name="type">A <see cref="glDrawElementsType"/> specifying the data type of the indices.</param> /// <param name="offset">The offset into the array bound to <see cref="glBufferTarget.ELEMENT_ARRAY_BUFFER"/>.</param> /// <param name="instancecount">Number of instances to be rendered.</param> /// <param name="basevertex">The per-element offset.</param> /// <param name="baseinstance">Offset to all instanced vertex attributes.</param> public static void DrawElementsInstancedBaseVertexBaseInstance(glDrawMode mode, int count, glDrawElementsType type, int offset, int instancecount, int basevertex, uint baseinstance) { _DrawElementsInstancedBaseVertexBaseInstance(mode, count, type, (IntPtr)offset, instancecount, basevertex, baseinstance); }
/// <summary> /// Renders multiple instances from array via indices. /// </summary> /// <param name="mode">A <see cref="glDrawMode"/> specifying the type of primitive to be rendered.</param> /// <param name="count">Number of indices.</param> /// <param name="type">A <see cref="glDrawElementsType"/> specifying the data type of the indices.</param> /// <param name="offset">The offset into the array bound to <see cref="glBufferTarget.ELEMENT_ARRAY_BUFFER"/>.</param> /// <param name="instancecount">Number of instances to be rendered.</param> public static void DrawElementsInstanced(glDrawMode mode, int count, glDrawElementsType type, int offset, int instancecount) { _DrawElementsInstanced(mode, count, type, (IntPtr)offset, instancecount); }
/// <summary> /// Renders primitives from array via indices. /// </summary> /// <param name="mode">A <see cref="glDrawMode"/> specifying the type of primitive to render.</param> /// <param name="count">Number of indices.</param> /// <param name="type">A <see cref="glDrawElementsType"/> specifying the data type of the indices.</param> /// <param name="offset">The offset into the array bound to <see cref="glBufferTarget.ELEMENT_ARRAY_BUFFER"/>.</param> public static void DrawElements(glDrawMode mode, int count, glDrawElementsType type, int offset) { DrawElements(mode, count, type, (IntPtr)offset); }
static extern void DrawElements(glDrawMode mode, int count, glDrawElementsType type, IntPtr indices);
public static extern void DrawArrays(glDrawMode mode, int first, int count);
/// <summary> /// Render primitives from array via a range of indices with a per-element offset. /// </summary> /// <param name="mode">A <see cref="glDrawMode"/> specifying the type of primitive to render.</param> /// <param name="start">Start of the range.</param> /// <param name="end">End of the range.</param> /// <param name="count">Number of indices.</param> /// <param name="type">A <see cref="glDrawElementsType"/> specifying the data type of the indices.</param> /// <param name="offset">The offset into the array bound to <see cref="glBufferTarget.ELEMENT_ARRAY_BUFFER"/>.</param> /// <param name="basevertex">The per-element offset.</param> public static void DrawRangeElementsBaseVertex(glDrawMode mode, uint start, uint end, int count, glDrawElementsType type, int offset, int basevertex) { _DrawRangeElementsBaseVertex(mode, start, end, count, type, (IntPtr)offset, basevertex); }