@@ -84,6 +84,11 @@ module glfw_bindings |
| 84 | 84 | integer(c_int), parameter :: GLFW_PRESS = 1 |
| 85 | 85 | integer(c_int), parameter :: GLFW_REPEAT = 2 |
| 86 | 86 | |
| 87 | + ! Mouse button constants |
| 88 | + integer(c_int), parameter :: GLFW_MOUSE_BUTTON_LEFT = 0 |
| 89 | + integer(c_int), parameter :: GLFW_MOUSE_BUTTON_RIGHT = 1 |
| 90 | + integer(c_int), parameter :: GLFW_MOUSE_BUTTON_MIDDLE = 2 |
| 91 | + |
| 87 | 92 | ! Callback type for framebuffer size |
| 88 | 93 | abstract interface |
| 89 | 94 | subroutine glfw_framebuffer_size_callback(window, width, height) bind(C) |
@@ -115,6 +120,18 @@ module glfw_bindings |
| 115 | 120 | type(c_ptr), value :: window |
| 116 | 121 | real(c_double), value :: xoffset, yoffset |
| 117 | 122 | end subroutine glfw_scroll_callback |
| 123 | + |
| 124 | + subroutine glfw_mouse_button_callback(window, button, action, mods) bind(C) |
| 125 | + import :: c_ptr, c_int |
| 126 | + type(c_ptr), value :: window |
| 127 | + integer(c_int), value :: button, action, mods |
| 128 | + end subroutine glfw_mouse_button_callback |
| 129 | + |
| 130 | + subroutine glfw_cursor_pos_callback(window, xpos, ypos) bind(C) |
| 131 | + import :: c_ptr, c_double |
| 132 | + type(c_ptr), value :: window |
| 133 | + real(c_double), value :: xpos, ypos |
| 134 | + end subroutine glfw_cursor_pos_callback |
| 118 | 135 | end interface |
| 119 | 136 | |
| 120 | 137 | interface |
@@ -168,6 +185,13 @@ module glfw_bindings |
| 168 | 185 | integer(c_int), value :: value |
| 169 | 186 | end subroutine glfwSetWindowShouldClose |
| 170 | 187 | |
| 188 | + ! void glfwSetWindowTitle(GLFWwindow* window, const char* title) |
| 189 | + subroutine glfwSetWindowTitle(window, title) bind(C, name="glfwSetWindowTitle") |
| 190 | + import :: c_ptr, c_char |
| 191 | + type(c_ptr), value :: window |
| 192 | + character(kind=c_char), intent(in) :: title(*) |
| 193 | + end subroutine glfwSetWindowTitle |
| 194 | + |
| 171 | 195 | ! void glfwSwapBuffers(GLFWwindow* window) |
| 172 | 196 | subroutine glfwSwapBuffers(window) bind(C, name="glfwSwapBuffers") |
| 173 | 197 | import :: c_ptr |
@@ -178,6 +202,11 @@ module glfw_bindings |
| 178 | 202 | subroutine glfwPollEvents() bind(C, name="glfwPollEvents") |
| 179 | 203 | end subroutine glfwPollEvents |
| 180 | 204 | |
| 205 | + ! double glfwGetTime(void) |
| 206 | + real(c_double) function glfwGetTime() bind(C, name="glfwGetTime") |
| 207 | + import :: c_double |
| 208 | + end function glfwGetTime |
| 209 | + |
| 181 | 210 | ! void glfwGetFramebufferSize(GLFWwindow* window, int* width, int* height) |
| 182 | 211 | subroutine glfwGetFramebufferSize(window, width, height) bind(C, name="glfwGetFramebufferSize") |
| 183 | 212 | import :: c_int, c_ptr |
@@ -230,6 +259,42 @@ module glfw_bindings |
| 230 | 259 | import :: c_funptr, c_char |
| 231 | 260 | character(kind=c_char), intent(in) :: procname(*) |
| 232 | 261 | end function glfwGetProcAddress |
| 262 | + |
| 263 | + ! GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow* window, GLFWmousebuttonfun callback) |
| 264 | + type(c_funptr) function glfwSetMouseButtonCallback(window, callback) & |
| 265 | + bind(C, name="glfwSetMouseButtonCallback") |
| 266 | + import :: c_ptr, c_funptr |
| 267 | + type(c_ptr), value :: window |
| 268 | + type(c_funptr), value :: callback |
| 269 | + end function glfwSetMouseButtonCallback |
| 270 | + |
| 271 | + ! GLFWcursorposfun glfwSetCursorPosCallback(GLFWwindow* window, GLFWcursorposfun callback) |
| 272 | + type(c_funptr) function glfwSetCursorPosCallback(window, callback) & |
| 273 | + bind(C, name="glfwSetCursorPosCallback") |
| 274 | + import :: c_ptr, c_funptr |
| 275 | + type(c_ptr), value :: window |
| 276 | + type(c_funptr), value :: callback |
| 277 | + end function glfwSetCursorPosCallback |
| 278 | + |
| 279 | + ! void glfwGetCursorPos(GLFWwindow* window, double* xpos, double* ypos) |
| 280 | + subroutine glfwGetCursorPos(window, xpos, ypos) bind(C, name="glfwGetCursorPos") |
| 281 | + import :: c_ptr, c_double |
| 282 | + type(c_ptr), value :: window |
| 283 | + real(c_double), intent(out) :: xpos, ypos |
| 284 | + end subroutine glfwGetCursorPos |
| 285 | + |
| 286 | + ! const char* glfwGetClipboardString(GLFWwindow* window) |
| 287 | + type(c_ptr) function glfwGetClipboardString(window) bind(C, name="glfwGetClipboardString") |
| 288 | + import :: c_ptr |
| 289 | + type(c_ptr), value :: window |
| 290 | + end function glfwGetClipboardString |
| 291 | + |
| 292 | + ! void glfwSetClipboardString(GLFWwindow* window, const char* string) |
| 293 | + subroutine glfwSetClipboardString(window, string) bind(C, name="glfwSetClipboardString") |
| 294 | + import :: c_ptr, c_char |
| 295 | + type(c_ptr), value :: window |
| 296 | + character(kind=c_char), intent(in) :: string(*) |
| 297 | + end subroutine glfwSetClipboardString |
| 233 | 298 | end interface |
| 234 | 299 | |
| 235 | 300 | end module glfw_bindings |