Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
C-Fu
OpenGL
Commits
91b65bf6
Commit
91b65bf6
authored
Nov 12, 2016
by
Anakin
Browse files
added drag n drop function,
need to clean up before loading the next mesh
parent
b4bd3144
Changes
3
Hide whitespace changes
Inline
Side-by-side
MshViewer/Header/callback.h
View file @
91b65bf6
...
...
@@ -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
MshViewer/Source/OpenGlController.cpp
View file @
91b65bf6
...
...
@@ -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
)
...
...
MshViewer/Source/callback.cpp
View file @
91b65bf6
...
...
@@ -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
]);
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment