ui: Add glcontext.go

This commit is contained in:
Hajime Hoshi 2016-07-24 00:05:36 +09:00
parent b146e5d1b4
commit c5e42c91be
4 changed files with 25 additions and 18 deletions

25
internal/ui/glcontext.go Normal file
View File

@ -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
}

View File

@ -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)

View File

@ -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)

View File

@ -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")
}