OGRECave / ogre

scene-oriented, flexible 3D engine (C++, Python, C#, Java)
https://ogrecave.github.io/ogre/
MIT License
4.01k stars 980 forks source link

[D3D11] - Add SDK and runtime versioning system for newer and future SDK versions. #1131

Open TheNicker opened 5 years ago

TheNicker commented 5 years ago

I suggest to add a versioning system that would abstract the Window SDK into "DXGI version" and "D3D version" both for compile time and run-time.

With these one would easily be able to compile against older versions of the SDK using compile time conditions when "unsupported" newer features are used, and choose at run-time to not use newer features if running on an older system.

The gap between WinRT and windows desktop could be minimized and the current messy implementation of the specialized newer D3D11 features could be generalized.

paroj commented 5 years ago

can you provide a (at least prototypic) implementation as a PR for this?

TheNicker commented 5 years ago

If it's merely to understand the requirement please refer to this PR:

https://bitbucket.org/sinbad/ogre/pull-requests/694/direct3d11-support-for-multiple-sdks/diff#chg-RenderSystems/Direct3D11/include/OgreD3D11Prerequisites.h

For usage example please refer to D3D11Renderwindow.CPP or any other files that use the OGRE_DXGIVER[x] constants

It's an old code, nowadays the implementation is much better but I believe it shows the intention.