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

update tests and examples after the mutability fix

This commit is contained in:
Alexander Medvednikov
2019-11-06 06:57:04 +03:00
parent b720bb2e77
commit f6d06fcda2
6 changed files with 27 additions and 26 deletions

View File

@ -9,7 +9,7 @@ import glfw
import time
struct Game {
mut:
mut:
gg &gg.GG
x int
y int
@ -26,24 +26,24 @@ fn main() {
width := 600
height := 300
mut game := &Game{
gg: 0
dx: 2
dy: 2
height: height
width: width
gg: 0
dx: 2
dy: 2
height: height
width: width
}
mut window := glfw.create_window(glfw.WinCfg {
width: width
height: height
borderless: false
window := glfw.create_window(glfw.WinCfg {
width: width
height: height
borderless: false
title: 'Hot code reloading demo'
ptr: game
always_on_top: true
})
ptr: game
always_on_top: true
})
//window.onkeydown(key_down)
game.main_wnd = window
game.main_wnd = window
window.make_context_current()
gg.init_gg()
gg.init_gg()
game.gg = gg.new_context(gg.Cfg {
width: width
height: height
@ -67,7 +67,7 @@ const (
[live]
fn (game &Game) draw() {
game.gg.draw_rect(game.x, game.y, width, width, gx.rgb(255, 0, 0))
game.gg.draw_rect(game.x, game.y, width, width, gx.rgb(255, 0, 0))
}
fn (game mut Game) run() {