问题
What is the best way to detect if a graphics card and compiled openGL binary supports textures which are not a power of 2 at run time?
回答1:
You can check with glGet
for ARB_texture_non_power_of_two or use GLEW.
Edit to reflect the comments: As of OpenGL 2.0 this feature is required and ARB_texture_non_power_of_two need not be defined. How to find the current version is described here. As Jerry points out: Depending on the GPU the feature might be implemented in software and the performance wont be great if you use textures with a non-power-of-two size.
来源:https://stackoverflow.com/questions/3046597/how-to-detect-if-opengl-card-supports-non-power-of-2