aboutsummaryrefslogtreecommitdiff
path: root/include/DataView.hpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2017-12-20 20:55:05 +0100
committerdec05eba <dec05eba@protonmail.com>2021-11-18 15:21:46 +0100
commitca92d8c90f7103db6d7cae4cef49b278d804b474 (patch)
treebaf44e42fcc1cf7e871a7b2f1d3d92f680f3a845 /include/DataView.hpp
parent3d7f123c0fc0af4b8df3ad791b264d22268bd423 (diff)
Create shader using c++ code
Diffstat (limited to 'include/DataView.hpp')
-rw-r--r--include/DataView.hpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/DataView.hpp b/include/DataView.hpp
new file mode 100644
index 0000000..c9e25e7
--- /dev/null
+++ b/include/DataView.hpp
@@ -0,0 +1,26 @@
+#pragma once
+
+#include "types.hpp"
+
+namespace amalgine
+{
+ template <typename T>
+ class DataView
+ {
+ public:
+ DataView() : data(nullptr), size(0) {}
+
+ DataView(T *_data, usize _size) : data(_data), size(_size)
+ {
+
+ }
+
+ usize getByteSize() const
+ {
+ return size * sizeof(T);
+ }
+
+ T *data;
+ usize size;
+ };
+}