views:

29

answers:

1

We are using OpenTK, C# and visual studio 2010. We need to ask the graphics device if it supports texture2DArray's, and what anti-aliasing modes it may support. Any help will be appreciated.

+1  A: 

The original support for texture arrays is part of GL_EXT_texture_array. This has been rolled in to OpenGL Core as part of version 3.0.

So you can check that your OpenGL version is greater or equal to 3.0, or that the extension string contains GL_EXT_TEXTURE_ARRAY. To be complete, you need to do the 2 tests, as support could be exposed through either means (or you can decide to run only on OpenGL 3.0 capable devices).

For the multi-sampling question, it's rather trickier. multi-sampling has historically been done at the platform level, since it was associated with the framebuffer properties. I'm assuming you're targeting GL on windows, but I'm not aware of exactly how this is done in c#.

Check out http://www.opengl.org/wiki/Multisampling for the rather convoluted ways of doing this for the initial framebuffer in C.

Now... Since framebuffer objects were introduced, the core GL also has the capability to allocate framebuffers, including multi-sampled surfaces (section 4.4 in the Core 3.0). If you use this functionality, then the allocation is done with glRenderbufferStorageMultisample, and the maximum number of samples that is supported is returned through glGetIntegerv(GL_MAX_SAMPLES)

Bahbar
That was very helpful, thanks alot!
Daniel