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

freetype: clean up new_context()

This commit is contained in:
Alexander Medvednikov 2019-08-09 17:57:48 +02:00
parent 11c2f634f3
commit d4441e4353
3 changed files with 8 additions and 3 deletions

View File

@ -140,7 +140,8 @@ fn main() {
height: WinHeight
use_ortho: true
font_size: 18
}, 1)
scale: 2
})
game.font_loaded = (game.ft != 0 )
for {
gg.clear(gx.White)

View File

@ -63,18 +63,20 @@ struct Context {
scale int // retina = 2 , normal = 1
}
/*
struct Cfg {
width int
height int
use_ortho bool
retina bool
scale int
font_size int
create_window bool
window_user_ptr voidptr
window_title string
always_on_top bool
}
*/
// jfn ft_load_char(face FT_Face, code FT_ULong) Character {
@ -116,7 +118,8 @@ fn ft_load_char(_face Face, code i64) Character {
return ch
}
pub fn new_context(cfg gg.Cfg, scale int) *Context {
pub fn new_context(cfg gg.Cfg) *Context {
scale := cfg.scale
// Can only have text in ortho mode
if !cfg.use_ortho {
return &Context{}

View File

@ -53,6 +53,7 @@ pub:
window_user_ptr voidptr
window_title string
always_on_top bool
scale int
}
struct GG {