start working towards imgui + sdl + vulkan init
This commit is contained in:
4
external/parallel-rdp/ParallelRDPWrapper.cpp
vendored
4
external/parallel-rdp/ParallelRDPWrapper.cpp
vendored
@@ -81,9 +81,9 @@ void ParallelRDP::LoadWSIPlatform(const std::shared_ptr<InstanceFactory> &instan
|
||||
windowInfo = newWindowInfo;
|
||||
}
|
||||
|
||||
void ParallelRDP::Init(const std::shared_ptr<InstanceFactory> &factory, const std::shared_ptr<WSIPlatform> &wsiPlatform,
|
||||
void ParallelRDP::Init(const std::shared_ptr<WSIPlatform> &wsiPlatform,
|
||||
const std::shared_ptr<WindowInfo> &newWindowInfo, const u8 *rdram) {
|
||||
LoadWSIPlatform(factory, wsiPlatform, newWindowInfo);
|
||||
LoadWSIPlatform(nullptr, wsiPlatform, newWindowInfo);
|
||||
|
||||
ResourceLayout vertLayout;
|
||||
ResourceLayout fragLayout;
|
||||
|
||||
2
external/parallel-rdp/ParallelRDPWrapper.hpp
vendored
2
external/parallel-rdp/ParallelRDPWrapper.hpp
vendored
@@ -19,7 +19,7 @@ public:
|
||||
virtual ~WindowInfo() = default;
|
||||
};
|
||||
|
||||
void Init(const std::shared_ptr<Vulkan::InstanceFactory> &, const std::shared_ptr<Vulkan::WSIPlatform> &,
|
||||
void Init(const std::shared_ptr<Vulkan::WSIPlatform> &,
|
||||
const std::shared_ptr<WindowInfo> &, const u8 *);
|
||||
ParallelRDP() = default;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ EmuThread::EmuThread(const std::shared_ptr<n64::Core> &core, double &fps, Render
|
||||
void EmuThread::start() noexcept {
|
||||
thread = std::thread([this]() {
|
||||
isRunning = true;
|
||||
core->parallel.Init(renderWidget.imGuiVkInstanceFactory, renderWidget.wsiPlatform, renderWidget.windowInfo,
|
||||
core->parallel.Init(renderWidget.wsiPlatform, renderWidget.windowInfo,
|
||||
core->cpu->GetMem().GetRDRAMPtr());
|
||||
|
||||
auto lastSample = std::chrono::high_resolution_clock::now();
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <backend/Core.hpp>
|
||||
#include <ImGuiImpl/StatusBar.hpp>
|
||||
|
||||
KaizenGui::KaizenGui() noexcept : core(std::make_shared<n64::Core>()), vulkanWidget(core), emuThread(core, fpsCounter, vulkanWidget, settingsWindow) {
|
||||
KaizenGui::KaizenGui() noexcept : window(SDL_CreateWindow("Kaizen", 1280, 720, SDL_WINDOW_HIGH_PIXEL_DENSITY | SDL_WINDOW_RESIZABLE | SDL_WINDOW_VULKAN)), core(std::make_shared<n64::Core>()), vulkanWidget(core, window), emuThread(core, fpsCounter, vulkanWidget, settingsWindow) {
|
||||
emuExitFunc = [&]() {
|
||||
quit = true;
|
||||
if (emuThread.isRunning) {
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <Discord.hpp>
|
||||
|
||||
class KaizenGui final {
|
||||
std::shared_ptr<SDL_Window> window;
|
||||
public:
|
||||
explicit KaizenGui() noexcept;
|
||||
double fpsCounter;
|
||||
|
||||
@@ -3,17 +3,10 @@
|
||||
#include <RenderWidget.hpp>
|
||||
#include <SDL3/SDL_events.h>
|
||||
|
||||
RenderWidget::RenderWidget(const std::shared_ptr<n64::Core> &core) {
|
||||
RenderWidget::RenderWidget(const std::shared_ptr<n64::Core> &core, const std::shared_ptr<SDL_Window>& window) {
|
||||
if (!Vulkan::Context::init_loader(nullptr)) {
|
||||
Util::panic("Could not initialize Vulkan ICD");
|
||||
}
|
||||
|
||||
imGuiVkInstanceFactory = std::make_shared<ImGuiInstanceFactory>();
|
||||
//windowHandle()->setVulkanInstance(&imGuiVkInstanceFactory->create_instance());
|
||||
//windowHandle()->create();
|
||||
|
||||
//wsiPlatform = std::make_shared<ImGuiWSIPlatform>(core, windowHandle());
|
||||
// windowInfo = std::make_shared<ImGuiParallelRdpWindowInfo>(windowHandle());
|
||||
}
|
||||
|
||||
void ImGuiWSIPlatform::poll_input() {
|
||||
|
||||
@@ -7,16 +7,9 @@ namespace n64 {
|
||||
struct Core;
|
||||
}
|
||||
|
||||
struct ImGuiInstanceFactory final : Vulkan::InstanceFactory {
|
||||
VkInstance create_instance(const VkInstanceCreateInfo *info) override {
|
||||
}
|
||||
|
||||
VkInstance instance;
|
||||
};
|
||||
|
||||
class ImGuiParallelRdpWindowInfo final : public ParallelRDP::WindowInfo {
|
||||
public:
|
||||
explicit ImGuiParallelRdpWindowInfo(SDL_Window *window) : window(window) {}
|
||||
explicit ImGuiParallelRdpWindowInfo(const std::shared_ptr<SDL_Window> window) : window(window) {}
|
||||
CoordinatePair get_window_size() override {
|
||||
int w,h;
|
||||
SDL_GetWindowSizeInPixels(window.get(), &w, &h);
|
||||
@@ -29,7 +22,7 @@ private:
|
||||
|
||||
class ImGuiWSIPlatform final : public Vulkan::WSIPlatform {
|
||||
public:
|
||||
explicit ImGuiWSIPlatform(const std::shared_ptr<n64::Core> &core, SDL_Window *window) : window(window), core(core) {}
|
||||
explicit ImGuiWSIPlatform(const std::shared_ptr<n64::Core> &core, const std::shared_ptr<SDL_Window> &window) : window(window), core(core) {}
|
||||
|
||||
std::vector<const char *> get_instance_extensions() override {
|
||||
auto vec = std::vector<const char *>();
|
||||
@@ -80,10 +73,8 @@ private:
|
||||
|
||||
class RenderWidget final {
|
||||
public:
|
||||
[[nodiscard]] VkInstance instance() const { return imGuiVkInstanceFactory->instance; }
|
||||
explicit RenderWidget(const std::shared_ptr<n64::Core> &);
|
||||
explicit RenderWidget(const std::shared_ptr<n64::Core> &, const std::shared_ptr<SDL_Window>&);
|
||||
|
||||
std::shared_ptr<ParallelRDP::WindowInfo> windowInfo;
|
||||
std::shared_ptr<ImGuiWSIPlatform> wsiPlatform;
|
||||
std::shared_ptr<ImGuiInstanceFactory> imGuiVkInstanceFactory;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user