From 4fda7587ce573a7b4fa7bacfa85fce95c8c98fcc Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Sun, 18 Jul 2021 21:33:52 -0500 Subject: [PATCH] chore(main): disable vsync --- src/main.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 6cd7452..6028803 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,7 +2,7 @@ use anyhow::{anyhow, Result}; use clap::{crate_authors, crate_description, crate_name, crate_version, App, Arg}; use gb::{AudioMPSC, Cycle, Egui, GB_HEIGHT, GB_WIDTH}; use gilrs::Gilrs; -use pixels::{Pixels, SurfaceTexture}; +use pixels::{PixelsBuilder, SurfaceTexture}; use rodio::OutputStream; use std::time::Instant; use winit::dpi::LogicalSize; @@ -60,7 +60,10 @@ fn main() -> Result<()> { let size = window.inner_size(); let scale_factor = window.scale_factor(); let surface_texture = SurfaceTexture::new(size.width, size.height, &window); - let pixels = Pixels::new(GB_WIDTH as u32, GB_HEIGHT as u32, surface_texture)?; + + let pixels = PixelsBuilder::new(GB_WIDTH as u32, GB_HEIGHT as u32, surface_texture) + .enable_vsync(false) + .build()?; let egui = Egui::new(size.width, size.height, scale_factor, pixels.context()); (pixels, egui)