]> git.sesse.net Git - nageru/blob - mixer.h
Run IWYU (plus lots of manual fiddling).
[nageru] / mixer.h
1 #ifndef _MIXER_H
2 #define _MIXER_H 1
3
4 #include <epoxy/gl.h>
5 #include <functional>
6
7 #include "ref_counted_gl_sync.h"
8
9 class QSurface;
10
11 void start_mixer(QSurface *surface, QSurface *surface2, QSurface *surface3, QSurface *surface4);
12 void mixer_quit();
13
14 enum Source {
15         SOURCE_INPUT1,
16         SOURCE_INPUT2,
17         SOURCE_SBS,
18 };
19 void mixer_cut(Source source);
20
21 struct DisplayFrame {
22         GLuint texnum;
23         RefCountedGLsync ready_fence;  // Asserted when the texture is done rendering.
24 };
25 bool mixer_get_display_frame(DisplayFrame *frame);  // Implicitly frees the previous one if there's a new frame available.
26
27 typedef std::function<void()> new_frame_ready_callback_t;
28 void set_frame_ready_fallback(new_frame_ready_callback_t callback);
29
30 #endif  // !defined(_MIXER_H)