// HLGL High Level GL Abstraction Layer package main import "github.com/go-gl/gl/v4.1-core/gl" type HLRectangle struct { X int Y int Width int Height int } type HLColorRGBA struct { R int G int B int A int } func DrawRectangleWH(x, y, width, height int, color HLColorRGBA) { // Triangle ONE var triangleOneVerticies = []float32{ float32(x), float32(y), 0.0, float32(x), float32(y + height), 0.0, float32(x + width), float32(y), 0.0, } var triangleOneVAO = NewVertexArray() var trianglOneVBO = NewVertexBuffer(triangleOneVerticies) triangleOneVAO.AddBuffer(trianglOneVBO, []int32{3}) triangleOneVAO.Bind() gl.DrawArrays(gl.TRIANGLES, 0, 3) // Triangle TWO var triangleTwoVerticies = []float32{ float32(x + width), float32(y + height), 0.0, float32(x), float32(y + height), 0.0, float32(x + width), float32(y), 0.0, } var triangleTwoVAO = NewVertexArray() var trianglTwoVBO = NewVertexBuffer(triangleTwoVerticies) triangleTwoVAO.AddBuffer(trianglTwoVBO, []int32{3}) triangleTwoVAO.Bind() gl.DrawArrays(gl.TRIANGLES, 0, 3) } func DrawRectangleRec(rectangle HLRectangle, color HLColorRGBA) {}