Is there a way to check if Android device supports openGL ES 2.0?

后端 未结 7 1041
轻奢々
轻奢々 2020-12-02 23:16

I need to check dynamically if the used device supports openGL ES 2.0. How can i do that?

7条回答
  •  清歌不尽
    2020-12-02 23:57

    For a while, I've been looking for the same answer, too. But unfortunately, I couldn't find a proper description for that. I just found a way a minute ago by myself, and I feel like I'd like to share it with everyone.

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    
        FeatureInfo[] list = this.getPackageManager()
                .getSystemAvailableFeatures();
    
        Toast.makeText(this,
                "OpenGL ES Version: " + list[list.length - 1].getGlEsVersion(),
                Toast.LENGTH_LONG).show();
    }
    

提交回复
热议问题