2 #include "vg/vg_platform.h"
5 #include "vg/vg_build.h"
6 #include "vg/vg_build_utils_shader.h"
9 u32 optimize_test_compile
= 0;
12 * Compilation specifications
13 * -------------------------------------------------------------------------- */
15 void build_game_content(void){
16 const char *project_name
= vg_build
.project_name
.buffer
;
17 vg_low( "Building game content structure\n" );
18 vg_symlink( "textures_qoi", "textures" );
19 vg_symlink( "maps", "maps" );
20 vg_symlink( "sound", "sound" );
21 vg_syscall( "mkdir -p bin/%s/cfg", project_name
);
24 void build_shaders(void);
25 void compile_game( int binaries
, int content
){
33 vg_build_new( "marblecomp" );
36 vg_add_source( "marblecomp.c" );
39 vg_compile( "marblecomp" );
48 * -------------------------------------------------------------------------- */
50 void s_release_all(void){
51 vg_info( "running script: s_release_all(void)\n" );
53 vg_build
.optimization
= 3;
55 vg_build
.arch
= k_architecture_x86_64
;
56 vg_build
.compiler
= k_compiler_zigcc
;
57 vg_build
.libc
= k_libc_version_2_23
;
59 /* binaries for windows and linux */
60 vg_build
.platform
= k_platform_windows
;
62 vg_tarball_last_project();
63 vg_success( "Completed 1/3\n" );
65 vg_build
.platform
= k_platform_linux
;
67 vg_tarball_last_project();
68 vg_success( "Completed 2/3\n" );
70 /* content files for any platform */
71 vg_build
.platform
= k_platform_anyplatform
;
72 vg_build
.compiler
= k_compiler_blob
;
73 vg_build
.arch
= k_architecture_anyarch
;
74 vg_build
.libc
= k_libc_version_native
;
76 vg_tarball_last_project();
77 vg_success( "Completed 3/3\n" );
80 void s_testing_build(void){
81 vg_info( "running script: s_testing_build(void)\n" );
83 vg_build
.optimization
= optimize_test_compile
;
85 vg_build
.platform
= k_platform_linux
;
86 vg_build
.arch
= k_architecture_x86_64
;
87 vg_build
.compiler
= k_compiler_clang
;
88 vg_build
.libc
= k_libc_version_native
;
92 vg_success( "Completed 1/1\n" );
95 int main( int argc
, char *argv
[] ){
97 while( vg_argp( argc
, argv
) ){
98 if( vg_long_opt( "release-all" ) )
101 if( vg_long_opt( "testing-build" ) )
105 optimize_test_compile
= 3;
108 if( vg_build
.warnings
)
109 vg_warn( "Finished with %u warnings\n", vg_build
.warnings
);
111 vg_success( "All scripts ran successfully\n" );
114 #define _S( NAME, VS, FS ) \
115 vg_build_shader( "shaders/" VS, "shaders/" FS, NULL, "shaders", NAME )
117 void build_shaders(void){
118 vg_info( "Compiling shader headers\n" );
119 vg_shader_set_include_dir( "shaders" );
122 _S( "tile_colour", "tile_colour.vs.glsl", "tile_colour.fs.glsl" );
123 _S( "tile_main", "tile_main.vs.glsl", "tile_main.fs.glsl" );
124 _S( "ball", "ball.vs.glsl", "ball.fs.glsl" );
125 _S( "background", "background.vs.glsl", "background.fs.glsl" );
126 _S( "wire", "wire.vs.glsl", "wire.fs.glsl" );
127 _S( "button", "button.vs.glsl", "button.fs.glsl" );
128 _S( "sprite", "sprite.vs.glsl", "sprite.fs.glsl" );
129 _S( "post_darken", "post_darken.vs.glsl", "post_darken.fs.glsl" );
130 _S( "post_comp", "post_comp.vs.glsl", "post_comp.fs.glsl" );
131 _S( "post_blur", "post_blur.vs.glsl", "post_blur.fs.glsl" );