]> git.sesse.net Git - casparcg/blobdiff - core/mixer/gpu/device_buffer.h
2.0. audio_mixer: Optimized.
[casparcg] / core / mixer / gpu / device_buffer.h
index f05a06b78a0fafa89bc2e3fc214e65721fb3b246..f329f72c4ee0d9af6f00d010f8561e95e00bf743 100644 (file)
 */\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