Add --graphics-debug command line argument;

This commit is contained in:
bjorn 2023-05-03 20:54:19 -07:00
parent 04a96f828b
commit c717670a80
2 changed files with 7 additions and 1 deletions

View File

@ -68,6 +68,8 @@ function lovr.boot()
if hasConf then confOk, confError = pcall(require, 'conf') end
if confOk and lovr.conf then confOk, confError = pcall(lovr.conf, conf) end
conf.graphics.debug = arg['--graphics-debug']
lovr._setConf(conf)
lovr.filesystem.setIdentity(conf.identity, conf.saveprecedence)

View File

@ -48,7 +48,8 @@ int main(int argc, char** argv) {
"options:\n"
" -h, --help\t\tShow help and exit\n"
" -v, --version\t\tShow version and exit\n"
" --console\t\tAttach Windows console\n\n"
" --console\t\tAttach Windows console\n"
" --graphics-debug\tEnable graphics debug messages\n\n"
"<source> can be a Lua file, a folder, or a zip archive\n"
);
exit(0);
@ -89,6 +90,9 @@ int main(int argc, char** argv) {
for (int i = 1; i < argc; i++, argOffset++) {
if (!strcmp(argv[i], "--console")) {
os_open_console();
} else if (!strcmp(argv[i], "--graphics-debug")) {
lua_pushboolean(L, true);
lua_setfield(L, -2, "--graphics-debug");
} else {
break; // This is the project path
}