Search code examples
c++namespacesdirectxabstraction

Hide DirectX namespace inside my namespace


I want enable colors from DirectX::Colors in my program, but without giving out that DirectX is used, so i'm trying this:

namespace Colors
{
    using namespace DirectX::Colors;
}

I hoped it would allow me to use e.g. Colors::Blue, but it doesn't. How can i do it?


Solution

  • To use namespace alias:

    namespace Colors = DirectX::Colors;
    

    and then Colors::...