@@ -14,6 +14,7 @@ import (
14
14
"github.com/raedatoui/learn-opengl-golang/utils"
15
15
"strconv"
16
16
"github.com/raedatoui/learn-opengl-golang/sections/modelloading"
17
+ "github.com/raedatoui/glfont"
17
18
)
18
19
19
20
var (
22
23
covers map [int ]sections.Slide
23
24
slideIndex = 0
24
25
window * glfw.Window
25
- font * utils .Font
26
+ font * glfont .Font
26
27
keys map [glfw.Key ]bool
27
28
wireframe int32
28
29
)
@@ -222,7 +223,7 @@ func main() {
222
223
window = w
223
224
224
225
//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 )
226
227
if err != nil {
227
228
log .Fatalf ("LoadFont: %v" , err )
228
229
}
@@ -299,12 +300,12 @@ func main() {
299
300
currentSlide .Draw ()
300
301
if currentSlide .DrawText () {
301
302
font .Printf (30 , 30 , 0.5 , currentSlide .GetHeader ())
302
- font .Printf (30 , utils .HEIGHT - 20 , 0.2 , currentSlide .GetColorHex ())
303
303
if currentSlide .GetSubHeader () != "" {
304
304
font .Printf (30 , 50 , 0.3 , currentSlide .GetSubHeader ())
305
305
}
306
306
}
307
307
308
+ font .Printf (30 , utils .HEIGHT - 20 , 0.2 , currentSlide .GetColorHex ())
308
309
fps := "FPS: " + strconv .FormatFloat (utils .CalcFPS (1.0 ), 'f' , 2 , 64 )
309
310
font .Printf (utils .WIDTH - 80 , utils .HEIGHT - 20 , 0.25 , fps )
310
311
0 commit comments