diff dw.hpp @ 2901:761b7a12b079

Add va_list versions of dw_debug() and dw_messagebox() for use in C++ bindings. dw_vdebug() and dw_vmessagebox() work similarly to the standard library versions. DW::App:Debug() and DW::App:MessageBox() use them for variable arguments.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 25 Dec 2022 00:20:49 +0000
parents fe31d4535270
children 9fd16f694a77
line wrap: on
line diff
--- a/dw.hpp	Sat Dec 24 14:28:39 2022 +0000
+++ b/dw.hpp	Sun Dec 25 00:20:49 2022 +0000
@@ -1395,7 +1395,23 @@
     void MainIteration() { dw_main_iteration(); }
     void MainQuit() { dw_main_quit(); }
     void Exit(int exitcode) { dw_exit(exitcode); }
-    int MessageBox(const char *title, int flags, const char *format) { return dw_messagebox(title, flags, format); }
+    int MessageBox(const char *title, int flags, const char *format, ...) { 
+        int retval;
+        va_list args;
+
+        va_start(args, format);
+        retval = dw_vmessagebox(title, flags, format, args); 
+        va_end(args);
+
+        return retval;
+    }
+    void Debug(const char *format, ...) { 
+        va_list args;
+
+        va_start(args, format);
+        dw_vdebug(format, args); 
+        va_end(args);
+    }
 };
 
 // Static singleton reference declared outside of the class