The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

c/client: Tidy and reorg flow in egl create function

+24 -5
+24 -5
src/xrt/compositor/client/comp_egl_client.c
··· 269 269 { 270 270 log_level = debug_get_log_option_egl_log(); 271 271 272 + 273 + /* 274 + * Init EGL functions 275 + */ 276 + 272 277 gladLoadEGL(display, get_gl_procaddr); 273 278 274 279 if (config == EGL_NO_CONFIG_KHR && !EGL_KHR_no_config_context) { ··· 279 284 // On Android this extension is 'hidden'. 280 285 ensure_native_fence_is_loaded(display, get_gl_procaddr); 281 286 287 + 288 + /* 289 + * Get client type. 290 + */ 291 + 292 + EGLint egl_client_type; 293 + if (!eglQueryContext(display, context, EGL_CONTEXT_CLIENT_TYPE, &egl_client_type)) { 294 + return XRT_ERROR_OPENGL; 295 + } 296 + 297 + 298 + /* 299 + * Make current. 300 + */ 301 + 282 302 // Save old EGL display, context and drawables. 283 303 struct client_egl_context old = {0}; 284 304 save_context(&old); ··· 296 316 return XRT_ERROR_OPENGL; 297 317 } 298 318 299 - EGLint egl_client_type; 300 - if (!eglQueryContext(display, context, EGL_CONTEXT_CLIENT_TYPE, &egl_client_type)) { 301 - restore_context(&old); 302 - return XRT_ERROR_OPENGL; 303 - } 319 + 320 + /* 321 + * Load GL functions. 322 + */ 304 323 305 324 switch (egl_client_type) { 306 325 case EGL_OPENGL_API: