From 257f05883c27f6d34df74758ecbaa4ff9c0628b4 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 15 Oct 2022 22:22:25 +0900 Subject: [PATCH] internal/graphicsdriver/opengl: enable to compiile for browsers with the 'opengles' tag The 'opengles' tag is just ignored for browsers. --- internal/graphicsdriver/opengl/context_gles.go | 3 ++- internal/graphicsdriver/opengl/graphics_gles.go | 3 ++- internal/graphicsdriver/opengl/graphics_js.go | 4 ++++ internal/graphicsdriver/opengl/shader_gles.go | 3 ++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/internal/graphicsdriver/opengl/context_gles.go b/internal/graphicsdriver/opengl/context_gles.go index 55063ede1..123f75501 100644 --- a/internal/graphicsdriver/opengl/context_gles.go +++ b/internal/graphicsdriver/opengl/context_gles.go @@ -12,8 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build android || ios || opengles +//go:build (android || ios || opengles) && !js // +build android ios opengles +// +build !js package opengl diff --git a/internal/graphicsdriver/opengl/graphics_gles.go b/internal/graphicsdriver/opengl/graphics_gles.go index 967784374..879e1e23b 100644 --- a/internal/graphicsdriver/opengl/graphics_gles.go +++ b/internal/graphicsdriver/opengl/graphics_gles.go @@ -12,8 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build android || ios || opengles +//go:build (android || ios || opengles) && !js // +build android ios opengles +// +build !js package opengl diff --git a/internal/graphicsdriver/opengl/graphics_js.go b/internal/graphicsdriver/opengl/graphics_js.go index 631e9dc7e..5db692eae 100644 --- a/internal/graphicsdriver/opengl/graphics_js.go +++ b/internal/graphicsdriver/opengl/graphics_js.go @@ -18,6 +18,10 @@ import ( "syscall/js" ) +func (g *Graphics) init() { + // Do nothing. +} + func (g *Graphics) SetCanvas(canvas js.Value) { g.context.canvas = canvas } diff --git a/internal/graphicsdriver/opengl/shader_gles.go b/internal/graphicsdriver/opengl/shader_gles.go index 77cce3c2a..92429475b 100644 --- a/internal/graphicsdriver/opengl/shader_gles.go +++ b/internal/graphicsdriver/opengl/shader_gles.go @@ -12,8 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build android || ios || opengles +//go:build (android || ios || opengles) && !js // +build android ios opengles +// +build !js package opengl