mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
tetris improvements
added getexepath() to os module added some wrapper functions to glfw removed hardcored path in gg module better tetris example exit and resource loading
This commit is contained in:
committed by
Alexander Medvednikov
parent
84f5d7e64b
commit
bed7440ebb
5
gg/gg.v
5
gg/gg.v
@@ -342,7 +342,10 @@ pub fn new_context_text(cfg Cfg, scale int) *GG {
|
||||
// face := FT_Face{}
|
||||
mut font_path := 'RobotoMono-Regular.ttf'
|
||||
if !os.file_exists(font_path) {
|
||||
font_path = '/var/tmp/RobotoMono-Regular.ttf'
|
||||
exePath := os.getexepath()
|
||||
exeDir := os.basedir(exePath)
|
||||
println('Trying to load from $exeDir')
|
||||
font_path = '${exeDir}/RobotoMono-Regular.ttf'
|
||||
}
|
||||
if !os.file_exists(font_path) {
|
||||
println('failed to load RobotoMono-Regular.ttf')
|
||||
|
||||
Reference in New Issue
Block a user