Files
86Box/src/qt/qt.c

81 lines
2.0 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>
2025-06-28 18:48:30 -04:00
#include <86box/renderdefs.h>
2021-11-25 10:20:56 +01:00
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
{
2025-06-28 18:48:30 -04:00
if (!strcasecmp(api, RENDERER_NAME_DEFAULT) || !strcasecmp(api, RENDERER_NAME_SYSTEM))
return RENDERER_SOFTWARE;
else if (!strcasecmp(api, RENDERER_NAME_QT_SOFTWARE))
return RENDERER_SOFTWARE;
else if (!strcasecmp(api, RENDERER_NAME_QT_OPENGL) || !strcasecmp(api, RENDERER_NAME_QT_OPENGLES) || !strcasecmp(api, RENDERER_NAME_QT_OPENGL3))
return RENDERER_OPENGL3;
else if (!strcasecmp(api, RENDERER_NAME_QT_VULKAN))
return RENDERER_VULKAN;
else if (!strcasecmp(api, RENDERER_NAME_VNC))
return RENDERER_VNC;
2021-11-25 10:20:56 +01:00
return 0;
}
2022-11-19 08:49:04 -05:00
char *
plat_vidapi_name(int api)
{
2025-06-28 18:48:30 -04:00
char *name = RENDERER_NAME_DEFAULT;
switch (api) {
2025-06-28 18:48:30 -04:00
case RENDERER_SOFTWARE:
name = RENDERER_NAME_QT_SOFTWARE;
2022-11-19 08:49:04 -05:00
break;
2025-06-28 18:48:30 -04:00
case RENDERER_OPENGL3:
name = RENDERER_NAME_QT_OPENGL3;
2022-11-19 08:49:04 -05:00
break;
2025-06-28 18:48:30 -04:00
case RENDERER_VULKAN:
name = RENDERER_NAME_QT_VULKAN;
2022-11-19 08:49:04 -05:00
break;
2025-06-28 18:48:30 -04:00
case RENDERER_VNC:
name = RENDERER_NAME_VNC;
2022-11-19 08:49:04 -05:00
break;
default:
fatal("Unknown renderer: %i\n", api);
break;
}
return name;
}