diff --git a/internal/graphicsdriver/opengl/shader_notjs.go b/internal/graphicsdriver/opengl/shader_desktop.go similarity index 95% rename from internal/graphicsdriver/opengl/shader_notjs.go rename to internal/graphicsdriver/opengl/shader_desktop.go index 198ddd1a5..bf16779de 100644 --- a/internal/graphicsdriver/opengl/shader_notjs.go +++ b/internal/graphicsdriver/opengl/shader_desktop.go @@ -12,7 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +// +build !android // +build !js +// +build !ios package opengl diff --git a/internal/graphicsdriver/opengl/shader_js.go b/internal/graphicsdriver/opengl/shader_js.go index d63c5352c..654ab180a 100644 --- a/internal/graphicsdriver/opengl/shader_js.go +++ b/internal/graphicsdriver/opengl/shader_js.go @@ -22,5 +22,5 @@ func glslVersion() glsl.GLSLVersion { if isWebGL2Available { return glsl.GLSLVersionES300 } - return glsl.GLSLVersionWebGL1 + return glsl.GLSLVersionES100 } diff --git a/internal/graphicsdriver/opengl/shader_mobile.go b/internal/graphicsdriver/opengl/shader_mobile.go new file mode 100644 index 000000000..21188d9b3 --- /dev/null +++ b/internal/graphicsdriver/opengl/shader_mobile.go @@ -0,0 +1,25 @@ +// Copyright 2020 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 android ios + +package opengl + +import ( + "github.com/hajimehoshi/ebiten/v2/internal/shaderir/glsl" +) + +func glslVersion() glsl.GLSLVersion { + return glsl.GLSLVersionES100 +} diff --git a/internal/shaderir/glsl/glsl.go b/internal/shaderir/glsl/glsl.go index 8cf1b95cb..201a7d575 100644 --- a/internal/shaderir/glsl/glsl.go +++ b/internal/shaderir/glsl/glsl.go @@ -28,7 +28,7 @@ type GLSLVersion int const ( GLSLVersionDefault GLSLVersion = iota - GLSLVersionWebGL1 + GLSLVersionES100 GLSLVersionES300 ) @@ -42,7 +42,7 @@ func VertexPrelude(version GLSLVersion) string { func FragmentPrelude(version GLSLVersion) string { var prefix string switch version { - case GLSLVersionWebGL1: + case GLSLVersionES100: prefix = `#extension GL_OES_standard_derivatives : enable` + "\n\n" case GLSLVersionES300: prefix = `#version 300 es` + "\n\n"