sdl_runtime_compiler git · main
SDL3 game for running and compiling code at runtime
C++ 72.3% C 26.2%git clone https://git.christianimmanuel.de/sdl-graphics/sdl_runtime_compiler.gitwget https://git.christianimmanuel.de/sdl-graphics/sdl_runtime_compiler/archive/sdl_runtime_compiler.tar.gzFix Rename MOD To Dyn
assets/sandbox.c | 11 ++++++----- assets/sandbox.c.last_ok | 11 ++++++----- assets/sandbox.c.orig | 8 ++++---- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/assets/sandbox.c b/assets/sandbox.c index aa2846b..acc21b5 100644 --- a/assets/sandbox.c +++ b/assets/sandbox.c @@ -1,8 +1,8 @@ # include "game_mod_abi.h" static int n ; -static ModObject * o ; +static DynObject * o ; static void box ( double x , double y , double z , double w , double h , double d , int dyn ) { -o [ n ] .kind = MOD_BOX ; o [ n ] .dynamic = dyn ; +o [ n ] .kind = DYN_BOX ; o [ n ] .dynamic = dyn ; double hx = w * 0.5 , hy = h * 0.5 , hz = d * 0.5 ; o [ n ] .x = x ; o [ n ] .y = y + hy ; @@ -12,7 +12,7 @@ o [ n ] .r = 0.6 ; o [ n ] .g = 0.6 ; o [ n ] .b = 0.8 ; n = n + 1 ; } static void text ( double x , double y , double z , char * t ) { -o [ n ] .kind = MOD_TEXT ; +o [ n ] .kind = DYN_TEXT ; o [ n ] .x = x ; o [ n ] .y = y ; o [ n ] .z = z ; o [ n ] .r = 1 ; o [ n ] .g = 1 ; o [ n ] .b = 1 ; int i = 0 ; @@ -20,11 +20,12 @@ while ( t [ i ] != 0 ) { o [ n ] .text [ i ] = t [ i ] ; i = i + 1 ; } o [ n ] .text [ i ] = 0 ; n = n + 1 ; } -int game_build ( ModObject * out , int max ) { +int game_build ( DynObject * out , int max ) { ( void ) max ; o = out ; n = 0 ; text ( 0 , - 15 , 5 , "hi" ) ; box ( 0 , - 16 , 5 , 2 , 1 , 2 , 0 ) ; -box ( 3 , - 16 , 5 , 2 , 2 , 2 , 0 ) ; +for ( int i = 0 ; i < 10 ; i ++ ) +box ( 2 * i , - 16 , 5 , 2 , 0 + i , 2 , 0 ) ; return n ; } diff --git a/assets/sandbox.c.last_ok b/assets/sandbox.c.last_ok index aa2846b..acc21b5 100644 --- a/assets/sandbox.c.last_ok +++ b/assets/sandbox.c.last_ok @@ -1,8 +1,8 @@ # include "game_mod_abi.h" static int n ; -static ModObject * o ; +static DynObject * o ; static void box ( double x , double y , double z , double w , double h , double d , int dyn ) { -o [ n ] .kind = MOD_BOX ; o [ n ] .dynamic = dyn ; +o [ n ] .kind = DYN_BOX ; o [ n ] .dynamic = dyn ; double hx = w * 0.5 , hy = h * 0.5 , hz = d * 0.5 ; o [ n ] .x = x ; o [ n ] .y = y + hy ; @@ -12,7 +12,7 @@ o [ n ] .r = 0.6 ; o [ n ] .g = 0.6 ; o [ n ] .b = 0.8 ; n = n + 1 ; } static void text ( double x , double y , double z , char * t ) { -o [ n ] .kind = MOD_TEXT ; +o [ n ] .kind = DYN_TEXT ; o [ n ] .x = x ; o [ n ] .y = y ; o [ n ] .z = z ; o [ n ] .r = 1 ; o [ n ] .g = 1 ; o [ n ] .b = 1 ; int i = 0 ; @@ -20,11 +20,12 @@ while ( t [ i ] != 0 ) { o [ n ] .text [ i ] = t [ i ] ; i = i + 1 ; } o [ n ] .text [ i ] = 0 ; n = n + 1 ; } -int game_build ( ModObject * out , int max ) { +int game_build ( DynObject * out , int max ) { ( void ) max ; o = out ; n = 0 ; text ( 0 , - 15 , 5 , "hi" ) ; box ( 0 , - 16 , 5 , 2 , 1 , 2 , 0 ) ; -box ( 3 , - 16 , 5 , 2 , 2 , 2 , 0 ) ; +for ( int i = 0 ; i < 10 ; i ++ ) +box ( 2 * i , - 16 , 5 , 2 , 0 + i , 2 , 0 ) ; return n ; } diff --git a/assets/sandbox.c.orig b/assets/sandbox.c.orig index 5e72631..5ae1dc2 100644 --- a/assets/sandbox.c.orig +++ b/assets/sandbox.c.orig @@ -1,15 +1,15 @@ # include "game_mod_abi.h" static int n ; -static ModObject * o ; +static DynObject * o ; static void box ( double x , double y , double z , double hx , double hy , double hz ) { -o [ n ] .kind = MOD_BOX ; +o [ n ] .kind = DYN_BOX ; o [ n ] .x = x ; o [ n ] .y = y ; o [ n ] .z = z ; o [ n ] .hx = hx ; o [ n ] .hy = hy ; o [ n ] .hz = hz ; o [ n ] .r = 0.6 ; o [ n ] .g = 0.6 ; o [ n ] .b = 0.8 ; n = n + 1 ; } static void text ( double x , double y , double z , char * t ) { -o [ n ] .kind = MOD_TEXT ; +o [ n ] .kind = DYN_TEXT ; o [ n ] .x = x ; o [ n ] .y = y ; o [ n ] .z = z ; o [ n ] .r = 1 ; o [ n ] .g = 1 ; o [ n ] .b = 1 ; int i = 0 ; @@ -17,7 +17,7 @@ while ( t [ i ] != 0 ) { o [ n ] .text [ i ] = t [ i ] ; i = i + 1 ; } o [ n ] .text [ i ] = 0 ; n = n + 1 ; } -int game_build ( ModObject * out , int max ) { +int game_build ( DynObject * out , int max ) { ( void ) max ; o = out ; n = 0 ; box ( 0 , - 16 , 5 , 1 , 1 , 1 ) ;