diff --git a/vertices.go b/vertices.go index 3eacf0e58..9239e5dc1 100644 --- a/vertices.go +++ b/vertices.go @@ -17,7 +17,6 @@ package ebiten import ( "github.com/hajimehoshi/ebiten/internal/affine" "github.com/hajimehoshi/ebiten/internal/restorable" - "github.com/hajimehoshi/ebiten/internal/web" ) // texelAdjustment represents a number to be used to adjust texel. @@ -26,13 +25,6 @@ import ( // See #317. var texelAdjustment float32 = 256 -func init() { - if web.IsIOSSafari() { - // Texel adjustment causes glitches on iOS Safari. - texelAdjustment = 0 - } -} - var ( quadFloat32Num = restorable.QuadVertexSizeInBytes() / 4 theVerticesBackend = &verticesBackend{} diff --git a/vertices_ios.go b/vertices_ios.go new file mode 100644 index 000000000..34e1979c5 --- /dev/null +++ b/vertices_ios.go @@ -0,0 +1,22 @@ +// Copyright 2017 The Ebiten Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// +build ios + +package ebiten + +func init() { + // Texel adjustment causes glitches on iOS. + texelAdjustment = 0 +} diff --git a/vertices_notios.go b/vertices_notios.go new file mode 100644 index 000000000..bd8d401f2 --- /dev/null +++ b/vertices_notios.go @@ -0,0 +1,28 @@ +// Copyright 2017 The Ebiten Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// +build !ios + +package ebiten + +import ( + "github.com/hajimehoshi/ebiten/internal/web" +) + +func init() { + if web.IsIOSSafari() { + // Texel adjustment causes glitches on iOS. + texelAdjustment = 0 + } +}