UFO: Alien Invasion
Loading...
Searching...
No Matches
r_framebuffer.h
Go to the documentation of this file.
1
4
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
26typedef struct {
27 int x;
28 int y;
29 int width;
30 int height;
32
33typedef struct {
34 int width;
35 int height;
41 unsigned int depth;
42 unsigned int fbo;
44 unsigned int* textures;
45 unsigned int proxyFBO;
47
48
49void R_InitFBObjects(void);
50void R_ShutdownFBObjects(void);
51
52r_framebuffer_t* R_CreateFramebuffer(int width, int height, int ntextures, bool depth, bool halfFloat, unsigned int* filters);
54
55void R_SetupViewport(r_framebuffer_t* buf, int x, int y, int width, int height);
57
60void R_DrawBuffers(unsigned int n);
61void R_BindColorAttachments(unsigned int n, unsigned int* attachments);
62bool R_EnableRenderbuffer(bool enable);
63bool R_RenderbufferEnabled(void);
voidpf void * buf
Definition ioapi.h:42
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_InitFBObjects(void)
void R_UseFramebuffer(const r_framebuffer_t *buf)
bind specified framebuffer object so we render to it
bool R_EnableRenderbuffer(bool enable)
Enable the render to the framebuffer.
void R_UseViewport(const r_framebuffer_t *buf)
Set the viewport to the dimensions of the given framebuffer.
void R_ResolveMSAA(const r_framebuffer_t *buf)
Forces multisample antialiasing resolve on given framebuffer, if needed.
void R_SetupViewport(r_framebuffer_t *buf, int x, int y, int width, int height)
Sets the framebuffer dimensions of the viewport.
void R_ShutdownFBObjects(void)
Delete all registered framebuffer and render buffer objects, clear memory.
void R_DeleteFBObject(r_framebuffer_t *buf)
Delete framebuffer object along with attached render buffer.
r_framebuffer_t * R_CreateFramebuffer(int width, int height, int ntextures, bool depth, bool halfFloat, unsigned int *filters)
create a new framebuffer object
bool R_RenderbufferEnabled(void)
unsigned int * textures
unsigned int proxyFBO
unsigned int depth
unsigned int fbo
r_viewport_t viewport
vec_t vec4_t[4]
Definition ufotypes.h:40