diff --git a/HandmadeMath.h b/HandmadeMath.h index 0676a9e..3619400 100644 --- a/HandmadeMath.h +++ b/HandmadeMath.h @@ -531,6 +531,8 @@ HINLINE vec2 Multiply(vec2 Left, vec2 Right) { vec2 Result = MultiplyV2(Left, Right); + + return(Result); } HINLINE vec3 @@ -553,7 +555,7 @@ HINLINE vec2 Divide(vec2 Left, vec2 Right) { vec2 Result = DivideV2(Left, Right); - + return(Result); } @@ -573,6 +575,91 @@ Divide(vec4 Left, vec4 Right) return(Result); } +vec2 operator+(vec2 Left, vec2 Right) +{ + vec2 Result = Add(Left, Right); + + return(Result); +} + +vec3 operator+(vec3 Left, vec3 Right) +{ + vec3 Result = Add(Left, Right); + + return(Result); +} + +vec4 operator+(vec4 Left, vec4 Right) +{ + vec4 Result = Add(Left, Right); + + return(Result); +} + +vec2 operator-(vec2 Left, vec2 Right) +{ + vec2 Result = Subtract(Left, Right); + + return(Result); +} + +vec3 operator-(vec3 Left, vec3 Right) +{ + vec3 Result = Subtract(Left, Right); + + return(Result); +} + +vec4 operator-(vec4 Left, vec4 Right) +{ + vec4 Result = Subtract(Left, Right); + + return(Result); +} + +vec2 operator*(vec2 Left, vec2 Right) +{ + vec2 Result = Multiply(Left, Right); + + return(Result); +} + +vec3 operator*(vec3 Left, vec3 Right) +{ + vec3 Result = Multiply(Left, Right); + + return(Result); +} + +vec4 operator*(vec4 Left, vec4 Right) +{ + vec4 Result = Multiply(Left, Right); + + return(Result); +} + +vec2 operator/(vec2 Left, vec2 Right) +{ + vec2 Result = Divide(Left, Right); + + return(Result); +} + +vec3 operator/(vec3 Left, vec3 Right) +{ + vec3 Result = Divide(Left, Right); + + return(Result); +} + +vec4 operator/(vec4 Left, vec4 Right) +{ + vec4 Result = Divide(Left, Right); + + return(Result); +} + + #endif /* HANDMADE_MATH_CPP_MODE */ #endif /* HANDMADE_MATH_IMPLEMENTATION */ diff --git a/build.bat b/build.bat index 45e920a..80c0fa4 100644 --- a/build.bat +++ b/build.bat @@ -5,9 +5,9 @@ IF NOT EXIST build mkdir build pushd build REM C Build -cl -FC -nologo -Z7 -Tc ../main.c +REM cl -FC -nologo -Z7 -Tc ../main.c REM C++ Build -REM cl -nologo -Zi ../main.cpp +cl -nologo -Zi -FC ../main.cpp popd diff --git a/main.cpp b/main.cpp index f6900f9..64918b7 100644 --- a/main.cpp +++ b/main.cpp @@ -2,8 +2,17 @@ #define HANDMADE_MATH_CPP_MODE #include "HandmadeMath.h" +#include +#include + int main(int ArgC, char **ArgV) { + vec2 TestVector1 = V2(50.0f, 36.0f); + vec2 TestVector2 = V2(5.0f, 6.0f); + + vec2 Result = TestVector1 - TestVector2; + _getch(); + return(0); }