From c5e42c91bec4ea3120f0c18f26ad0273bf280cbd Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 24 Jul 2016 00:05:36 +0900 Subject: [PATCH] ui: Add glcontext.go --- internal/ui/glcontext.go | 25 +++++++++++++++++++++++++ internal/ui/ui_glfw.go | 6 ------ internal/ui/ui_js.go | 6 ------ internal/ui/ui_mobile.go | 6 ------ 4 files changed, 25 insertions(+), 18 deletions(-) create mode 100644 internal/ui/glcontext.go diff --git a/internal/ui/glcontext.go b/internal/ui/glcontext.go new file mode 100644 index 000000000..82ba033dd --- /dev/null +++ b/internal/ui/glcontext.go @@ -0,0 +1,25 @@ +// Copyright 2016 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. + +package ui + +import ( + "github.com/hajimehoshi/ebiten/internal/graphics/opengl" +) + +var glContext *opengl.Context + +func GLContext() *opengl.Context { + return glContext +} diff --git a/internal/ui/ui_glfw.go b/internal/ui/ui_glfw.go index c7b2a59ce..3ca4bcab7 100644 --- a/internal/ui/ui_glfw.go +++ b/internal/ui/ui_glfw.go @@ -43,12 +43,6 @@ func CurrentUI() UserInterface { return currentUI } -var glContext *opengl.Context - -func GLContext() *opengl.Context { - return glContext -} - func init() { if err := initialize(); err != nil { panic(err) diff --git a/internal/ui/ui_js.go b/internal/ui/ui_js.go index 7ddcc0119..bbca48c7c 100644 --- a/internal/ui/ui_js.go +++ b/internal/ui/ui_js.go @@ -136,12 +136,6 @@ func touchEventToTouches(e *js.Object) []touch { return t } -var glContext *opengl.Context - -func GLContext() *opengl.Context { - return glContext -} - func init() { if err := initialize(); err != nil { panic(err) diff --git a/internal/ui/ui_mobile.go b/internal/ui/ui_mobile.go index 8e39e3c54..4e3b5a3e8 100644 --- a/internal/ui/ui_mobile.go +++ b/internal/ui/ui_mobile.go @@ -24,12 +24,6 @@ import ( "github.com/hajimehoshi/ebiten/internal/graphics/opengl" ) -var glContext *opengl.Context - -func GLContext() *opengl.Context { - return glContext -} - func Main() error { return errors.New("ui: don't call this: use RunWithoutMainLoop instead of Run") }