examples/lines: refactoring

This commit is contained in:
Hajime Hoshi 2024-11-09 18:37:38 +09:00
parent 1a4237213c
commit e860747f4c

View File

@ -27,18 +27,6 @@ import (
"github.com/hajimehoshi/ebiten/v2/vector" "github.com/hajimehoshi/ebiten/v2/vector"
) )
var (
whiteImage = ebiten.NewImage(3, 3)
// whiteSubImage is an internal sub image of whiteImage.
// Use whiteSubImage at DrawTriangles instead of whiteImage in order to avoid bleeding edges.
whiteSubImage = whiteImage.SubImage(image.Rect(1, 1, 2, 2)).(*ebiten.Image)
)
func init() {
whiteImage.Fill(color.White)
}
const ( const (
screenWidth = 640 screenWidth = 640
screenHeight = 480 screenHeight = 480
@ -47,9 +35,6 @@ const (
type Game struct { type Game struct {
counter int counter int
vertices []ebiten.Vertex
indices []uint16
aa bool aa bool
showCenter bool showCenter bool
} }