Skip to content

Commit

Permalink
[entrypoint] added tz/main.hpp to provide support for the tz_main ent…
Browse files Browse the repository at this point in the history
…ry point. this is because all executables created by topaz_add_executable are now GUI applications on windows instead of console applications. however, this forces us to deal wit the stupid monstrous nonsense that is WinMain. so tz_main is defined to whatever is needed (does nothing if you're not on windows of course)
  • Loading branch information
harrand committed Oct 31, 2024
1 parent 74e5d02 commit 88df6d1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmake/topaz.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function(topaz_add_executable)
${ARGN}
)

add_executable(${TOPAZ_ADD_EXECUTABLE_TARGET}
add_executable(${TOPAZ_ADD_EXECUTABLE_TARGET} WIN32
${TOPAZ_ADD_EXECUTABLE_SOURCES}
)
topaz_add_shader(
Expand Down
7 changes: 7 additions & 0 deletions include/tz/main.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#ifndef TZMAIN_HPP
#ifdef _WIN32
#define NOMINMAX
#include <Windows.h>
#define tz_main() WINAPI wWinMain([[maybe_unused]] HINSTANCE, [[maybe_unused]] HINSTANCE,[[maybe_unused]] LPWSTR, [[maybe_unused]] _In_ int)
#endif
#endif // TZMAIN_HPP

0 comments on commit 88df6d1

Please sign in to comment.