aboutsummaryrefslogtreecommitdiff
path: root/src/compositor.h
blob: 3d8d8761993dde991b4012fd568d993c203eb492 (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
#ifndef NGXC_COMPOSITOR_H
#define NGXC_COMPOSITOR_H

#include "window_texture.h"

// TODO: Make dynamic
#define NGXC_COMPOSITOR_MAX_WINDOWS 100

typedef struct {
    WindowTexture texture;
    int x;
    int y;
} ngxc_window;

typedef struct {
    Display *dpy;
    Window composite_window;
    double frame_timer;
    ngxc_window windows[NGXC_COMPOSITOR_MAX_WINDOWS];
    int num_windows;
} ngxc_compositor;

void ngxc_compositor_init(ngxc_compositor *self, Display *dpy, Window composite_window);
void ngxc_compositor_deinit(ngxc_compositor *self);

void ngxc_compositor_add_window(ngxc_compositor *self, Window window);
void ngxc_compositor_remove_window(ngxc_compositor *self, Window window);
void ngxc_compositor_render(ngxc_compositor *self);
void ngxc_compositor_on_configure(ngxc_compositor *self, const XConfigureEvent *configure_event);

#endif /* NGXC_COMPOSITOR_H */