freetype: clean up new_context()
parent
11c2f634f3
commit
d4441e4353
|
@ -140,7 +140,8 @@ fn main() {
|
||||||
height: WinHeight
|
height: WinHeight
|
||||||
use_ortho: true
|
use_ortho: true
|
||||||
font_size: 18
|
font_size: 18
|
||||||
}, 1)
|
scale: 2
|
||||||
|
})
|
||||||
game.font_loaded = (game.ft != 0 )
|
game.font_loaded = (game.ft != 0 )
|
||||||
for {
|
for {
|
||||||
gg.clear(gx.White)
|
gg.clear(gx.White)
|
||||||
|
|
|
@ -63,18 +63,20 @@ struct Context {
|
||||||
scale int // retina = 2 , normal = 1
|
scale int // retina = 2 , normal = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
struct Cfg {
|
struct Cfg {
|
||||||
width int
|
width int
|
||||||
height int
|
height int
|
||||||
use_ortho bool
|
use_ortho bool
|
||||||
retina bool
|
retina bool
|
||||||
|
scale int
|
||||||
font_size int
|
font_size int
|
||||||
create_window bool
|
create_window bool
|
||||||
window_user_ptr voidptr
|
window_user_ptr voidptr
|
||||||
window_title string
|
window_title string
|
||||||
always_on_top bool
|
always_on_top bool
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
// jfn ft_load_char(face FT_Face, code FT_ULong) Character {
|
// 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
|
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
|
// Can only have text in ortho mode
|
||||||
if !cfg.use_ortho {
|
if !cfg.use_ortho {
|
||||||
return &Context{}
|
return &Context{}
|
||||||
|
|
|
@ -53,6 +53,7 @@ pub:
|
||||||
window_user_ptr voidptr
|
window_user_ptr voidptr
|
||||||
window_title string
|
window_title string
|
||||||
always_on_top bool
|
always_on_top bool
|
||||||
|
scale int
|
||||||
}
|
}
|
||||||
|
|
||||||
struct GG {
|
struct GG {
|
||||||
|
|
Loading…
Reference in New Issue