Played with making xenia-run a Win32 app, but then logging stops working...

This commit is contained in:
Ben Vanik 2014-01-15 21:58:09 -08:00
parent df90707fe3
commit ffcd687ef6
6 changed files with 39 additions and 2 deletions

View File

@ -123,7 +123,7 @@ void D3D11GraphicsSystem::Initialize() {
// will take place.
XEASSERTNULL(window_);
window_ = new D3D11Window(run_loop_, dxgi_factory_, device_);
if (window_->Initialize("Xenia D3D11", 1280, 768)) {
if (window_->Initialize("Xenia D3D11", 1280, 720)) {
XELOGE("Failed to create D3D11Window");
exit(1);
return;

View File

@ -18,11 +18,14 @@ namespace {
typedef int (*user_main_t)(int argc, xechar_t** argv);
}
} // namespace
#if XE_LIKE_WIN32 && defined(UNICODE) && UNICODE
#include <windows.h>
#include <shellapi.h>
int xe_main_thunk(
int argc, wchar_t* argv[],
void* user_main, const char* usage) {
@ -53,6 +56,23 @@ int xe_main_thunk(
return result;
}
int xe_main_window_thunk(
wchar_t* command_line,
void* user_main, const wchar_t* name, const char* usage) {
wchar_t buffer[2048];
xestrcpy(buffer, XECOUNT(buffer), name);
xestrcat(buffer, XECOUNT(buffer), XETEXT(" "));
xestrcat(buffer, XECOUNT(buffer), command_line);
int argc;
wchar_t** argv = CommandLineToArgvW(buffer, &argc);
if (!argv) {
return 1;
}
int result = xe_main_thunk(argc, argv, user_main, usage);
LocalFree(argv);
return result;
}
#else
int xe_main_thunk(

View File

@ -142,6 +142,13 @@ int xe_main_thunk(
int wmain(int argc, wchar_t *argv[]) { \
return xe_main_thunk(argc, argv, NAME, USAGE); \
}
int xe_main_window_thunk(
wchar_t* command_line,
void* user_main, const wchar_t* name, const char* usage);
#define XE_MAIN_WINDOW_THUNK(NAME, APP_NAME, USAGE) \
int APIENTRY wWinMain(HINSTANCE, HINSTANCE, LPTSTR command_line, int) { \
return xe_main_window_thunk(command_line, NAME, APP_NAME, USAGE); \
}
#else
int xe_main_thunk(
int argc, char** argv,
@ -150,6 +157,8 @@ int xe_main_thunk(
int main(int argc, char **argv) { \
return xe_main_thunk(argc, argv, (void*)NAME, USAGE); \
}
#define XE_MAIN_WINDOW_THUNK(NAME, APP_NAME, USAGE) \
XE_MAIN_THUNK(NAME, USAGE)
#endif // WIN32

View File

@ -88,3 +88,4 @@ XECLEANUP:
return result_code;
}
XE_MAIN_THUNK(xenia_run, "xenia-run some.xex");
//XE_MAIN_WINDOW_THUNK(xenia_run, XETEXT("xenia-run"), "xenia-run some.xex");

View File

@ -5,6 +5,12 @@
'target_name': 'xenia-run',
'type': 'executable',
'msvs_settings': {
'VCLinkerTool': {
#'SubSystem': '2'
}
},
'dependencies': [
'xenia',
],

View File

@ -285,6 +285,7 @@
'd3dcompiler',
'xinput',
'xaudio2',
'Shell32',
],
}],
['OS == "mac"', {