1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

interface fix

This commit is contained in:
Alexander Medvednikov
2020-01-09 01:39:47 +01:00
parent c1cc203c17
commit 29564ed63d
7 changed files with 61 additions and 53 deletions

View File

@@ -143,23 +143,21 @@ fn main() {
window_title: 'V Tetris'
window_user_ptr: game
})
ft: 0
ft: freetype.new_context(gg.Cfg{
width: WinWidth
height: WinHeight
use_ortho: true
font_size: 18
scale: 2
window_user_ptr: 0
})
}
game.gg.window.set_user_ptr(game) // TODO remove this when `window_user_ptr:` works
game.init_game()
game.gg.window.onkeydown(key_down)
go game.run() // Run the game loop in a new thread
gg.clear(BackgroundColor)
// Try to load font
game.ft = freetype.new_context(gg.Cfg{
width: WinWidth
height: WinHeight
use_ortho: true
font_size: 18
scale: 2
window_user_ptr: 0
})
game.font_loaded = (game.ft != 0 )
game.font_loaded = game.ft != 0
for {
gg.clear(BackgroundColor)
game.draw_scene()