00001 #ifndef GUI_GL_RENDERTARGET_HPP
00002 #define GUI_GL_RENDERTARGET_HPP
00003
00004 #include <utils.hpp>
00005 #include <gui_rendertarget.hpp>
00006 #include "gui_gl_material.hpp"
00007 #include "gui_gl_matrix4.hpp"
00008
00009 namespace gui {
00010 namespace gl
00011 {
00013 class render_target : public gui::render_target
00014 {
00015 public :
00016
00018
00021 render_target(uint uiWidth, uint uiHeight);
00022
00024 ~render_target();
00025
00027 void begin();
00028
00030 void end();
00031
00033
00035 void clear(const color& mColor);
00036
00038
00040 uint get_width() const;
00041
00043
00045 uint get_height() const;
00046
00048
00053 bool set_dimensions(uint uiWidth, uint uiHeight);
00054
00056
00062 uint get_real_width() const;
00063
00065
00071 uint get_real_height() const;
00072
00074
00076 utils::wptr<gl::material> get_material();
00077
00079
00081 static void check_availability();
00082
00083 private :
00084
00085 void update_view_matrix_() const;
00086
00087 uint uiFBOHandle_;
00088 utils::refptr<gl::material> pTexture_;
00089
00090 mutable bool bUpdateViewMatrix_;
00091 mutable matrix4 mViewMatrix_;
00092 };
00093 }
00094 }
00095
00096 #endif