diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..322d13e Binary files /dev/null and b/.DS_Store differ diff --git a/Comfortaa-Regular.ttf b/Comfortaa-Regular.ttf new file mode 100755 index 0000000..3f900aa Binary files /dev/null and b/Comfortaa-Regular.ttf differ diff --git a/glfw.go b/glfw.go index 65d02a5..72a9170 100644 --- a/glfw.go +++ b/glfw.go @@ -5,10 +5,12 @@ import ( "fmt" "image" "log" + "os" "github.com/go-gl/gl/v2.1/gl" "github.com/go-gl/glfw/v3.1/glfw" "github.com/lordwelch/qml" + "github.com/go-gl/gltext" ) var ( @@ -19,8 +21,18 @@ var ( projMonitor *glfw.Monitor tex1 *uint32 //identifier for opengl texture texDel Bool //if texture should be deleted + flt *os.File + f *gltext.Font ) +func loadfont(){ + + flt,err = os.Open("Comfortaa-Regular.ttf") + if err != nil { + f, err = gltext.LoadTruetype(flt, 30, 32, 255, gltext.LeftToRight) + } +} + func setupScene() { gl.ClearColor(0, 0, 0, 0) @@ -63,6 +75,7 @@ func drawSlide() { gl.Vertex3f(-1, -1, 0) gl.End() + f.Printf(5,10,"test") } @@ -142,6 +155,7 @@ func glInit() { if err := gl.Init(); err != nil { panic(err) } + loadfont() win.SetPos(projMonitor.GetPos()) setupScene()