linux build

This commit is contained in:
Daniel Ledda
2025-01-07 10:29:07 +01:00
parent 6872ebf418
commit b84b59df09
4 changed files with 13 additions and 7 deletions

View File

@@ -1,4 +1,7 @@
CompileFlags:
Add:
- -DOS_WINDOWS
- "-IC:\\source\\libs\\include"
# LINUX FLAGS
- -DOS_LINUX
# WINDOW FLAGS
# - -DOS_WINDOWS
# - "-IC:\\source\\libs\\include"

6
build
View File

@@ -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

View File

@@ -1,7 +1,6 @@
#include <iostream>
#include <ostream>
#include <math.h>
#include <string.h>
#include <unistd.h>
#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;
}

View File

@@ -2,7 +2,6 @@
#include <vector>
#include "lib/glad/glad.c"
#include "lib/djstdlib/core.h"
#include <GLFW/glfw3.h>
#define GLM_ENABLE_EXPERIMENTAL
@@ -397,6 +396,6 @@ int main_gfx() {
int main() {
initialiseCore();
return main_cmd();
return main_gfx();
}