fixed fog regression
[voxscape] / src / glfb.h
1 #ifndef OPENGL_FRAMEBUFFER_H_
2 #define OPENGL_FRAMEBUFFER_H_
3
4 /* show pixels with OpenGL
5  *
6  * Usage example:
7  *   glfb_setup(width, height, GLFB_RGBA32, width * 4);
8  *   ...
9  *   glfb_update(pixels);
10  *   glfb_display();
11  */
12
13 enum glfb_pixel_format {
14         GLFB_IDX8,
15         GLFB_RGB15,             /* 555 */
16         GLFB_RGB16,             /* 565 */
17         GLFB_RGB24,             /* 888 */
18         GLFB_RGBA32             /* 8888 (alpha ignored) */
19 };
20
21 enum glfb_filter {
22         GLFB_NEAREST,
23         GLFB_LINEAR
24 };
25
26 void glfb_setup(int x, int y, enum glfb_pixel_format fmt, int pitch);
27 void glfb_filter(enum glfb_filter filt);
28 void glfb_color(int idx, int r, int g, int b);
29 void glfb_update(void *pixels);
30 void glfb_display(void);
31
32 #endif  /* OPENGL_FRAMEBUFFER_H_ */