summaryrefslogtreecommitdiff
path: root/EGL/yagl_backend.h
blob: f884f0bd1a5b5a76825e6aa33b6aef4e0714aa50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef _YAGL_BACKEND_H_
#define _YAGL_BACKEND_H_

#include "yagl_export.h"
#include "yagl_types.h"
#include "yagl_native_types.h"
#include "EGL/egl.h"

struct yagl_display;
struct yagl_surface;
struct yagl_image;
struct yagl_native_platform;
struct yagl_native_drawable;
struct wl_resource;

struct yagl_backend
{
    struct yagl_display *(*create_display)(struct yagl_native_platform */*platform*/,
                                           yagl_os_display /*os_dpy*/,
                                           yagl_host_handle /*host_dpy*/);

    /*
     * Takes ownership of 'native_window'.
     */
    struct yagl_surface *(*create_window_surface)(struct yagl_display */*dpy*/,
                                                  yagl_host_handle /*host_config*/,
                                                  struct yagl_native_drawable */*native_window*/,
                                                  const EGLint */*attrib_list*/);

    /*
     * Takes ownership of 'native_pixmap'.
     */
    struct yagl_surface *(*create_pixmap_surface)(struct yagl_display */*dpy*/,
                                                  yagl_host_handle /*host_config*/,
                                                  struct yagl_native_drawable */*native_pixmap*/,
                                                  const EGLint */*attrib_list*/);

    struct yagl_surface *(*create_pbuffer_surface)(struct yagl_display */*dpy*/,
                                                   yagl_host_handle /*host_config*/,
                                                   const EGLint */*attrib_list*/);

    /*
     * Takes ownership of 'native_pixmap'.
     */
    struct yagl_image *(*create_image_pixmap)(struct yagl_display */*dpy*/,
                                              yagl_host_handle /*host_context*/,
                                              struct yagl_native_drawable */*native_pixmap*/,
                                              const EGLint */*attrib_list*/);

    struct yagl_image *(*create_image_wl_buffer)(struct yagl_display */*dpy*/,
                                                 yagl_host_handle /*host_context*/,
                                                 struct wl_resource */*buffer*/,
                                                 const EGLint */*attrib_list*/);

    void (*destroy)(struct yagl_backend */*backend*/);

    EGLint y_inverted;
};

struct yagl_backend *yagl_get_backend();

#endif