all: move standalone libraries to libs/ subdirectory
The root dir of our repository has grown quite a lot the past few months.
I'd like to make it more clear where the bulk of the engine lives (`src/`) and
also make it more clear which Mach libraries are consumable as standalone projects.
As for the name of this directory, `libs` was my first choice but there's a bit of
a convention of that being external libraries in Zig projects _today_, while these
are libraries maintained as part of Mach in this repository - not external ones.
We will name this directory `libs`, and if we have a need for external libraries
we will use `external` or `deps` for that directory name. I considered other names
such as `components`, `systems`, `modules` (which are bad as they overlap with
major ECS / engine concepts), and it seems likely the official Zig package manager
will break the convention of using a `libs` dir anyway.
Performed via:
```sh
mkdir libs/
git mv freetype libs/
git mv basisu libs/
git mv gamemode libs/
git mv glfw libs/
git mv gpu libs/
git mv gpu-dawn libs/
git mv sysaudio libs/
git mv sysjs libs/
git mv ecs libs/
```
git-subtree-dir: glfw
git-subtree-mainline: 0d5b853443
git-subtree-split: 572d1144f11b353abdb64fff828b25a4f0fbb7ca
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
git mv ecs libs/
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
79ec61396f
commit
0645429df9
240 changed files with 6 additions and 6 deletions
0
libs/gpu-dawn/src/dawn/dummy.zig
Normal file
0
libs/gpu-dawn/src/dawn/dummy.zig
Normal file
56
libs/gpu-dawn/src/dawn/mingw_helpers.cpp
Normal file
56
libs/gpu-dawn/src/dawn/mingw_helpers.cpp
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
#ifdef __MINGW32__
|
||||
#include <guiddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#define MINGW_UUIDOF(type, spec) \
|
||||
extern "C++" { \
|
||||
struct __declspec(uuid(spec)) type; \
|
||||
template<> const GUID &__mingw_uuidof<type>() { \
|
||||
static constexpr IID __uuid_inst = guid_from_string(spec); \
|
||||
return __uuid_inst; \
|
||||
} \
|
||||
template<> const GUID &__mingw_uuidof<type*>() { \
|
||||
return __mingw_uuidof<type>(); \
|
||||
} \
|
||||
}
|
||||
|
||||
constexpr uint8_t nybble_from_hex(char c) {
|
||||
return ((c >= '0' && c <= '9')
|
||||
? (c - '0')
|
||||
: ((c >= 'a' && c <= 'f')
|
||||
? (c - 'a' + 10)
|
||||
: ((c >= 'A' && c <= 'F') ? (c - 'A' + 10)
|
||||
: /* Should be an error */ -1)));
|
||||
}
|
||||
|
||||
constexpr uint8_t byte_from_hex(char c1, char c2) {
|
||||
return nybble_from_hex(c1) << 4 | nybble_from_hex(c2);
|
||||
}
|
||||
|
||||
constexpr uint8_t byte_from_hexstr(const char str[2]) {
|
||||
return nybble_from_hex(str[0]) << 4 | nybble_from_hex(str[1]);
|
||||
}
|
||||
|
||||
constexpr GUID guid_from_string(const char str[37]) {
|
||||
return GUID{static_cast<uint32_t>(byte_from_hexstr(str)) << 24 |
|
||||
static_cast<uint32_t>(byte_from_hexstr(str + 2)) << 16 |
|
||||
static_cast<uint32_t>(byte_from_hexstr(str + 4)) << 8 |
|
||||
byte_from_hexstr(str + 6),
|
||||
static_cast<uint16_t>(
|
||||
static_cast<uint16_t>(byte_from_hexstr(str + 9)) << 8 |
|
||||
byte_from_hexstr(str + 11)),
|
||||
static_cast<uint16_t>(
|
||||
static_cast<uint16_t>(byte_from_hexstr(str + 14)) << 8 |
|
||||
byte_from_hexstr(str + 16)),
|
||||
{byte_from_hexstr(str + 19), byte_from_hexstr(str + 21),
|
||||
byte_from_hexstr(str + 24), byte_from_hexstr(str + 26),
|
||||
byte_from_hexstr(str + 28), byte_from_hexstr(str + 30),
|
||||
byte_from_hexstr(str + 32), byte_from_hexstr(str + 34)}};
|
||||
}
|
||||
|
||||
#endif // __MINGW32__
|
||||
|
||||
// The point of this helper file is to export the specializations for MINGW_UUIDOF
|
||||
// below, since MinGW does not have these as part of dxguid yet (not completely up
|
||||
// to date.)
|
||||
MINGW_UUIDOF(IDXGraphicsAnalysis, "9f251514-9d4d-4902-9d60-18988ab7d4b5")
|
||||
0
libs/gpu-dawn/src/dawn/zig_mingw_pthread/pthread.h
Normal file
0
libs/gpu-dawn/src/dawn/zig_mingw_pthread/pthread.h
Normal file
1
libs/gpu-dawn/src/main.zig
Normal file
1
libs/gpu-dawn/src/main.zig
Normal file
|
|
@ -0,0 +1 @@
|
|||
pub fn main() void {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue