position windows and allow ignore obj_size

This commit is contained in:
Alex Janka 2023-02-06 12:17:58 +11:00
parent 805ae0c817
commit 56e2735e58
2 changed files with 9 additions and 2 deletions

View file

@ -260,7 +260,7 @@ fn main() {
// let buffer: Vec<u32> = ; // let buffer: Vec<u32> = ;
let window = Window::new( let mut window = Window::new(
"Gameboy", "Gameboy",
WIDTH * FACTOR, WIDTH * FACTOR,
HEIGHT * FACTOR, HEIGHT * FACTOR,
@ -270,6 +270,8 @@ fn main() {
panic!("{}", e); panic!("{}", e);
}); });
window.set_position(50, 50);
window.topmost(true); window.topmost(true);
let rom: ROM = fs::read(args.rom).expect("Could not load ROM"); let rom: ROM = fs::read(args.rom).expect("Could not load ROM");

View file

@ -47,6 +47,7 @@ enum ObjSize {
S8x16, S8x16,
} }
#[allow(dead_code)]
struct LCDC { struct LCDC {
enable: bool, enable: bool,
window_tilemap: TilemapArea, window_tilemap: TilemapArea,
@ -106,7 +107,7 @@ pub struct GPU {
impl Default for GPU { impl Default for GPU {
fn default() -> Self { fn default() -> Self {
let window = Window::new( let mut window = Window::new(
"Tiles", "Tiles",
TILE_WINDOW_EDGE_LENGTH_SCALED, TILE_WINDOW_EDGE_LENGTH_SCALED,
TILE_WINDOW_EDGE_LENGTH_SCALED, TILE_WINDOW_EDGE_LENGTH_SCALED,
@ -115,6 +116,10 @@ impl Default for GPU {
.unwrap_or_else(|e| { .unwrap_or_else(|e| {
panic!("{}", e); panic!("{}", e);
}); });
window.set_position((100 + (WIDTH * FACTOR)) as isize, 50);
window.topmost(true);
Self { Self {
buffer: vec![0; WIDTH * HEIGHT], buffer: vec![0; WIDTH * HEIGHT],
scaled_buffer: vec![0; WIDTH * HEIGHT * 4], scaled_buffer: vec![0; WIDTH * HEIGHT * 4],