When you say that your Tegra 3 device supports GL_EXT_texture_array
but not GL_NV_texture_array
, I'm assuming that you determined that through a call to glGetString(GL_EXTENSIONS)
.
GL_NV_texture_array
is very similar to GL_EXT_texture_array
, just limited to 2d texture arrays. Not surprisingly, it uses many of the same constants as GL_EXT_texture_array, just with different names.
TEXTURE_2D_ARRAY_NV 0x8C1A
TEXTURE_BINDING_2D_ARRAY_NV 0x8C1D
MAX_ARRAY_TEXTURE_LAYERS_NV 0x88FF
FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_NV 0x8CD4
SAMPLER_2D_ARRAY_NV 0x8DC1
TEXTURE_2D_ARRAY_EXT 0x8C1A
TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D
MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF
FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4
SAMPLER_2D_ARRAY_EXT 0x8DC1
This version of gl2ext_nv.h defines the constants for GL_EXT_texture_array
but not for GL_NV_texture_array
, so perhaps nVidia is using the the old name now. If you can't find a more recent version of the header, just include this one.
To gain access to functions offered by GL extensions, use eglGetProcAddress
to assign the function to a function pointer.
// The function pointer, declared in a header.
// You can put this in a class instance or at global scope.
// If the latter, declare it with "extern", and define the actual function
// pointer without "extern" in a single source file.
PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC glFramebufferTextureLayerEXT;
In your function that checks for the presence of the GL_EXT_texture_array extension, if it's found, get the address of the function and store it in your function pointer. With OpenGL-ES, that means asking EGL:
glFramebufferTextureEXT = (PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) eglGetProcAddress("glFramebufferTextureLayerEXT");
Now you can use the function just like it was part of regular OpenGL.