1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-11-17 18:06:03 -05:00
OpenDiablo2/d2common/d2interface/renderer.go
2020-11-03 11:19:59 -08:00

27 lines
772 B
Go

package d2interface
import "github.com/hajimehoshi/ebiten/v2"
type renderCallback = func(Surface) error
type updateCallback = func() error
// Renderer interface defines the functionality of a renderer
type Renderer interface {
GetRendererName() string
SetWindowIcon(fileName string)
Run(r renderCallback, u updateCallback, width, height int, title string) error
IsDrawingSkipped() bool
CreateSurface(surface Surface) (Surface, error)
NewSurface(width, height int) Surface
IsFullScreen() bool
SetFullScreen(fullScreen bool)
SetVSyncEnabled(vsync bool)
GetVSyncEnabled() bool
GetCursorPos() (int, int)
CurrentFPS() float64
ShowPanicScreen(message string)
Print(target *ebiten.Image, str string) error
PrintAt(target *ebiten.Image, str string, x, y int)
}