#endif
/* Forward declarations to avoid inclusion of GL/glx.h */
-typedef struct _XDisplay Display;
-typedef struct __GLXcontextRec *GLXContext;
+#ifndef GLX_H
+struct _XDisplay;
+struct __GLXcontextRec;
+#endif
/* Forward declarations to avoid inclusion of EGL/egl.h */
+#ifndef __egl_h_
typedef void *EGLDisplay;
typedef void *EGLContext;
+#endif
/** Returned error codes. */
enum {
/**
* Device information returned by Mesa.
*/
-typedef struct _mesa_glinterop_device_info {
+struct mesa_glinterop_device_info {
/* The caller should set this to the version of the struct they support */
+ /* The callee will overwrite it if it supports a lower version.
+ *
+ * The caller should check the value and access up-to the version supported
+ * by the callee.
+ */
/* NOTE: Do not use the MESA_GLINTEROP_DEVICE_INFO_VERSION macro */
uint32_t version;
uint32_t vendor_id;
uint32_t device_id;
- /* The interop version determines what behavior the caller should expect
- * out of all functions.
- *
- * Interop version 1:
- * - mesa_glinterop_export_in is not read beyond "out_driver_data"
- * - mesa_glinterop_export_out is not written beyond "out_driver_data_written"
- * - mesa_glinterop_device_info is not written beyond "interop_version"
- */
- uint32_t interop_version;
/* Structure version 1 ends here. */
-} mesa_glinterop_device_info;
+};
#define MESA_GLINTEROP_EXPORT_IN_VERSION 1
/**
* Input parameters to Mesa interop export functions.
*/
-typedef struct _mesa_glinterop_export_in {
+struct mesa_glinterop_export_in {
/* The caller should set this to the version of the struct they support */
+ /* The callee will overwrite it if it supports a lower version.
+ *
+ * The caller should check the value and access up-to the version supported
+ * by the callee.
+ */
/* NOTE: Do not use the MESA_GLINTEROP_EXPORT_IN_VERSION macro */
uint32_t version;
*/
void *out_driver_data;
/* Structure version 1 ends here. */
-} mesa_glinterop_export_in;
+};
#define MESA_GLINTEROP_EXPORT_OUT_VERSION 1
/**
* Outputs of Mesa interop export functions.
*/
-typedef struct _mesa_glinterop_export_out {
+struct mesa_glinterop_export_out {
/* The caller should set this to the version of the struct they support */
+ /* The callee will overwrite it if it supports a lower version.
+ *
+ * The caller should check the value and access up-to the version supported
+ * by the callee.
+ */
/* NOTE: Do not use the MESA_GLINTEROP_EXPORT_OUT_VERSION macro */
uint32_t version;
/* The number of bytes written to out_driver_data. */
uint32_t out_driver_data_written;
/* Structure version 1 ends here. */
-} mesa_glinterop_export_out;
+};
/**
* \return MESA_GLINTEROP_SUCCESS or MESA_GLINTEROP_* != 0 on error
*/
int
-MesaGLInteropGLXQueryDeviceInfo(Display *dpy, GLXContext context,
- mesa_glinterop_device_info *out);
+MesaGLInteropGLXQueryDeviceInfo(struct _XDisplay *dpy, struct __GLXcontextRec *context,
+ struct mesa_glinterop_device_info *out);
/**
*/
int
MesaGLInteropEGLQueryDeviceInfo(EGLDisplay dpy, EGLContext context,
- mesa_glinterop_device_info *out);
+ struct mesa_glinterop_device_info *out);
/**
* \return MESA_GLINTEROP_SUCCESS or MESA_GLINTEROP_* != 0 on error
*/
int
-MesaGLInteropGLXExportObject(Display *dpy, GLXContext context,
- const mesa_glinterop_export_in *in,
- mesa_glinterop_export_out *out);
+MesaGLInteropGLXExportObject(struct _XDisplay *dpy, struct __GLXcontextRec *context,
+ struct mesa_glinterop_export_in *in,
+ struct mesa_glinterop_export_out *out);
/**
*/
int
MesaGLInteropEGLExportObject(EGLDisplay dpy, EGLContext context,
- const mesa_glinterop_export_in *in,
- mesa_glinterop_export_out *out);
+ struct mesa_glinterop_export_in *in,
+ struct mesa_glinterop_export_out *out);
-typedef int (PFNMESAGLINTEROPGLXQUERYDEVICEINFOPROC)(Display *dpy, GLXContext context,
- mesa_glinterop_device_info *out);
+typedef int (PFNMESAGLINTEROPGLXQUERYDEVICEINFOPROC)(struct _XDisplay *dpy, struct __GLXcontextRec *context,
+ struct mesa_glinterop_device_info *out);
typedef int (PFNMESAGLINTEROPEGLQUERYDEVICEINFOPROC)(EGLDisplay dpy, EGLContext context,
- mesa_glinterop_device_info *out);
-typedef int (PFNMESAGLINTEROPGLXEXPORTOBJECTPROC)(Display *dpy, GLXContext context,
- const mesa_glinterop_export_in *in,
- mesa_glinterop_export_out *out);
+ struct mesa_glinterop_device_info *out);
+typedef int (PFNMESAGLINTEROPGLXEXPORTOBJECTPROC)(struct _XDisplay *dpy, struct __GLXcontextRec *context,
+ struct mesa_glinterop_export_in *in,
+ struct mesa_glinterop_export_out *out);
typedef int (PFNMESAGLINTEROPEGLEXPORTOBJECTPROC)(EGLDisplay dpy, EGLContext context,
- const mesa_glinterop_export_in *in,
- mesa_glinterop_export_out *out);
+ struct mesa_glinterop_export_in *in,
+ struct mesa_glinterop_export_out *out);
#ifdef __cplusplus
}