From b84b59df091d382ba05d6d7f5cbd20e024617600 Mon Sep 17 00:00:00 2001 From: Daniel Ledda Date: Tue, 7 Jan 2025 10:29:07 +0100 Subject: [PATCH] linux build --- .clangd | 7 +++++-- build | 6 +++++- src/lib/djstdlib/core.cpp | 4 ++-- src/main.cpp | 3 +-- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.clangd b/.clangd index 81bc546..cfb056a 100644 --- a/.clangd +++ b/.clangd @@ -1,4 +1,7 @@ CompileFlags: Add: - - -DOS_WINDOWS - - "-IC:\\source\\libs\\include" +# LINUX FLAGS + - -DOS_LINUX +# WINDOW FLAGS +# - -DOS_WINDOWS +# - "-IC:\\source\\libs\\include" diff --git a/build b/build index 8f3ce76..cb244d5 100755 --- a/build +++ b/build @@ -1,4 +1,8 @@ #!/bin/bash -LIB_INCLUDE="-lglfw -lGLU -lGL -lXrandr -lXxf86vm -lXi -lXinerama -lX11 -lrt -ldl" +LIB_INCLUDE="-lglfw -lGL" g++ -g -g3 -DOS_LINUX=1 -DENABLE_ASSERT=1 ./src/main.cpp -o ./target/somaesque $LIB_INCLUDE +pushd target +./somaesque +popd + diff --git a/src/lib/djstdlib/core.cpp b/src/lib/djstdlib/core.cpp index 396b181..3e2f774 100644 --- a/src/lib/djstdlib/core.cpp +++ b/src/lib/djstdlib/core.cpp @@ -1,7 +1,6 @@ -#include -#include #include #include +#include #include "core.h" #include "os.cpp" #define STB_SPRINTF_IMPLEMENTATION @@ -298,6 +297,7 @@ real32 parsePositiveReal32(string str, size_t *lengthPointer) { *lengthPointer += 1; int fractionalPart = parsePositiveInt(fractionalPartStr, lengthPointer); if (wholePart >= 0 && fractionalPart >= 0) { + // TODO(dledda): implement powf with intrinsics? or just custom real32 fractionalPartMultiplier = 1.0f / powf(10.0f, (real32)fractionalPartStr.length); result = (real32)wholePart + (real32)fractionalPart * (real32)fractionalPartMultiplier; } diff --git a/src/main.cpp b/src/main.cpp index 88dd2cf..07318b2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2,7 +2,6 @@ #include #include "lib/glad/glad.c" -#include "lib/djstdlib/core.h" #include #define GLM_ENABLE_EXPERIMENTAL @@ -397,6 +396,6 @@ int main_gfx() { int main() { initialiseCore(); - return main_cmd(); + return main_gfx(); }