Fresh start

This commit is contained in:
bloeys
2021-10-09 21:54:38 +04:00
parent 97c396e54c
commit 7a29b411ac
10 changed files with 0 additions and 762 deletions

View File

@ -1,45 +0,0 @@
package input
import "github.com/veandco/go-sdl2/sdl"
var (
anyKeyDown bool
anyMouseBtnDown bool
)
//EventLoopStarted should be called just before processing SDL events
func EventLoopStarted() {
anyKeyDown = false
anyMouseBtnDown = false
//Clear XThisFrame which is needed because a repeat event needs multiple frames to happen
for _, v := range mouseBtns {
v.isDoubleClick = false
v.pressedThisFrame = false
v.releasedThisFrame = false
if v.state == sdl.PRESSED {
anyMouseBtnDown = true
}
}
for _, v := range keyboardKeys {
v.pressedThisFrame = false
v.releasedThisFrame = false
if v.state == sdl.PRESSED {
anyKeyDown = true
}
}
}
func AnyKeyDown() bool {
return anyKeyDown
}
func AnyMouseBtnDown() bool {
return anyMouseBtnDown
}