Commit 91b65bf6 authored by Anakin's avatar Anakin

added drag n drop function,

need to clean up before loading the next mesh
parent b4bd3144
......@@ -8,4 +8,6 @@ extern void mouseMove(GLFWwindow *window, double xpos, double ypos);
extern void mouseWheel(GLFWwindow *window, double xoffset, double yoffset);
extern void keyPress(GLFWwindow *window, int key, int scancode, int action, int mods);
\ No newline at end of file
extern void keyPress(GLFWwindow *window, int key, int scancode, int action, int mods);
extern void dragNdrop(GLFWwindow* window, int count, const char** paths);
\ No newline at end of file
......@@ -179,6 +179,7 @@ void OpenGLController::setCallbackFunctions()
glfwSetWindowSizeCallback(pWindow, windowResize);
glfwSetScrollCallback(pWindow, mouseWheel);
glfwSetKeyCallback(pWindow, keyPress);
glfwSetDropCallback(pWindow, dragNdrop);
}
glm::mat4 OpenGLController::getModelMatrix(unsigned int index)
......
......@@ -98,3 +98,10 @@ void keyPress(GLFWwindow *window, int key, int scancode, int action, int mods)
}
}
}
void dragNdrop(GLFWwindow* window, int count, const char** paths)
{
OpenGLController* controller = reinterpret_cast<OpenGLController*>(glfwGetWindowUserPointer(window));
if(count > 0)
controller->loadMsh(paths[0]);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment