summaryrefslogtreecommitdiff
path: root/src/graphics.h
blob: 56d16de06b1c75e361b9ec67a8504687ffcf0b5e (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
#pragma once

#include <EGL/egl.h>
#include <wayland-egl.h>

#include "utils.h"

enum graphics_error_e : u8 {
  GRAPHICS_ERROR_NONE = 0,
  GRAPHICS_ERROR_ACQUIRE_DISPLAY,
  GRAPHICS_ERROR_SELECT_CONFIG,
  GRAPHICS_ERROR_USE_DESKTOP,
  GRAPHICS_ERROR_CREATE_CONTEXT,
};

struct graphics_s {
  EGLDisplay display;
  EGLContext context;
  EGLConfig config;
};

enum graphics_error_e wayc_graphics_init(struct graphics_s* graphics,
                                         struct wlstate_s* state);
void wayc_graphics_deinit(struct graphics_s* graphics);

enum renderer_error_e : u8 {
  RENDERER_ERROR_NONE = 0,
};

struct renderer_s {
  struct graphics_s* graphics;
  wl_egl_window_t window;
  EGLSurface surface;
};