Beispiel #1
0
func draw(wnd *glfwui.Window, body ui.View) {
	w, h, ratio := wnd.Size()
	bnd.BeginFrame(w, h, ratio)
	bnd.Background(0, 0, w, h)
	drawView(body)
	bnd.EndFrame()
}
Beispiel #2
0
func render(wnd *glfwui.Window, app *app) {
	wnd.MakeContextCurrent()
	defer wnd.DetachContext()
	blendish.Init()
	for syncswap := range app.drawc {
		draw(wnd, app)
		if !syncswap {
			app.donec <- true
		}
		wnd.SwapBuffers()
		if syncswap {
			app.donec <- true
		}
	}
}