3rdParty: misc changes to rt64

This commit is contained in:
Rosalie Wanders committed 2024-07-08 16:11:56 +02:00
1 parent d325019c31
commit 67ceae2a2e
6 files changed
+34 -25

No files matched your search

+7 -11
View File
@@ -55,15 +55,11 @@ DLLEXPORT void CALL UpdateScreen(void) {
}
DLLEXPORT void CALL ChangeWindow(void) {
CoreVideo_ToggleFullScreen();
#if 0 // TODO...
RT64::ApplicationWindow *appWindow = RT64::API.app->appWindow.get();
appWindow->setFullScreen(!appWindow->fullScreen);
#endif
const bool isPJ64 = (RT64::API.apiType == RT64::APIType::Project64);
if (isPJ64) {
CoreVideo_ToggleFullScreen();
} else {
RT64::ApplicationWindow *appWindow = RT64::API.app->appWindow.get();
appWindow->setFullScreen(!appWindow->fullScreen);
}
}
DLLEXPORT m64p_error CALL PluginShutdown(void) {
return M64ERR_SUCCESS;
}
+2 -2
View File
@@ -8,7 +8,7 @@
#include "m64p_types.h"
#include "m64p_vidext.h"
// uglyyyyy
// mupen64plus function pointers for the video extension functions
extern ptr_VidExt_InitWithRenderMode CoreVideo_InitWithRenderMode;
extern ptr_VidExt_Quit CoreVideo_Quit;
extern ptr_VidExt_SetCaption CoreVideo_SetCaption;
@@ -17,8 +17,8 @@ extern ptr_VidExt_ResizeWindow CoreVideo_ResizeWindow;
extern ptr_VidExt_VK_GetSurface CoreVideo_VK_GetSurface;
extern ptr_VidExt_VK_GetInstanceExtensions CoreVideo_VK_GetInstanceExtensions;
extern ptr_VidExt_SetVideoMode CoreVideo_SetVideoMode;
extern ptr_VidExt_GL_SwapBuffers CoreVideo_SwapCounter;
// TODO: move this to applicationwindow?
extern int window_width;
extern int window_height;
+14 -6
View File
@@ -22,7 +22,6 @@ ptr_VidExt_ResizeWindow CoreVideo_ResizeWindow = NULL;
ptr_VidExt_VK_GetSurface CoreVideo_VK_GetSurface = NULL;
ptr_VidExt_VK_GetInstanceExtensions CoreVideo_VK_GetInstanceExtensions = NULL;
ptr_VidExt_SetVideoMode CoreVideo_SetVideoMode = NULL;
ptr_VidExt_GL_SwapBuffers CoreVideo_SwapCounter = NULL;
#ifdef _WIN32
#define DLSYM(a, b) GetProcAddress(a, b)
@@ -40,7 +39,20 @@ DLLEXPORT m64p_error CALL PluginStartup(m64p_dynlib_handle CoreLibHandle, void *
CoreVideo_VK_GetSurface = (ptr_VidExt_VK_GetSurface)DLSYM(CoreLibHandle, "VidExt_VK_GetSurface");
CoreVideo_VK_GetInstanceExtensions = (ptr_VidExt_VK_GetInstanceExtensions)DLSYM(CoreLibHandle, "VidExt_VK_GetInstanceExtensions");
CoreVideo_SetVideoMode = (ptr_VidExt_SetVideoMode)DLSYM(CoreLibHandle, "VidExt_SetVideoMode");
CoreVideo_SwapCounter = (ptr_VidExt_GL_SwapBuffers)DLSYM(CoreLibHandle, "VidExt_GL_SwapBuffers");
if (CoreVideo_InitWithRenderMode == NULL ||
CoreVideo_Quit == NULL ||
CoreVideo_SetCaption == NULL ||
CoreVideo_ToggleFullScreen == NULL ||
CoreVideo_ResizeWindow == NULL ||
CoreVideo_VK_GetSurface == NULL ||
CoreVideo_VK_GetInstanceExtensions == NULL ||
CoreVideo_SetVideoMode == NULL) {
return M64ERR_SYSTEM_FAIL;
}
return M64ERR_SUCCESS;
}
DLLEXPORT m64p_error CALL PluginShutdown(void) {
return M64ERR_SUCCESS;
}
@@ -83,18 +95,14 @@ DLLEXPORT void CALL RomClosed(void) {
RT64::API.app->end();
RT64::API.app.reset();
}
// Do nothing.
}
DLLEXPORT int CALL RomOpen(void) {
#if 0
const bool isPJ64 = (RT64::API.apiType == RT64::APIType::Project64);
if (isPJ64) {
RT64::ApplicationWindow *appWindow = RT64::API.app->appWindow.get();
appWindow->makeResizable();
}
#endif
return 1;
}
+1 -1
View File
@@ -461,7 +461,7 @@ namespace RT64 {
if (needsResize || ext.appWindow->detectWindowMoved()) {
ext.appWindow->detectRefreshRate();
ext.sharedResources->setSwapChainRate(std::min(60u, displayTimingRate));
ext.sharedResources->setSwapChainRate(std::min(ext.appWindow->getRefreshRate(), displayTimingRate));
}
if (displayTiming) {
+1 -1
View File
@@ -8,7 +8,7 @@
extern "C" {
// Exporting this flag indicates to the NVIDIA driver that it should prefer using the high performance device.
_declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
__declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
}
#endif
+9 -4
View File
@@ -2216,9 +2216,14 @@ namespace RT64 {
}
void VulkanSwapChain::getWindowSize(uint32_t &dstWidth, uint32_t &dstHeight) const {
dstWidth = window_width;
dstHeight = window_height;
return;
# if defined(RT64_BUILD_PLUGIN)
const bool isPJ64 = (RT64::API.apiType == RT64::APIType::Project64);
if (!isPJ64) {
dstWidth = window_width;
dstHeight = window_height;
return;
}
# endif
# if defined(_WIN64)
RECT rect;
@@ -2228,7 +2233,7 @@ namespace RT64 {
# elif defined(__ANDROID__)
dstWidth = ANativeWindow_getWidth(renderWindow);
dstHeight = ANativeWindow_getHeight(renderWindow);
# elif defined(__linux__)
# elif defined(__linux__) && !defined(RT64_BUILD_PLUGIN)
XWindowAttributes attributes;
XGetWindowAttributes(renderWindow.display, renderWindow.window, &attributes);
// The attributes width and height members do not include the border.