Пример #1
0
func Draw() {
	sdl.RenderClear(g_engine.renderer)
	g_game.Draw()

	if font := g_engine.GetFont(FONT_PURITANBOLD_14); font != nil {
		font.SetColor(255, 242, 0)
		font.DrawBorderedText(fmt.Sprintf("FPS: %v", g_FPS), 760, 5)
	}

	sdl.RenderPresent(g_engine.renderer)
}
Пример #2
0
//Internal draw function
func (game *Game) draw() {
	//Clear the screen
	sdl.RenderClear(game.renderer)

	//Call user-defined draw function
	if game.drawFun != nil {
		game.drawFun()
	}

	if game.guiManager != nil {
		game.guiManager.Draw()
	}

	//Render everything
	sdl.RenderPresent(game.renderer)
}