29 #ifndef RE_OGLFramebuffer_h
30 #define RE_OGLFramebuffer_h
39 class re_FrameBufferAttachment;
81 const char *
getName() {
return myName.isstring()?(
const char *)myName:
""; }
121 int colorbufnum = 0);
125 int colorbufnum = 0);
128 int colorbufnum = 0);
131 int colorbufnum = 0);
138 int colorbufnum = 0);
142 bool verifyBufferAttachment(
RE_Render *r,
165 static const char *getFBOErrorMessage(
RE_FBOStatus status);
171 bool bind(
RE_Render *r,
bool for_draw =
true);
176 bool switch_only =
false,
177 bool restore_ms =
true);
185 int colorbufnum = 0,
bool initview =
true);
191 int colorbufnum = 0);
201 int colorbufnum = 0);
204 int colorbufnum = 0);
209 void drawToBuffers(
RE_Render *r,
int num,
const int *bufferlist);
228 bool readAsyncFromBuffers(
RE_Render *r,
int num,
int *bufferlist);
234 int colorbufnum = 0);
251 bool freeme =
false);
256 {
return detach( r, buffer_type, colorbufnum ,
true); }
272 RE_BufferBindMode bindmode = RE_BIND_DRAW);
278 bool initImpl(
RE_Render *r,
bool generate);
281 re_FrameBufferAttachment *attach,
285 bool hasColorBuffer()
const;
286 bool hasDepthBuffer()
const;
289 RE_BufferBindMode bindmode = RE_BIND_DRAW);
293 unsigned getGLBuffer()
const;
303 RE_BufferBindMode myOpenMode;
309 int myDrawBuffersMask;
311 bool myPrevMultisample;
312 bool mySavedMultisample;
330 void setFormat(
RE_GPUType data_type,
int vectorsize);
331 void setResolution(
int w,
int h);
342 {
return myFormatType; }
bool detachAndFree(RE_Render *r, RE_BufferAttachment buffer_type=RE_COLOR_BUFFER, int colorbufnum=0)
GT_API const UT_StringHolder filename
virtual bool init(RE_Render *r)=0
GLenum GLsizei GLenum GLenum const void * image
GLuint const GLchar * name
GLubyte GLubyte GLubyte GLubyte w
void interruptDraw(RE_Render *r)
GLint GLsizei GLsizei height
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint getID() const
Raw GL ID of the FBO.
GLfloat GLfloat GLfloat GLfloat h
void resumeDraw(RE_Render *r)
RE_GPUType getFormatType() const
bool isActiveDraw()
Returns true if the framebuffer is being drawn to.