mirror of
https://github.com/geode-sdk/android-launcher.git
synced 2026-10-21 16:32:39 +00:00
add callback for loading geode
This commit is contained in:
2 files changed
+16
No files matched your search
@@ -0,0 +1,9 @@
|
|||||||
|
package com.geode.launcher
|
||||||
|
|
||||||
|
object Native {
|
||||||
|
var isInitRun = false
|
||||||
|
var isGeodeLoaded = false
|
||||||
|
|
||||||
|
@JvmStatic
|
||||||
|
external fun postGameInit()
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package org.cocos2dx.lib
|
package org.cocos2dx.lib
|
||||||
|
|
||||||
import android.opengl.GLSurfaceView
|
import android.opengl.GLSurfaceView
|
||||||
|
import com.geode.launcher.Native
|
||||||
import javax.microedition.khronos.egl.EGLConfig
|
import javax.microedition.khronos.egl.EGLConfig
|
||||||
import javax.microedition.khronos.opengles.GL10
|
import javax.microedition.khronos.opengles.GL10
|
||||||
|
|
||||||
@@ -67,6 +68,12 @@ class Cocos2dxRenderer : GLSurfaceView.Renderer {
|
|||||||
|
|
||||||
override fun onSurfaceCreated(gl10: GL10?, eglConfig: EGLConfig?) {
|
override fun onSurfaceCreated(gl10: GL10?, eglConfig: EGLConfig?) {
|
||||||
nativeInit(screenWidth, screenHeight)
|
nativeInit(screenWidth, screenHeight)
|
||||||
|
|
||||||
|
if (Native.isGeodeLoaded && !Native.isInitRun) {
|
||||||
|
Native.postGameInit()
|
||||||
|
Native.isInitRun = true
|
||||||
|
}
|
||||||
|
|
||||||
lastTickInNanoSeconds = System.nanoTime()
|
lastTickInNanoSeconds = System.nanoTime()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user