コード例 #1
0
ファイル: pal_test.go プロジェクト: rsaarelm/teratogen
func unpaletted() (result *sdl.Surface) {
	result = sdl.NewSurface(8, 8)
	for y := 0; y < 8; y++ {
		for x := 0; x < 8; x++ {
			result.Set(x, y, color.RGBA{byte(x*16 + y*16), 0, 0, 255})
		}
	}
	return result
}
コード例 #2
0
ファイル: app.go プロジェクト: rsaarelm/teratogen
func initApp() App {
	sdl.Run(640, 480)
	sdl.SetFrame(sdl.NewSurface(320, 240))

	a := &app{}
	a.nanosecondsPerFrame = 33e6
	a.states = []State{}

	return a
}