r_framebuffer.h

Go to the documentation of this file.
00001 
00005 /*
00006  Copyright (C) 2008 Victor Luchits
00007 
00008  This program is free software; you can redistribute it and/or
00009  modify it under the terms of the GNU General Public License
00010  as published by the Free Software Foundation; either version 2
00011  of the License, or (at your option) any later version.
00012 
00013  This program is distributed in the hope that it will be useful,
00014  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00016 
00017  See the GNU General Public License for more details.
00018 
00019  You should have received a copy of the GNU General Public License
00020  along with this program; if not, write to the Free Software
00021  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00022 */
00023 
00024 #ifndef R_FRAMEBUFFER_H_
00025 #define R_FRAMEBUFFER_H_
00026 
00027 typedef struct {
00028     int x;
00029     int y;
00030     int width;
00031     int height;
00032 } r_viewport_t;
00033 
00034 typedef struct {
00035     int width;
00036     int height;
00037     vec4_t clearColor;
00038     r_viewport_t viewport;
00039     int pixelFormat;
00040     int byteFormat;
00041     unsigned int depth;
00042     unsigned int fbo;
00043     int nTextures;
00044     unsigned int *textures;
00045 } r_framebuffer_t;
00046 
00047 
00048 void R_InitFBObjects(void);
00049 void R_ShutdownFBObjects(void);
00050 
00051 r_framebuffer_t* R_CreateFramebuffer(int width, int height, int ntextures, qboolean depth, qboolean halfFloat, unsigned int *filters);
00052 void R_DeleteFBObject(r_framebuffer_t *buf);
00053 
00054 void R_SetupViewport(r_framebuffer_t *buf, int x, int y, int width, int height);
00055 void R_UseViewport(const r_framebuffer_t *buf);
00056 
00057 void R_UseFramebuffer(const r_framebuffer_t *buf);
00058 void R_DrawBuffers(int n);
00059 void R_BindColorAttachments(int n, unsigned int *attachments);
00060 qboolean R_EnableRenderbuffer(qboolean enable);
00061 qboolean R_RenderbufferEnabled(void);
00062 
00063 #endif /* R_FRAMEBUFFER_H_ */
00064 

Generated by  doxygen 1.6.2