mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +01:00
Refactoring: Add init.go
This commit is contained in:
parent
099ce1b3b4
commit
024fc48647
29
init.go
Normal file
29
init.go
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
package ebiten
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/hajimehoshi/ebiten/internal/graphicscommand"
|
||||||
|
"github.com/hajimehoshi/ebiten/internal/mipmap"
|
||||||
|
"github.com/hajimehoshi/ebiten/internal/shareable"
|
||||||
|
)
|
||||||
|
|
||||||
|
var _ = __EBITEN_REQUIRES_GO_VERSION_1_12_OR_LATER__
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
mipmap.SetGraphicsDriver(uiDriver().Graphics())
|
||||||
|
shareable.SetGraphicsDriver(uiDriver().Graphics())
|
||||||
|
graphicscommand.SetGraphicsDriver(uiDriver().Graphics())
|
||||||
|
}
|
2
run.go
2
run.go
@ -21,8 +21,6 @@ import (
|
|||||||
"github.com/hajimehoshi/ebiten/internal/driver"
|
"github.com/hajimehoshi/ebiten/internal/driver"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = __EBITEN_REQUIRES_GO_VERSION_1_12_OR_LATER__
|
|
||||||
|
|
||||||
// Game defines necessary functions for a game.
|
// Game defines necessary functions for a game.
|
||||||
type Game interface {
|
type Game interface {
|
||||||
// Update updates a game by one frame.
|
// Update updates a game by one frame.
|
||||||
|
@ -23,18 +23,9 @@ import (
|
|||||||
"github.com/hajimehoshi/ebiten/internal/buffered"
|
"github.com/hajimehoshi/ebiten/internal/buffered"
|
||||||
"github.com/hajimehoshi/ebiten/internal/clock"
|
"github.com/hajimehoshi/ebiten/internal/clock"
|
||||||
"github.com/hajimehoshi/ebiten/internal/driver"
|
"github.com/hajimehoshi/ebiten/internal/driver"
|
||||||
"github.com/hajimehoshi/ebiten/internal/graphicscommand"
|
|
||||||
"github.com/hajimehoshi/ebiten/internal/hooks"
|
"github.com/hajimehoshi/ebiten/internal/hooks"
|
||||||
"github.com/hajimehoshi/ebiten/internal/mipmap"
|
|
||||||
"github.com/hajimehoshi/ebiten/internal/shareable"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
|
||||||
mipmap.SetGraphicsDriver(uiDriver().Graphics())
|
|
||||||
shareable.SetGraphicsDriver(uiDriver().Graphics())
|
|
||||||
graphicscommand.SetGraphicsDriver(uiDriver().Graphics())
|
|
||||||
}
|
|
||||||
|
|
||||||
type defaultGame struct {
|
type defaultGame struct {
|
||||||
update func(screen *Image) error
|
update func(screen *Image) error
|
||||||
width int
|
width int
|
||||||
|
Loading…
Reference in New Issue
Block a user