1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

interfaces fixes; freetype.text_width(); gl and stbi fixes

This commit is contained in:
Alexander Medvednikov
2020-01-09 12:00:39 +01:00
parent 938f27e391
commit b6c0b22742
14 changed files with 150 additions and 14 deletions

View File

@@ -220,6 +220,13 @@ pub fn (w &Window) set_clipboard_text(s string) {
C.glfwSetClipboardString(w.data, s.str)
}
pub fn get_cursor_pos(glfw_window voidptr) (f64, f64) {
x := f64(0)
y := f64(0)
C.glfwGetCursorPos(glfw_window, &x, &y)
return x,y
}
pub fn (w &Window) get_cursor_pos() Pos {
x := f64(0)
y := f64(0)
@@ -230,6 +237,21 @@ pub fn (w &Window) get_cursor_pos() Pos {
}
}
enum Cursor {
arrow
ibeam
hand
}
pub fn set_cursor(c Cursor) {
C.glfwSetCursor(0, C.GLFW_IBEAM_CURSOR)
}
pub fn (w &Window) set_cursor(c Cursor) {
C.glfwSetCursor(w.data, C.GLFW_IBEAM_CURSOR)
}
pub fn (w &Window) user_ptr() voidptr {
return C.glfwGetWindowUserPointer(w.data)
}