瀏覽代碼

Fixed build on Clang and C++11

Christophe Riccio 12 年之前
父節點
當前提交
da95e96fcf
共有 3 個文件被更改,包括 9 次插入18 次删除
  1. 5 2
      glm/gtc/packing.inl
  2. 4 15
      glm/gtc/type_ptr.inl
  3. 0 1
      test/gtc/gtc_packing.cpp

+ 5 - 2
glm/gtc/packing.inl

@@ -262,7 +262,7 @@ namespace detail
 	{
 		glm::int8 Scaled(round(clamp(v ,-1.0f, 1.0f) * 127.0f));
 		detail::snorm1x8 Packing;
-		Packing.x = Scaled.x;
+		Packing.data = Scaled;
 		return Packing.pack;
 	}
 	
@@ -321,6 +321,7 @@ namespace detail
 			float(Packing.data.z),
 			float(Packing.data.w));
 		Result *= float(1.5259021896696421759365224689097e-5); // 1.0 / 65535.0
+		return Result;
 	}
 
 	GLM_FUNC_QUALIFIER uint16 packSnorm1x16(float v)
@@ -445,7 +446,9 @@ namespace detail
     
 	GLM_FUNC_QUALIFIER vec3 unpackF11F11F10(uint32 const & v)
     {
-    
+    	vec3 Result;
+    	// TODO
+    	return Result;
     }
 
 }//namespace glm

+ 4 - 15
glm/gtc/type_ptr.inl

@@ -286,21 +286,10 @@ namespace glm
 
 	//! Return the address to the data of the matrix input.
 	/// @see gtc_type_ptr
-	template<typename T>
-	GLM_FUNC_QUALIFIER T * value_ptr(detail::tmat4x3<T> & mat)
-	{
-		return &(mat[0].x);
-	}
-    
-	/// Return the constant address to the data of the quaternion input.
-	/// @see gtc_type_ptr
 	template<typename T, precision P>
-	GLM_FUNC_QUALIFIER T * value_ptr
-	(
-		detail::tquat<T, P> & q
-	)
+	GLM_FUNC_QUALIFIER T * value_ptr(detail::tmat4x3<T, P> & mat)
 	{
-		return &(q[0]);
+		return &(mat[0].x);
 	}
 
 	//! Return the constant address to the data of the input parameter.
@@ -316,10 +305,10 @@ namespace glm
     
 	//! Return the address to the data of the quaternion input.
 	/// @see gtc_type_ptr
-	template<typename T>
+	template<typename T, precision P>
 	GLM_FUNC_QUALIFIER T * value_ptr
 	(
-        detail::tquat<T> & q
+        detail::tquat<T, P> & q
     )
 	{
 		return &(q[0]);

+ 0 - 1
test/gtc/gtc_packing.cpp

@@ -26,7 +26,6 @@
 /// @author Christophe Riccio
 ///////////////////////////////////////////////////////////////////////////////////
 
-
 #include <glm/glm.hpp>
 #include <glm/gtc/packing.hpp>
 #include <cstdio>