Compare commits

...

2 Commits

Author SHA1 Message Date
burkkyy 31089f3539 adding fmt third_party library + adding cloc support 2026-10-04 22:41:42 -07:00
burkkyy 6cc8bf4262 adding in sandbox 2026-10-04 01:03:47 -07:00
9 changed files with 85 additions and 1 deletions
+8
View File
@@ -0,0 +1,8 @@
third_party
build
__dump
traces
.vscode
.claude
.git
imgui.ini
+3
View File
@@ -14,3 +14,6 @@
[submodule "third_party/ImGuizmo"] [submodule "third_party/ImGuizmo"]
path = third_party/ImGuizmo path = third_party/ImGuizmo
url = https://github.com/CedricGuillemet/ImGuizmo.git url = https://github.com/CedricGuillemet/ImGuizmo.git
[submodule "third_party/fmt"]
path = third_party/fmt
url = https://github.com/fmtlib/fmt
+1
View File
@@ -39,4 +39,5 @@ add_subdirectory(third_party)
add_subdirectory(engine) add_subdirectory(engine)
add_subdirectory(editor) add_subdirectory(editor)
add_subdirectory(testbed) add_subdirectory(testbed)
add_subdirectory(sandbox)
add_subdirectory(examples) add_subdirectory(examples)
+21
View File
@@ -80,8 +80,29 @@ class DevCommand(GiteaCommand, RenderDocCommand, ShadersCommand, TracyCommand):
os.chdir(preset_dir) os.chdir(preset_dir)
os.execv(binary, [binary, *args]) os.execv(binary, [binary, *args])
##
# Builds the debug preset (incrementally), then runs the raw Vulkan
# sandbox from build/debug. Any arguments are passed through.
# dev sandbox [args...]
def sandbox(self, *args, **kwargs):
preset = self.DEFAULT_PRESET
self._build_preset(preset, fresh=False)
preset_dir = os.path.join(self._project_root(), "build", preset)
binary = os.path.join(preset_dir, "bin", "sandbox")
print(f"Running: {shlex.join([binary, *args])}")
os.chdir(preset_dir)
os.execv(binary, [binary, *args])
# Custom helpers # Custom helpers
##
# Counts lines of code from the project root, skipping paths listed in
# .clocignore. Any arguments are passed through to cloc.
# dev cloc [args...]
def cloc(self, *args, **kwargs):
self._run_in_root(["cloc", "--exclude-list-file=.clocignore", *args, "."])
def ownit(self, *args, **kwargs): def ownit(self, *args, **kwargs):
file_or_directory = args[0] if args else None file_or_directory = args[0] if args else None
if file_or_directory is None: if file_or_directory is None:
+1 -1
View File
@@ -15,7 +15,7 @@ class Window {
Window(const Window&) = delete; Window(const Window&) = delete;
Window& operator=(const Window&) = delete; Window& operator=(const Window&) = delete;
Window(int width, int height, const std::string& name = "sophiahaestus"); Window(int width, int height, const std::string& name = "sophia");
~Window(); ~Window();
bool shouldClose() { return glfwWindowShouldClose(window); } bool shouldClose() { return glfwWindowShouldClose(window); }
+22
View File
@@ -0,0 +1,22 @@
# Vulkan playground. Links the engine (and its third-party libraries), and
# can also include the engine's internal headers from engine/src.
file(GLOB_RECURSE SOURCES CONFIGURE_DEPENDS *.cpp)
add_executable(sandbox ${SOURCES})
target_compile_definitions(sandbox PRIVATE
SANDBOX_SHADER_DIR="${CMAKE_CURRENT_SOURCE_DIR}/shaders"
)
# engine/include comes in through the engine's public include path.
target_include_directories(sandbox PRIVATE
"${CMAKE_SOURCE_DIR}/engine/src"
)
# The engine publicly provides vulkan, vma, shaderc, glfw, glm, imgui, entt
# and Tracy, plus the GLM defines. The rest are engine-private.
target_link_libraries(sandbox PRIVATE
${PROJECT_NAME}
imguizmo
stb_image
)
+28
View File
@@ -0,0 +1,28 @@
#define GLFW_INCLUDE_VULKAN
#include <GLFW/glfw3.h>
#include <algorithm>
#include <array>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <glm/mat4x4.hpp>
#include <glm/vec4.hpp>
#include <vector>
#define VK_CHECK(expr) \
do { \
vk::Result result_ = (expr); \
if (result_ != vk::Result::eSuccess) { \
std::fprintf(stderr, "%s:%d: %s -> %d\n", __FILE__, __LINE__, #expr, \
result_); \
std::abort(); \
} \
} while (0)
constexpr uint32_t WIDTH = 1280;
constexpr uint32_t HEIGHT = 720;
constexpr const char* NAME = "";
int main() { return EXIT_SUCCESS; }
View File
Vendored Submodule
+1
Submodule third_party/fmt added at 4afd0e498e