X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=build.c;h=1201177d9ea357b5d1349250a3c0df00861f302f;hb=0a33f65eecb5e75cddaefa08d3a5eb1a301d0479;hp=96a8930cfaa8ddb90238c3e821e9d4691d190161;hpb=e591be4b2ed26bbaaea79eff64e7b6070362a6ef;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/build.c b/build.c index 96a8930..1201177 100644 --- a/build.c +++ b/build.c @@ -3,6 +3,7 @@ #include "vg/vg_log.h" #include "vg/vg_opt.h" #include "vg/vg_build.h" +#include "vg/vg_build_utils_shader.h" /* * c build.c --release --clang @@ -27,8 +28,16 @@ void build_server( enum compiler compiler ) compiled_something = 1; } +void build_shaders(void); void build_game( enum compiler compiler ) { + static int shaders_built = 0; + if( !shaders_built ) + { + shaders_built = 1; + build_shaders(); + } + vg_build_start( "skaterift", compiler ); vg_build_object( "skaterift.c " ); vg_build_add_link_for_graphics(); @@ -99,3 +108,40 @@ int main( int argc, char *argv[] ) } } } + +#define _S( NAME, VS, FS ) \ + vg_build_shader( "shaders/" VS, "shaders/" FS, NULL, "shaders", NAME ) + +void build_shaders(void) +{ + vg_shader_set_include_dir( "shaders" ); + + /* Scene */ + _S( "scene_standard", "scene.vs", "scene_standard.fs" ); + _S( "scene_standard_alphatest", "scene.vs", "scene_standard_alphatest.fs" ); + _S( "scene_vertex_blend", "scene.vs", "scene_vertex_blend.fs" ); + _S( "scene_terrain", "scene.vs", "scene_terrain.fs" ); + _S( "scene_route", "scene.vs", "scene_route.fs" ); + _S( "scene_depth", "scene.vs", "scene_depth.fs" ); + _S( "scene_position", "scene.vs", "scene_position.fs" ); + _S( "scene_water", "scene.vs", "scene_water.fs" ); + _S( "scene_water_fast", "scene.vs", "scene_water_fast.fs" ); + _S( "scene_scoretext", "scene_sfd.vs", "scene_standard.fs" ); + + /* Models */ + _S( "model_sky", "model.vs", "model_sky.fs" ); + _S( "model_menu", "model.vs", "model_menu.fs" ); + _S( "model_character_view", "model_skinned.vs", "model_character_view.fs" ); + _S( "model_gate", "model_gate.vs", "model_gate_lq.fs" ); + + /* 2D */ + _S( "blit", "blit.vs", "blit.fs" ); + _S( "blitblur", "blit.vs", "blitblur.fs" ); + _S( "blitcolour","blit.vs", "colour.fs" ); + _S( "routeui", "routeui.vs", "routeui.fs" ); + +#if 0 + // 3D Standard + _S( "scoretext", "shaders/scoretext.vs", "shaders/vblend.fs" ); +#endif +}