1
0
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:
aguspiza
2019-06-27 22:17:13 +02:00
committed by Alexander Medvednikov
parent 84f5d7e64b
commit bed7440ebb
4 changed files with 44 additions and 1 deletions

View File

@@ -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')