Added file drag and drop support

This commit is contained in:
WerWolv
2020-11-17 13:58:50 +01:00
parent d05805595e
commit 6e21f703ab
8 changed files with 38 additions and 17 deletions
+8
View File
@@ -137,6 +137,7 @@ namespace hex {
void Window::frameEnd() {
ImGui::Render();
int display_w, display_h;
glfwGetFramebufferSize(this->m_window, &display_w, &display_h);
glViewport(0, 0, display_w, display_h);
@@ -176,6 +177,13 @@ namespace hex {
Window::s_currShortcut = { key, mods };
});
glfwSetDropCallback(this->m_window, [](GLFWwindow *window, int count, const char **paths) {
if (count != 1)
return;
View::postEvent(Events::FileDropped, paths[0]);
});
glfwSetWindowSizeLimits(this->m_window, 720, 480, GLFW_DONT_CARE, GLFW_DONT_CARE);
if (gladLoadGL() == 0)