Skip to content

Commit b3e4571

Browse files
committed
Add submodules stb, tinyobjloader
1 parent a930fdd commit b3e4571

File tree

5 files changed

+32
-1
lines changed

5 files changed

+32
-1
lines changed

.gitmodules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[submodule "external/stb"]
2+
path = external/stb
3+
url = https://github.com/nothings/stb
4+
[submodule "external/tinyobjloader"]
5+
path = external/tinyobjloader
6+
url = https://github.com/tinyobjloader/tinyobjloader.git

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ add_executable(Portracer
2121
src/utils/print_util.h
2222
external/implementation.cpp)
2323

24+
include_directories("external/stb")
25+
include_directories("external/tinyobjloader")
26+
2427
if (DEV_MODE)
2528
target_compile_definitions(Portracer PRIVATE
2629
RESOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}/resources"

external/implementation.cpp

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,22 @@
11
#define WEBGPU_CPP_IMPLEMENTATION
2-
#include "webgpu/webgpu.hpp"
2+
#include <webgpu/webgpu.hpp>
3+
4+
// Disable pedantic warnings for this external library.
5+
#ifdef _MSC_VER
6+
// Microsoft Visual C++ Compiler
7+
#pragma warning (push, 0)
8+
#endif
9+
10+
#define STBI_MSC_SECURE_CRT
11+
#define STB_IMAGE_IMPLEMENTATION
12+
#include "stb_image.h"
13+
14+
#define STBI_MSC_SECURE_CRT
15+
#define STB_IMAGE_WRITE_IMPLEMENTATION
16+
#include "stb_image_write.h"
17+
18+
// Restore warning levels.
19+
#ifdef _MSC_VER
20+
// Microsoft Visual C++ Compiler
21+
#pragma warning (pop)
22+
#endif

external/stb

Submodule stb added at 5736b15

external/tinyobjloader

Submodule tinyobjloader added at 22441b1

0 commit comments

Comments
 (0)