comparison 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
comparison
equal deleted inserted replaced
2900:fe31d4535270 2901:761b7a12b079
1393 // User functions 1393 // User functions
1394 void Main() { dw_main(); } 1394 void Main() { dw_main(); }
1395 void MainIteration() { dw_main_iteration(); } 1395 void MainIteration() { dw_main_iteration(); }
1396 void MainQuit() { dw_main_quit(); } 1396 void MainQuit() { dw_main_quit(); }
1397 void Exit(int exitcode) { dw_exit(exitcode); } 1397 void Exit(int exitcode) { dw_exit(exitcode); }
1398 int MessageBox(const char *title, int flags, const char *format) { return dw_messagebox(title, flags, format); } 1398 int MessageBox(const char *title, int flags, const char *format, ...) {
1399 int retval;
1400 va_list args;
1401
1402 va_start(args, format);
1403 retval = dw_vmessagebox(title, flags, format, args);
1404 va_end(args);
1405
1406 return retval;
1407 }
1408 void Debug(const char *format, ...) {
1409 va_list args;
1410
1411 va_start(args, format);
1412 dw_vdebug(format, args);
1413 va_end(args);
1414 }
1399 }; 1415 };
1400 1416
1401 // Static singleton reference declared outside of the class 1417 // Static singleton reference declared outside of the class
1402 App* App::_app = DW_NULL; 1418 App* App::_app = DW_NULL;
1403 1419