/**************************************************************************** ** Copyright (c) 2021, Fougue Ltd. ** All rights reserved. ** See license at https://github.com/fougue/mayo/blob/master/LICENSE.txt ****************************************************************************/ // -- // NOTE // This file isolates inclusion of which is problematic on X11/Linux // #defines constants like "None" which causes name clash with GuiDocument::ViewTrihedronMode::None // -- #include "../base/occ_handle.h" #include #include #include namespace Mayo { using FunctionCreateGraphicsDriver = std::function()>; static FunctionCreateGraphicsDriver& getFunctionCreateGraphicsDriver() { static FunctionCreateGraphicsDriver fn = []{ return makeOccHandle(new Aspect_DisplayConnection); }; return fn; } void setFunctionCreateGraphicsDriver(FunctionCreateGraphicsDriver fn) { getFunctionCreateGraphicsDriver() = std::move(fn); } OccHandle graphicsCreateDriver() { const auto& fn = getFunctionCreateGraphicsDriver(); if (fn) return fn(); return {}; } } // namespace Mayo