Ejemplo n.º 1
0
func (app) EndPaint(e paint.Event) {
	// gl.Flush is a lightweight (on modern GL drivers) blocking call
	// that ensures all GL functions pending in the gl package have
	// been passed onto the GL driver before the app package attempts
	// to swap the screen buffer.
	//
	// This enforces that the final receive (for this paint cycle) on
	// gl.WorkAvailable happens before the send on endPaint.
	gl.Flush()
	endPaint <- e
}
Ejemplo n.º 2
0
func (app) Publish() PublishResult {
	// gl.Flush is a lightweight (on modern GL drivers) blocking call
	// that ensures all GL functions pending in the gl package have
	// been passed onto the GL driver before the app package attempts
	// to swap the screen buffer.
	//
	// This enforces that the final receive (for this paint cycle) on
	// gl.WorkAvailable happens before the send on endPaint.
	gl.Flush()
	publish <- struct{}{}
	return <-publishResult
}
Ejemplo n.º 3
0
func (app) EndDraw() {
	// gl.Flush is a lightweight (on modern GL drivers) blocking call
	// that ensures all GL functions pending in the gl package have
	// been passed onto the GL driver before the app package attempts
	// to swap the screen buffer.
	//
	// This enforces that the final receive (for this draw cycle) on
	// gl.WorkAvailable happens before the send on endDraw.
	gl.Flush()

	select {
	case endDraw <- struct{}{}:
	default:
	}
}