2016-05-19 17:07:04 +02:00
|
|
|
// Copyright 2015 Hajime Hoshi
|
|
|
|
//
|
|
|
|
// 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
|
|
|
|
|
2018-02-03 16:22:38 +01:00
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
)
|
|
|
|
|
2016-09-01 17:53:05 +02:00
|
|
|
type GraphicsContext interface {
|
2017-05-31 03:47:52 +02:00
|
|
|
SetSize(width, height int, scale float64)
|
2017-11-09 17:18:41 +01:00
|
|
|
Update(afterFrameUpdate func()) error
|
2017-01-21 17:37:08 +01:00
|
|
|
Invalidate()
|
2016-09-01 17:53:05 +02:00
|
|
|
}
|
|
|
|
|
2018-02-03 16:22:38 +01:00
|
|
|
// RegularTermination represents a regular termination.
|
|
|
|
// Run can return this error, and if this error is received,
|
|
|
|
// the game loop should be terminated as soon as possible.
|
|
|
|
var RegularTermination = errors.New("regular termination")
|