opengl: Refactoring

This commit is contained in:
Hajime Hoshi 2017-12-03 03:55:07 +09:00
parent 847ba9de0c
commit 71ca838193

View File

@ -19,19 +19,14 @@ import (
)
var (
zeroPlus float32
oneMinus float32
)
func init() {
zeroPlus = math.Nextafter32(0, 1)
oneMinus = math.Nextafter32(1, 0)
}
)
// adjustForClearColor adjust the value x for glClearColor function.
//
// On some machines like MacBook Pro, exact 0 and exact 1 might cause problems
// at glClear() (#452).
// at glClearColor() (#452).
func adjustForClearColor(x float32) float32 {
if x <= 0 {
return zeroPlus