In my previous OpenGL projects I’ve always made assumptions about the availability of various capabilities, having the program throw errors if they’re not available. Now I find myself having to write a GL pathway for an existing D3D code-base and I’m struggling to work out how I can fit in with that scheme by providing the equivalent of “caps” for GL. That is to say, I want to provide an implementation of the following:
/* Virtual */
void
Adaptors3dOpenGLWin32::EnumerateInternal()
{
// Call base enumerator to fetch available devices.
Adaptors3dWin32::EnumerateInternal();
// Enumerate all pixel formats.
EnumerateAllPixelFormats();
// Now enumerate all front/back buffer combinations.
EnumerateBackFrontBufferCombinations();
// Enumerate all depth/stencil formats for each combination.
EnumerateDepthStencilFormats();
// Enumerate all multi-sample types.
EnumerateMultiSampleTypes();
// Enumerate all map formats (texture formats).
EnumerateMapFormats();
// Enumerate capabilities.
EnumerateCapabilities();
}
I’ve asked this question in various forms on stackoverflow, but I never seem to get a coherent answer! I’m aware there are some “take it for granted this is supported” capabilities for various GL versions, but I’m not sure how to write a coherent set of functions that will give me the data I need.
Assuming I have an abstract interface, and abstract identifiers for things like R8G8B8A8, etc., how can I populate a data structure with capability details for GL?
If my question is dumb and I need a totally different approach, that would also be a valid answer :p.
Thanks.