Skip to content
Snippets Groups Projects
Verified Commit 457bc7b1 authored by João Magalhães's avatar João Magalhães :rocket:
Browse files

feat: new icon and logo

parent 9be6380a
No related branches found
No related tags found
No related merge requests found
examples/sdl/res/icon.png

13.3 KiB

......@@ -3,8 +3,8 @@ use boytacean::{
ppu::{DISPLAY_HEIGHT, DISPLAY_WIDTH},
};
use sdl2::{
event::Event, pixels::PixelFormatEnum, video::Window, AudioSubsystem, EventPump,
TimerSubsystem, VideoSubsystem,
event::Event, image::LoadSurface, pixels::PixelFormatEnum, surface::Surface, video::Window,
AudioSubsystem, EventPump, TimerSubsystem, VideoSubsystem,
};
/// The base title to be used in the window.
......@@ -57,6 +57,11 @@ fn start_sdl() -> Graphics {
fn main() {
let mut graphics = start_sdl();
// updates the icon of the window to reflect the image
// and style of the emulator
let surface = Surface::from_file("./res/icon.png").unwrap();
graphics.window.set_icon(&surface);
let mut canvas = graphics.window.into_canvas().accelerated().build().unwrap();
canvas.clear();
canvas.present();
......
res/logo.png

13.3 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment