@@ -14,6 +14,7 @@ import (
1414 "github.com/raedatoui/learn-opengl-golang/utils"
1515 "strconv"
1616 "github.com/raedatoui/learn-opengl-golang/sections/modelloading"
17+ "github.com/raedatoui/glfont"
1718)
1819
1920var (
2223 covers map [int ]sections.Slide
2324 slideIndex = 0
2425 window * glfw.Window
25- font * utils .Font
26+ font * glfont .Font
2627 keys map [glfw.Key ]bool
2728 wireframe int32
2829)
@@ -222,7 +223,7 @@ func main() {
222223 window = w
223224
224225 //load font (fontfile, font scale, window width, window height
225- f , err := utils .LoadFont ("_assets/fonts/huge_agb_v5.ttf" , int32 (52 ), utils .WIDTH , utils .HEIGHT )
226+ f , err := glfont .LoadFont ("_assets/fonts/huge_agb_v5.ttf" , int32 (52 ), utils .WIDTH , utils .HEIGHT )
226227 if err != nil {
227228 log .Fatalf ("LoadFont: %v" , err )
228229 }
@@ -299,12 +300,12 @@ func main() {
299300 currentSlide .Draw ()
300301 if currentSlide .DrawText () {
301302 font .Printf (30 , 30 , 0.5 , currentSlide .GetHeader ())
302- font .Printf (30 , utils .HEIGHT - 20 , 0.2 , currentSlide .GetColorHex ())
303303 if currentSlide .GetSubHeader () != "" {
304304 font .Printf (30 , 50 , 0.3 , currentSlide .GetSubHeader ())
305305 }
306306 }
307307
308+ font .Printf (30 , utils .HEIGHT - 20 , 0.2 , currentSlide .GetColorHex ())
308309 fps := "FPS: " + strconv .FormatFloat (utils .CalcFPS (1.0 ), 'f' , 2 , 64 )
309310 font .Printf (utils .WIDTH - 80 , utils .HEIGHT - 20 , 0.25 , fps )
310311
0 commit comments