From 0c2f8bdbd5004a27fdb20fec5e2e5088b6540b54 Mon Sep 17 00:00:00 2001 From: Anton Ljungdahl Date: Wed, 14 May 2025 13:30:49 +0200 Subject: [PATCH] working caseys thread window creation example --- build.bat | 7 +++++-- src/base/base_core.h | 17 ++++++++++++++++- src/main.c | 24 ++++++++---------------- src/os/os_core.c | 2 ++ src/os/os_core.h | 7 +++++++ src/os/os_inc.c | 5 ++++- src/os/os_inc.h | 5 +++++ 7 files changed, 47 insertions(+), 20 deletions(-) create mode 100644 src/os/os_core.c create mode 100644 src/os/os_core.h diff --git a/build.bat b/build.bat index ce70279..63911b7 100644 --- a/build.bat +++ b/build.bat @@ -1,5 +1,5 @@ @echo off - +echo --- Metagen @rem --------------------------------------------------------------------------------------- @rem Build and run codegen @@ -24,11 +24,12 @@ pushd gen_test popd popd +echo --- Main @rem --------------------------------------------------------------------------------------- @rem Build main program -set CommonCompilerFlags=/nologo /Zi /FC /Od +set CommonCompilerFlags=/nologo /Zi /FC /Od /wd4042 @rem /WX /W4 /wd4201 /wd4100 /wd4189 /wd4244 /wd4127 /wd4456 @rem @rem @@ -48,3 +49,5 @@ popd IF NOT %LastError%==0 GOTO :end :end + +echo --- \ No newline at end of file diff --git a/src/base/base_core.h b/src/base/base_core.h index 3eb34e9..6e0ccd2 100644 --- a/src/base/base_core.h +++ b/src/base/base_core.h @@ -1,4 +1,19 @@ +#ifndef BASE_CORE_H +#define BASE_CORE_H + +#include + +typedef int32_t S32; +typedef uint32_t U32; +typedef int64_t S64; +typedef uint64_t U64; +typedef float F32; +typedef double F64; +#define global static +#define function static + + +#endif /* BASE_CORE_H */ -#define function static \ No newline at end of file diff --git a/src/main.c b/src/main.c index 7493870..9afb54e 100644 --- a/src/main.c +++ b/src/main.c @@ -1,12 +1,16 @@ #include -////////////////////////////////////////////////////////////////////////////////////////////// + +static void entry_point(); + + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //~ Header includes #include "base/base_inc.h" #include "os/os_inc.h" #include "render/render_inc.h" -////////////////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //~ Source includes #include "base/base_inc.c" #include "os/os_inc.c" @@ -17,22 +21,10 @@ -///////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //~ Main entry function void entry_point() { - + printf("HELLO MAIN"); } - -int main() -{ - printf("Accessing generated table gen_table[enum]\n"); - for (int i = 0; i < TestEnum_COUNT; i++) - { - printf("table[%i] = %s \n", i, test_value_table[i]); - - - } - return 0; -} \ No newline at end of file diff --git a/src/os/os_core.c b/src/os/os_core.c new file mode 100644 index 0000000..1d1efce --- /dev/null +++ b/src/os/os_core.c @@ -0,0 +1,2 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//~ \ No newline at end of file diff --git a/src/os/os_core.h b/src/os/os_core.h new file mode 100644 index 0000000..4263eed --- /dev/null +++ b/src/os/os_core.h @@ -0,0 +1,7 @@ +#ifndef OS_CORE_H +#define OS_CORE_H +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//~ + + +#endif /* OS_CORE_H */ \ No newline at end of file diff --git a/src/os/os_inc.c b/src/os/os_inc.c index 1fc3a41..b108492 100644 --- a/src/os/os_inc.c +++ b/src/os/os_inc.c @@ -1,2 +1,5 @@ ////////////////////////////////////////////////////////////////////////////////////////////// -//~ os source includes \ No newline at end of file +//~ os source includes + +#include "os/os_core.c" +#include "os/win32/os_core_win32.c" \ No newline at end of file diff --git a/src/os/os_inc.h b/src/os/os_inc.h index 3d01b2b..83f8897 100644 --- a/src/os/os_inc.h +++ b/src/os/os_inc.h @@ -4,4 +4,9 @@ ////////////////////////////////////////////////////////////////////////////////////////////// //~ OS Header includes +#include "os/os_core.h" + +// If win32 +#include "os/win32/os_core_win32.h" + #endif /* OS_INC_H */ \ No newline at end of file