mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 11:48:55 +01:00
opengl: Refactoring
This commit is contained in:
parent
847ba9de0c
commit
71ca838193
@ -19,19 +19,14 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
zeroPlus float32
|
|
||||||
oneMinus float32
|
|
||||||
)
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
zeroPlus = math.Nextafter32(0, 1)
|
zeroPlus = math.Nextafter32(0, 1)
|
||||||
oneMinus = math.Nextafter32(1, 0)
|
oneMinus = math.Nextafter32(1, 0)
|
||||||
}
|
)
|
||||||
|
|
||||||
// adjustForClearColor adjust the value x for glClearColor function.
|
// adjustForClearColor adjust the value x for glClearColor function.
|
||||||
//
|
//
|
||||||
// On some machines like MacBook Pro, exact 0 and exact 1 might cause problems
|
// 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 {
|
func adjustForClearColor(x float32) float32 {
|
||||||
if x <= 0 {
|
if x <= 0 {
|
||||||
return zeroPlus
|
return zeroPlus
|
||||||
|
Loading…
Reference in New Issue
Block a user