Browse Source

Added offset to mtxOrtho.

Branimir Karadžić 11 years ago
parent
commit
2f1645ec8e
1 changed files with 2 additions and 2 deletions
  1. 2 2
      include/bx/fpumath.h

+ 2 - 2
include/bx/fpumath.h

@@ -268,7 +268,7 @@ namespace bx
 		mtxProjXYWH(_result, 0.0f, 0.0f, width, height, _near, _far, _oglNdc);
 		mtxProjXYWH(_result, 0.0f, 0.0f, width, height, _near, _far, _oglNdc);
 	}
 	}
 
 
-	inline void mtxOrtho(float* _result, float _left, float _right, float _bottom, float _top, float _near, float _far)
+	inline void mtxOrtho(float* _result, float _left, float _right, float _bottom, float _top, float _near, float _far, float _offset = 0.0f)
 	{
 	{
 		const float aa = 2.0f/(_right - _left);
 		const float aa = 2.0f/(_right - _left);
 		const float bb = 2.0f/(_top - _bottom);
 		const float bb = 2.0f/(_top - _bottom);
@@ -281,7 +281,7 @@ namespace bx
 		_result[0] = aa;
 		_result[0] = aa;
 		_result[5] = bb;
 		_result[5] = bb;
 		_result[10] = cc;
 		_result[10] = cc;
-		_result[12] = dd;
+		_result[12] = dd + _offset;
 		_result[13] = ee;
 		_result[13] = ee;
 		_result[14] = ff;
 		_result[14] = ff;
 		_result[15] = 1.0f;
 		_result[15] = 1.0f;