*/\r
#pragma once\r
\r
-#include "../gpu/host_buffer.h"\r
+#include <common/memory/safe_ptr.h>\r
\r
#include <boost/noncopyable.hpp>\r
\r
#include <memory>\r
\r
-namespace caspar { namespace mixer {\r
- \r
+namespace caspar { namespace core {\r
+ \r
class device_buffer : boost::noncopyable\r
{\r
public:\r
- device_buffer(size_t width, size_t height, size_t stride);\r
\r
size_t stride() const; \r
size_t width() const;\r
size_t height() const;\r
\r
- void bind();\r
void bind(int index);\r
void unbind();\r
+ \r
+ void begin_read();\r
+ bool ready() const;\r
+private:\r
+ friend class ogl_device;\r
+ device_buffer(size_t width, size_t height, size_t stride);\r
\r
- void clear();\r
+ int id() const;\r
\r
- void attach(int index = 0);\r
- void read(host_buffer& source);\r
- void write(host_buffer& target);\r
- \r
-private:\r
struct implementation;\r
- std::shared_ptr<implementation> impl_;\r
+ safe_ptr<implementation> impl_;\r
};\r
+ \r
+unsigned int format(size_t stride);\r
\r
}}
\ No newline at end of file