diff --git a/demo/tz/tz_triangle_demo.cpp b/demo/tz/tz_triangle_demo.cpp index 67d9eb40b8..8c6bbd2898 100644 --- a/demo/tz/tz_triangle_demo.cpp +++ b/demo/tz/tz_triangle_demo.cpp @@ -8,7 +8,8 @@ #include ImportedShaderHeader(triangle, vertex) #include ImportedShaderHeader(triangle, fragment) -int main() +#include "tz/main.hpp" +int tz_main() { tz::initialise(); tz::os::open_window({.title = "tz_triangle_demo"}); diff --git a/test/tz/bundle_test.cpp b/test/tz/bundle_test.cpp index fe3cd12ede..65f323385c 100644 --- a/test/tz/bundle_test.cpp +++ b/test/tz/bundle_test.cpp @@ -1,7 +1,8 @@ #include "tz/topaz.hpp" #include "tz/os/file.hpp" -int main() +#include "tz/main.hpp" +int tz_main() { std::string ret = tz_must(tz::os::read_file("./files/secret.txt")); tz_assert(ret == "42", ""); diff --git a/test/tz/gpu_compute_renderer_test.cpp b/test/tz/gpu_compute_renderer_test.cpp index cd6d36330c..b65ff6ede5 100644 --- a/test/tz/gpu_compute_renderer_test.cpp +++ b/test/tz/gpu_compute_renderer_test.cpp @@ -4,7 +4,8 @@ #include "tz/gpu/graph.hpp" #include ImportedShaderHeader(noop, compute) -int main() +#include "tz/main.hpp" +int tz_main() { tz::initialise(); diff --git a/test/tz/gpu_graphics_renderer_test.cpp b/test/tz/gpu_graphics_renderer_test.cpp index 7d5b265c75..4edcbc27e9 100644 --- a/test/tz/gpu_graphics_renderer_test.cpp +++ b/test/tz/gpu_graphics_renderer_test.cpp @@ -8,7 +8,8 @@ #include ImportedShaderHeader(triangle, vertex) #include ImportedShaderHeader(triangle, fragment) -int main() +#include "tz/main.hpp" +int tz_main() { tz::initialise(); tz::os::open_window({.title = "Graphics Render Test", .flags = tz::os::window_flags::invisible}); diff --git a/test/tz/gpu_initialise.cpp b/test/tz/gpu_initialise.cpp index 53743cbf33..255244c959 100644 --- a/test/tz/gpu_initialise.cpp +++ b/test/tz/gpu_initialise.cpp @@ -13,7 +13,8 @@ void go() tz::terminate(); } -int main() +#include "tz/main.hpp" +int tz_main() { // go twice, to test that terminate -> initialise again works. go(); diff --git a/test/tz/gpu_resource_test.cpp b/test/tz/gpu_resource_test.cpp index b3dacad3fc..aacca4e8e3 100644 --- a/test/tz/gpu_resource_test.cpp +++ b/test/tz/gpu_resource_test.cpp @@ -2,7 +2,8 @@ #include "tz/gpu/hardware.hpp" #include "tz/gpu/resource.hpp" -int main() +#include "tz/main.hpp" +int tz_main() { tz::initialise(); diff --git a/test/tz/gpu_shader_test.cpp b/test/tz/gpu_shader_test.cpp index 36a4838dc9..9027713f9a 100644 --- a/test/tz/gpu_shader_test.cpp +++ b/test/tz/gpu_shader_test.cpp @@ -6,7 +6,8 @@ #include ImportedShaderHeader(triangle, fragment) #include ImportedShaderHeader(noop, compute) -int main() +#include "tz/main.hpp" +int tz_main() { tz::initialise(); diff --git a/test/tz/initialise.cpp b/test/tz/initialise.cpp index bde112cd0e..2b3da98874 100644 --- a/test/tz/initialise.cpp +++ b/test/tz/initialise.cpp @@ -1,6 +1,7 @@ #include "tz/topaz.hpp" -int main() +#include "tz/main.hpp" +int tz_main() { tz::initialise(); tz::terminate(); diff --git a/test/tz/io_image_test.cpp b/test/tz/io_image_test.cpp index 505f605acb..3f8dd7a8a0 100644 --- a/test/tz/io_image_test.cpp +++ b/test/tz/io_image_test.cpp @@ -2,7 +2,8 @@ #include "tz/os/file.hpp" #include "tz/io/image.hpp" -int main() +#include "tz/main.hpp" +int tz_main() { std::string imgdata = tz_must(tz::os::read_file("./files/img.png")); std::span span{reinterpret_cast(imgdata.data()), imgdata.size()}; diff --git a/test/tz/lua_execute_test.cpp b/test/tz/lua_execute_test.cpp index 4c51068651..9343dc9f20 100644 --- a/test/tz/lua_execute_test.cpp +++ b/test/tz/lua_execute_test.cpp @@ -23,7 +23,8 @@ void do_work() tz_assert(myvar == "hello there", "string get failed"); } -int main() +#include "tz/main.hpp" +int tz_main() { tz::initialise(); // initialise topaz diff --git a/test/tz/matrix_test.cpp b/test/tz/matrix_test.cpp index a50e0c576f..ca12b9eab7 100644 --- a/test/tz/matrix_test.cpp +++ b/test/tz/matrix_test.cpp @@ -82,7 +82,8 @@ void test_matrix_transpose() tz_assert(transposed == expected, "transpose() failed. Expected transposed matrix"); } -int main() +#include "tz/main.hpp" +int tz_main() { test_matrix_constructor(); test_matrix_constructor(); diff --git a/test/tz/ren_quad_test.cpp b/test/tz/ren_quad_test.cpp index f4250e449b..642b1e9a2f 100644 --- a/test/tz/ren_quad_test.cpp +++ b/test/tz/ren_quad_test.cpp @@ -3,7 +3,8 @@ #include "tz/os/window.hpp" #include "tz/gpu/hardware.hpp" -int main() +#include "tz/main.hpp" +int tz_main() { tz::initialise(); tz::os::open_window({.flags = tz::os::window_flags::invisible}); diff --git a/test/tz/vector_test.cpp b/test/tz/vector_test.cpp index 56d3cc52ca..02dcd26454 100644 --- a/test/tz/vector_test.cpp +++ b/test/tz/vector_test.cpp @@ -102,7 +102,8 @@ void test_basic_operations() "Division failed. Expected: {{10.0f, 2.0f, 3.0f}}, got: {{{}, {}, {}}}", div_vec[0], div_vec[1], div_vec[2]); } -int main() +#include "tz/main.hpp" +int tz_main() { test_constructor(); test_constructor();