aboutsummaryrefslogtreecommitdiff
path: root/09-september/tomcat/not_in_use/fbo.h
blob: 244cb7f2e7d38f81a3c7f1561ecdd931beb3f89d (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
32
33
34
35
#ifndef FBO_H
#define FBO_H

#include "../shared.h"

struct _Texture;

typedef struct _Fbo
{
    char _name[MAX_PATH_LENGTH];

    GLuint frame_buffer; /** Actual fbo object**/

    /** color_texture when you want to render to a
        texture and color_buffer when you want to render
        to a RenderBuffer **/
    struct _Texture *color_textures[8];
    GLuint color_buffer[8];
    GLenum color_format;

    struct _Texture *depth_texture;
    GLuint depth_buffer;
    GLenum depth_format;

    GLint width;
    GLint height;
} Fbo;

extern Fbo *fbo_new(const char *name, GLint width, GLint height);
extern void fbo_attach_buffer(Fbo *fbo, GLenum format, int index);
extern void fbo_attach_texture(Fbo *fbo, struct _Texture *t, GLenum attachment);
extern void fbo_bind(Fbo *fbo);
extern void fbo_purge(Fbo *fbo);

#endif // FBO_H