support game pad view in a separate window

This commit is contained in:
Samuliak 2024-08-30 08:57:50 +02:00
parent 1cfb841b5f
commit 2f822d07c7
6 changed files with 24 additions and 34 deletions

View file

@ -3,9 +3,9 @@
#include "gui/guiWrapper.h"
MetalLayerHandle::MetalLayerHandle(MTL::Device* device, const Vector2i& size)
MetalLayerHandle::MetalLayerHandle(MTL::Device* device, const Vector2i& size, bool mainWindow)
{
const auto& windowInfo = gui_getWindowInfo().window_main;
const auto& windowInfo = (mainWindow ? gui_getWindowInfo().window_main : gui_getWindowInfo().window_pad);
m_layer = (CA::MetalLayer*)CreateMetalLayer(windowInfo.handle, m_layerScaleX, m_layerScaleY);
m_layer->setDevice(device);
@ -32,7 +32,7 @@ bool MetalLayerHandle::AcquireDrawable()
m_drawable = m_layer->nextDrawable();
if (!m_drawable)
{
debug_printf("failed to acquire next drawable\n");
debug_printf("layer %p failed to acquire next drawable\n", this);
return false;
}