Skip to content

Commit

Permalink
Boiler plate for skia_glfw_module, and brief usage
Browse files Browse the repository at this point in the history
  • Loading branch information
HinTak committed Aug 23, 2023
1 parent 590df31 commit 83bf5d3
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions examples/skia_glfw_module.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
# skia_glfw_module
# This file created by 2023 Hin-Tak Leung; but Copyright skia-python project:

# Adapted from https://kyamagu.github.io/skia-python/tutorial/canvas.html#opengl-window

# Typical usage:
#
# from skia_glfw_module import glfw_window, skia_surface
# ....
# with glfw_window(WIDTH, HEIGHT) as window:
# ...
# with skia_surface(window) as surface:
# with surface as canvas:
# canvas.drawStuff()
#
# surface.flushAndSubmit()
# glfw.swap_buffers(window)
#

import contextlib, glfw
import skia
from OpenGL import GL
Expand Down

0 comments on commit 83bf5d3

Please sign in to comment.