summaryrefslogtreecommitdiff
path: root/EGL/yagl_image.h
blob: d87ec84c3ce488bbcbfb8172cc8c9a5e594a15ec (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
#ifndef _YAGL_IMAGE_H_
#define _YAGL_IMAGE_H_

#include "yagl_export.h"
#include "yagl_types.h"
#include "yagl_resource.h"
#include <X11/X.h>
#include "EGL/egl.h"
#include "EGL/eglext.h"
#include "GLES2/gl2.h"
#include "GLES2/gl2ext.h"
#include "yagl_gles_image.h"

struct yagl_display;

struct yagl_image
{
    struct yagl_resource res;

    struct yagl_display *dpy;

    Pixmap x_pixmap;

    struct yagl_gles_image gles_image;

    void (*update)(struct yagl_image */*image*/);
};

void yagl_image_init(struct yagl_image *image,
                     yagl_ref_destroy_func destroy_func,
                     yagl_host_handle handle,
                     struct yagl_display *dpy,
                     Pixmap x_pixmap);

void yagl_image_cleanup(struct yagl_image *image);

EGLImageKHR yagl_image_get_handle(struct yagl_image *image);

/*
 * Passing NULL won't hurt, this is for convenience.
 */
void yagl_image_acquire(struct yagl_image *image);

/*
 * Passing NULL won't hurt, this is for convenience.
 */
void yagl_image_release(struct yagl_image *image);

#endif