66 lines
1.2 KiB
Go
66 lines
1.2 KiB
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
_ "embed"
|
||
|
)
|
||
|
|
||
|
//go:embed shader.frag
|
||
|
var shaderFrag string
|
||
|
|
||
|
//go:embed shader.vert
|
||
|
var shaderVert string
|
||
|
|
||
|
//go:embed square.png
|
||
|
var textureData []byte
|
||
|
|
||
|
var cubeVertices = []float32{
|
||
|
// X, Y, Z, U, V
|
||
|
// Bottom
|
||
|
-1.0, -1.0, -1.0, 0.0, 0.0,
|
||
|
1.0, -1.0, -1.0, 1.0, 0.0,
|
||
|
-1.0, -1.0, 1.0, 0.0, 1.0,
|
||
|
1.0, -1.0, -1.0, 1.0, 0.0,
|
||
|
1.0, -1.0, 1.0, 1.0, 1.0,
|
||
|
-1.0, -1.0, 1.0, 0.0, 1.0,
|
||
|
|
||
|
// Top
|
||
|
-1.0, 1.0, -1.0, 0.0, 0.0,
|
||
|
-1.0, 1.0, 1.0, 0.0, 1.0,
|
||
|
1.0, 1.0, -1.0, 1.0, 0.0,
|
||
|
1.0, 1.0, -1.0, 1.0, 0.0,
|
||
|
-1.0, 1.0, 1.0, 0.0, 1.0,
|
||
|
1.0, 1.0, 1.0, 1.0, 1.0,
|
||
|
|
||
|
// Front
|
||
|
-1.0, -1.0, 1.0, 1.0, 0.0,
|
||
|
1.0, -1.0, 1.0, 0.0, 0.0,
|
||
|
-1.0, 1.0, 1.0, 1.0, 1.0,
|
||
|
1.0, -1.0, 1.0, 0.0, 0.0,
|
||
|
1.0, 1.0, 1.0, 0.0, 1.0,
|
||
|
-1.0, 1.0, 1.0, 1.0, 1.0,
|
||
|
|
||
|
// Back
|
||
|
-1.0, -1.0, -1.0, 0.0, 0.0,
|
||
|
-1.0, 1.0, -1.0, 0.0, 1.0,
|
||
|
1.0, -1.0, -1.0, 1.0, 0.0,
|
||
|
1.0, -1.0, -1.0, 1.0, 0.0,
|
||
|
-1.0, 1.0, -1.0, 0.0, 1.0,
|
||
|
1.0, 1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