summaryrefslogtreecommitdiff
path: root/src/modules/evas/engines/wayland_egl/evas_engine.h
blob: a385921e0790431ec3a2a6dbf67a71eb39c8a727 (plain) (blame)
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
63
64
65
66
67
68
69
70
71
72
#ifndef EVAS_ENGINE_H
# define EVAS_ENGINE_H

#include "config.h"
#include "evas_common.h"
#include "evas_private.h"
#include "Evas.h"
#include "Evas_Engine_Wayland_Egl.h"

#include <EGL/egl.h>
#include "evas_gl_common.h"

#include <wayland-egl.h>

extern int _evas_engine_wl_egl_log_dom;
#ifdef ERR
# undef ERR
#endif
#define ERR(...) EINA_LOG_DOM_ERR(_evas_engine_wl_egl_log_dom, __VA_ARGS__)

#ifdef DBG
# undef DBG
#endif
#define DBG(...) EINA_LOG_DOM_DBG(_evas_engine_wl_egl_log_dom, __VA_ARGS__)

#ifdef INF
# undef INF
#endif
#define INF(...) EINA_LOG_DOM_INFO(_evas_engine_wl_egl_log_dom, __VA_ARGS__)

#ifdef WRN
# undef WRN
#endif
#define WRN(...) EINA_LOG_DOM_WARN(_evas_engine_wl_egl_log_dom, __VA_ARGS__)

#ifdef CRIT
# undef CRIT
#endif
#define CRIT(...) EINA_LOG_DOM_CRIT(_evas_engine_wl_egl_log_dom, __VA_ARGS__)

typedef struct _Evas_GL_Wl_Window Evas_GL_Wl_Window;

struct _Evas_GL_Wl_Window
{
   struct wl_display *disp;
   struct wl_surface *surface;
   struct wl_egl_window *win;
   Evas_Coord w, h;
   Eina_Bool alpha : 1;
   int rotation;
   Evas_Engine_GL_Context *gl_context;
   Eina_Bool drawn : 1;
   Eina_Bool surf : 1;
   struct 
     {
        EGLContext context[1];
        EGLSurface surface[1];
        EGLConfig config;
        EGLDisplay disp;
     } egl;
};

Evas_GL_Wl_Window *eng_window_new(struct wl_display *disp, 
                                  struct wl_surface *surface, int screen,
                                   int depth, int w, int h, int indirect,
                                   int alpha, int rot);
void eng_window_free(Evas_GL_Wl_Window *gw);
void eng_window_use(Evas_GL_Wl_Window *gw);
void eng_window_unsurf(Evas_GL_Wl_Window *gw);
void eng_window_resurf(Evas_GL_Wl_Window *gw);

#endif