Polymorphic Map and threadpool

This commit is contained in:
2021-11-01 20:25:16 +01:00
parent 9c48c48f8c
commit 1b7ab9b1f1
20 changed files with 1442 additions and 1280 deletions
@@ -38,6 +38,12 @@ void glfwFileCallback(GLFWwindow* handle, int count, const char** paths)
window->fileCallback(count, paths);
}
void glfwCloseCallback(GLFWwindow* handle)
{
Window* window = (Window*)glfwGetWindowUserPointer(handle);
window->closeCallback();
}
Window::Window(PGraphics graphics, const WindowCreateInfo &createInfo)
: Gfx::Window(createInfo)
, graphics(graphics)
@@ -56,6 +62,7 @@ Window::Window(PGraphics graphics, const WindowCreateInfo &createInfo)
glfwSetMouseButtonCallback(handle, &glfwMouseButtonCallback);
glfwSetScrollCallback(handle, &glfwScrollCallback);
glfwSetDropCallback(handle, &glfwFileCallback);
glfwSetWindowCloseCallback(handle, &glfwCloseCallback);
glfwCreateWindowSurface(instance, handle, nullptr, &surface);
@@ -134,6 +141,11 @@ void Window::setFileCallback(std::function<void(int, const char**)> callback)
fileCallback = callback;
}
void Window::setCloseCallback(std::function<void()> callback)
{
closeCallback = callback;
}
void Window::advanceBackBuffer()
{
VkResult res = VK_ERROR_OUT_OF_DATE_KHR;