本文整理匯總了Golang中github.com/krig/Go-SDL2/sdl.Renderer.Present方法的典型用法代碼示例。如果您正苦於以下問題:Golang Renderer.Present方法的具體用法?Golang Renderer.Present怎麽用?Golang Renderer.Present使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/krig/Go-SDL2/sdl.Renderer
的用法示例。
在下文中一共展示了Renderer.Present方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: studioUpdate
func studioUpdate(window *sdl.Window, rend *sdl.Renderer, screen *Screen) bool {
var event sdl.Event
running := true
for (&event).Poll() {
switch e := (&event).Get().(type) {
case sdl.QuitEvent:
running = false
case sdl.KeyboardEvent:
if e.Keysym.Keycode == sdl.K_ESCAPE {
running = false
}
case sdl.MouseMotionEvent:
screen.stack.OnMouseMotionEvent(&e)
case sdl.MouseButtonEvent:
screen.stack.OnMouseButtonEvent(&e)
}
}
neww, newh := window.GetSize()
screen.UpdateLayout(sdl.Rect{0, 0, int32(neww), int32(newh)})
//screen.UpdateAnimations(framerate.Delta())
rend.SetDrawBlendMode(sdl.BLENDMODE_NONE)
rend.SetDrawColor(screen.rsc.BackgroundColor)
rend.Clear()
rend.SetDrawBlendMode(sdl.BLENDMODE_BLEND)
screen.Draw(rend)
rend.Present()
screen.framerate.FramerateDelay()
return running
}