00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef VRN_RENDERTARGET_H
00029 #define VRN_RENDERTARGET_H
00030
00031 #include "tgt/framebufferobject.h"
00032
00033 namespace voreen {
00034
00035 class RenderTarget {
00036 public:
00037 RenderTarget();
00038 virtual ~RenderTarget();
00039
00040 void initialize(GLint internalColorFormat = GL_RGBA16, GLint internalDepthFormat = GL_DEPTH_COMPONENT24);
00041
00042 void deinitialize();
00043
00044 void activateTarget(const std::string& debugLabel = "");
00045 void deactivateTarget();
00046
00047 void bindColorTexture(GLint texUnit);
00048 void bindDepthTexture(GLint texUnit);
00049
00050 void bindColorTexture();
00051 void bindDepthTexture();
00052
00053 tgt::Texture* getColorTexture() { return colorTex_; }
00054 tgt::Texture* getDepthTexture() { return depthTex_; }
00055
00056
00057 tgt::vec4 getColorAtPos(tgt::ivec2 pos);
00058
00059 tgt::ivec2 getSize() const;
00060 void resize(tgt::ivec2 newsize);
00061
00062
00063 std::string getDebugLabel() { return debugLabel_; }
00064 void setDebugLabel(const std::string& debugLabel) { debugLabel_ = debugLabel; }
00065
00066 void increaseNumUpdates() { numUpdates_++; }
00067 int getNumUpdates() { return numUpdates_; }
00068
00069 protected:
00070 tgt::FramebufferObject* fbo_;
00071
00072 tgt::Texture* colorTex_;
00073 tgt::Texture* depthTex_;
00074
00075 std::string debugLabel_;
00076 int numUpdates_;
00077
00078 static const std::string loggerCat_;
00079 };
00080
00081 }
00082
00083 #endif // VRN_RENDERTARGET_H