I have been using glGetIntegerv and glGetString to query OpenGL extensions and properties (e.g. max. texture size etc.). Now I want to find out if my device supports float textures:
GLint ext_tex;
glGetIntegerv(GL_HALF_FLOAT_OES, &ext_tex);
Unfortunately this returns “0” for all devices, also those which support float textures. How can I find out if a device supports this texture format? At the moment I am using iOS where iPhone 4S and iPad2 and later support this extension but I would prefer a generic solution instead of deciding based on the device model.
You detect support for an extension by getting the extension string (
glGetString(GL_EXTENSIONS)) and searching for the appropriate extension name. If it’s there, then it’s supported.