]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/datatype.h
Update and improve documentation
[libs/gl.git] / source / core / datatype.h
index a911561358c2c845d529f44e67aa090e49639f77..22c72f6a3d8ea0c67c8b6c1ab6921082fdbb2e8d 100644 (file)
@@ -3,15 +3,16 @@
 
 #include <msp/linal/matrix.h>
 #include <msp/linal/vector.h>
-#include "gl.h"
 
 namespace Msp {
 namespace GL {
 
 /**
-Identifies a data type.  The values are bitfields laid as follows:
+Identifies a data type.
 
-__ds addd ccrr _bfg ssss ssss
+The values are bitfields laid as follows:
+
+__hm addd ccrr _bfg ssss ssss
   ││ │  │  │ │  │││         └╴Size (bytes)
   ││ │  │  │ │  ││└──────────╴Signed flag
   ││ │  │  │ │  │└───────────╴Floating-point flag
@@ -24,7 +25,7 @@ __ds addd ccrr _bfg ssss ssss
   └──────────────────────────╴Shadow sampler flag
 
 This information is presented for internal documentation purposes only; it is
-inadvisable for programs to rely on it.
+inadvisable for applications to rely on it.
 */
 enum DataType
 {
@@ -92,7 +93,7 @@ enum DataType
        SAMPLER_CUBE_ARRAY_SHADOW = 0x3C0304
 };
 
-inline unsigned get_type_size(DataType t) { return t&0xFF; }
+inline std::size_t get_type_size(DataType t) { return t&0xFF; }
 inline bool is_float(DataType t) { return t&0x200; }
 inline bool is_matrix(DataType t) { return t&0xC000; }
 inline bool is_vector(DataType t) { return !is_matrix(t) && (t&0x3000); }
@@ -133,9 +134,6 @@ struct TypeTraits<LinAl::Matrix<T, N, M>>
        static const DataType type = static_cast<DataType>((TypeTraits<T>::type&0xF00) | ((TypeTraits<T>::type&0xFF)*N*M) | ((N-1)<<12) | ((M-1)<<14));
 };
 
-GLenum get_gl_type(DataType);
-DataType from_gl_type(GLenum);
-
 void require_type(DataType);
 
 } // namespace GL