00001
00002
00004
00005
00006
00007
00009
00010 #ifndef glm_core_type_half
00011 #define glm_core_type_half
00012
00013 #include <cstdlib>
00014
00015 namespace glm
00016 {
00017 namespace test
00018 {
00019 bool main_type_half();
00020
00021 }
00022
00023 namespace detail
00024 {
00025 typedef short hdata;
00026
00027 float toFloat32(hdata value);
00028 hdata toFloat16(float const & value);
00029
00032 class thalf
00033 {
00034 public:
00035
00036 GLM_FUNC_DECL thalf();
00037 GLM_FUNC_DECL thalf(thalf const & s);
00038
00039 template <typename U>
00040 GLM_FUNC_DECL explicit thalf(U const & s);
00041
00042
00043
00044 GLM_FUNC_DECL operator float() const;
00045
00046
00047
00048
00049 GLM_FUNC_DECL thalf& operator= (thalf const & s);
00050 GLM_FUNC_DECL thalf& operator+=(thalf const & s);
00051 GLM_FUNC_DECL thalf& operator-=(thalf const & s);
00052 GLM_FUNC_DECL thalf& operator*=(thalf const & s);
00053 GLM_FUNC_DECL thalf& operator/=(thalf const & s);
00054 GLM_FUNC_DECL thalf& operator++();
00055 GLM_FUNC_DECL thalf& operator--();
00056
00057 GLM_FUNC_DECL float toFloat() const{return toFloat32(data);}
00058
00059 GLM_FUNC_DECL hdata _data() const{return data;}
00060
00061 private:
00062 hdata data;
00063 };
00064
00065 thalf operator+ (thalf const & s1, thalf const & s2);
00066
00067 thalf operator- (thalf const & s1, thalf const & s2);
00068
00069 thalf operator* (thalf const & s1, thalf const & s2);
00070
00071 thalf operator/ (thalf const & s1, thalf const & s2);
00072
00073
00074 thalf operator- (thalf const & s);
00075
00076 thalf operator-- (thalf const & s, int);
00077
00078 thalf operator++ (thalf const & s, int);
00079
00080 }
00081
00082
00083 }
00084
00085 #include "type_half.inl"
00086
00087 #endif//glm_core_type_half