Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
rendertarget.hpp
Go to the documentation of this file.
1 #pragma once
2 #include <SDL_opengl.h> // for GL_FRAMEBUFFER, GL_REN...
3 #include <math.h> // for ceil, floor
4 #include <string.h> // for memcpy, memset
5 #include <algorithm> // for min, max, swap
6 
7 #include "SDL_opengl.h" // for GLenum, glDisable, glE...
8 #include "inexor/engine/glemu.hpp" // for attribf, begin, defvertex
9 #include "inexor/engine/glexts.hpp" // for glBindFramebuffer_
10 #include "inexor/engine/shader.hpp" // for setblurshader, setupbl...
11 #include "inexor/shared/cube_loops.hpp" // for i, loop, loopi
12 #include "inexor/shared/cube_types.hpp" // for uint
13 #include "inexor/texture/texsettings.hpp" // for hwtexsize
14 #include "inexor/texture/texture.hpp" // for createtexture
15 #include "inexor/ui/screen/ScreenManager.hpp" // for ScreenManager, screen_...
16 
17 extern void screenquad(float sw, float sh); // todo remove
18 extern void hudquad(float x, float y, float w, float h, float tx, float ty, float tw, float th);
19 
20 #include "inexor/network/SharedVar.hpp" // for SharedVar
21 
23 
25 {
26  int texw, texh, vieww, viewh;
29  int blursize;
30  float blursigma;
32 
34 #define BLURTILES 32
35 #define BLURTILEMASK (0xFFFFFFFFU>>(32-BLURTILES))
37 
39 
40  rendertarget() : texw(0), texh(0), vieww(0), viewh(0), colorfmt(GL_FALSE), depthfmt(GL_FALSE), rendertex(0), renderfb(0), renderdb(0), blurtex(0), blurfb(0), blurdb(0), blursize(0), blursigma(0), initialized(false)
41  {
42  }
43 
44  virtual ~rendertarget() {}
45 
46  virtual GLenum attachment() const
47  {
48  return GL_COLOR_ATTACHMENT0;
49  }
50 
51  virtual const GLenum *colorformats() const
52  {
53  static const GLenum colorfmts[] = { GL_RGB, GL_RGB8, GL_FALSE };
54  return colorfmts;
55  }
56 
57  virtual const GLenum *depthformats() const
58  {
59  static const GLenum depthfmts[] = { GL_DEPTH_COMPONENT24, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT32, GL_FALSE };
60  return depthfmts;
61  }
62 
63  virtual bool depthtest() const { return true; }
64 
65  void cleanup(bool fullclean = false);
66 
67  void cleanupblur()
68  {
69  if(blurfb) { glDeleteFramebuffers_(1, &blurfb); blurfb = 0; }
70  if(blurtex) { glDeleteTextures(1, &blurtex); blurtex = 0; }
71  if(blurdb) { glDeleteRenderbuffers_(1, &blurdb); blurdb = 0; }
72  blursize = 0;
73  blursigma = 0.0f;
74  }
75 
76  void setupblur()
77  {
78  if(!blurtex) glGenTextures(1, &blurtex);
79  createtexture(blurtex, texw, texh, nullptr, 3, 1, colorfmt);
80 
81  if(!swaptexs() || rtsharefb) return;
85  if(depthtest())
86  {
92  }
94  }
95 
96  void setup(int w, int h)
97  {
100  if(!rendertex) glGenTextures(1, &rendertex);
101 
102  GLenum attach = attachment();
103  if(attach == GL_DEPTH_ATTACHMENT)
104  {
105  glDrawBuffer(GL_NONE);
106  glReadBuffer(GL_NONE);
107  }
108 
109  const GLenum *colorfmts = colorformats();
110  int find = 0;
111  do
112  {
113  createtexture(rendertex, w, h, nullptr, 3, filter() ? 1 : 0, colorfmt ? colorfmt : colorfmts[find]);
114  glFramebufferTexture2D_(GL_FRAMEBUFFER, attach, GL_TEXTURE_2D, rendertex, 0);
116  }
117  while(!colorfmt && colorfmts[++find]);
118  if(!colorfmt) colorfmt = colorfmts[find];
119 
120  if(attach != GL_DEPTH_ATTACHMENT && depthtest())
121  {
122  if(!renderdb) { glGenRenderbuffers_(1, &renderdb); depthfmt = GL_FALSE; }
124  const GLenum *depthfmts = depthformats();
125  find = 0;
126  do
127  {
128  if(!depthfmt) glRenderbufferStorage_(GL_RENDERBUFFER, depthfmts[find], w, h);
131  }
132  while(!depthfmt && depthfmts[++find]);
133  if(!depthfmt) depthfmt = depthfmts[find];
134  }
135 
137 
138  texw = w;
139  texh = h;
140  initialized = false;
141  }
142 
143  bool addblurtiles(float x1, float y1, float x2, float y2, float blurmargin = 0)
144  {
145  if(x1 >= 1 || y1 >= 1 || x2 <= -1 || y2 <= -1) return false;
146 
147  scissorx1 = std::min(scissorx1, std::max(x1, -1.0f));
148  scissory1 = std::min(scissory1, std::max(y1, -1.0f));
149  scissorx2 = std::max(scissorx2, std::min(x2, 1.0f));
150  scissory2 = std::max(scissory2, std::min(y2, 1.0f));
151 
152  float blurerror = 2.0f*float(2*blursize + blurmargin);
153  int tx1 = std::max(0, std::min(BLURTILES - 1, int((x1-blurerror/vieww + 1)/2 * BLURTILES))),
154  ty1 = std::max(0, std::min(BLURTILES - 1, int((y1-blurerror/viewh + 1)/2 * BLURTILES))),
155  tx2 = std::max(0, std::min(BLURTILES - 1, int((x2+blurerror/vieww + 1)/2 * BLURTILES))),
156  ty2 = std::max(0, std::min(BLURTILES - 1, int((y2+blurerror/viewh + 1)/2 * BLURTILES)));
157 
158  uint mask = (BLURTILEMASK>>(BLURTILES - (tx2+1))) & (BLURTILEMASK<<tx1);
159  for(int y = ty1; y <= ty2; y++) blurtiles[y] |= mask;
160  return true;
161  }
162 
163  bool checkblurtiles(float x1, float y1, float x2, float y2, float blurmargin = 0)
164  {
165  float blurerror = 2.0f*float(2*blursize + blurmargin);
166  if(x2+blurerror/vieww < scissorx1 || y2+blurerror/viewh < scissory1 ||
167  x1-blurerror/vieww > scissorx2 || y1-blurerror/viewh > scissory2)
168  return false;
169 
170  if(!blurtile) return true;
171 
172  int tx1 = std::max(0, std::min(BLURTILES - 1, int((x1 + 1)/2 * BLURTILES))),
173  ty1 = std::max(0, std::min(BLURTILES - 1, int((y1 + 1)/2 * BLURTILES))),
174  tx2 = std::max(0, std::min(BLURTILES - 1, int((x2 + 1)/2 * BLURTILES))),
175  ty2 = std::max(0, std::min(BLURTILES - 1, int((y2 + 1)/2 * BLURTILES)));
176 
177  uint mask = (BLURTILEMASK>>(BLURTILES - (tx2+1))) & (BLURTILEMASK<<tx1);
178  for(int y = ty1; y <= ty2; y++) if(blurtiles[y] & mask) return true;
179 
180  return false;
181  }
182 
183  void rendertiles()
184  {
185  float wscale = vieww/float(texw), hscale = viewh/float(texh);
186  if(blurtile && scissorx1 < scissorx2 && scissory1 < scissory2)
187  {
188  uint tiles[sizeof(blurtiles)/sizeof(uint)];
189  memcpy(tiles, blurtiles, sizeof(blurtiles));
190 
191  LOCALPARAMF(screentexcoord0, wscale*0.5f, hscale*0.5f, wscale*0.5f, hscale*0.5f);
192  gle::defvertex(2);
193  gle::begin(GL_QUADS);
194  float tsz = 1.0f/BLURTILES;
195  loop(y, BLURTILES+1)
196  {
197  uint mask = tiles[y];
198  int x = 0;
199  while(mask)
200  {
201  while(!(mask&0xFF)) { mask >>= 8; x += 8; }
202  while(!(mask&1)) { mask >>= 1; x++; }
203  int xstart = x;
204  do { mask >>= 1; x++; } while(mask&1);
205  uint strip = (BLURTILEMASK>>(BLURTILES - x)) & (BLURTILEMASK<<xstart);
206  int yend = y;
207  do { tiles[yend] &= ~strip; yend++; } while((tiles[yend] & strip) == strip);
208  float tx = xstart*tsz,
209  ty = y*tsz,
210  tw = (x-xstart)*tsz,
211  th = (yend-y)*tsz,
212  vx = 2*tx - 1, vy = 2*ty - 1, vw = tw*2, vh = th*2;
213  gle::attribf(vx, vy);
214  gle::attribf(vx+vw, vy);
215  gle::attribf(vx+vw, vy+vh);
216  gle::attribf(vx, vy+vh);
217  }
218  }
219  gle::end();
220  }
221  else
222  {
223  screenquad(wscale, hscale);
224  }
225  }
226 
227  void blur(int wantsblursize, float wantsblursigma, int x, int y, int w, int h, bool scissor)
228  {
229  if(!blurtex) setupblur();
230  if(blursize!=wantsblursize || (wantsblursize && blursigma!=wantsblursigma))
231  {
232  setupblurkernel(wantsblursize, wantsblursigma, blurweights, bluroffsets);
233  blursize = wantsblursize;
234  blursigma = wantsblursigma;
235  }
236 
237  glDisable(GL_DEPTH_TEST);
238  glDisable(GL_CULL_FACE);
239 
240  if(scissor)
241  {
242  glScissor(x, y, w, h);
243  glEnable(GL_SCISSOR_TEST);
244  }
245 
246  loopi(2)
247  {
249 
250  if(!swaptexs() || rtsharefb) glFramebufferTexture2D_(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, i ? rendertex : blurtex, 0);
252  glBindTexture(GL_TEXTURE_2D, i ? blurtex : rendertex);
253 
254  rendertiles();
255  }
256 
257  if(scissor) glDisable(GL_SCISSOR_TEST);
258 
259  glEnable(GL_DEPTH_TEST);
260  glEnable(GL_CULL_FACE);
261  }
262 
263  virtual bool swaptexs() const { return false; }
264 
265  virtual bool dorender() { return true; }
266 
267  virtual bool shouldrender() { return true; }
268 
269  virtual void doblur(int blursize, float blursigma)
270  {
271  int sx, sy, sw, sh;
272  bool scissoring = rtscissor && scissorblur(sx, sy, sw, sh) && sw > 0 && sh > 0;
273  if(!scissoring) { sx = sy = 0; sw = vieww; sh = viewh; }
274  blur(blursize, blursigma, sx, sy, sw, sh, scissoring);
275  }
276 
277  virtual bool scissorrender(int &x, int &y, int &w, int &h)
278  {
279  if(scissorx1 >= scissorx2 || scissory1 >= scissory2)
280  {
281  if(vieww < texw || viewh < texh)
282  {
283  x = y = 0;
284  w = vieww;
285  h = viewh;
286  return true;
287  }
288  return false;
289  }
290  x = std::max(int(floor((scissorx1+1)/2*vieww)) - 2*blursize, 0);
291  y = std::max(int(floor((scissory1+1)/2*viewh)) - 2*blursize, 0);
292  w = std::min(int(ceil((scissorx2+1)/2*vieww)) + 2*blursize, vieww) - x;
293  h = std::min(int(ceil((scissory2+1)/2*viewh)) + 2*blursize, viewh) - y;
294  return true;
295  }
296 
297  virtual bool scissorblur(int &x, int &y, int &w, int &h)
298  {
300  {
301  if(vieww < texw || viewh < texh)
302  {
303  x = y = 0;
304  w = vieww;
305  h = viewh;
306  return true;
307  }
308  return false;
309  }
310  x = std::max(int(floor((scissorx1+1)/2*vieww)), 0);
311  y = std::max(int(floor((scissory1+1)/2*viewh)), 0);
312  w = std::min(int(ceil((scissorx2+1)/2*vieww)), vieww) - x;
313  h = std::min(int(ceil((scissory2+1)/2*viewh)), viewh) - y;
314  return true;
315  }
316 
317  virtual void doclear() {}
318 
319  virtual bool screenrect() const { return false; }
320  virtual bool filter() const { return true; }
321 
322  void render(int w, int h, int blursize = 0, float blursigma = 0)
323  {
324  w = std::min(w, *hwtexsize);
325  h = std::min(h, *hwtexsize);
326  if(screenrect())
327  {
328  // TODO: this name is so ugly it cries for replacement.
331  }
332  vieww = w;
333  viewh = h;
334  if(w!=texw || h!=texh || (swaptexs() && !rtsharefb ? !blurfb : blurfb)) cleanup();
335 
336  if(!filter())
337  {
338  if(blurtex) cleanupblur();
339  blursize = 0;
340  }
341 
342  if(!rendertex) setup(w, h);
343 
344  scissorx2 = scissory2 = -1;
345  scissorx1 = scissory1 = 1;
346  memset(blurtiles, 0, sizeof(blurtiles));
347 
348  if(!shouldrender()) return;
349 
350  if(blursize && !blurtex) setupblur();
351  if(swaptexs() && blursize)
352  {
353  std::swap(rendertex, blurtex);
354  if(!rtsharefb)
355  {
356  std::swap(renderfb, blurfb);
357  std::swap(renderdb, blurdb);
358  }
359  }
361  if(swaptexs() && blursize && rtsharefb)
363  glViewport(0, 0, vieww, viewh);
364 
365  doclear();
366 
367  int sx, sy, sw, sh;
368  bool scissoring = rtscissor && scissorrender(sx, sy, sw, sh) && sw > 0 && sh > 0;
369  if(scissoring)
370  {
371  glScissor(sx, sy, sw, sh);
372  glEnable(GL_SCISSOR_TEST);
373  }
374  else
375  {
376  sx = sy = 0;
377  sw = vieww;
378  sh = viewh;
379  }
380 
381  if(!depthtest()) glDisable(GL_DEPTH_TEST);
382 
383  bool succeeded = dorender();
384 
385  if(!depthtest()) glEnable(GL_DEPTH_TEST);
386 
387  if(scissoring) glDisable(GL_SCISSOR_TEST);
388 
389  if(succeeded)
390  {
391  initialized = true;
392 
394  }
395 
398  }
399 
400  virtual void dodebug(int w, int h) {}
401  virtual bool flipdebug() const { return true; }
402 
403  void debugscissor(int w, int h, bool lines = false)
404  {
405  if(!rtscissor || scissorx1 >= scissorx2 || scissory1 >= scissory2) return;
406  int sx = int(0.5f*(scissorx1 + 1)*w),
407  sy = int(0.5f*(scissory1 + 1)*h),
408  sw = int(0.5f*(scissorx2 - scissorx1)*w),
409  sh = int(0.5f*(scissory2 - scissory1)*h);
410  if(flipdebug()) { sy = h - sy; sh = -sh; }
411  gle::defvertex(2);
412  gle::begin(lines ? GL_LINE_LOOP : GL_TRIANGLE_STRIP);
413  gle::attribf(sx, sy);
414  gle::attribf(sx + sw, sy);
415  if(lines) gle::attribf(sx + sw, sy + sh);
416  gle::attribf(sx, sy + sh);
417  if(!lines) gle::attribf(sx + sw, sy + sh);
418  gle::end();
419  }
420 
421  void debugblurtiles(int w, int h, bool lines = false)
422  {
423  if(!blurtile) return;
424  float vxsz = float(w)/BLURTILES, vysz = float(h)/BLURTILES;
425  gle::defvertex(2);
426  loop(y, BLURTILES+1)
427  {
428  uint mask = blurtiles[y];
429  int x = 0;
430  while(mask)
431  {
432  while(!(mask&0xFF)) { mask >>= 8; x += 8; }
433  while(!(mask&1)) { mask >>= 1; x++; }
434  int xstart = x;
435  do { mask >>= 1; x++; } while(mask&1);
436  uint strip = (BLURTILEMASK>>(BLURTILES - x)) & (BLURTILEMASK<<xstart);
437  int yend = y;
438  do { blurtiles[yend] &= ~strip; yend++; } while((blurtiles[yend] & strip) == strip);
439  float vx = xstart*vxsz,
440  vy = y*vysz,
441  vw = (x-xstart)*vxsz,
442  vh = (yend-y)*vysz;
443  if(flipdebug()) { vy = h - vy; vh = -vh; }
444  loopi(lines ? 1 : 2)
445  {
446  if(!lines) gle::colorf(1, 1, i ? 1.0f : 0.5f);
447  gle::begin(lines || i ? GL_LINE_LOOP : GL_TRIANGLE_STRIP);
448  gle::attribf(vx, vy);
449  gle::attribf(vx+vw, vy);
450  if(lines || i) gle::attribf(vx+vw, vy+vh);
451  gle::attribf(vx, vy+vh);
452  if(!lines && !i) gle::attribf(vx+vw, vy+vh);
453  gle::end();
454  }
455  }
456  }
457  }
458 
459  void debug()
460  {
461  if(!rendertex) return;
463  hudshader->set();
464  gle::colorf(1, 1, 1);
465  glBindTexture(GL_TEXTURE_2D, rendertex);
466  float tx1 = 0, tx2 = 1, ty1 = 0, ty2 = 1;
467  if(flipdebug()) std::swap(ty1, ty2);
468  hudquad(0, 0, w, h, tx1, ty1, tx2-tx1, ty2-ty1);
470  dodebug(w, h);
471  }
472 };
473 
virtual bool scissorrender(int &x, int &y, int &w, int &h)
Definition: rendertarget.hpp:277
void screenquad(float sw, float sh)
Definition: rendergl.cpp:1173
GLuint renderdb
Definition: rendertarget.hpp:28
virtual bool shouldrender()
Definition: rendertarget.hpp:267
void setupblurkernel(int radius, float sigma, float *weights, float *offsets)
Definition: shader.cpp:1466
const T & max(const inexor::rpc::SharedVar< T > &a, const T &b)
Definition: SharedVar.hpp:224
virtual bool depthtest() const
Definition: rendertarget.hpp:63
void rendertiles()
Definition: rendertarget.hpp:183
typedef GLenum(APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC)(GLenum target)
virtual void doblur(int blursize, float blursigma)
Definition: rendertarget.hpp:269
Header for the internal GLSL shader organisation.
unsigned int uint
Definition: cube_types.hpp:9
PFNGLDELETERENDERBUFFERSPROC glDeleteRenderbuffers_
Definition: rendergl.cpp:218
#define GL_DEPTH_ATTACHMENT
Definition: glexts.hpp:284
#define loop(v, m)
Legacy file defining loops.
Definition: cube_loops.hpp:7
virtual bool scissorblur(int &x, int &y, int &w, int &h)
Definition: rendertarget.hpp:297
SharedVar< int > blurtile
Shader * hudnotextureshader
Definition: shader.cpp:33
GLenum colorfmt
Definition: rendertarget.hpp:27
int viewh
Definition: rendertarget.hpp:26
virtual bool flipdebug() const
Definition: rendertarget.hpp:401
void setup(int w, int h)
Definition: rendertarget.hpp:96
void createtexture(int tnum, int w, int h, void *pixels, int clamp, int filter, GLenum component, GLenum subtarget, int pw, int ph, int pitch, bool resize, GLenum format)
Definition: texture.cpp:138
void begin(GLenum mode)
Definition: glemu.cpp:220
virtual bool dorender()
Definition: rendertarget.hpp:265
int screenh
Definition: ScreenManager.hpp:64
GLuint blurtex
Definition: rendertarget.hpp:28
virtual ~rendertarget()
Definition: rendertarget.hpp:44
void render(int w, int h, int blursize=0, float blursigma=0)
Definition: rendertarget.hpp:322
int screenw
screen resolution management
Definition: ScreenManager.hpp:63
GLint GLint GLint GLint GLint GLint GLint GLbitfield mask
Definition: glexts.hpp:299
virtual bool swaptexs() const
Definition: rendertarget.hpp:263
bool checkblurtiles(float x1, float y1, float x2, float y2, float blurmargin=0)
Definition: rendertarget.hpp:163
virtual void doclear()
Definition: rendertarget.hpp:317
ICOMMAND * f(float *a, float *b), floatret(*a **b)
float scissory2
Definition: rendertarget.hpp:33
rendertarget()
Definition: rendertarget.hpp:40
typedef GLuint(APIENTRYP PFNGLGETUNIFORMBLOCKINDEXPROC)(GLuint program
bool addblurtiles(float x1, float y1, float x2, float y2, float blurmargin=0)
Definition: rendertarget.hpp:143
else loopi(numargs)
Definition: command.cpp:3019
virtual bool filter() const
Definition: rendertarget.hpp:320
#define GL_FRAMEBUFFER_COMPLETE
Definition: glexts.hpp:281
Shader * hudshader
Definition: shader.cpp:33
Settings for texture loading and handling.
void cleanupblur()
Definition: rendertarget.hpp:67
float scissorx1
Definition: rendertarget.hpp:33
float scissory1
Definition: rendertarget.hpp:33
static int scissoring
Definition: rendergl.cpp:1087
const T & min(const inexor::rpc::SharedVar< T > &a, const T &b)
Definition: SharedVar.hpp:210
float bluroffsets[MAXBLURRADIUS+1]
Definition: rendertarget.hpp:31
PFNGLFRAMEBUFFERRENDERBUFFERPROC glFramebufferRenderbuffer_
Definition: rendergl.cpp:226
float blursigma
Definition: rendertarget.hpp:30
PFNGLDELETEFRAMEBUFFERSPROC glDeleteFramebuffers_
Definition: rendergl.cpp:223
SharedVar< int > hwtexsize
Definition: texsettings.hpp:11
SharedVar< int > rtsharefb
internal texture loading and organizing routines + main texture structures.
#define GL_COLOR_ATTACHMENT0
Definition: glexts.hpp:282
float blurweights[MAXBLURRADIUS+1]
Definition: rendertarget.hpp:31
GLuint rendertex
Definition: rendertarget.hpp:28
GLuint blurfb
Definition: rendertarget.hpp:28
uint blurtiles[BLURTILES+1]
Definition: rendertarget.hpp:36
virtual void dodebug(int w, int h)
Definition: rendertarget.hpp:400
virtual bool screenrect() const
Definition: rendertarget.hpp:319
float scissorx2
Definition: rendertarget.hpp:33
void setblurshader(int pass, int size, int radius, float *weights, float *offsets)
Definition: shader.cpp:1489
GLuint blurdb
Definition: rendertarget.hpp:28
void setupblur()
Definition: rendertarget.hpp:76
int texw
Definition: rendertarget.hpp:26
ScreenManager screen_manager
Singleton instnace of the screenmanager.
Definition: ScreenManager.cpp:227
PFNGLBINDFRAMEBUFFERPROC glBindFramebuffer_
Definition: rendergl.cpp:222
bool find(fpsent *d, aistate &b, bool override=false)
Definition: ai.cpp:527
int texh
Definition: rendertarget.hpp:26
void cleanup(bool fullclean=false)
Definition: rendertarget.cpp:3
#define BLURTILES
Definition: rendertarget.hpp:34
SharedVar< int > rtscissor
int end()
Definition: glemu.cpp:256
PFNGLFRAMEBUFFERTEXTURE2DPROC glFramebufferTexture2D_
Definition: rendergl.cpp:225
virtual const GLenum * depthformats() const
Definition: rendertarget.hpp:57
Definition: rendertarget.hpp:24
bool initialized
Definition: rendertarget.hpp:38
void hudquad(float x, float y, float w, float h, float tx, float ty, float tw, float th)
Definition: rendergl.cpp:1216
void debugblurtiles(int w, int h, bool lines=false)
Definition: rendertarget.hpp:421
#define BLURTILEMASK
Definition: rendertarget.hpp:35
SharedVar wrapper for primitive/immutable objects.
Definition: SharedVar.hpp:55
PFNGLCHECKFRAMEBUFFERSTATUSPROC glCheckFramebufferStatus_
Definition: rendergl.cpp:221
void debug()
Definition: rendertarget.hpp:459
void debugscissor(int w, int h, bool lines=false)
Definition: rendertarget.hpp:403
int vieww
Definition: rendertarget.hpp:26
PFNGLGENFRAMEBUFFERSPROC glGenRenderbuffers_
Definition: rendergl.cpp:219
GLenum depthfmt
Definition: rendertarget.hpp:27
PFNGLRENDERBUFFERSTORAGEPROC glRenderbufferStorage_
Definition: rendergl.cpp:220
PFNGLGENFRAMEBUFFERSPROC glGenFramebuffers_
Definition: rendergl.cpp:224
virtual const GLenum * colorformats() const
Definition: rendertarget.hpp:51
void set()
Definition: shader.hpp:278
GLuint renderfb
Definition: rendertarget.hpp:28
void blur(int wantsblursize, float wantsblursigma, int x, int y, int w, int h, bool scissor)
Definition: rendertarget.hpp:227
int blursize
Definition: rendertarget.hpp:29
#define GL_RENDERBUFFER
Definition: glexts.hpp:287
#define LOCALPARAMF(name,...)
Definition: shader.hpp:445
PFNGLBINDRENDERBUFFERPROC glBindRenderbuffer_
Definition: rendergl.cpp:217
#define GL_FRAMEBUFFER
Definition: glexts.hpp:286
#define MAXBLURRADIUS
Definition: shader.hpp:483
virtual GLenum attachment() const
Definition: rendertarget.hpp:46