From 08af9e401081a69dbe8edc88a268c1fee56e2f9f Mon Sep 17 00:00:00 2001 From: faiface Date: Thu, 24 Nov 2016 14:24:17 +0100 Subject: [PATCH] add orphan function Clear --- pixelgl/orphan.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 pixelgl/orphan.go diff --git a/pixelgl/orphan.go b/pixelgl/orphan.go new file mode 100644 index 0000000..14d67f6 --- /dev/null +++ b/pixelgl/orphan.go @@ -0,0 +1,13 @@ +package pixelgl + +import "github.com/go-gl/gl/v3.3-core/gl" + +// This file defines functions that can operate without a parent BeginEnder. + +// Clear clears the current context.. +func Clear(r, g, b, a float64) { + DoNoBlock(func() { + gl.ClearColor(float32(r), float32(g), float32(b), float32(a)) + gl.Clear(gl.COLOR_BUFFER_BIT) + }) +}