change build system to CMake and use SDL3 for everything
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
#pragma once
|
||||
#ifdef _WIN32
|
||||
#define log(format, ...) _log(__FUNCTION__, format, __VA_ARGS__)
|
||||
#define log_error(format, ...) _log_error(__FUNCTION__, format, __VA_ARGS__)
|
||||
#else
|
||||
#define log(format, ...) _log(__FUNCTION__, format __VA_OPT__(,) __VA_ARGS__)
|
||||
#define log_error(format, ...) _log_error(__FUNCTION__, format __VA_OPT__(,) __VA_ARGS__)
|
||||
#endif
|
||||
|
||||
void _log(const char* function_name, const char* format, ...);
|
||||
void _log_error(const char* function_name, const char* format, ...);
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#include <stddef.h>
|
||||
|
||||
struct String {
|
||||
|
||||
|
||||
+841
-886
File diff suppressed because it is too large
Load Diff
+8
-12
@@ -21,12 +21,12 @@ constexpr inline float clamp(float min, float a, float max) {
|
||||
return result;
|
||||
}
|
||||
|
||||
//clamp für 0-1 Bereich (Grafik)
|
||||
//clamp für 0-1 Bereich (Grafik)
|
||||
constexpr inline float clamp01(float a) {
|
||||
return clamp(0, a, 1);
|
||||
}
|
||||
|
||||
//clamp für Integer
|
||||
//clamp für Integer
|
||||
constexpr inline int64_t clamp(int64_t min, int64_t a, int64_t max) {
|
||||
int64_t result = a;
|
||||
if (a < min)
|
||||
@@ -221,7 +221,7 @@ inline float length(V2 a) {
|
||||
return square_root(length_squared(a));
|
||||
}
|
||||
|
||||
//Reziproke der Länge
|
||||
//Reziproke der Länge
|
||||
inline float reciprocal_length(V2 a) {
|
||||
return reciprocal_square_root(length_squared(a));
|
||||
}
|
||||
@@ -231,7 +231,7 @@ inline V2 normalize(V2 a) {
|
||||
return a * reciprocal_length(a);
|
||||
}
|
||||
|
||||
//Vektor der 90°
|
||||
//Vektor der 90
|
||||
inline V2 perp(V2 a) {
|
||||
return {
|
||||
-a.y,
|
||||
@@ -239,7 +239,7 @@ inline V2 perp(V2 a) {
|
||||
};
|
||||
}
|
||||
|
||||
//clamp für 2-dim Vektor
|
||||
//clamp für 2-dim Vektor
|
||||
inline V2 clamp01(V2 a) {
|
||||
return {
|
||||
clamp01(a.x),
|
||||
@@ -435,7 +435,7 @@ inline float length(V3 a) {
|
||||
return square_root(length_squared(a));
|
||||
}
|
||||
|
||||
//Reziproke der Länge
|
||||
//Reziproke der Länge
|
||||
inline float reciprocal_length(V3 a) {
|
||||
return reciprocal_square_root(length_squared(a));
|
||||
}
|
||||
@@ -596,7 +596,7 @@ inline M2x2 transpose(M2x2 a) {
|
||||
};
|
||||
}
|
||||
|
||||
//Einheitsmatrix (oder Identitätsmatrix)
|
||||
//Einheitsmatrix (oder Identitätsmatrix)
|
||||
constexpr inline M2x2 identityM2x2() {
|
||||
return {
|
||||
1.0f, 0.0f,
|
||||
@@ -711,7 +711,7 @@ inline M3x3 transpose(M3x3 a) {
|
||||
};
|
||||
}
|
||||
|
||||
//Einheitsmatrix (oder Identitätsmatrix)
|
||||
//Einheitsmatrix (oder Identitätsmatrix)
|
||||
inline M3x3 identityM3x3() {
|
||||
return {
|
||||
1.0f, 0.0f, 0.0f,
|
||||
@@ -770,7 +770,3 @@ inline __m128 square_root(__m128 a) {
|
||||
inline __m128 operator /(m128 a, m128 b) {
|
||||
return _mm_div_ps(a.val, b.val);
|
||||
}
|
||||
|
||||
inline __m128 lerp(__m128 a, float t, float b) {
|
||||
return (1.0f - t) * a + (t * b);
|
||||
}
|
||||
Reference in New Issue
Block a user