MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/FleX / createWindowSurface

Method createWindowSurface

external/egl_setup/egl_setup.cpp:219–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

217}
218
219bool EGLInfo::createWindowSurface(ANativeWindow* window) {
220 // EGL_NATIVE_VISUAL_ID is an attribute of the EGLConfig that is
221 // guaranteed to be accepted by ANativeWindow_setBuffersGeometry().
222 // As soon as we picked a EGLConfig, we can safely reconfigure the
223 // ANativeWindow buffers to match, using EGL_NATIVE_VISUAL_ID.
224 EGLint format;
225 if (!eglGetConfigAttrib(m_display, m_config, EGL_NATIVE_VISUAL_ID, &format)) {
226 EGLLOGE("Fatal error! Failed to get config format!");
227 return false;
228 }
229
230 ANativeWindow_setBuffersGeometry(window, 0, 0, format);
231 m_surface = eglCreateWindowSurface(m_display, m_config, window, NULL);
232
233 return m_surface != NULL;
234}
235
236EGLInfo::EGLInfo() {
237 m_display = EGL_NO_DISPLAY;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected