Get OpenGL max texture size

前端 未结 2 1127
挽巷
挽巷 2021-01-03 05:57

I\'m developing an Android app that\'s going to work with bitmaps extensively and I\'m looking for a reliable way to get the maximum texture size for OpenGL on different dev

相关标签:
2条回答
  • 2021-01-03 06:34

    This will give you the maximum height allowed.

    Canvas canvas = new Canvas();
    canvas.getMaximumBitmapHeight() / 8
    
    0 讨论(0)
  • 2021-01-03 06:45

    try use this code

    int[] maxTextureSize = new int[1];
    GLES10.glGetIntegerv(GL10.GL_MAX_TEXTURE_SIZE, maxTextureSize, 0);
    

    maxTextureSize stores the size limit for decoded image such as 4096x4096, 8192x8192 . Remember to run this piece of code in the MainThread or you will get Zero.

    0 讨论(0)
提交回复
热议问题