1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-02 09:03:37 +00:00
GLideN64/src/MupenPlusPluginAPI.cpp
Rosalie Wanders 366ff85de3 Allow GLideNUI to work with mupen64plus
* Update the mupen64plus API headers
  * Add the new video extension functions in the opengl wrappers
  * Pull new headers from upsteam mupen64plus-core

* Modify CMakeLists.txt
  * Add GLideNUI source files
  * Expose new MUPENPLUSAPI_GLIDENUI option
    * This allows you to compile GLideN64 for mupen64plus with GLideNUI
    * NOTE that this only works with front-ends which call PluginConfig

* Move src/windows/Config_windows.cpp to src/GLideNUI/Config_GLideNUI.cpp
  * This makes more sense because it's not windows-exclusive anymore

* Add src/GLideNUI/fullscreenresolutions_mupen64plus.cpp
  * This allows GLideNUI to enumerate the fullscreen refresh rates and resolutions

* Modify src/Graphics/OpenGLContext/mupen64plus/mupen64plus_DisplayWindow.cpp
  * This modification allows mupen64plus with GLideNUI to use the selected fullscreen resolution and refresh rates

* Expose a new PluginConfig function which calls Config_DoConfig()
  * NOTE that this only works with front-ends which call this function
  * NOTE that this technically breaks the mupen spec
2020-09-16 19:02:46 +07:00

66 lines
1.3 KiB
C++

#include "PluginAPI.h"
#include "Types.h"
#include "mupenplus/GLideN64_mupenplus.h"
#include "N64.h"
extern "C" {
EXPORT int CALL RomOpen(void)
{
if (rdram_size != nullptr)
RDRAMSize = *rdram_size - 1;
else
RDRAMSize = 0;
return api().RomOpen();
}
EXPORT m64p_error CALL PluginGetVersion(
m64p_plugin_type * _PluginType,
int * _PluginVersion,
int * _APIVersion,
const char ** _PluginNamePtr,
int * _Capabilities
)
{
return api().PluginGetVersion(_PluginType, _PluginVersion, _APIVersion, _PluginNamePtr, _Capabilities);
}
EXPORT m64p_error CALL PluginStartup(
m64p_dynlib_handle CoreLibHandle,
void *Context,
void (*DebugCallback)(void *, int, const char *)
)
{
return api().PluginStartup(CoreLibHandle);
}
#ifdef M64P_GLIDENUI
EXPORT m64p_error CALL PluginConfig(void)
{
return api().PluginConfig();
}
#endif // M64P_GLIDENUI
EXPORT m64p_error CALL PluginShutdown(void)
{
return api().PluginShutdown();
}
EXPORT void CALL ReadScreen2(void *dest, int *width, int *height, int front)
{
api().ReadScreen2(dest, width, height, front);
}
EXPORT void CALL SetRenderingCallback(void (*callback)(int))
{
api().SetRenderingCallback(callback);
}
EXPORT void CALL ResizeVideoOutput(int width, int height)
{
api().ResizeVideoOutput(width, height);
}
} // extern "C"