[UI] Loop thread to main thread WindowedAppContext
This commit is contained in:
@@ -2,28 +2,44 @@
|
||||
******************************************************************************
|
||||
* Xenia : Xbox 360 Emulator Research Project *
|
||||
******************************************************************************
|
||||
* Copyright 2020 Ben Vanik. All rights reserved. *
|
||||
* Copyright 2021 Ben Vanik. All rights reserved. *
|
||||
* Released under the BSD license - see LICENSE in the root for more details. *
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "xenia/base/main.h"
|
||||
#include "xenia/ui/d3d12/d3d12_provider.h"
|
||||
#include "xenia/ui/window.h"
|
||||
#include "xenia/ui/window_demo.h"
|
||||
#include "xenia/ui/windowed_app.h"
|
||||
|
||||
namespace xe {
|
||||
namespace ui {
|
||||
namespace d3d12 {
|
||||
|
||||
int window_demo_main(const std::vector<std::string>& args);
|
||||
class D3D12WindowDemoApp final : public WindowDemoApp {
|
||||
public:
|
||||
static std::unique_ptr<WindowedApp> Create(WindowedAppContext& app_context) {
|
||||
return std::unique_ptr<WindowedApp>(new D3D12WindowDemoApp(app_context));
|
||||
}
|
||||
|
||||
std::unique_ptr<GraphicsProvider> CreateDemoGraphicsProvider(Window* window) {
|
||||
return xe::ui::d3d12::D3D12Provider::Create(window);
|
||||
protected:
|
||||
std::unique_ptr<GraphicsProvider> CreateGraphicsProvider() const override;
|
||||
|
||||
private:
|
||||
explicit D3D12WindowDemoApp(WindowedAppContext& app_context)
|
||||
: WindowDemoApp(app_context, "xenia-ui-window-d3d12-demo") {}
|
||||
};
|
||||
|
||||
std::unique_ptr<GraphicsProvider> D3D12WindowDemoApp::CreateGraphicsProvider()
|
||||
const {
|
||||
return D3D12Provider::Create();
|
||||
}
|
||||
|
||||
} // namespace d3d12
|
||||
} // namespace ui
|
||||
} // namespace xe
|
||||
|
||||
DEFINE_ENTRY_POINT("xenia-ui-window-d3d12-demo", xe::ui::window_demo_main, "");
|
||||
XE_DEFINE_WINDOWED_APP(xenia_ui_window_d3d12_demo,
|
||||
xe::ui::d3d12::D3D12WindowDemoApp::Create);
|
||||
|
||||
Reference in New Issue
Block a user