b4cbdb0844f6ed12a8c3001d028a1d63c7681c04
[libpicofe.git] / gl.h
1 #ifndef LIBPICOFE_GL_H
2 #define LIBPICOFE_GL_H
3
4 #ifdef HAVE_GLES
5
6 int  gl_init(void *display, int *quirks);
7 int  gl_create(void *window, int *quirks, int w, int h);
8 void gl_announce(void);
9 int  gl_flip_v(const void *fb, int w, int h, const float *vertices);
10 int  gl_flip(const void *fb, int w, int h);
11 void gl_clear(void);
12 void gl_destroy(void);
13 void gl_shutdown(void);
14
15 /* for external flips */
16 extern void *gl_es_display;
17 extern void *gl_es_surface;
18
19 #else
20
21 static __inline int gl_init(void *display, int *quirks)
22 {
23   return -1;
24 }
25
26 static __inline int gl_create(void *window, int *quirks, int w, int h)
27 {
28   return -1;
29 }
30 static __inline void gl_announce(void)
31 {
32 }
33 static __inline int gl_flip_v(const void *fb, int w, int h, const float *vertices)
34 {
35   return -1;
36 }
37 static __inline int gl_flip(const void *fb, int w, int h)
38 {
39   return -1;
40 }
41 static __inline void gl_clear(void) {}
42 static __inline void gl_destroy(void) {}
43 static __inline void gl_shutdown(void) {}
44
45 #define gl_es_display (void *)0
46 #define gl_es_surface (void *)0
47
48 #endif
49
50 #define GL_QUIRK_ACTIVATE_RECREATE 1
51 #define GL_QUIRK_SCALING_NEAREST 2
52 #define GL_QUIRK_VSYNC_ON 4
53
54 #endif // LIBPICOFE_GL_H