gg: resizable window option

pull/2511/head
Alexander Medvednikov 2019-10-23 12:17:08 +03:00
parent 8b74c711c6
commit a6aad880f7
3 changed files with 8 additions and 3 deletions

View File

@ -27,7 +27,7 @@ else
V_V=`git rev-parse --short HEAD`; \
if [ $$VC_V != $$V_V ]; then \
echo "Self rebuild ($$VC_V => $$V_V)"; \
./v v.v; \
./v -o v v.v; \
fi)
endif
rm -rf vc/
@ -49,4 +49,4 @@ ifdef LINUX
endif
selfcompile:
./v v.v
./v -o v v.v

View File

@ -44,7 +44,6 @@ fn generate_vh(mod string) {
for file in filtered {
mut p := v.new_parser_from_file(file)
p.scanner.is_vh = true
println('kek $file')
p.parse(.decl)
for i, tok in p.tokens {
if !p.tok.is_decl() {

View File

@ -38,6 +38,7 @@ pub:
height int
use_ortho bool
retina bool
resizable bool
font_size int
font_path string
@ -70,6 +71,11 @@ pub mut:
pub fn new_context(cfg Cfg) &GG {
mut window := &glfw.Window{!}
if cfg.create_window {
if cfg.resizable {
glfw.window_hint(C.GLFW_RESIZABLE, 1)
} else {
glfw.window_hint(C.GLFW_RESIZABLE, 0)
}
window = glfw.create_window(glfw.WinCfg{
title: cfg.window_title
width: cfg.width