Voxellancer  0.3
A game about voxels in space
 All Classes Functions Pages
blitprogram.h
1 #pragma once
2 
3 #include <glow/Program.h>
4 
5 #include "geometry/viewport.h"
6 #include "etc/contextdependant.h"
7 
8 namespace glow {
9  class FrameBufferObject;
10  class Texture;
11 }
12 
13 class ScreenQuad;
14 
15 class BlitProgram : public ContextDependant, protected glow::Program {
16 public:
17  const GLint TEXTURE_LOCATION = 0;
18 
19  BlitProgram();
20  virtual ~BlitProgram();
21 
22  void setSource(glow::Texture* source);
23  void setDestination(glow::FrameBufferObject* targetFBO, const Viewport& m_targetViewpoer);
24 
25  virtual void blit();
26 
27 protected:
28  glow::Texture* m_source;
29  glow::FrameBufferObject* m_destinationFBO;
30  std::unique_ptr<ScreenQuad> m_quad;
31  Viewport m_destinationViewport;
32  bool m_initialized;
33 
34  virtual void initialize();
35  virtual void initializeShaders() = 0;
36 
37  template<typename T> void setUniform(const std::string& name, const T& value);
38 
39  virtual void beforeContextDestroy() override;
40  virtual void afterContextRebuild() override;
41 };
42 
43 
44 #include "blitprogram.inl"
Definition: viewport.h:6
Definition: contextdependant.h:7
Definition: blitprogram.h:15
Definition: screenquad.h:15