forked from avilleret/gem-mpv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgemframebuffer.h
110 lines (84 loc) · 2.75 KB
/
gemframebuffer.h
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/*-----------------------------------------------------------------
LOG
GEM - Graphics Environment for Multimedia
render to offscreen buffer and make texture
created 11/27/2005
Copyright (c) 2005-2006 James Tittle II, tigital AT mac DOT com
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution.
-----------------------------------------------------------------*/
#ifndef _INCLUDE__GEM_CONTROLS_GEMFRAMEBUFFER_H_
#define _INCLUDE__GEM_CONTROLS_GEMFRAMEBUFFER_H_
#include "Base/GemBase.h"
#include "Gem/GemGL.h"
#include <iostream>
class mpv;
/*-----------------------------------------------------------------
-------------------------------------------------------------------
CLASS
gemframebuffer
render to offscreen buffer and make texture
DESCRIPTION
"bang" - sends out a state list
-----------------------------------------------------------------*/
class GEM_EXTERN gemframebuffer : public GemBase
{
CPPEXTERN_HEADER(gemframebuffer, GemBase);
friend mpv;
public:
//////////
// Constructor
gemframebuffer(int, t_atom*);
protected:
//////////
// Destructor
~gemframebuffer(void);
//////////
// A render message
void render(GemState *state);
void postrender(GemState *state);
void initFBO(void);
void destroyFBO(void);
//////////
// Set up the modifying flags
void startRendering(void);
//////////
// Clean up the modifying flags
void stopRendering(void);
// extension checks
virtual bool isRunnable(void);
//////////
// change the size dimensions
void dimMess(int width, int height);
//////////
// format-message
virtual void formatMess(std::string);
virtual void typeMess(std::string);
virtual void colorMess(t_symbol*,int argc, t_atom*argv);
virtual void perspectiveMess(t_symbol*,int argc, t_atom*argv);
virtual void rectangleMess(bool mode);
virtual void texunitMess(int mode);
virtual void fixFormat(GLenum wantedFormat);
virtual void printInfo(void);
private:
GLboolean m_haveinit, m_wantinit;
GLuint m_frameBufferIndex;
GLuint m_depthBufferIndex;
GLuint m_offScreenID;
GLuint m_texTarget;
GLuint m_texunit;
int m_width, m_height;
bool m_rectangle; // 1=TEXTURE_RECTANGLE_EXT, 0=TEXTURE_2D
GLenum m_canRectangle; // whichever rectangle formats are supported
int m_internalformat;
int m_format;
GLenum m_wantFormat;
int m_type;
GLint m_vp[4];
GLfloat m_color[4];
GLfloat m_FBOcolor[4];
t_outlet *m_outTexInfo;
GLfloat m_perspect[6];
void bangMess(void);
};
#endif // for header file