MCPcopy Create free account
hub / github.com/SFML/SFML / openDisplay

Function openDisplay

src/SFML/Window/Unix/Display.cpp:57–77  ·  view source on GitHub ↗

///////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

55{
56////////////////////////////////////////////////////////////
57std::shared_ptr<Display> openDisplay()
58{
59 const std::lock_guard lock(UnixDisplayImpl::mutex);
60
61 auto sharedDisplay = UnixDisplayImpl::weakSharedDisplay.lock();
62 if (!sharedDisplay)
63 {
64 sharedDisplay.reset(XOpenDisplay(nullptr), XCloseDisplay);
65 UnixDisplayImpl::weakSharedDisplay = sharedDisplay;
66
67 // Opening display failed: The best we can do at the moment is to output a meaningful error message
68 // and cause an abnormal program termination
69 if (!sharedDisplay)
70 {
71 err() << "Failed to open X11 display; make sure the DISPLAY environment variable is set correctly" << std::endl;
72 std::abort();
73 }
74 }
75
76 return sharedDisplay;
77}
78
79
80////////////////////////////////////////////////////////////

Callers 15

WindowImplX11.cppFile · 0.85
ewmhSupportedFunction · 0.85
WindowImplX11Method · 0.85
setWindowGroupIdsMethod · 0.85
GlxContextMethod · 0.85
ClipboardImplMethod · 0.85
getAtomFunction · 0.85
createVulkanSurfaceMethod · 0.85
isMouseButtonPressedFunction · 0.85
getMousePositionFunction · 0.85
setMousePositionFunction · 0.85
getFullscreenModesMethod · 0.85

Calls 1

resetMethod · 0.80

Tested by

no test coverage detected