Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 142e0cd

Browse files
author
Raed Atoui
committed
fork glfont
1 parent 6cefdd0 commit 142e0cd

File tree

4 files changed

+7
-352
lines changed

4 files changed

+7
-352
lines changed

‎sections/title_slide.go‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,17 @@ import (
55
"github.com/go-gl/gl/v4.1-core/gl"
66
"github.com/raedatoui/learn-opengl-golang/utils"
77
"strings"
8+
"github.com/raedatoui/glfont"
89
)
910

1011
type TitleSlide struct {
1112
BaseSlide
12-
font *utils.Font
13+
font *glfont.Font
1314
lines []string
1415
}
1516

1617
func (s *TitleSlide) Init(a ...interface{}) error {
17-
f, ok := a[0].(*utils.Font)
18+
f, ok := a[0].(*glfont.Font)
1819
if ok == false {
1920
return errors.New("first argument isnt a font")
2021
}

‎tutorial.go‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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

1920
var (
@@ -22,7 +23,7 @@ var (
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

‎utils/font.go‎

Lines changed: 0 additions & 197 deletions
This file was deleted.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /