Skip to content

Commit 83bf5d3

Browse files
committed
Boiler plate for skia_glfw_module, and brief usage
1 parent 590df31 commit 83bf5d3

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

examples/skia_glfw_module.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
# skia_glfw_module
2+
# This file created by 2023 Hin-Tak Leung; but Copyright skia-python project:
3+
4+
# Adapted from https://kyamagu.github.io/skia-python/tutorial/canvas.html#opengl-window
5+
6+
# Typical usage:
7+
#
8+
# from skia_glfw_module import glfw_window, skia_surface
9+
# ....
10+
# with glfw_window(WIDTH, HEIGHT) as window:
11+
# ...
12+
# with skia_surface(window) as surface:
13+
# with surface as canvas:
14+
# canvas.drawStuff()
15+
#
16+
# surface.flushAndSubmit()
17+
# glfw.swap_buffers(window)
18+
#
19+
120
import contextlib, glfw
221
import skia
322
from OpenGL import GL

0 commit comments

Comments
 (0)