任何Android模拟器都支持OpenGL ES顶点阵列对象吗?

Cyp*_*eld 14 c++ android opengl-es android-emulator

我一直在尝试运行使用Android NDK在C++中使用VAO并在模拟器上运行的代码.我希望能够使用glDeleteVertexArraysOES,glGenVertexArraysOESglBindVertexArrayOES.

我发现模拟器无法运行代码,即使我使用OpenGL ES 2并使用此解决方案动态链接扩展:Android OpenGL ES 2.0中是否支持使用扩展的顶点数组对象?

我运行glGetString(GL_EXTENSIONS)了运行API Level 19和GPU加速的Nexus 4仿真器并获得了以下信息:

GL_EXT_debug_marker
GL_OES_EGL_image
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
Run Code Online (Sandbox Code Playgroud)

我假设我需要看到GL_OES_vertex_array_object才能使用顶点数组对象.因此,对于那个特定的模拟器来说,这似乎是不可取的.

你知道在任何现有的Android模拟器(第三方或其他)上是否可以在OpenGL ES中使用顶点数组对象?如果是这样,怎么样?

Nov*_*ile 0

Genymotion 的 Nexus 5 Android 5.1.0 API 22 虚拟设备仅报告 OpenGL ES 版本 2.0支持。

\n\n

您可以使用下面的代码来检查未来系统映像和模拟器的支持:

\n\n
package com.example.opengltest;\n\nimport android.app.Activity;\nimport android.app.ActivityManager;\nimport android.content.Context;\nimport android.content.pm.ConfigurationInfo;\nimport android.os.Bundle;\nimport android.util.Log;\nimport android.widget.Toast;\n\npublic class OpenGLESVersionActivity extends Activity {\n\n    private static final String TAG = "OpenGLESVersionActivity";\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        final ActivityManager activityManager =\n                (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);\n        final ConfigurationInfo configurationInfo =\n                activityManager.getDeviceConfigurationInfo();\n        String versionText = "Device Supported OpenGL ES Version = " + configurationInfo.getGlEsVersion();\n        Toast.makeText(this, versionText, Toast.LENGTH_LONG).show();\n        Log.d(TAG, versionText);\n    }\n\n}\n
Run Code Online (Sandbox Code Playgroud)\n\n

它来自Android模拟器是否支持OpenGL ES 3.0?

\n\n
\n\n

需要将参数更改为模拟器

\n\n

1)您需要编辑模拟器映像,进入硬件部分,添加 \xe2\x80\x9cGPU Emulation\xe2\x80\x9d 并将其设置为 true。

\n\n

2)\xe2\x80\x99s 模拟器存在一个错误,使得此行: \xe2\x80\x9cfinal booleansupportsEs2 = configurationInfo.reqGlEsVersion >= 0\xc3\x9720000;\xe2\x80\x9d 不起作用。它总是返回 false。您可以添加 \xe2\x80\x9c|| Build.FINGERPRINT.startsWith(\xe2\x80\x9cgeneric\xe2\x80\x9d)\xe2\x80\x9d 或简单地注释掉这些检查并假设在模拟器上运行时支持 OpenGL ES 2。

\n\n

3) 如果它因 \xe2\x80\x9cno config found\xe2\x80\x9d 而崩溃,请尝试在调用 \xe2\x80\x9csetRenderer(\xe2\x80\xa6)\xe2\x80\x9d 之前添加此行: \xe2\x80\x9cglSurfaceView.setEGLConfigChooser(8 , 8, 8, 8, 16, 0);\xe2\x80\x9d

\n\n

尝试这个。

\n