diff --git a/PanoPainter.rc b/PanoPainter.rc
new file mode 100644
index 0000000..4c4255c
Binary files /dev/null and b/PanoPainter.rc differ
diff --git a/data/layout.xml b/data/layout.xml
index db2f76d..1460f08 100644
--- a/data/layout.xml
+++ b/data/layout.xml
@@ -74,7 +74,18 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -506,6 +517,7 @@
+
diff --git a/engine.vcxproj b/engine.vcxproj
index 182e3b0..7ef817c 100644
--- a/engine.vcxproj
+++ b/engine.vcxproj
@@ -101,6 +101,10 @@
Console
true
+
+
+
+
@@ -114,6 +118,10 @@
Console
true
+
+
+
+
@@ -132,6 +140,10 @@
true
true
+
+
+
+
@@ -145,11 +157,15 @@
MultiThreadedDLL
- Console
+ Windows
true
true
true
+
+
+
+
@@ -301,6 +317,9 @@
+
+
+
diff --git a/engine.vcxproj.filters b/engine.vcxproj.filters
index 55711fa..98968f1 100644
--- a/engine.vcxproj.filters
+++ b/engine.vcxproj.filters
@@ -372,4 +372,9 @@
Header Files\ui
+
+
+ Resource Files
+
+
\ No newline at end of file
diff --git a/engine/main.cpp b/engine/main.cpp
index e4992a3..556d8c3 100644
--- a/engine/main.cpp
+++ b/engine/main.cpp
@@ -6,8 +6,7 @@
#include "image.h"
#include "app.h"
#include "keymap.h"
-
-#ifdef _WIN32
+#include "../resource.h"
#pragma comment (lib, "opengl32.lib")
#pragma comment (lib, "glew32.lib")
@@ -158,7 +157,7 @@ static void SetupExceptionHandler()
//
// PCTSTR pszLogFileName = BT_GetLogFileName(g_iLogHandle);
TCHAR wpath[1024];
- GetFullPathNameW(L"log.txt", 1024, wpath, nullptr);
+ GetFullPathNameW(L"panopainter-log.txt", 1024, wpath, nullptr);
BT_AddLogFile(wpath);
BT_SetPreErrHandler([](INT_PTR){
@@ -166,7 +165,7 @@ static void SetupExceptionHandler()
}, 0);
}
-int main()
+int main(int argc, char** argv)
{
WNDCLASS wc;
PIXELFORMATDESCRIPTOR pfd;
@@ -200,7 +199,7 @@ int main()
RegisterClass(&wc);
AdjustWindowRect(&clientRect, WS_OVERLAPPEDWINDOW, false);
- hWnd = CreateWindow(wc.lpszClassName, L"New Engine", WS_OVERLAPPEDWINDOW,
+ hWnd = CreateWindow(wc.lpszClassName, L"PanoPainter", WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT, clientRect.right - clientRect.left,
clientRect.bottom - clientRect.top, 0, 0, hInst, 0);
@@ -279,6 +278,9 @@ int main()
ShowWindow(hWnd, SW_NORMAL);
WacomTablet::I.init(hWnd);
+ SendMessage(hWnd, WM_SETICON, ICON_SMALL,
+ (LPARAM)LoadIcon(GetModuleHandle(0), MAKEINTRESOURCE(IDI_ICON1)));
+
MSG msg;
bool running = true;
unsigned long t0 = GetTickCount();
@@ -514,4 +516,29 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp)
return DefWindowProc(hWnd, msg, wp, lp);
}
-#endif
+int WINAPI WinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance,
+ _In_ LPSTR lpCmdLine, _In_ int nShowCmd)
+{
+ LPWSTR *szArgList{ nullptr };
+ int argc{ 0 };
+ char** argv{ nullptr };
+
+ szArgList = CommandLineToArgvW(GetCommandLine(), &argc);
+ if (szArgList == NULL)
+ {
+ MessageBox(NULL, L"Unable to parse command line", L"Error", MB_OK);
+ return 10;
+ }
+
+ argv = new char*[argc + 1];
+ for (int i = 0; i < argc; i++)
+ {
+ auto len = wcslen(szArgList[i]) + 1;
+ argv[i] = new char[len];
+ wcstombs_s(nullptr, argv[i], len, szArgList[i], len);
+ }
+
+ LocalFree(szArgList);
+
+ return main(argc, argv);
+}
diff --git a/icon.ico b/icon.ico
new file mode 100644
index 0000000..87edc2a
Binary files /dev/null and b/icon.ico differ
diff --git a/icon.png b/icon.png
index fd0f3f5..364c721 100644
Binary files a/icon.png and b/icon.png differ
diff --git a/icon512.png b/icon512.png
deleted file mode 100644
index da62a12..0000000
Binary files a/icon512.png and /dev/null differ
diff --git a/resource.h b/resource.h
new file mode 100644
index 0000000..42e2961
Binary files /dev/null and b/resource.h differ