Skip to content

Commit 7da01b5

Browse files
BillyDMrobbert-vdh
authored andcommitted
fix transparency in softbuffer example
1 parent d64b2ab commit 7da01b5

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • plugins/examples/byo_gui_softbuffer/src

plugins/examples/byo_gui_softbuffer/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,10 @@ impl baseview::WindowHandler for CustomSoftbufferWindow {
8181
let red = x % 255;
8282
let green = y % 255;
8383
let blue = (x * y) % 255;
84+
let alpha = 255;
85+
8486
let index = y as usize * self.physical_width as usize + x as usize;
85-
buffer[index] = blue | (green << 8) | (red << 16);
87+
buffer[index] = blue | (green << 8) | (red << 16) | (alpha << 24);
8688
}
8789
}
8890

0 commit comments

Comments
 (0)