Add Metal support to Qt frontend and clean up renderer creation code (#795)

* Qt: Initial support for Metal renderer

* Clean up graphics context code

* Nits

* More nits

* Qt: Move screen-related stuff to own folder

* Qt: Make screen widget polymorphic

* Qt: Re-add Metal

* Add factory for screen widget

* Qt: Support compilation without Metal

* Qt: Fix build without Metal

* Oops

* oops
This commit is contained in:
wheremyfoodat
2025-07-26 23:13:08 +03:00
committed by GitHub
parent 8b0b1939cf
commit 0446bcdaa1
23 changed files with 331 additions and 146 deletions

View File

@@ -0,0 +1,18 @@
#pragma once
#include "panda_qt/screen/screen.hpp"
class ScreenWidgetMTL : public ScreenWidget {
void* mtkLayer = nullptr;
// Objective-C++ functions for handling the Metal context
bool createMetalContext();
void resizeMetalView();
public:
ScreenWidgetMTL(API api, ResizeCallback resizeCallback, QWidget* parent = nullptr);
~ScreenWidgetMTL() override;
virtual void* getMTKLayer() override;
virtual bool createContext() override;
virtual void resizeDisplay() override;
};