Add SetMainLoop() function

This commit is contained in:
Milan Nikolic 2017-12-08 06:17:42 +01:00
parent 2bfca1f330
commit 1fec9fe2f0
4 changed files with 17 additions and 0 deletions

View file

@ -41,6 +41,10 @@ func SetCallbackFunc(callback func(unsafe.Pointer)) {
callbackHolder = callback callbackHolder = callback
} }
// SetMainLoop - Sets main loop function
func SetMainLoop(f func(), fps, simulateInfiniteLoop int) {
}
//export androidMain //export androidMain
func androidMain(app *C.struct_android_app) { func androidMain(app *C.struct_android_app) {
if callbackHolder != nil { if callbackHolder != nil {

View file

@ -32,6 +32,10 @@ func SetCallbackFunc(func(unsafe.Pointer)) {
return return
} }
// SetMainLoop - Sets main loop function
func SetMainLoop(f func(), fps, simulateInfiniteLoop int) {
}
// ShowCursor - Shows cursor // ShowCursor - Shows cursor
func ShowCursor() { func ShowCursor() {
C.ShowCursor() C.ShowCursor()

View file

@ -32,6 +32,10 @@ func SetCallbackFunc(func(unsafe.Pointer)) {
return return
} }
// SetMainLoop - Sets main loop function
func SetMainLoop(f func(), fps, simulateInfiniteLoop int) {
}
// ShowCursor - Shows cursor // ShowCursor - Shows cursor
func ShowCursor() { func ShowCursor() {
C.ShowCursor() C.ShowCursor()

View file

@ -19,6 +19,11 @@ func InitWindow(width int32, height int32, t interface{}) {
func SetCallbackFunc(func(unsafe.Pointer)) { func SetCallbackFunc(func(unsafe.Pointer)) {
} }
// SetMainLoop - Sets main loop function
func SetMainLoop(f func(), fps, simulateInfiniteLoop int) {
js.Global.Get("Module").Call("_emscripten_set_main_loop", f, fps, simulateInfiniteLoop)
}
// ShowCursor - Shows cursor // ShowCursor - Shows cursor
func ShowCursor() { func ShowCursor() {
} }