summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.bat7
-rw-r--r--icon.icobin0 -> 3160 bytes
-rw-r--r--icon.rc26
-rw-r--r--icon.resbin0 -> 4200 bytes
-rw-r--r--project-base/src/windows/platform.c2
-rw-r--r--src/main.c5
6 files changed, 37 insertions, 3 deletions
diff --git a/build.bat b/build.bat
index adc4518..8302705 100644
--- a/build.bat
+++ b/build.bat
@@ -1,3 +1,6 @@
robocopy "data/" "build/data" /s /e
-gcc.exe -m64 -w -g -DMODE_DEBUG src/main.c -o build/truckerx2.exe -Llibs/ -lSDL2 -lSDL2_mixer
-call build\truckerx2.exe \ No newline at end of file
+
+windres icon.rc -O coff -o icon.res
+
+gcc.exe -m64 -w -g -DMODE_DEBUG src/main.c icon.res -o build/truckerx.exe -Llibs/ -lSDL2 -lSDL2_mixer -mwindows
+call build\truckerx.exe \ No newline at end of file
diff --git a/icon.ico b/icon.ico
new file mode 100644
index 0000000..fdf6161
--- /dev/null
+++ b/icon.ico
Binary files differ
diff --git a/icon.rc b/icon.rc
new file mode 100644
index 0000000..20e33bb
--- /dev/null
+++ b/icon.rc
@@ -0,0 +1,26 @@
+
+101 ICON "icon.ico"
+
+1 VERSIONINFO
+FILEVERSION 1,0,0,0
+PRODUCTVERSION 1,0,0,0
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "080904E4"
+ BEGIN
+ VALUE "CompanyName", "Aldrik Ramaekers"
+ VALUE "FileDescription", "TruckerX"
+ VALUE "FileVersion", "1.0.0"
+ VALUE "InternalName", "TruckerX"
+ VALUE "LegalCopyright", "Aldrik Ramaekers"
+ VALUE "OriginalFilename", "truckerX.exe"
+ VALUE "ProductName", "TruckerX"
+ VALUE "ProductVersion", "1.0.0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x809, 1252
+ END
+END
diff --git a/icon.res b/icon.res
new file mode 100644
index 0000000..20c5ef4
--- /dev/null
+++ b/icon.res
Binary files differ
diff --git a/project-base/src/windows/platform.c b/project-base/src/windows/platform.c
index 52bf1df..119e08e 100644
--- a/project-base/src/windows/platform.c
+++ b/project-base/src/windows/platform.c
@@ -930,7 +930,7 @@ platform_window* platform_open_window_ex(char *name, u16 width, u16 height, u16
window->window_class.lpfnWndProc = main_window_callback;
window->window_class.hInstance = instance;
window->window_class.lpszClassName = name;
- window->window_class.hIcon = LoadIcon(NULL, IDI_WINLOGO);
+ window->window_class.hIcon = LoadIcon(instance, MAKEINTRESOURCE(101));
//window->window_class.hCursor = LoadCursor(NULL, IDC_ARROW);
ATOM success = RegisterClass(&window->window_class);
diff --git a/src/main.c b/src/main.c
index 2a5e908..1b10c0a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -137,6 +137,11 @@ void update_render_game(platform_window* window)
update_music();
}
+int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, char* ignore, int nShowCmd)
+{
+ return main(__argc, __argv);
+}
+
int main(int argc, char** argv)
{
platform_init(argc, argv, CONFIG_DIRECTORY);