/**************************************************************************** +** Copyright (c) 2022, 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/global.h" #ifdef MAYO_OS_WINDOWS # include #endif #include "../base/occ_handle.h" #include #include #if defined(MAYO_OS_WINDOWS) # include # include #elif defined(MAYO_OS_MAC) # include #elif defined(MAYO_OS_ANDROID) # include #else # include #endif namespace Mayo { OccHandle graphicsCreateVirtualWindow(const OccHandle& gfxDriver, int wndWidth, int wndHeight) { #if defined(MAYO_OS_WINDOWS) MAYO_UNUSED(gfxDriver); // Create a "virtual" WNT window being a pure WNT window redefined to be never shown static OccHandle wClass; if (wClass.IsNull()) { auto cursor = LoadCursor(NULL, IDC_ARROW); wClass = new WNT_WClass("GW3D_Class", nullptr, CS_VREDRAW | CS_HREDRAW, 0, 0, cursor); } auto wnd = new WNT_Window("", wClass, WS_POPUP, 0, 0, wndWidth, wndHeight, Quantity_NOC_BLACK); #elif defined(MAYO_OS_MAC) MAYO_UNUSED(gfxDriver); auto wnd = new Cocoa_Window("", 0, 0, wndWidth, wndHeight); #elif defined(MAYO_OS_ANDROID) MAYO_UNUSED(gfxDriver); auto wnd = new Aspect_NeutralWindow; wnd->SetSize(wndWidth, wndHeight); #else auto displayConn = gfxDriver->GetDisplayConnection(); auto wnd = new Xw_Window(displayConn, "", 0, 0, wndWidth, wndHeight); #endif wnd->SetVirtual(true); return wnd; } } // namespace Mayo