mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-05-01 09:20:30 -05:00
Added file drag and drop support
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user