Compare commits

...

5 Commits

Author SHA1 Message Date
Ben Visness
ddb9971e71 Update README 2020-07-09 08:51:53 -05:00
GsxCasper
341a376a17 Added HMM_PREFIX macro to function implementations (#120) 2020-07-08 16:32:29 -05:00
Ben Visness
c825fe48cf Update version and release notes 2020-04-06 10:02:16 -05:00
Ben Visness
15bef820db Add ability to customize HMM_ prefix (#114)
* Add prefix macro and use it everywhere

* Add lightweight test for prefix

* Add a little doc blurb
2020-04-06 09:57:10 -05:00
Ben Visness
fe32f081f2 Suppress float equality warnings (#113)
* Add a macro to help with deprecations

* Suppress warnings about float equality
2020-04-06 09:55:40 -05:00
5 changed files with 368 additions and 328 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -10,6 +10,8 @@ To get started, go download [the latest release](https://github.com/HandmadeMath
Version | Changes |
----------------|----------------|
**1.11.1** | Added HMM_PREFIX macro to a few functions that were missing it. |
**1.11.0** | Added ability to customize or remove the default `HMM_` prefix on function names by defining a macro called `HMM_PREFIX(name)`. |
**1.10.1** | Removed stdint.h, this doesn't exist on some really old compilers and we didn't really use it anyways. |
**1.10.0** | Made HMM_Perspective use vertical FOV instead of horizontal FOV for consistency with other graphics APIs. |
**1.9.0** | Added SSE versions of quaternion operations. |

View File

@@ -0,0 +1,12 @@
#define HMM_PREFIX(name) WOW_##name
#define HANDMADE_MATH_IMPLEMENTATION
#define HANDMADE_MATH_NO_INLINE
#include "../HandmadeMath.h"
int main() {
hmm_vec4 a = WOW_Vec4(1, 2, 3, 4);
hmm_vec4 b = WOW_Vec4(5, 6, 7, 8);
WOW_Add(a, b);
}

View File

@@ -1,8 +1,8 @@
BUILD_DIR=./build
CXXFLAGS+=-g -Wall -Wextra -pthread -Wno-missing-braces -Wno-missing-field-initializers
CXXFLAGS+=-g -Wall -Wextra -pthread -Wno-missing-braces -Wno-missing-field-initializers -Wfloat-equal
all: c c_no_sse cpp cpp_no_sse build_c_without_coverage build_cpp_without_coverage
all: c c_no_sse cpp cpp_no_sse build_c_without_coverage build_cpp_without_coverage build_cpp_different_prefix
build_all: build_c build_c_no_sse build_cpp build_cpp_no_sse
@@ -58,7 +58,7 @@ build_cpp_no_sse: HandmadeMath.cpp test_impl
test_impl: hmm_test.cpp hmm_test.c
build_c_without_coverage: HandmadeMath.c
build_c_without_coverage: HandmadeMath.c test_impl
@echo "\nCompiling in C mode"
mkdir -p $(BUILD_DIR)
cd $(BUILD_DIR)\
@@ -75,3 +75,11 @@ build_cpp_without_coverage: HandmadeMath.cpp test_impl
&& $(CXX) $(CPPFLAGS) $(CXXFLAGS) -ohmm_test_cpp_no_sse \
-DHANDMADE_MATH_CPP_MODE -DWITHOUT_COVERAGE \
../HandmadeMath.cpp ../hmm_test.cpp
build_cpp_different_prefix: HandmadeMath.cpp
@echo "\nCompiling C++ with different prefix"
mkdir -p $(BUILD_DIR)
cd $(BUILD_DIR) \
&& $(CXX) $(CPPFLAGS) $(CXXFLAGS) -ohmm_test_cpp_different_prefix \
-DHANDMADE_MATH_CPP_MODE -DDIFFERENT_PREFIX \
../HandmadeMathDifferentPrefix.cpp

View File

@@ -74,9 +74,9 @@ TEST(ScalarMath, Power)
TEST(ScalarMath, PowerF)
{
EXPECT_FLOAT_EQ(HMM_PowerF(2.0f, 0), 1.0f);
EXPECT_NEAR(HMM_PowerF(2.0f, 4.1), 17.148376f, 0.0001f);
EXPECT_NEAR(HMM_PowerF(2.0f, -2.5), 0.176777f, 0.0001f);
EXPECT_FLOAT_EQ(HMM_PowerF(2.0f, 0.0f), 1.0f);
EXPECT_NEAR(HMM_PowerF(2.0f, 4.1f), 17.148376f, 0.0001f);
EXPECT_NEAR(HMM_PowerF(2.0f, -2.5f), 0.176777f, 0.0001f);
}
TEST(ScalarMath, Lerp)