/// <summary> Render setup for primitive Trianges from a previous RS with primitive restart, with optional control over various parameters of the primitive </summary> static public GLRenderState Tri(GLRenderState prev, DrawElementsType primitiverestarttype, FrontFaceDirection frontface = FrontFaceDirection.Ccw, bool cullface = true, PolygonMode polygonmode = PolygonMode.Fill, bool polysmooth = false) { return(new GLRenderState(prev) { PrimitiveRestart = GL4Statics.DrawElementsRestartValue(primitiverestarttype), FrontFace = frontface, CullFace = cullface, PolygonModeFrontAndBack = polygonmode, PolygonSmooth = polysmooth }); }
/// <summary> Vector4 and Vector2 and index array in a tuple. Element index is created. In attributes 0,1. No primitive restart</summary> public static GLRenderableItem CreateVector4Vector2Indexed(GLItemsList items, PrimitiveType prim, GLRenderState pt, Tuple <Vector4[], Vector2[], uint[]> vectors, IGLRenderItemData id = null, int ic = 1, int seconddivisor = 0) { var dt = GL4Statics.DrawElementsTypeFromMaxEID((uint)vectors.Item1.Length - 1); var ri = CreateVector4Vector2(items, prim, pt, vectors.Item1, vectors.Item2, id, ic, seconddivisor); ri.CreateElementIndex(items.NewBuffer(), vectors.Item3, dt); return(ri); }
///<summary> Given a elementbuffer, fill with indexes from an array. Set ElementBuffer, ElementIndexSize, BaseIndexOffset, DrawCount </summary> public void CreateElementIndex(GLBuffer elementbuf, uint[] eids, int base_index = 0) { CreateElementIndex(elementbuf, eids, GL4Statics.DrawElementsTypeFromMaxEID(eids.Max()), base_index); }