< /p>
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 <<' ' << strsep(extension, "") << std::endl;
std::cout << std::endl;
}
< p>By changing the parameters of glGetString, you can also access Vendor, renderer and version.
Please refer to:
http://www.khronos.org/opengles/sdk/1.1/docs/ man/glGetString.xml
On Android, is there a way to get GPU information without creating a SurfaceView? I don’t plan to use OpenGL to draw anything, but I only need to get hardware information such as vendor, OpenGL ES version, available extensions, etc.
Sorry, I don’t know how to use Android, But the function glGetString allows you to access OpenGL information. Below is a sample C style code, which will output the extensions supported by your hardware, I hope you can 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 <<' ' << strsep (extension, "") << std::endl;
std::cout << std::endl;
}
By changing the parameters of glGetString, you can also access Vendor, renderer and version.
Please refer to:
http://www.khronos.org/opengles/sdk/1.1/docs/man/glGetString.xml