]> git.sesse.net Git - casparcg/blobdiff - accelerator/ogl/util/device.h
set svn:eol-style native on .h and .cpp files
[casparcg] / accelerator / ogl / util / device.h
index 2e84080366fe7a78c44d3216fedcb26a759f089a..7577285fd4389cc94d71c2c21312b86e484a177c 100644 (file)
@@ -1,80 +1,80 @@
-/*\r
-* Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>\r
-*\r
-* This file is part of CasparCG (www.casparcg.com).\r
-*\r
-* CasparCG is free software: you can redistribute it and/or modify\r
-* it under the terms of the GNU General Public License as published by\r
-* the Free Software Foundation, either version 3 of the License, or\r
-* (at your option) any later version.\r
-*\r
-* CasparCG is distributed in the hope that it will be useful,\r
-* but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-* GNU General Public License for more details.\r
-*\r
-* You should have received a copy of the GNU General Public License\r
-* along with CasparCG. If not, see <http://www.gnu.org/licenses/>.\r
-*\r
-* Author: Robert Nagy, ronag89@gmail.com\r
-*/\r
-\r
-#pragma once\r
-\r
-#include <core/frame/frame.h>\r
-\r
-#include <common/memory.h>\r
-#include <common/executor.h>\r
-\r
-namespace caspar { namespace accelerator { namespace ogl {\r
-\r
-class texture;\r
-\r
-class device sealed : public std::enable_shared_from_this<device>\r
-{      \r
-       device(const device&);\r
-       device& operator=(const device&);\r
-\r
-       executor executor_;\r
-public:                \r
-\r
-       // Static Members\r
-\r
-       // Constructors\r
-\r
-       device();\r
-       ~device();\r
-\r
-       // Methods\r
-                       \r
-       spl::shared_ptr<texture> create_texture(int width, int height, int stride);\r
-       array<std::uint8_t>              create_array(int size);\r
-               \r
-       // NOTE: Since the returned texture is cached it SHOULD NOT be modified.\r
-       boost::unique_future<spl::shared_ptr<texture>>  copy_async(const array<const std::uint8_t>& source, int width, int height, int stride);\r
-\r
-       boost::unique_future<spl::shared_ptr<texture>>  copy_async(const array<std::uint8_t>& source, int width, int height, int stride);\r
-       boost::unique_future<array<const std::uint8_t>> copy_async(const spl::shared_ptr<texture>& source);\r
-                       \r
-       template<typename Func>\r
-       auto begin_invoke(Func&& func, task_priority priority = task_priority::normal_priority) -> boost::unique_future<decltype(func())> // noexcept\r
-       {                       \r
-               return executor_.begin_invoke(std::forward<Func>(func), priority);\r
-       }\r
-       \r
-       template<typename Func>\r
-       auto invoke(Func&& func, task_priority priority = task_priority::normal_priority) -> decltype(func())\r
-       {\r
-               return executor_.invoke(std::forward<Func>(func), priority);\r
-       }\r
-\r
-       // Properties\r
-       \r
-       std::wstring version() const;\r
-\r
-private:\r
-       struct impl;\r
-       spl::shared_ptr<impl> impl_;\r
-};\r
-\r
+/*
+* Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>
+*
+* This file is part of CasparCG (www.casparcg.com).
+*
+* CasparCG is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* CasparCG is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with CasparCG. If not, see <http://www.gnu.org/licenses/>.
+*
+* Author: Robert Nagy, ronag89@gmail.com
+*/
+
+#pragma once
+
+#include <core/frame/frame.h>
+
+#include <common/memory.h>
+#include <common/executor.h>
+
+namespace caspar { namespace accelerator { namespace ogl {
+
+class texture;
+
+class device sealed : public std::enable_shared_from_this<device>
+{      
+       device(const device&);
+       device& operator=(const device&);
+
+       executor executor_;
+public:                
+
+       // Static Members
+
+       // Constructors
+
+       device();
+       ~device();
+
+       // Methods
+                       
+       spl::shared_ptr<texture> create_texture(int width, int height, int stride);
+       array<std::uint8_t>              create_array(int size);
+               
+       // NOTE: Since the returned texture is cached it SHOULD NOT be modified.
+       boost::unique_future<spl::shared_ptr<texture>>  copy_async(const array<const std::uint8_t>& source, int width, int height, int stride);
+
+       boost::unique_future<spl::shared_ptr<texture>>  copy_async(const array<std::uint8_t>& source, int width, int height, int stride);
+       boost::unique_future<array<const std::uint8_t>> copy_async(const spl::shared_ptr<texture>& source);
+                       
+       template<typename Func>
+       auto begin_invoke(Func&& func, task_priority priority = task_priority::normal_priority) -> boost::unique_future<decltype(func())> // noexcept
+       {                       
+               return executor_.begin_invoke(std::forward<Func>(func), priority);
+       }
+       
+       template<typename Func>
+       auto invoke(Func&& func, task_priority priority = task_priority::normal_priority) -> decltype(func())
+       {
+               return executor_.invoke(std::forward<Func>(func), priority);
+       }
+
+       // Properties
+       
+       std::wstring version() const;
+
+private:
+       struct impl;
+       spl::shared_ptr<impl> impl_;
+};
+
 }}}
\ No newline at end of file