ebiten/internal/ui/init.go

34 lines
854 B
Go
Raw Normal View History

2016-05-18 04:07:00 +02:00
// Copyright 2016 Hajime Hoshi
2016-02-05 15:20:41 +01:00
//
// 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.
2016-05-18 04:07:00 +02:00
package ui
2016-02-05 15:20:41 +01:00
import (
"github.com/hajimehoshi/ebiten/internal/graphics/opengl"
)
var glContext *opengl.Context
2016-05-18 04:07:00 +02:00
func GLContext() *opengl.Context {
return glContext
}
2016-02-05 15:20:41 +01:00
func init() {
2016-04-10 18:45:13 +02:00
var err error
2016-05-18 04:12:23 +02:00
glContext, err = initialize()
2016-04-10 18:45:13 +02:00
if err != nil {
panic(err)
}
2016-02-05 15:20:41 +01:00
}