forked from Dynamitos/Seele
Fixing render layout split
This commit is contained in:
1 parent
28a76ed404
commit
c57ca4efe6
27 files changed
+230
-57
No files matched your search
@@ -107,7 +107,12 @@ void glfwMouseButtonCallback(GLFWwindow* handle, int button, int action, int mod
|
||||
|
||||
void glfwScrollCallback(GLFWwindow* handle, double xoffset, double yoffset) {
|
||||
auto* window = static_cast<Seele::Vulkan::Window*>(glfwGetWindowUserPointer(handle));
|
||||
window->scroll(xoffset, yoffset);
|
||||
// GLFW's scroll callback does NOT give the cursor position, but per-view routing
|
||||
// needs it (scroll is spatial, like a mouse move). Query the current cursor pos
|
||||
// synchronously — it is stable between events and this is the only source we have.
|
||||
double x = 0.0, y = 0.0;
|
||||
glfwGetCursorPos(handle, &x, &y);
|
||||
window->scroll(x, y, xoffset, yoffset);
|
||||
}
|
||||
|
||||
void glfwFileCallback(GLFWwindow* handle, int count, const char** paths) {
|
||||
@@ -257,7 +262,7 @@ void Seele::Vulkan::Window::setMouseMoveCallback(std::function<void(double, doub
|
||||
|
||||
void Seele::Vulkan::Window::setMouseButtonCallback(std::function<void(MouseButton, InputAction, KeyModifierFlags)> callback) { mouseButtonCallback = callback; }
|
||||
|
||||
void Seele::Vulkan::Window::setScrollCallback(std::function<void(double, double)> callback) { scrollCallback = callback; }
|
||||
void Seele::Vulkan::Window::setScrollCallback(std::function<void(double x, double y, double xScroll, double yScroll)> callback) { scrollCallback = callback; }
|
||||
|
||||
void Seele::Vulkan::Window::setFileCallback(std::function<void(int, const char**)> callback) { fileCallback = callback; }
|
||||
|
||||
@@ -271,7 +276,7 @@ void Seele::Vulkan::Window::mouseMove(double x, double y) { mouseMoveCallback(x,
|
||||
|
||||
void Seele::Vulkan::Window::mouseButton(MouseButton button, InputAction action, KeyModifierFlags modifier) { mouseButtonCallback(button, action, modifier); }
|
||||
|
||||
void Seele::Vulkan::Window::scroll(double x, double y) { scrollCallback(x, y); }
|
||||
void Seele::Vulkan::Window::scroll(double x, double y, double xScroll, double yScroll) { scrollCallback(x, y, xScroll, yScroll); }
|
||||
|
||||
void Seele::Vulkan::Window::fileDrop(int num, const char** files) { fileCallback(num, files); }
|
||||
|
||||
@@ -291,6 +296,12 @@ void Seele::Vulkan::Window::resize(int width, int height) {
|
||||
framebufferWidth = extent.width;
|
||||
framebufferHeight = extent.height;
|
||||
createSwapChain();
|
||||
// The swapchain size changed and the views will be re-laid-out by resizeCallback below,
|
||||
// which rebuilds each pass's intermediate textures at the new (view) size. Any cached
|
||||
// framebuffers from the previous size are now stale (their handle-only hash also changed)
|
||||
// and must be dropped before the next render, or the pass would bind an over-wide
|
||||
// framebuffer whose renderArea is a sub-slice of it.
|
||||
graphics->invalidateFramebuffers();
|
||||
resizeCallback(width, height);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user