Use texelFetch+debug grid in atlas

This commit is contained in:
bloeys
2022-07-06 17:53:55 +04:00
parent afcd514f98
commit d23e833b54
4 changed files with 47 additions and 13 deletions

View File

@ -90,7 +90,7 @@ func (p *program) Init() {
fmt.Printf("DPI: %f, font size: %d\n", dpi, p.FontSize)
w, h := p.win.SDLWin.GetSize()
p.GlyphRend, err = glyphs.NewGlyphRend("./res/fonts/KawkabMono-Regular.ttf", &truetype.Options{Size: float64(p.FontSize), DPI: p.Dpi, SubPixelsX: subPixelX, SubPixelsY: subPixelY, Hinting: hinting}, w, h)
p.GlyphRend, err = glyphs.NewGlyphRend("./res/fonts/Consolas.ttf", &truetype.Options{Size: float64(p.FontSize), DPI: p.Dpi, SubPixelsX: subPixelX, SubPixelsY: subPixelY, Hinting: hinting}, w, h)
if err != nil {
panic("Failed to create atlas from font file. Err: " + err.Error())
}
@ -175,8 +175,6 @@ var b = rand.Float32()
func (p *program) Render() {
// println("Will profile with pprof...")
defer p.GlyphRend.Draw()
if p.shouldDrawGrid {
@ -201,7 +199,7 @@ func (p *program) Render() {
textColor := gglm.NewVec4(r, g, b, 1)
// str := "مرحبا بك my friend"
str := " hello there يا friend. أسمي عمر wow"
str := " hello there يا friend. سمي عمر wow"
// str := " ijojo\n\n Hello there, friend|. pq?\n ABCDEFG\tHIJKLMNOPQRSTUVWXYZ\nمرحبا بك"
// str := " ijojo\n\n Hello there, friend|. pq?\n ABCDEFG\tHIJKLMNOPQRSTUVWXYZ"