Files
86Box/src/qt/qt.c

80 lines
1.7 KiB
C
Raw Normal View History

2022-02-07 15:00:02 +06:00
/*
2023-01-06 15:36:05 -05:00
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus.
2022-02-07 15:00:02 +06:00
*
2023-01-06 15:36:05 -05:00
* This file is part of the 86Box distribution.
2022-02-07 15:00:02 +06:00
*
*
*
2023-01-06 15:36:05 -05:00
* Authors: Joakim L. Gilje <jgilje@jgilje.net>
2022-02-07 15:00:02 +06:00
*
2023-01-06 15:36:05 -05:00
* Copyright 2021 Joakim L. Gilje
2022-02-07 15:00:02 +06:00
*/
2021-11-25 10:20:56 +01:00
/*
* C functionality for Qt platform, where the C equivalent is not easily
* implemented in Qt
*/
#if !defined(_WIN32) || !defined(__clang__)
2022-11-19 08:49:04 -05:00
# include <strings.h>
2021-12-19 23:49:47 +02:00
#endif
#include <string.h>
2021-11-25 10:20:56 +01:00
#include <stdint.h>
#include <wchar.h>
#include <86box/86box.h>
#include <86box/device.h>
#include <86box/plat.h>
#include <86box/timer.h>
#include <86box/nvr.h>
2022-11-19 08:49:04 -05:00
int
qt_nvr_save(void)
{
2021-11-25 10:20:56 +01:00
return nvr_save();
}
int
plat_vidapi(const char *api)
2022-11-19 08:49:04 -05:00
{
if (!strcasecmp(api, "default") || !strcasecmp(api, "system"))
return 0;
else if (!strcasecmp(api, "qt_software"))
return 0;
else if (!strcasecmp(api, "qt_opengl") || !strcasecmp(api, "qt_opengles") || !strcasecmp(api, "qt_opengl3"))
return 1;
else if (!strcasecmp(api, "qt_vulkan"))
return 2;
else if (!strcasecmp(api, "vnc"))
2021-12-27 16:32:03 +06:00
return 3;
2021-11-25 10:20:56 +01:00
return 0;
}
2022-11-19 08:49:04 -05:00
char *
plat_vidapi_name(int api)
{
char *name = "default";
switch (api) {
2022-11-19 08:49:04 -05:00
case 0:
name = "qt_software";
break;
case 1:
name = "qt_opengl3";
break;
case 2:
2022-11-19 08:49:04 -05:00
name = "qt_vulkan";
break;
case 3:
2022-11-19 08:49:04 -05:00
name = "vnc";
break;
default:
fatal("Unknown renderer: %i\n", api);
break;
}
return name;
}