Add Metal backend (#1287)

This commit is contained in:
SamoZ256 2025-12-06 17:14:25 +01:00 committed by GitHub
parent 5520613dc3
commit 26e40a4bce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
108 changed files with 14986 additions and 453 deletions

View file

@ -8,6 +8,7 @@
#include "Cafe/OS/libs/swkbd/swkbd.h"
#include "wxgui/canvas/OpenGLCanvas.h"
#include "wxgui/canvas/VulkanCanvas.h"
#include "wxgui/canvas/MetalCanvas.h"
#include "config/CemuConfig.h"
#include "wxgui/MainWindow.h"
#include "wxgui/helpers/wxHelpers.h"
@ -74,8 +75,12 @@ void PadViewFrame::InitializeRenderCanvas()
{
if (ActiveSettings::GetGraphicsAPI() == kVulkan)
m_render_canvas = new VulkanCanvas(this, wxSize(854, 480), false);
else
else if (ActiveSettings::GetGraphicsAPI() == kOpenGL)
m_render_canvas = GLCanvas_Create(this, wxSize(854, 480), false);
#if ENABLE_METAL
else
m_render_canvas = new MetalCanvas(this, wxSize(854, 480), false);
#endif
sizer->Add(m_render_canvas, 1, wxEXPAND, 0, nullptr);
}
SetSizer(sizer);
@ -173,7 +178,7 @@ void PadViewFrame::OnChar(wxKeyEvent& event)
{
if (swkbd_hasKeyboardInputHook())
swkbd_keyInput(event.GetUnicodeKey());
event.Skip();
}
@ -198,7 +203,7 @@ void PadViewFrame::OnMouseLeft(wxMouseEvent& event)
instance.m_pad_mouse.position = { physPos.x, physPos.y };
if (event.ButtonDown(wxMOUSE_BTN_LEFT))
instance.m_pad_mouse.left_down_toggle = true;
}
void PadViewFrame::OnMouseRight(wxMouseEvent& event)