UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
r_framebuffer.h
Go to the documentation of this file.
1 
5 /*
6  Copyright (C) 2008 Victor Luchits
7 
8  This program is free software; you can redistribute it and/or
9  modify it under the terms of the GNU General Public License
10  as published by the Free Software Foundation; either version 2
11  of the License, or (at your option) any later version.
12 
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 
17  See the GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program; if not, write to the Free Software
21  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 */
23 
24 #pragma once
25 
26 typedef struct {
27  int x;
28  int y;
29  int width;
30  int height;
31 } r_viewport_t;
32 
33 typedef struct {
34  int width;
35  int height;
36  int samples;
41  unsigned int depth;
42  unsigned int fbo;
43  int nTextures;
44  unsigned int* textures;
45  unsigned int proxyFBO;
47 
48 
49 void R_InitFBObjects(void);
50 void R_ShutdownFBObjects(void);
51 
52 r_framebuffer_t* R_CreateFramebuffer(int width, int height, int ntextures, bool depth, bool halfFloat, unsigned int* filters);
54 
55 void R_SetupViewport(r_framebuffer_t* buf, int x, int y, int width, int height);
56 void R_UseViewport(const r_framebuffer_t* buf);
57 
58 void R_ResolveMSAA (const r_framebuffer_t* buf);
60 void R_DrawBuffers(unsigned int n);
61 void R_BindColorAttachments(unsigned int n, unsigned int* attachments);
62 bool R_EnableRenderbuffer(bool enable);
63 bool R_RenderbufferEnabled(void);
void R_SetupViewport(r_framebuffer_t *buf, int x, int y, int width, int height)
Sets the framebuffer dimensions of the viewport.
void R_DeleteFBObject(r_framebuffer_t *buf)
Delete framebuffer object along with attached render buffer.
unsigned int * textures
Definition: r_framebuffer.h:44
r_framebuffer_t * R_CreateFramebuffer(int width, int height, int ntextures, bool depth, bool halfFloat, unsigned int *filters)
create a new framebuffer object
void R_BindColorAttachments(unsigned int n, unsigned int *attachments)
Activate draw buffer(s)
void R_DrawBuffers(unsigned int n)
Activate draw buffer(s)
void R_UseFramebuffer(const r_framebuffer_t *buf)
bind specified framebuffer object so we render to it
voidpf void * buf
Definition: ioapi.h:42
unsigned int depth
Definition: r_framebuffer.h:41
unsigned int proxyFBO
Definition: r_framebuffer.h:45
bool R_RenderbufferEnabled(void)
void R_ShutdownFBObjects(void)
Delete all registered framebuffer and render buffer objects, clear memory.
r_viewport_t viewport
Definition: r_framebuffer.h:38
void R_ResolveMSAA(const r_framebuffer_t *buf)
Forces multisample antialiasing resolve on given framebuffer, if needed.
void R_UseViewport(const r_framebuffer_t *buf)
Set the viewport to the dimensions of the given framebuffer.
bool R_EnableRenderbuffer(bool enable)
Enable the render to the framebuffer.
unsigned int fbo
Definition: r_framebuffer.h:42
void R_InitFBObjects(void)
vec_t vec4_t[4]
Definition: ufotypes.h:40