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

sokol: add mouse cursor support (#15111)

This commit is contained in:
Mehmet Ali
2022-07-18 09:44:48 +03:00
committed by GitHub
parent c1502b3c1f
commit 12d57e8e7b
6 changed files with 344 additions and 37 deletions

24
examples/gg/cursor.v Normal file
View File

@ -0,0 +1,24 @@
module main
import gg
import gx
import sokol.sapp
fn main() {
gg.new_context(
bg_color: gx.white
window_title: 'Cursor'
frame_fn: frame
init_fn: init
).run()
}
fn init(mut ctx gg.Context) {
sapp.set_mouse_cursor(.ibeam)
}
fn frame(mut ctx gg.Context) {
ctx.begin()
ctx.draw_text_def(10, 25, 'Your cursor should be an I shaped beam.')
ctx.end()
}