Go to the source code of this file.
Data Structures | |
struct | r_viewport_t |
struct | r_framebuffer_t |
Functions | |
void | R_InitFBObjects (void) |
void | R_ShutdownFBObjects (void) |
Delete all registered framebuffer and render buffer objects, clear memory. | |
r_framebuffer_t * | R_CreateFramebuffer (int width, int height, int ntextures, qboolean depth, qboolean halfFloat, unsigned int *filters) |
create a new framebuffer object | |
void | R_DeleteFBObject (r_framebuffer_t *buf) |
Delete framebuffer object along with attached render buffer. | |
void | R_SetupViewport (r_framebuffer_t *buf, int x, int y, int width, int height) |
Sets the framebuffer dimensions of the viewport. | |
void | R_UseViewport (const r_framebuffer_t *buf) |
Set the viewport to the dimensions of the given framebuffer. | |
void | R_UseFramebuffer (const r_framebuffer_t *buf) |
bind specified framebuffer object so we render to it | |
void | R_DrawBuffers (int n) |
void | R_BindColorAttachments (int n, unsigned int *attachments) |
qboolean | R_EnableRenderbuffer (qboolean enable) |
qboolean | R_RenderbufferEnabled (void) |
Definition in file r_framebuffer.h.
void R_BindColorAttachments | ( | int | n, | |
unsigned int * | attachments | |||
) |
Definition at line 332 of file r_framebuffer.c.
References rstate_t::activeFramebuffer, Com_DPrintf(), DEBUG_RENDERER, rconfig_t::frameBufferObject, rstate_t::frameBufferObjectsInitialized, cvar_s::integer, rconfig_t::maxDrawBuffers, r_framebuffer_t::nTextures, r_config, r_postprocess, r_programs, and r_state.
Referenced by R_DrawBuffers(), R_EnableDrawAsGlow(), and R_EnableGlowMap().
r_framebuffer_t* R_CreateFramebuffer | ( | int | width, | |
int | height, | |||
int | ntextures, | |||
qboolean | depth, | |||
qboolean | halfFloat, | |||
unsigned int * | filters | |||
) |
create a new framebuffer object
[in] | width | The width of the framebuffer |
[in] | height | The height of the framebuffer |
[in] | ntextures | The amount of textures for this framebuffer. See also the filters array. |
[in] | depth | Also generate a depth buffer |
[in] | halfFloat | Use half float pixel format |
[in] | filters | Filters for the textures. Must have ntextures entries |
Definition at line 174 of file r_framebuffer.c.
References rconfig_t::anisotropic, r_framebuffer_t::byteFormat, r_framebuffer_t::clearColor, colorAttachments, Com_Printf(), r_framebuffer_t::depth, r_framebuffer_t::fbo, frameBufferObjectCount, rstate_t::frameBufferObjectsInitialized, r_framebuffer_t::height, i, lengthof, rconfig_t::maxAnisotropic, rconfig_t::maxDrawBuffers, Mem_Alloc, r_framebuffer_t::nTextures, r_framebuffer_t::pixelFormat, qtrue, R_CheckError, r_config, R_GetFreeFBOTexture(), R_SetupViewport(), r_state, r_framebuffer_t::textures, Vector4Clear, and r_framebuffer_t::width.
Referenced by R_InitFBObjects().
void R_DeleteFBObject | ( | r_framebuffer_t * | buf | ) |
Delete framebuffer object along with attached render buffer.
Definition at line 122 of file r_framebuffer.c.
References r_framebuffer_t::depth, r_framebuffer_t::fbo, i, Mem_Free, r_framebuffer_t::nTextures, R_FreeFBOTexture(), and r_framebuffer_t::textures.
Referenced by R_ShutdownFBObjects().
void R_DrawBuffers | ( | int | n | ) |
Definition at line 327 of file r_framebuffer.c.
References colorAttachments, and R_BindColorAttachments().
Referenced by R_Draw3DGlobe(), R_EnableDrawAsGlow(), R_EnableGlowMap(), and R_EnableRenderbuffer().
Definition at line 346 of file r_framebuffer.c.
References fbo_render, fbo_screen, rconfig_t::frameBufferObject, rstate_t::frameBufferObjectsInitialized, cvar_s::integer, qfalse, qtrue, r_config, R_DrawBuffers(), r_postprocess, r_programs, r_state, R_UseFramebuffer(), and rstate_t::renderbuffer_enabled.
Referenced by MAP_DrawMap(), R_DrawBloom(), R_Setup2D(), and R_Setup3D().
void R_InitFBObjects | ( | void | ) |
Definition at line 61 of file r_framebuffer.c.
References rstate_t::activeFramebuffer, rstate_t::buffers0, rstate_t::buffers1, rstate_t::buffers2, r_framebuffer_t::clearColor, colorAttachments, r_framebuffer_t::depth, DOWNSAMPLE_PASSES, DOWNSAMPLE_SCALE, r_framebuffer_t::fbo, fbo_bloom0, fbo_bloom1, rconfig_t::frameBufferObject, frameBufferObjectCount, rstate_t::frameBufferObjectsInitialized, frameBufferTextures, GLenum, viddef_t::height, r_framebuffer_t::height, i, int(), cvar_s::integer, rconfig_t::maxDrawBuffers, Mem_Alloc, r_framebuffer_t::nTextures, qfalse, qtrue, R_CheckError, r_config, R_CreateFramebuffer(), r_programs, R_SetupViewport(), r_state, rstate_t::renderBuffer, Vector4Clear, viddef, viddef_t::width, and r_framebuffer_t::width.
Referenced by R_Init(), and R_SetMode().
qboolean R_RenderbufferEnabled | ( | void | ) |
Definition at line 364 of file r_framebuffer.c.
References r_state, and rstate_t::renderbuffer_enabled.
Referenced by R_DrawBloom().
void R_SetupViewport | ( | r_framebuffer_t * | buf, | |
int | x, | |||
int | y, | |||
int | width, | |||
int | height | |||
) |
Sets the framebuffer dimensions of the viewport.
[out] | buf | The framebuffer to initialize the viewport for. If NULL the screen buffer will be taken. |
Definition at line 300 of file r_framebuffer.c.
References r_viewport_t::height, r_framebuffer_t::viewport, r_viewport_t::width, r_viewport_t::x, and r_viewport_t::y.
Referenced by R_CreateFramebuffer(), and R_InitFBObjects().
void R_ShutdownFBObjects | ( | void | ) |
Delete all registered framebuffer and render buffer objects, clear memory.
Definition at line 145 of file r_framebuffer.c.
References colorAttachments, frameBufferObjectCount, rstate_t::frameBufferObjectsInitialized, i, Mem_Free, qfalse, R_DeleteFBObject(), r_state, and R_UseFramebuffer().
Referenced by R_SetMode(), and R_Shutdown().
void R_UseFramebuffer | ( | const r_framebuffer_t * | buf | ) |
bind specified framebuffer object so we render to it
[in] | buf | the framebuffer to use, if NULL the screen buffer will be used. |
Definition at line 263 of file r_framebuffer.c.
References rstate_t::activeFramebuffer, r_framebuffer_t::clearColor, colorAttachments, Com_Printf(), r_framebuffer_t::depth, r_framebuffer_t::fbo, rconfig_t::frameBufferObject, rstate_t::frameBufferObjectsInitialized, cvar_s::integer, r_framebuffer_t::nTextures, R_CheckError, r_config, r_postprocess, r_programs, and r_state.
Referenced by R_BlurStack(), R_DrawBloom(), R_EnableBlur(), R_EnableRenderbuffer(), and R_ShutdownFBObjects().
void R_UseViewport | ( | const r_framebuffer_t * | buf | ) |
Set the viewport to the dimensions of the given framebuffer.
[out] | buf | The framebuffer to set the viewport for. If NULL the screen buffer will be taken. |
Definition at line 316 of file r_framebuffer.c.
References rconfig_t::frameBufferObject, rstate_t::frameBufferObjectsInitialized, r_viewport_t::height, cvar_s::integer, r_config, r_postprocess, r_programs, r_state, r_framebuffer_t::viewport, r_viewport_t::width, r_viewport_t::x, and r_viewport_t::y.
Referenced by R_Blur(), R_BlurStack(), and R_DrawBloom().