Commit Graph

16 Commits

Author SHA1 Message Date
Michael Fabian 'Xaymar' Dirks e0e2d9fe80 project: Improve Linux support (#27 and #13)
While Linux was not an original goal of the project, it should still be supported out of the box. Therefore a number of changes are contained in this changeset:

- All C++ .h files were renamed to .hpp.
- All C includes (<....h>) were replaced with C++ includes (<c...>) and missing includes were added.
- std::memset and std::memcpy was replaced with memset and memcpy.
- All anonymous structs were removed where necessary.
- `extern "C"` was removed where it wasn't needed.
- #pragma warning was placed behind an #ifdef _MSC_VER
- The macros for `min`, `max` and `clamp` were removed as they were not used.
- `-fpedantic` was added to the GCC flags for bitmask support.
- `gs::rendertarget_op` is now declared before use.
- std::exception(const char*) was replaced with std::runtime_error(const char*).
- Added aligned_alloc and aligned_free macros for GCC and MSVC support.
- Replaced use of `sprintf_s` with `snprintf`.
- Placed additional guards around windows only code.

Additonally some changes were made that do not affect Linux:
- `NOMINMAX` and `NOINOUT` were removed.

Fixes: #27
Fixes: #13
2019-01-14 22:31:35 +01:00
Michael Fabian 'Xaymar' Dirks c94a3fa11f util-math: Use C++ math header 2018-12-23 19:57:07 +01:00
Michael Fabian 'Xaymar' Dirks f327f4ccc6 util-math: Undefine macro 2018-09-30 21:44:00 +02:00
Michael Fabian 'Xaymar' Dirks 6561ea9b3c util-math: Rename get_power_of_two to get_power_of_two_exponent 2018-09-29 16:57:41 +02:00
Michael Fabian 'Xaymar' Dirks bc89eaf33a util-math: Fix is_power_of_two_loop for non-64-bit types 2018-09-28 21:21:40 +02:00
Michael Fabian 'Xaymar' Dirks 528d36a13f util-math: Fix compile error and add get_power_of_two_* 2018-09-28 14:23:26 +02:00
Michael Fabian 'Xaymar' Dirks 1923a724d7 util-math: Formatting and is_power_of_two templates 2018-09-28 14:17:43 +02:00
Michael Fabian 'Xaymar' Dirks 0cd4520774 util-math: Bilateral Blur 2018-04-28 12:45:23 +02:00
Michael Fabian 'Xaymar' Dirks ec19f44f96 project: Don't prefix includes with "libobs/" 2018-04-23 17:53:27 +02:00
Michael Fabian 'Xaymar' Dirks 304db23335 util-math: Add SizeFromString method
Converts a String to an std::pair of int64_t (long long), which contain the size or 0 if none could be parsed. Any delimiter except digits(0-9), a minus sign(-) or a plus sign(+) between width and height are allowed. If a plus or minus sign is used as a delimiter, it must immediately be followed by the second size number. This allows for formats such as: 100x100, 100:100, 100p100, 100@100, 100+100 and so on, but not formats such as 100+:100, 100ThisIsSomeReall+yLongText100, etc.

The parameter 'allowSquare' also determines what to do when the height parameter is not found. A value of true will have the function return <width,width> instead of <width,0>.
2018-03-05 16:36:20 +01:00
Michael Fabian 'Xaymar' Dirks f721ad0f19 util-math: Fix standalone compilation issues
All libobs files must be loaded with libobs/... instead of directly.
2018-01-08 16:47:39 +01:00
Michael Fabian 'Xaymar' Dirks 08c088ce5a util-math, util-memory: Formatting 2018-01-08 16:14:54 +01:00
Michael Fabian 'Xaymar' Dirks a3d859fb4f util-math: Implement aligned vec3 and vec4 versions
A bug in Visual C++ 2013 32-bit & 2015 32-bit causes the C++ compiler to incorrectly align the vec3 and vec4 structs to 8-byte instead of 16-byte, resulting in a crash if the target PC supports SSE. Visual Studio 2017 and 64-bit builds are not affected.

Related: #9
2018-01-08 15:29:42 +01:00
Michael Fabian 'Xaymar' Dirks 0d794254be util-math: Fix MSVC 2013 errors 2017-12-14 03:00:31 +01:00
Michael Fabian 'Xaymar' Dirks 408481c22d util-math: Functions to calculate nearest power of two values 2017-12-14 01:36:07 +01:00
Michael Fabian 'Xaymar' Dirks d78d3024cc util-math: Add commonly used mathematical functions 2017-12-14 00:28:35 +01:00