00001 #ifndef SGE_RENDERER_TEXTURE_RW_HPP_INCLUDED 00002 #define SGE_RENDERER_TEXTURE_RW_HPP_INCLUDED 00003 00004 #include "texture.hpp" 00005 #include "../export.hpp" 00006 #include <boost/optional.hpp> 00007 #include <boost/scoped_ptr.hpp> 00008 00009 namespace sge 00010 { 00011 namespace renderer 00012 { 00013 class SGE_CLASS_SYMBOL texture_rw : public texture 00014 { 00015 public: 00016 SGE_SYMBOL texture_rw(texture_ptr read,texture_ptr write); 00017 SGE_SYMBOL dim_type const dim() const; 00018 SGE_SYMBOL image_view const lock(lock_rect const &, lock_flag_t); 00019 SGE_SYMBOL const_image_view const lock(lock_rect const &) const; 00020 SGE_SYMBOL void unlock() const; 00021 resource_flag_t flags() const { return resource_flags::dynamic; } 00022 private: 00023 mutable texture_ptr read,write; 00024 00025 struct lock_data 00026 { 00027 lock_rect area; 00028 boost::optional<image_view> view; 00029 00030 lock_data(lock_rect const &area,boost::optional<image_view> const view = boost::none) 00031 : area(area),view(view) {} 00032 }; 00033 00034 mutable boost::scoped_ptr<lock_data> locked; 00035 }; 00036 } 00037 } 00038 00039 #endif
1.5.5