// Copyright (c) 2019-2020 Collabora, Ltd.
//
// SPDX-License-Identifier: CC-BY-4.0

include::{generated}/meta/XR_MNDX_egl_enable.adoc[]

*Last Modified Date*::
    2023-12-02
*IP Status*::
    No known IP claims.
*Contributors*::
    Jakob Bornecrantz, Collabora +
    Drew DeVault, Individual +
    Simon Ser, Individual

*Overview*

This extension must be provided by runtimes supporting applications using
the EGL API to create rendering contexts.

* dlink:XR_USE_PLATFORM_EGL

*New Object Types*

*New Flag Types*

*New Enum Constants*

elink:XrStructureType enumeration is extended with:

* ename:XR_TYPE_GRAPHICS_BINDING_EGL_MNDX

*New Enums*

*New Structures*

[open,refpage='XrGraphicsBindingEGLMNDX',type='structs',desc='The graphics binding structure to be passed at session creation to EGL',xrefs='xrCreateSession']
--
The slink:XrGraphicsBindingEGLMNDX structure is defined as:

include::{generated}/api/structs/XrGraphicsBindingEGLMNDX.adoc[]

.Member Descriptions
****
* pname:type is the elink:XrStructureType of this structure.
* pname:next is code:NULL or a pointer to the next structure in a structure
  chain.
  No such structures are defined in core OpenXR or this extension.
* pname:getProcAddress is a valid function pointer to
  sname:eglGetProcAddress.
* pname:display is a valid EGL sname:EGLDisplay.
* pname:config is a valid EGL sname:EGLConfig.
* pname:context is a valid EGL sname:EGLContext.
****

When creating an EGL based slink:XrSession, the application will provide a
pointer to an slink:XrGraphicsBindingEGLMNDX structure in the pname:next
chain of the slink:XrSessionCreateInfo.

The required window system configuration define to expose this structure
type is dlink:XR_USE_PLATFORM_EGL.

include::{generated}/validity/structs/XrGraphicsBindingEGLMNDX.adoc[]
--

*New Functions*

*New Function Pointers*

[open,refpage='PFN_xrEglGetProcAddressMNDX',type='funcpointers',desc='typedef of eglGetProcAddress',xrefs='']
--
include::{generated}/api/funcpointers/PFN_xrEglGetProcAddressMNDX.adoc[]

.Parameter Descriptions
****
* pname:name specifies the name of the function to return.
****

eglGetProcAddress returns the address of the client API or EGL function
named by procname.
For details please see
https://registry.khronos.org/EGL/sdk/docs/man/html/eglGetProcAddress.xhtml
--

*Issues*

*Version History*

* Revision 1, 2020-05-20 (Jakob Bornecrantz)
** Initial draft

* Revision 2, 2023-12-02
** Use `PFN_xrEglGetProcAddressMNDX` to replace `PFNEGLGETPROCADDRESSPROC`
   (for `eglGetProcAddress`).
   Note this does change function pointer attributes on some platforms.
