examples: fix x,y dimensions

pull/10840/head
Delyan Angelov 2021-07-16 22:51:20 +03:00
parent 82fc5fe79f
commit 05284c45a6
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
1 changed files with 4 additions and 4 deletions

View File

@ -11,17 +11,17 @@ struct AppState {
mut: mut:
gg &gg.Context = 0 gg &gg.Context = 0
istream_idx int istream_idx int
pixels [pwidth][pheight]u32 pixels [pheight][pwidth]u32
} }
[direct_array_access] [direct_array_access]
fn (mut state AppState) update() { fn (mut state AppState) update() {
mut rcolor := u64(state.gg.frame) mut rcolor := u64(state.gg.frame)
for { for {
for x in 0 .. pwidth {
for y in 0 .. pheight { for y in 0 .. pheight {
for x in 0 .. pwidth {
rcolor = rcolor * 1664525 + 1013904223 rcolor = rcolor * 1664525 + 1013904223
state.pixels[x][y] = u32(rcolor & 0x0000_0000_FFFF_FFFF) | 0x1010AFFF state.pixels[y][x] = u32(rcolor & 0x0000_0000_FFFF_FFFF) | 0x1010AFFF
} }
} }
time.sleep(33 * time.millisecond) time.sleep(33 * time.millisecond)