コード例 #1
0
ファイル: drawing.go プロジェクト: kse/aStar-demo
/*
 * Draw a grid on the display and return info about the Tile
 */
func drawGrid(screen *sdl.Surface) {
	/*{{{*/
	vid := sdl.GetVideoInfo()

	// First the vertical
	for i := 0; i < int(vid.Current_w); i += SIZE {
		screen.FillRect(
			&sdl.Rect{int16(i), int16(0), 1, uint16(vid.Current_h)},
			0x000000)
		screen.UpdateRect(int32(i), 0, 1, uint32(vid.Current_h))
	}

	// Then the horizontal
	for i := 0; i < int(vid.Current_h); i += SIZE {
		screen.FillRect(
			&sdl.Rect{0, int16(i), uint16(vid.Current_w), 1},
			0x000000)
		screen.UpdateRect(0, int32(i), uint32(vid.Current_w), 1)
	}

	return
	/*}}}*/
}