From fdffcd69528931fb181d2a076bcf42bfabd0085f Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 13 Feb 2021 11:42:20 +0200 Subject: [PATCH] Add some files which got forgotten in earlier commits --- extensions/arb_sampler_objects.glext | 1 + source/datatype.cpp | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 extensions/arb_sampler_objects.glext create mode 100644 source/datatype.cpp diff --git a/extensions/arb_sampler_objects.glext b/extensions/arb_sampler_objects.glext new file mode 100644 index 00000000..67497988 --- /dev/null +++ b/extensions/arb_sampler_objects.glext @@ -0,0 +1 @@ +extension ARB_sampler_objects diff --git a/source/datatype.cpp b/source/datatype.cpp new file mode 100644 index 00000000..1def3ca3 --- /dev/null +++ b/source/datatype.cpp @@ -0,0 +1,26 @@ +#include +#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 -- 2.43.0