This repository was archived by the owner on Mar 11, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +18
-64
lines changed Expand file tree Collapse file tree 4 files changed +18
-64
lines changed Original file line number Diff line number Diff line change 2
2
#include < Tkge/Engine.hpp>
3
3
#include < Tkge/Graphics/Drawable.hpp>
4
4
#include < Tkge/Graphics/Shader.hpp>
5
- #include < Tkge/Utilities.hpp>
6
5
#include < klib/assert.hpp>
7
6
#include < kvf/time.hpp>
8
7
#include < cmath>
@@ -108,12 +107,12 @@ namespace
108
107
}
109
108
} // namespace
110
109
111
- int main ([[maybe_unused]] int argc, [[maybe_unused]] char ** argv)
110
+ int main ([[maybe_unused]] int argc, char ** argv)
112
111
{
113
112
try
114
113
{
115
114
KLIB_ASSERT (argc > 0 );
116
- const auto assets_path = Upfind (Tkge::Utilities::GetCurrentExecutablePath () , " Assets" );
115
+ const auto assets_path = Upfind (*argv , " Assets" );
117
116
Run (assets_path);
118
117
}
119
118
catch (const std::exception& e)
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
#include < Tkge/AssetLoader.hpp>
2
- #include < Tkge/Utilities.hpp>
3
2
#include < filesystem>
4
3
4
+ #ifdef _WIN32
5
+ #ifndef WIN32_MEAN_AND_LEAN
6
+ #define WIN32_MEAN_AND_LEAN
7
+ #define _AMD64_
8
+ #endif
9
+ #include < libloaderapi.h>
10
+ #include < minwindef.h>
11
+ #endif
12
+
5
13
std::vector<std::filesystem::path> Tkge::AssetLoader::GetSearchPaths () const
6
14
{
7
15
std::vector<std::filesystem::path> paths{};
8
16
9
17
paths.emplace_back (" ." );
10
18
11
- paths.push_back (Tkge::Utilities::GetCurrentExecutablePath ());
19
+ #ifdef _WIN32
20
+ char buffer[MAX_PATH]{};
21
+ GetModuleFileNameA (nullptr , buffer, MAX_PATH);
22
+
23
+ paths.push_back (std::filesystem::path{buffer}.parent_path ());
12
24
paths.push_back (paths.back () / " Assets" );
25
+ #else
26
+ #endif
13
27
14
28
return paths;
15
29
}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments