#include <RE_FrameBuffer.h>
Public Member Functions | |
| RE_FrameBuffer () | |
| ~RE_FrameBuffer () | |
| bool | attachTexture (RE_Render *r, GLuint textureid, RE_GPUType type, int vectorsize, int miplevel=0, RE_BufferAttachment buf=RE_COLOR_BUFFER, int colorbufnum=0) |
| GLuint | createTexture (RE_Render *r, int w, int h, RE_GPUType type, int vectorsize, int miplevel=0, RE_BufferAttachment buf=RE_COLOR_BUFFER, int colorbufnum=0, bool rect=false) |
| GLuint | createRenderBuffer (RE_Render *r, int w, int h, RE_GPUType type, int vectorsize, RE_BufferAttachment buf=RE_COLOR_BUFFER, int colorbufnum=0) |
| void | setResolution (int width, int height) |
| int | getWidth () const |
| int | getHeight () const |
| bool | isValid (RE_Render *r) |
| Returns true if the framebuffer is ready to render. | |
| bool | begin (RE_Render *r, RE_BufferAttachment buf=RE_COLOR_BUFFER, int colorbufnum=0, bool initview=true) |
| void | end (RE_Render *r) |
| void | drawToBuffer (RE_Render *r, RE_BufferAttachment buf=RE_COLOR_BUFFER, int colorbufnum=0) |
| void | drawToBuffers (RE_Render *r, int num, int *bufferlist) |
| bool | readAsyncFromBuffers (RE_Render *r, int num, int *bufferlist) |
| bool | readFromRenderBuffer (RE_Render *r, void *buffer, RE_BufferAttachment buf=RE_COLOR_BUFFER, int colorbufnum=0) |
| bool | detach (RE_Render *r, RE_BufferAttachment buf=RE_COLOR_BUFFER, int colorbufnum=0, bool freeme=false) |
| bool | detachAndFree (RE_Render *r, RE_BufferAttachment buf=RE_COLOR_BUFFER, int colorbufnum=0) |
Static Public Member Functions | |
| static bool | isFrameBufferSupported () |
| static int | getNumColorAttachments () |
| static int | getMaxDrawBuffers (RE_Render *r) |
Definition at line 53 of file RE_FrameBuffer.h.
| RE_FrameBuffer::RE_FrameBuffer | ( | ) |
| RE_FrameBuffer::~RE_FrameBuffer | ( | ) |
| bool RE_FrameBuffer::attachTexture | ( | RE_Render * | r, | |
| GLuint | textureid, | |||
| RE_GPUType | type, | |||
| int | vectorsize, | |||
| int | miplevel = 0, |
|||
| RE_BufferAttachment | buf = RE_COLOR_BUFFER, |
|||
| int | colorbufnum = 0 | |||
| ) |
Attach a texture to the framebuffer. You are still responsible for deleting it.
| bool RE_FrameBuffer::begin | ( | RE_Render * | r, | |
| RE_BufferAttachment | buf = RE_COLOR_BUFFER, |
|||
| int | colorbufnum = 0, |
|||
| bool | initview = true | |||
| ) |
do all rendering between the begin/end statements. Renders to the given attachment. Specify initview = true set the modelview matrix to an orthographic projection the size of the framebuffer, the viewport to the size of the framebuffer, and to push the current GL state (via RE_OGLRender::pushState(1)).
| GLuint RE_FrameBuffer::createRenderBuffer | ( | RE_Render * | r, | |
| int | w, | |||
| int | h, | |||
| RE_GPUType | type, | |||
| int | vectorsize, | |||
| RE_BufferAttachment | buf = RE_COLOR_BUFFER, |
|||
| int | colorbufnum = 0 | |||
| ) |
Create a renderbuffer and attach it to the framebuffer. This will be cleaned up when you delete the render buffer, or call clearAttachment() on it.
| GLuint RE_FrameBuffer::createTexture | ( | RE_Render * | r, | |
| int | w, | |||
| int | h, | |||
| RE_GPUType | type, | |||
| int | vectorsize, | |||
| int | miplevel = 0, |
|||
| RE_BufferAttachment | buf = RE_COLOR_BUFFER, |
|||
| int | colorbufnum = 0, |
|||
| bool | rect = false | |||
| ) |
Create a texture and attach it to the framebuffer. You are still responsible for deleting it. Specify rect = true to create a texture rectangle (check to see that this extension is supported before calling this method).
| bool RE_FrameBuffer::detach | ( | RE_Render * | r, | |
| RE_BufferAttachment | buf = RE_COLOR_BUFFER, |
|||
| int | colorbufnum = 0, |
|||
| bool | freeme = false | |||
| ) |
Removes the attachment, and frees the renderbuffer or texture if freeme is true.
| bool RE_FrameBuffer::detachAndFree | ( | RE_Render * | r, | |
| RE_BufferAttachment | buf = RE_COLOR_BUFFER, |
|||
| int | colorbufnum = 0 | |||
| ) | [inline] |
Definition at line 137 of file RE_FrameBuffer.h.
| void RE_FrameBuffer::drawToBuffer | ( | RE_Render * | r, | |
| RE_BufferAttachment | buf = RE_COLOR_BUFFER, |
|||
| int | colorbufnum = 0 | |||
| ) |
| void RE_FrameBuffer::drawToBuffers | ( | RE_Render * | r, | |
| int | num, | |||
| int * | bufferlist | |||
| ) |
| void RE_FrameBuffer::end | ( | RE_Render * | r | ) |
| int RE_FrameBuffer::getHeight | ( | ) | const [inline] |
Definition at line 94 of file RE_FrameBuffer.h.
| static int RE_FrameBuffer::getMaxDrawBuffers | ( | RE_Render * | r | ) | [static] |
| static int RE_FrameBuffer::getNumColorAttachments | ( | ) | [static] |
| int RE_FrameBuffer::getWidth | ( | ) | const [inline] |
Definition at line 93 of file RE_FrameBuffer.h.
| static bool RE_FrameBuffer::isFrameBufferSupported | ( | ) | [static] |
| bool RE_FrameBuffer::isValid | ( | RE_Render * | r | ) |
Returns true if the framebuffer is ready to render.
| bool RE_FrameBuffer::readAsyncFromBuffers | ( | RE_Render * | r, | |
| int | num, | |||
| int * | bufferlist | |||
| ) |
| bool RE_FrameBuffer::readFromRenderBuffer | ( | RE_Render * | r, | |
| void * | buffer, | |||
| RE_BufferAttachment | buf = RE_COLOR_BUFFER, |
|||
| int | colorbufnum = 0 | |||
| ) |
reads the data from the render buffer specified into 'buffer'. 'buffer' must be large enough to contain the full renderbuffer size.
| void RE_FrameBuffer::setResolution | ( | int | width, | |
| int | height | |||
| ) |
You must call this if attaching textures (if you are creating textures, the resulotion of the textures you pass is used).
1.5.9