]> git.tdb.fi Git - libs/gl.git/commitdiff
Add some files which got forgotten in earlier commits
authorMikko Rasa <tdb@tdb.fi>
Sat, 13 Feb 2021 09:42:20 +0000 (11:42 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sat, 13 Feb 2021 09:43:15 +0000 (11:43 +0200)
extensions/arb_sampler_objects.glext [new file with mode: 0644]
source/datatype.cpp [new file with mode: 0644]

diff --git a/extensions/arb_sampler_objects.glext b/extensions/arb_sampler_objects.glext
new file mode 100644 (file)
index 0000000..6749798
--- /dev/null
@@ -0,0 +1 @@
+extension ARB_sampler_objects
diff --git a/source/datatype.cpp b/source/datatype.cpp
new file mode 100644 (file)
index 0000000..1def3ca
--- /dev/null
@@ -0,0 +1,26 @@
+#include <stdexcept>
+#include "datatype.h"
+
+using namespace std;
+
+namespace Msp {
+namespace GL {
+
+unsigned get_type_size(DataType type)
+{
+       switch(type)
+       {
+       case BYTE:
+       case UNSIGNED_BYTE: return 1;
+       case SHORT:
+       case UNSIGNED_SHORT:
+       case HALF_FLOAT: return 2;
+       case INT:
+       case UNSIGNED_INT:
+       case FLOAT: return 4;
+       default: throw invalid_argument("get_type_size");
+       }
+}
+
+} // namespace GL
+} // namespace Msp