From 114a8aa6eacea1ead4d57a4a67fd2c8ce1b68f11 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Mon, 14 Nov 2022 02:33:23 +0900 Subject: [PATCH] internal/graphicsdriver/opengl/gl: reland: refactoring: reduce opengles build tags Updates #292 --- internal/graphicsdriver/opengl/shader_gles.go | 25 ------------------- .../opengl/{shader_gl.go => shader_notjs.go} | 5 +++- 2 files changed, 4 insertions(+), 26 deletions(-) delete mode 100644 internal/graphicsdriver/opengl/shader_gles.go rename internal/graphicsdriver/opengl/{shader_gl.go => shader_notjs.go} (92%) diff --git a/internal/graphicsdriver/opengl/shader_gles.go b/internal/graphicsdriver/opengl/shader_gles.go deleted file mode 100644 index f309af4a8..000000000 --- a/internal/graphicsdriver/opengl/shader_gles.go +++ /dev/null @@ -1,25 +0,0 @@ -// 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. - -//go:build (android || ios || opengles) && !js - -package opengl - -import ( - "github.com/hajimehoshi/ebiten/v2/internal/shaderir/glsl" -) - -func (c *context) glslVersion() glsl.GLSLVersion { - return glsl.GLSLVersionES100 -} diff --git a/internal/graphicsdriver/opengl/shader_gl.go b/internal/graphicsdriver/opengl/shader_notjs.go similarity index 92% rename from internal/graphicsdriver/opengl/shader_gl.go rename to internal/graphicsdriver/opengl/shader_notjs.go index 1281999f9..307a17621 100644 --- a/internal/graphicsdriver/opengl/shader_gl.go +++ b/internal/graphicsdriver/opengl/shader_notjs.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build !android && !ios && !js && !opengles +//go:build !js package opengl @@ -21,5 +21,8 @@ import ( ) func (c *context) glslVersion() glsl.GLSLVersion { + if c.isES() { + return glsl.GLSLVersionES100 + } return glsl.GLSLVersionDefault }