Trying to fix other passes

This commit is contained in:
2023-11-11 13:56:12 +01:00
parent 91555fcec3
commit 4c05886d38
24 changed files with 5792 additions and 93 deletions
+7 -6
View File
@@ -62,6 +62,7 @@ Window::Window(PGraphics graphics, const WindowCreateInfo &createInfo)
GLFWwindow *handle = glfwCreateWindow(createInfo.width, createInfo.height, createInfo.title, createInfo.bFullscreen ? glfwGetPrimaryMonitor() : nullptr, nullptr);
windowHandle = handle;
glfwSetWindowUserPointer(handle, this);
glfwGetWindowSize(handle, &windowState.width, &windowState.height);
glfwSetKeyCallback(handle, &glfwKeyCallback);
glfwSetCursorPosCallback(handle, &glfwMouseMoveCallback);
@@ -93,7 +94,7 @@ Window::Window(PGraphics graphics, const WindowCreateInfo &createInfo)
std::cerr << "Device not suitable for presenting to surface " << surface << ", use a different one" << std::endl;
}
recreateSwapchain(createInfo);
recreateSwapchain(windowState);
}
Window::~Window()
@@ -364,10 +365,10 @@ void Window::choosePresentMode(const Array<VkPresentModeKHR> &modes)
Viewport::Viewport(PGraphics graphics, PWindow owner, const ViewportCreateInfo &viewportInfo)
: Gfx::Viewport(owner, viewportInfo), graphics(graphics)
{
handle.width = static_cast<float>(viewportInfo.dimensions.size.x);
handle.height = static_cast<float>(viewportInfo.dimensions.size.y);
handle.x = static_cast<float>(viewportInfo.dimensions.offset.x);
handle.y = static_cast<float>(viewportInfo.dimensions.offset.y) + handle.height;
handle.width = static_cast<float>(sizeX);
handle.height = static_cast<float>(sizeY);
handle.x = static_cast<float>(offsetX);
handle.y = static_cast<float>(offsetY) + handle.height;
handle.height = -handle.height;
handle.minDepth = 0.f;
handle.maxDepth = 1.f;
@@ -392,4 +393,4 @@ void Viewport::move(uint32 newOffsetX, uint32 newOffsetY)
offsetY = newOffsetY;
handle.x = static_cast<float>(offsetX);
handle.y = static_cast<float>(offsetY + sizeY);
}
}