mirror of https://github.com/snes9xgit/snes9x.git
Error handling.
This commit is contained in:
parent
fd3a9dba14
commit
246a44a940
|
@ -927,8 +927,13 @@ static void S9xInitDriver()
|
||||||
if (driver->init())
|
if (driver->init())
|
||||||
{
|
{
|
||||||
delete driver;
|
delete driver;
|
||||||
gui_config->display_driver = "none";
|
|
||||||
|
driver = new S9xGTKDisplayDriver(top_level, gui_config);
|
||||||
driver->init();
|
driver->init();
|
||||||
|
gui_config->display_driver = "none";
|
||||||
|
|
||||||
|
Gtk::MessageDialog dialog("Couldn't load display driver. Using default.");
|
||||||
|
dialog.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
pool = NULL;
|
pool = NULL;
|
||||||
|
|
|
@ -53,9 +53,10 @@ static vk::UniqueInstance create_instance_preamble(const char *wsi_extension)
|
||||||
#ifdef VK_USE_PLATFORM_WIN32_KHR
|
#ifdef VK_USE_PLATFORM_WIN32_KHR
|
||||||
bool Context::init_win32(HINSTANCE hinstance, HWND hwnd, int preferred_device)
|
bool Context::init_win32(HINSTANCE hinstance, HWND hwnd, int preferred_device)
|
||||||
{
|
{
|
||||||
if (instance)
|
|
||||||
return false;
|
|
||||||
instance = create_instance_preamble(VK_KHR_WIN32_SURFACE_EXTENSION_NAME);
|
instance = create_instance_preamble(VK_KHR_WIN32_SURFACE_EXTENSION_NAME);
|
||||||
|
if (!instance)
|
||||||
|
return false;
|
||||||
|
|
||||||
auto win32_surface_create_info = vk::Win32SurfaceCreateInfoKHR{}
|
auto win32_surface_create_info = vk::Win32SurfaceCreateInfoKHR{}
|
||||||
.setHinstance(hinstance)
|
.setHinstance(hinstance)
|
||||||
.setHwnd(hwnd);
|
.setHwnd(hwnd);
|
||||||
|
@ -69,10 +70,14 @@ bool Context::init_win32(HINSTANCE hinstance, HWND hwnd, int preferred_device)
|
||||||
#ifdef VK_USE_PLATFORM_XLIB_KHR
|
#ifdef VK_USE_PLATFORM_XLIB_KHR
|
||||||
bool Context::init_Xlib(Display *dpy, Window xid, int preferred_device)
|
bool Context::init_Xlib(Display *dpy, Window xid, int preferred_device)
|
||||||
{
|
{
|
||||||
if (instance)
|
|
||||||
return false;
|
|
||||||
instance = create_instance_preamble(VK_KHR_XLIB_SURFACE_EXTENSION_NAME);
|
instance = create_instance_preamble(VK_KHR_XLIB_SURFACE_EXTENSION_NAME);
|
||||||
|
if (!instance)
|
||||||
|
return false;
|
||||||
|
|
||||||
surface = instance->createXlibSurfaceKHRUnique({ {}, dpy, xid });
|
surface = instance->createXlibSurfaceKHRUnique({ {}, dpy, xid });
|
||||||
|
|
||||||
|
if (!surface)
|
||||||
|
return false;
|
||||||
return init(preferred_device);
|
return init(preferred_device);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -80,13 +85,17 @@ bool Context::init_Xlib(Display *dpy, Window xid, int preferred_device)
|
||||||
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
|
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
|
||||||
bool Context::init_wayland(wl_display *dpy, wl_surface *parent, int initial_width, int initial_height, int preferred_device)
|
bool Context::init_wayland(wl_display *dpy, wl_surface *parent, int initial_width, int initial_height, int preferred_device)
|
||||||
{
|
{
|
||||||
if (instance)
|
|
||||||
return false;
|
|
||||||
instance = create_instance_preamble(VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME);
|
instance = create_instance_preamble(VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME);
|
||||||
|
if (!instance)
|
||||||
|
return false;
|
||||||
|
|
||||||
auto wayland_surface_create_info = vk::WaylandSurfaceCreateInfoKHR{}
|
auto wayland_surface_create_info = vk::WaylandSurfaceCreateInfoKHR{}
|
||||||
.setSurface(parent)
|
.setSurface(parent)
|
||||||
.setDisplay(dpy);
|
.setDisplay(dpy);
|
||||||
surface = instance->createWaylandSurfaceKHRUnique(wayland_surface_create_info);
|
surface = instance->createWaylandSurfaceKHRUnique(wayland_surface_create_info);
|
||||||
|
if (!surface)
|
||||||
|
return false;
|
||||||
|
|
||||||
init_device(preferred_device);
|
init_device(preferred_device);
|
||||||
init_vma();
|
init_vma();
|
||||||
init_command_pool();
|
init_command_pool();
|
||||||
|
|
Loading…
Reference in New Issue