Android工作室LibGDX

时间:2017-01-26 22:47:05

标签: java android libgdx

抱歉,如果这个问题非常模糊,但最近试图在Android工作室使用LibGDX制作游戏并提供指导

https://www.youtube.com/watch?v=rzBVTPaUUDg&list=PLZm85UZQLd2TPXpUJfDEdWTSgszionbJy

一切似乎都很好,因为它可以在桌面启动器上运行,但是当我厌倦了在Android模拟器上启动游戏应用程序时,该应用程序根本无法打开并立即声明"应用程序终止&#34 ;.

以某种方式总结这个问题,在libgdx上创建的所有内容在桌面启动器上工作正常,就像youtuber一样,但是当我需要它在Android模拟器上运行时,它不起作用。

这是错误消息:

01/27 06:36:30: Launching android
$ adb push C:\Users\Lenovo\Desktop\TestGame\TGame\android\build\outputs\apk\android-debug.apk /data/local/tmp/com.kyh.game
$ adb shell pm install -r "/data/local/tmp/com.kyh.game"

Success

$ adb shell am start -n "com.kyh.game/com.kyh.game.AndroidLauncher" 
-a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Client not ready yet..Waiting for process to come online
Waiting for process to come online

Connected to process 2395 on device emulator-5554
I/AndroidInput: sensor listener setup
I/OpenGLRenderer: Initialized EGL, version 1.4
D/OpenGLRenderer: Swap behavior 1

                  [ 01-26 22:37:34.185  2395: 2424 D/         ]
                  HostConnection::get() New Host Connection established 0x7f235f7cbd60, tid 2424
W/GL2JNIView: creating OpenGL ES 2.0 context
W/GL2JNIView: Returning a GLES 2 context
E/EGL_emulation: tid 2427: eglSurfaceAttrib(1174): error 0x3009 (EGL_BAD_MATCH)
W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0x7f2362271940, error=EGL_BAD_MATCH
I/GL2: all initialized 2
I/AndroidGraphics: OGL renderer: Android Emulator OpenGL ES Translator (Intel(R) HD Graphics 4600)
I/AndroidGraphics: OGL vendor: Google (Intel)
I/AndroidGraphics: OGL version: OpenGL ES 2.0 (4.3.0 - Build 10.18.14.4029)
I/AndroidGraphics: OGL extensions: GL_EXT_debug_marker GL_OES_EGL_image 
GL_OES_EGL_image_external GL_OES_depth24 GL_OES_depth32 
GL_OES_element_index_uint GL_OES_texture_float GL_OES_texture_float_linear 
GL_OES_compressed_paletted_texture GL_OES_compressed_ETC1_RGB8_texture 
GL_OES_depth_texture GL_OES_texture_half_float GL_OES_texture_half_float_linear     
GL_OES_packed_depth_stencil GL_OES_vertex_half_float GL_OES_texture_npot 
GL_OES_rgb8_rgba8 ANDROID_EMU_CHECKSUM_HELPER_v1 
E/EGL_emulation: [getAttribValue] Bad attribute idx
E/EGL_emulation: tid 2424: eglGetConfigAttrib(815): error 0x3004 (EGL_BAD_ATTRIBUTE)
E/EGL_emulation: [getAttribValue] Bad attribute idx
E/EGL_emulation: tid 2424: eglGetConfigAttrib(815): error 0x3004 
(EGL_BAD_ATTRIBUTE)    
I/AndroidGraphics: framebuffer: (5, 6, 5, 0)
I/AndroidGraphics: depthbuffer: (16)
I/AndroidGraphics: stencilbuffer: (0)
I/AndroidGraphics: samples: (0)
I/AndroidGraphics: coverage sampling: (false)
I/AndroidGraphics: Managed meshes/app: { }
I/AndroidGraphics: Managed textures/app: { }
I/AndroidGraphics: Managed cubemap/app: { }
I/AndroidGraphics: Managed shaders/app: { }
I/AndroidGraphics: Managed buffers/app: { }
Application terminated.

1 个答案:

答案 0 :(得分:0)

根据官方OpenGL documentation

如果在掩码中设置了除三个定义位之外的任何位,glClear将生成GL_INVALID_VALUE。

所以,我会仔细检查你的glClear句子。