@@ -1536,7 +1536,10 @@ private File writeSketchImpl(RunnerListener listener) throws IOException {
15361536 out .append ("\n " );
15371537 out .append ("#ifdef _WIN32\n " );
15381538 out .append ("#include <windows.h>\n " );
1539- out .append ("int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR,int) {\n " );
1539+ out .append ("int main() {\n " );
1540+ out .append (" #ifdef _WIN32\n " );
1541+ out .append (" ::ShowWindow(::GetConsoleWindow(), SW_HIDE);\n " );
1542+ out .append (" #endif\n " );
15401543 out .append (" Processing::Sketch sketch;\n " );
15411544 out .append (" sketch.run();\n " );
15421545 out .append (" return 0;\n " );
@@ -3192,8 +3195,8 @@ else if (!cmd.contains(defaultsCpp.getAbsolutePath()))
31923195 Collections .addAll (cmd ,
31933196 "-lglfw3" , "-lglew32" , "-lopengl32" , "-lglu32" ,
31943197 "-lcomdlg32" , "-lshell32" , "-lole32" , "-luuid" ,
3195- "-mwindows" , "- pthread" , "-D_USE_MATH_DEFINES" ,
3196- "-static-libgcc" , "-static-libstdc++ " );
3198+ "-pthread" , "-D_USE_MATH_DEFINES" ,
3199+ "-Wl,--subsystem,windows " );
31973200 } else if (mac ) {
31983201 // macOS: prefer bundled dylibs shipped with the mode (libs/macos)
31993202 // universal dylibs work on both arm64 and x64.
0 commit comments