Sign in to follow this  
chronozphere

GL_NV_draw_buffers on Android/Tegra. Where can I find the headers?

Recommended Posts

chronozphere    144
Hi,

I would like to use the gl_nv_draw_buffers extension, which should be available on all tegra devices. I found the following header file:

[font="arial, sans-serif"][color="#009933"][size=1][size=4][url="http://www.khronos.org/registry/gles/api/2.0/gl2ext.h"]http://www.khronos.org/registry/gles/api/2.0/gl2ext.h[/url][/size][/size][/color][/font]

However, I'm not sure how to use this, as it is not part of android. The official NDK doesn't contain a version of gl2ext.h which defines gl_nv_draw_buffers.

I would like to know where to get the official headers as used by NVidia. Also, I would like to know how to use these properly. Should I put them in the android-ndk/platform directory somewhere?

Thanks a bunch! Edited by chronozphere

Share this post


Link to post
Share on other sites
Hodgman    51334
The way that GL extensions work, is that you won't usually find them in your standard GL headers ([i]otherwise they'd be standard, not extensions [img]http://public.gamedev.net//public/style_emoticons/default/wink.png[/img][/i]).
You can read the background on the idea here: [url="http://www.opengl.org/archives/resources/features/OGLextensions/"]http://www.opengl.or.../OGLextensions/[/url]

I'm not sure if nVidia supplies "official" headers for their extensions, but anyone can make their own header by following the instructions in the official txt description of the extension. There's projects such as GLee and GLEW that take it upon themselves to try and create comprehensive extension headers to simplify this process.

That header that you've linked to ([i]which comes from the official GL authority -- the khronos group[/i]) defines a new "function pointer" type ([font=courier new,courier,monospace]PFNGLDRAWBUFFERSNVPROC[/font]), which is able to hold the address of your [font=courier new,courier,monospace]glDrawBuffersNV[/font] function. The OS will have a mechanism where you can ask for the address of a GL function by name, e.g. "glDrawBuffersNV", and it will return a function pointer. You can then cast this function pointer to the above type, and then call it as if it were a real function.

On Windows, you do this name->function-pointer lookup using the [font=courier new,courier,monospace]wglGetProcAddress[/font] function, I assume android has something similar, but I'm not familiar with it.

[EDIT] These might be of use:
[url="http://stackoverflow.com/questions/6970725/android-opengl-es-all-extensions-supported"]http://stackoverflow...sions-supported[/url]
[url="http://graphicexperiences.wordpress.com/2011/12/01/access-opengl-es-extensions-in-android-2-2-and-early/"]http://graphicexperiences.wordpress.com/2011/12/01/access-opengl-es-extensions-in-android-2-2-and-early/[/url]
It seems Android originally didn't want to allow developers to use vendor-specific extensions... Edited by Hodgman

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this