local lg = love.graphics
local mesh = lg.newMesh(
  {{"VertexPosition", "float", 3}},
  {
    {-1,-1,-1}, --A
    {-1,-1, 1}, --B
    {-1, 1,-1}, --H
    {-1, 1, 1}, --G
    { 1,-1,-1}, --D
    { 1,-1, 1}, --C
    { 1, 1,-1}, --E
    { 1, 1, 1}, --F
  },
  "triangles",
  "static")
mesh:setVertexMap{ 
  1, 2, 3,
  2, 3, 4,
  3, 4, 7,
  4, 7, 8,
  7, 5, 8,
  5, 8, 6,
  8, 4, 6,
  4, 6, 2,
  6, 2, 5,
  2, 5, 1,
  5, 1, 7,
  1, 7, 3,
}

local shader = require( "shaders.veil" )

local function draw( view, proj )
  lg.push( "all" )
  lg.setMeshCullMode( "none" )
  --get view matrix without translation
  shader:send( "proj", "column", proj )
  shader:send( "view", "column", view )
  lg.setShader( shader )
  lg.draw( mesh )
  lg.pop()
end
return { draw = draw }