diff options
author | Chia-I Wu <[email protected]> | 2010-01-23 00:11:48 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2010-01-23 10:10:47 +0800 |
commit | fe33b7083b0081b91ee338acbe966400c6b9a7b9 (patch) | |
tree | 1f0c26b24e0d625cf9d858f5a678fb0567386db2 /progs/egl/segl/segl.h | |
parent | 2292c93bc0f703d1ebdc2b79b5f525efebe21f1c (diff) |
add segl
Diffstat (limited to 'progs/egl/segl/segl.h')
-rw-r--r-- | progs/egl/segl/segl.h | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/progs/egl/segl/segl.h b/progs/egl/segl/segl.h new file mode 100644 index 00000000000..20faf6ef027 --- /dev/null +++ b/progs/egl/segl/segl.h @@ -0,0 +1,60 @@ +#ifndef _SEGL_H_ +#define _SEGL_H_ + +#include <stdarg.h> +#include <EGL/egl.h> + +struct segl_winsys { + EGLNativeDisplayType dpy; + + EGLNativeWindowType (*create_window)(struct segl_winsys *winsys, + const char *name, + EGLint width, EGLint height, + EGLint visual); + void (*destroy_window)(struct segl_winsys *winsys, EGLNativeWindowType win); + + EGLNativePixmapType (*create_pixmap)(struct segl_winsys *winsys, + EGLint width, EGLint height, + EGLint depth); + void (*destroy_pixmap)(struct segl_winsys *winsys, EGLNativePixmapType pix); + + /* get current time in seconds */ + double (*now)(struct segl_winsys *winsys); + /* log a message. OPTIONAL */ + void (*vlog)(struct segl_winsys *winsys, const char *format, va_list ap); +}; + +struct segl { + EGLBoolean verbose; + + struct segl_winsys *winsys; + + EGLint major, minor; + EGLDisplay dpy; + EGLConfig conf; +}; + +struct segl_winsys * +segl_get_winsys(EGLNativeDisplayType dpy); + +struct segl * +segl_new(struct segl_winsys *winsys, const EGLint *attribs); + +void +segl_destroy(struct segl *segl); + +EGLBoolean +segl_create_window(struct segl *segl, const char *name, + EGLint width, EGLint height, const EGLint *attribs, + EGLNativeWindowType *win_ret, EGLSurface *surf_ret); + +EGLBoolean +segl_create_pixmap(struct segl *segl, + EGLint width, EGLint height, const EGLint *attribs, + EGLNativePixmapType *pix_ret, EGLSurface *surf_ret); + +void +segl_benchmark(struct segl *segl, double seconds, + void (*draw_frame)(void *), void *draw_data); + +#endif /* _SEGL_H_ */ |