开发者

How to ask OpenGL for graphics device Capabilities (texture2DArray, supported anti-aliasing modes)

We are using OpenTK, C# and visual studio 2010. We need to ask the graphics device if it supports textu开发者_JS百科re2DArray's, and what anti-aliasing modes it may support. Any help will be appreciated.


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)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜