public GuiModel(GuiVAO vao, Texture texture, BeginMode drawmode, Vector2 size) { this.vao = vao; this.texture = texture; this.drawmode = drawmode; this.size = size; }
public static GuiModel CreateWireRectangle(Vector2 size, Color colour, BufferUsageHint verticeshint = BufferUsageHint.StaticDraw, BufferUsageHint uvhint = BufferUsageHint.StaticDraw) { Vector2[] vertices = new Vector2[] { new Vector2(-1, 1), new Vector2(-1, -1), new Vector2(1, -1), new Vector2(1, 1) }; int[] elements = new int[] { 0, 1, 2, 3, 0 }; Vector2[] uvs = new Vector2[] { new Vector2(0, 1), new Vector2(0, 0), new Vector2(1, 0), new Vector2(1, 1) }; GuiVAO vao = new GuiVAO(vertices, elements, uvs, verticeshint, uvhint); return(new GuiModel(vao, TextureUtil.CreateTexture(colour), BeginMode.LineLoop, size)); }
public static GuiModel CreateRectangle(Vector2 size, Texture texture, BufferUsageHint verticeshint = BufferUsageHint.StaticDraw, BufferUsageHint uvhint = BufferUsageHint.StaticDraw) { Vector2[] vertices = new Vector2[] { new Vector2(-1, 1), new Vector2(-1, -1), new Vector2(1, -1), new Vector2(1, 1) }; int[] elements = new int[] { 0, 1, 2, 3, 0 }; Vector2[] uvs = new Vector2[] { new Vector2(0, 1), new Vector2(0, 0), new Vector2(1, 0), new Vector2(1, 1) }; GuiVAO vao = new GuiVAO(vertices, elements, uvs, verticeshint, uvhint); return(new GuiModel(vao, texture, BeginMode.TriangleStrip, size)); }
public static GuiModel CreateLine(Vector2 size, Texture texture) { Vector2[] vertices = new Vector2[] { new Vector2(0, 0), size }; int[] elements = new int[] { 0, 1 }; Vector2[] uvs = new Vector2[] { new Vector2(0, 0), new Vector2(0, 0) }; GuiVAO vao = new GuiVAO(vertices, elements, uvs); return(new GuiModel(vao, texture, BeginMode.Lines, new Vector2(1, 1))); }