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

Method EglContext

src/SFML/Window/EglContext.cpp:107–126  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

105{
106////////////////////////////////////////////////////////////
107EglContext::EglContext(EglContext* shared)
108{
109 EglContextImpl::ensureInit();
110
111 // Get the initialized EGL display
112 m_display = EglContextImpl::getInitializedDisplay();
113
114 // Get the best EGL config matching the default video settings
115 m_config = getBestConfig(m_display, VideoMode::getDesktopMode().bitsPerPixel, ContextSettings());
116 updateSettings();
117
118 // Note: The EGL specs say that attribList can be a null pointer when passed to eglCreatePbufferSurface,
119 // but this is resulting in a segfault. Bug in Android?
120 static constexpr std::array attribList = {EGL_WIDTH, 1, EGL_HEIGHT, 1, EGL_NONE};
121
122 m_surface = eglCheck(eglCreatePbufferSurface(m_display, m_config, attribList.data()));
123
124 // Create EGL context
125 createContext(shared);
126}
127
128
129////////////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls 4

ensureInitFunction · 0.70
getInitializedDisplayFunction · 0.70
ContextSettingsClass · 0.50
getNativeHandleMethod · 0.45

Tested by

no test coverage detected