获取GPU信息在Android上没有SurfaceView [英] Get GPU info on Android without SurfaceView
问题描述
在Android上,有没有办法让GPU的信息,而无需创建一个SurfaceView?我不希望绘制使用OpenGL什么,但我只需要得到这样的供应商,OpenGL ES版本,可扩展等硬件信息。
On Android, is there a way to get GPU information without creating a SurfaceView? I'm not looking to draw anything using OpenGL, but I just need to get hardware information like vendor, OpenGL ES version, extensions available etc.
推荐答案
我很抱歉,我不知道该怎么办了Android但功能glGetString允许您访问OpenGL的信息。下面是一个示例C ++风格$ C $您的硬件,我希望你能够适应到Android将支持输出扩展C:
I am sorry I am not sure how to do that with Android but the function glGetString allows you to access the OpenGL information. Here is a sample C++ style code that will output the extensions supported by your hardware that I hope you'll be able to adapt to Android:
void PrettyPrintExtensions(){
std::string extensions = (const char*) glGetString(GL_EXTENSIONS);
char* extensionStart = &extensions[0];
char** extension = &extensionStart;
std::cout << "Supported OpenGL ES Extensions:" << std::endl;
while (*extension)
std::cout << '\t' << strsep(extension, " ") << std::endl;
std::cout << std::endl;
}
通过改变glGetString您还可以访问卖方,渲染器和版本的参数。
请参阅:
By changing the parameter of glGetString you can also access the Vendor, renderer and version. Please see:
http://www.khronos.org/opengles/ SDK / 1.1 /文档/人/ glGetString.xml
这篇关于获取GPU信息在Android上没有SurfaceView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!