fix: reimplement grabbing ROM title if provided via cmd arg

This commit is contained in:
2023-03-27 16:22:07 -05:00
parent b879c76510
commit 1d8b21d6b4
4 changed files with 10 additions and 8 deletions

View File

@@ -57,7 +57,7 @@ pub const Gui = struct {
allocator: Allocator,
program_id: gl.GLuint,
pub fn init(allocator: Allocator, apu: *Apu) !Self {
pub fn init(allocator: Allocator, apu: *Apu, title_opt: ?*const [12]u8) !Self {
if (SDL.SDL_Init(SDL.SDL_INIT_VIDEO | SDL.SDL_INIT_EVENTS | SDL.SDL_INIT_AUDIO) < 0) panic();
if (SDL.SDL_GL_SetAttribute(SDL.SDL_GL_CONTEXT_PROFILE_MASK, SDL.SDL_GL_CONTEXT_PROFILE_CORE) < 0) panic();
if (SDL.SDL_GL_SetAttribute(SDL.SDL_GL_CONTEXT_MAJOR_VERSION, 3) < 0) panic();
@@ -91,7 +91,7 @@ pub const Gui = struct {
.audio = Audio.init(apu),
.allocator = allocator,
.state = try imgui.State.init(allocator),
.state = try imgui.State.init(allocator, title_opt),
};
}