Played with making xenia-run a Win32 app, but then logging stops working...
This commit is contained in:
parent
df90707fe3
commit
ffcd687ef6
|
@ -123,7 +123,7 @@ void D3D11GraphicsSystem::Initialize() {
|
||||||
// will take place.
|
// will take place.
|
||||||
XEASSERTNULL(window_);
|
XEASSERTNULL(window_);
|
||||||
window_ = new D3D11Window(run_loop_, dxgi_factory_, device_);
|
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");
|
XELOGE("Failed to create D3D11Window");
|
||||||
exit(1);
|
exit(1);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -18,11 +18,14 @@ namespace {
|
||||||
|
|
||||||
typedef int (*user_main_t)(int argc, xechar_t** argv);
|
typedef int (*user_main_t)(int argc, xechar_t** argv);
|
||||||
|
|
||||||
}
|
} // namespace
|
||||||
|
|
||||||
|
|
||||||
#if XE_LIKE_WIN32 && defined(UNICODE) && UNICODE
|
#if XE_LIKE_WIN32 && defined(UNICODE) && UNICODE
|
||||||
|
|
||||||
|
#include <windows.h>
|
||||||
|
#include <shellapi.h>
|
||||||
|
|
||||||
int xe_main_thunk(
|
int xe_main_thunk(
|
||||||
int argc, wchar_t* argv[],
|
int argc, wchar_t* argv[],
|
||||||
void* user_main, const char* usage) {
|
void* user_main, const char* usage) {
|
||||||
|
@ -53,6 +56,23 @@ int xe_main_thunk(
|
||||||
return result;
|
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
|
#else
|
||||||
|
|
||||||
int xe_main_thunk(
|
int xe_main_thunk(
|
||||||
|
|
|
@ -142,6 +142,13 @@ int xe_main_thunk(
|
||||||
int wmain(int argc, wchar_t *argv[]) { \
|
int wmain(int argc, wchar_t *argv[]) { \
|
||||||
return xe_main_thunk(argc, argv, NAME, USAGE); \
|
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
|
#else
|
||||||
int xe_main_thunk(
|
int xe_main_thunk(
|
||||||
int argc, char** argv,
|
int argc, char** argv,
|
||||||
|
@ -150,6 +157,8 @@ int xe_main_thunk(
|
||||||
int main(int argc, char **argv) { \
|
int main(int argc, char **argv) { \
|
||||||
return xe_main_thunk(argc, argv, (void*)NAME, USAGE); \
|
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
|
#endif // WIN32
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -88,3 +88,4 @@ XECLEANUP:
|
||||||
return result_code;
|
return result_code;
|
||||||
}
|
}
|
||||||
XE_MAIN_THUNK(xenia_run, "xenia-run some.xex");
|
XE_MAIN_THUNK(xenia_run, "xenia-run some.xex");
|
||||||
|
//XE_MAIN_WINDOW_THUNK(xenia_run, XETEXT("xenia-run"), "xenia-run some.xex");
|
||||||
|
|
|
@ -5,6 +5,12 @@
|
||||||
'target_name': 'xenia-run',
|
'target_name': 'xenia-run',
|
||||||
'type': 'executable',
|
'type': 'executable',
|
||||||
|
|
||||||
|
'msvs_settings': {
|
||||||
|
'VCLinkerTool': {
|
||||||
|
#'SubSystem': '2'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
'dependencies': [
|
'dependencies': [
|
||||||
'xenia',
|
'xenia',
|
||||||
],
|
],
|
||||||
|
|
Loading…
Reference in New Issue