mirror of
https://github.com/bailwillharr/engine.git
synced 2024-09-21 04:51:18 +00:00
Finish organising libraries
This commit is contained in:
parent
2b6c0ca5f0
commit
dec129f280
@ -21,12 +21,6 @@ set(SRC_FILES
|
|||||||
"src/ecs.cpp"
|
"src/ecs.cpp"
|
||||||
"src/gfx_device_vulkan.cpp"
|
"src/gfx_device_vulkan.cpp"
|
||||||
"src/input_manager.cpp"
|
"src/input_manager.cpp"
|
||||||
"src/libs/mikktspace.c"
|
|
||||||
"src/libs/mikktspace.h"
|
|
||||||
"src/libs/tiny_gltf.h"
|
|
||||||
"src/libs/tiny_gltf_impl.cpp"
|
|
||||||
"src/libs/weldmesh.c"
|
|
||||||
"src/libs/weldmesh.h"
|
|
||||||
"src/renderer.cpp"
|
"src/renderer.cpp"
|
||||||
"src/resource_font.cpp"
|
"src/resource_font.cpp"
|
||||||
"src/resource_material.cpp"
|
"src/resource_material.cpp"
|
||||||
@ -168,10 +162,6 @@ else()
|
|||||||
target_link_libraries(${PROJECT_NAME} PUBLIC shaderc_shared)
|
target_link_libraries(${PROJECT_NAME} PUBLIC shaderc_shared)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# stb
|
|
||||||
add_subdirectory(vendor/stb)
|
|
||||||
target_link_libraries(${PROJECT_NAME} PUBLIC stb)
|
|
||||||
|
|
||||||
# SDL2:
|
# SDL2:
|
||||||
set(SDL2_DISABLE_INSTALL ON CACHE INTERNAL "" FORCE)
|
set(SDL2_DISABLE_INSTALL ON CACHE INTERNAL "" FORCE)
|
||||||
set(SDL_SHARED ON CACHE INTERNAL "" FORCE)
|
set(SDL_SHARED ON CACHE INTERNAL "" FORCE)
|
||||||
@ -187,6 +177,7 @@ target_link_libraries(${PROJECT_NAME} PUBLIC SDL2::SDL2main)
|
|||||||
set(BUILD_SHARED_LIBS OFF)
|
set(BUILD_SHARED_LIBS OFF)
|
||||||
add_subdirectory(vendor/glm)
|
add_subdirectory(vendor/glm)
|
||||||
target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC vendor/glm)
|
target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC vendor/glm)
|
||||||
|
target_compile_definitions(${PROJECT_NAME} PUBLIC GLM_ENABLE_EXPERIMENTAL)
|
||||||
|
|
||||||
# spdlog
|
# spdlog
|
||||||
set(SPDLOG_BUILD_SHARED OFF CACHE INTERNAL "" FORCE)
|
set(SPDLOG_BUILD_SHARED OFF CACHE INTERNAL "" FORCE)
|
||||||
@ -195,10 +186,26 @@ set(BUILD_SHARED_LIBS OFF)
|
|||||||
add_subdirectory(vendor/spdlog) # automatically calls target_include_directories
|
add_subdirectory(vendor/spdlog) # automatically calls target_include_directories
|
||||||
target_link_libraries(${PROJECT_NAME} PUBLIC spdlog)
|
target_link_libraries(${PROJECT_NAME} PUBLIC spdlog)
|
||||||
|
|
||||||
# imgui (depends on volk and SDL2)
|
# stb
|
||||||
|
add_subdirectory(vendor/stb)
|
||||||
|
target_link_libraries(${PROJECT_NAME} PUBLIC stb)
|
||||||
|
|
||||||
|
# imgui (depends on volk, SDL2, and stb)
|
||||||
add_subdirectory(vendor/imgui)
|
add_subdirectory(vendor/imgui)
|
||||||
target_link_libraries(${PROJECT_NAME} PUBLIC imgui)
|
target_link_libraries(${PROJECT_NAME} PUBLIC imgui)
|
||||||
|
|
||||||
# json
|
# json
|
||||||
add_subdirectory(vendor/json)
|
add_subdirectory(vendor/json)
|
||||||
target_link_libraries(${PROJECT_NAME} PUBLIC json)
|
target_link_libraries(${PROJECT_NAME} PUBLIC json)
|
||||||
|
|
||||||
|
# tinygltf (depends on json and stb)
|
||||||
|
add_subdirectory(vendor/tinygltf)
|
||||||
|
target_link_libraries(${PROJECT_NAME} PUBLIC tinygltf)
|
||||||
|
|
||||||
|
# mikktspace
|
||||||
|
add_subdirectory(vendor/mikktspace)
|
||||||
|
target_link_libraries(${PROJECT_NAME} PUBLIC mikktspace)
|
||||||
|
|
||||||
|
# weldmesh
|
||||||
|
add_subdirectory(vendor/weldmesh)
|
||||||
|
target_link_libraries(${PROJECT_NAME} PUBLIC weldmesh)
|
@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "resources/material.h"
|
#include "resource_material.h"
|
||||||
#include "resources/mesh.h"
|
#include "resource_mesh.h"
|
||||||
|
|
||||||
namespace engine {
|
namespace engine {
|
||||||
|
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "inputs/keyboard.h"
|
#include "input_keys.h"
|
||||||
#include "inputs/mouse.h"
|
#include "input_mouse.h"
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
|
|
||||||
namespace engine {
|
namespace engine {
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
#include "application_component.h"
|
#include "application_component.h"
|
||||||
#include "gfx_device.h"
|
#include "gfx_device.h"
|
||||||
#include "systems/mesh_render_system.h"
|
#include "system_mesh_render.h"
|
||||||
|
|
||||||
namespace engine {
|
namespace engine {
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
#include "resources/mesh.h"
|
#include "resource_mesh.h"
|
||||||
|
|
||||||
namespace engine {
|
namespace engine {
|
||||||
|
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "resources/shader.h"
|
#include "resource_shader.h"
|
||||||
#include "resources/texture.h"
|
#include "resource_texture.h"
|
||||||
|
|
||||||
// a material is just a shader with assigned textures/parameters
|
// a material is just a shader with assigned textures/parameters
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
#include "ecs.h"
|
#include "ecs.h"
|
||||||
#include "event_system.h"
|
#include "event_system.h"
|
||||||
#include "components/transform.h"
|
#include "component_transform.h"
|
||||||
|
|
||||||
namespace engine {
|
namespace engine {
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
#include <glm/mat4x4.hpp>
|
#include <glm/mat4x4.hpp>
|
||||||
|
|
||||||
#include "components/collider.h"
|
#include "component_collider.h"
|
||||||
#include "ecs.h"
|
#include "ecs.h"
|
||||||
|
|
||||||
namespace engine {
|
namespace engine {
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <volk.h>
|
||||||
|
|
||||||
#include <vk_mem_alloc.h>
|
#include <vk_mem_alloc.h>
|
||||||
|
|
||||||
#include "device.h"
|
#include "vulkan_device.h"
|
||||||
|
|
||||||
namespace engine {
|
namespace engine {
|
||||||
|
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
#include <glm/vec2.hpp>
|
#include <glm/vec2.hpp>
|
||||||
|
|
||||||
#include "inputs/keyboard.h"
|
#include "input_keys.h"
|
||||||
#include "inputs/mouse.h"
|
#include "input_mouse.h"
|
||||||
|
|
||||||
namespace engine {
|
namespace engine {
|
||||||
|
|
||||||
|
@ -9,27 +9,27 @@
|
|||||||
|
|
||||||
#include <glm/mat4x4.hpp>
|
#include <glm/mat4x4.hpp>
|
||||||
|
|
||||||
#include "imgui/imgui.h"
|
#include <imgui.h>
|
||||||
#include "imgui/imgui_impl_sdl2.h"
|
#include <imgui_impl_sdl2.h>
|
||||||
#include "imgui/imgui_impl_vulkan.h"
|
#include <imgui_impl_vulkan.h>
|
||||||
|
|
||||||
#include "components/collider.h"
|
#include "component_collider.h"
|
||||||
#include "components/transform.h"
|
#include "component_transform.h"
|
||||||
#include "gfx.h"
|
#include "gfx.h"
|
||||||
#include "gfx_device.h"
|
#include "gfx_device.h"
|
||||||
#include "input_manager.h"
|
#include "input_manager.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "resources/font.h"
|
#include "resource_font.h"
|
||||||
#include "resources/material.h"
|
#include "resource_material.h"
|
||||||
#include "resources/mesh.h"
|
#include "resource_mesh.h"
|
||||||
#include "resources/shader.h"
|
#include "resource_shader.h"
|
||||||
#include "resources/texture.h"
|
#include "resource_texture.h"
|
||||||
#include "scene.h"
|
#include "scene.h"
|
||||||
#include "scene_manager.h"
|
#include "scene_manager.h"
|
||||||
#include "systems/collisions.h"
|
#include "system_collisions.h"
|
||||||
#include "systems/mesh_render_system.h"
|
#include "system_mesh_render.h"
|
||||||
#include "util/file_dialog.h"
|
#include "file_dialog.h"
|
||||||
#include "util/gltf_loader.h"
|
#include "gltf_loader.h"
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
|
|
||||||
static struct ImGuiThings {
|
static struct ImGuiThings {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "util/file_dialog.h"
|
#include "file_dialog.h"
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
#include "util/files.h"
|
#include "files.h"
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
#include "stb_image.h"
|
#include "stb_image.h"
|
||||||
|
|
||||||
namespace engine::util {
|
namespace engine {
|
||||||
|
|
||||||
std::unique_ptr<std::vector<char>> ReadTextFile(const std::string& path)
|
std::unique_ptr<std::vector<char>> ReadTextFile(const std::string& path)
|
||||||
{
|
{
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
#include "util/gen_tangents.h"
|
#include "gen_tangents.h"
|
||||||
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
#include "libs/mikktspace.h"
|
#include <mikktspace.h>
|
||||||
#include "libs/weldmesh.h"
|
#include <weldmesh.h>
|
||||||
|
|
||||||
#include "resources/mesh.h"
|
#include "resource_mesh.h"
|
||||||
|
|
||||||
namespace engine::util {
|
namespace engine::util {
|
||||||
|
|
||||||
|
@ -37,18 +37,18 @@
|
|||||||
|
|
||||||
#include <volk.h>
|
#include <volk.h>
|
||||||
|
|
||||||
#include "imgui/imgui.h"
|
#include "imgui.h"
|
||||||
#include "imgui/imgui_impl_vulkan.h"
|
#include "imgui_impl_vulkan.h"
|
||||||
|
|
||||||
#include "gfx_device.h"
|
#include "gfx_device.h"
|
||||||
#include "vulkan/instance.h"
|
#include "vulkan_instance.h"
|
||||||
#include "vulkan/device.h"
|
#include "vulkan_device.h"
|
||||||
#include "vulkan/gpu_allocator.h"
|
#include "vulkan_allocator.h"
|
||||||
#include "vulkan/swapchain.h"
|
#include "vulkan_swapchain.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "util/files.h"
|
#include "files.h"
|
||||||
|
|
||||||
static constexpr bool flip_viewport = false;
|
static constexpr bool flip_viewport = false;
|
||||||
|
|
||||||
@ -1275,11 +1275,11 @@ gfx::Pipeline* GFXDevice::CreatePipeline(const gfx::PipelineInfo& info)
|
|||||||
VkShaderModule fragShaderModule;
|
VkShaderModule fragShaderModule;
|
||||||
// be careful with these .c_str() calls. It is OK here because 'info' exists for the duration of CreatePipeline()
|
// be careful with these .c_str() calls. It is OK here because 'info' exists for the duration of CreatePipeline()
|
||||||
{
|
{
|
||||||
auto vertShaderCode = util::ReadTextFile(info.vert_shader_path.c_str());
|
auto vertShaderCode = ReadTextFile(info.vert_shader_path.c_str());
|
||||||
vertShaderModule = compileShader(pimpl->device.device, shaderc_vertex_shader, vertShaderCode->data(), info.vert_shader_path.c_str());
|
vertShaderModule = compileShader(pimpl->device.device, shaderc_vertex_shader, vertShaderCode->data(), info.vert_shader_path.c_str());
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
auto fragShaderCode = util::ReadTextFile(info.frag_shader_path.c_str());
|
auto fragShaderCode = ReadTextFile(info.frag_shader_path.c_str());
|
||||||
fragShaderModule = compileShader(pimpl->device.device, shaderc_fragment_shader, fragShaderCode->data(), info.frag_shader_path.c_str());
|
fragShaderModule = compileShader(pimpl->device.device, shaderc_fragment_shader, fragShaderCode->data(), info.frag_shader_path.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
#include "util/gltf_loader.h"
|
#include "gltf_loader.h"
|
||||||
|
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "util/files.h"
|
#include "files.h"
|
||||||
|
|
||||||
#include "libs/mikktspace.h"
|
#include <mikktspace.h>
|
||||||
#include "libs/weldmesh.h"
|
#include <weldmesh.h>
|
||||||
#include "libs/tiny_gltf.h"
|
#include <tiny_gltf.h>
|
||||||
|
|
||||||
#include "components/mesh_renderable.h"
|
#include "component_mesh.h"
|
||||||
#include "components/transform.h"
|
#include "component_transform.h"
|
||||||
#include "components/collider.h"
|
#include "component_collider.h"
|
||||||
|
|
||||||
struct Color {
|
struct Color {
|
||||||
uint8_t r, g, b, a;
|
uint8_t r, g, b, a;
|
||||||
|
@ -3,14 +3,14 @@
|
|||||||
#include <array>
|
#include <array>
|
||||||
|
|
||||||
#include "application_component.h"
|
#include "application_component.h"
|
||||||
#include "util/files.h"
|
#include "files.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
#include <glm/mat4x4.hpp>
|
#include <glm/mat4x4.hpp>
|
||||||
#include <glm/trigonometric.hpp>
|
#include <glm/trigonometric.hpp>
|
||||||
#include <glm/ext/matrix_clip_space.hpp>
|
#include <glm/ext/matrix_clip_space.hpp>
|
||||||
|
|
||||||
#include "imgui/imgui.h"
|
#include <imgui.h>
|
||||||
|
|
||||||
namespace engine {
|
namespace engine {
|
||||||
|
|
||||||
@ -97,7 +97,7 @@ Renderer::Renderer(Application& app, gfx::GraphicsSettings settings) : Applicati
|
|||||||
|
|
||||||
for (int face = 0; face < 6; ++face) {
|
for (int face = 0; face < 6; ++face) {
|
||||||
std::string path = std::string("engine/textures/skybox") + std::to_string(face) + std::string(".jpg");
|
std::string path = std::string("engine/textures/skybox") + std::to_string(face) + std::string(".jpg");
|
||||||
face_unq_ptrs[face] = util::ReadImageFile(GetResourcePath(path), w, h);
|
face_unq_ptrs[face] = ReadImageFile(GetResourcePath(path), w, h);
|
||||||
if (cubemap_w != w || cubemap_h != h) throw std::runtime_error("Skybox textures must be 512x512!");
|
if (cubemap_w != w || cubemap_h != h) throw std::runtime_error("Skybox textures must be 512x512!");
|
||||||
face_unsafe_ptrs[face] = face_unq_ptrs[face]->data();
|
face_unsafe_ptrs[face] = face_unq_ptrs[face]->data();
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "resources/font.h"
|
#include "resource_font.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
@ -6,13 +6,13 @@
|
|||||||
#include <stb_truetype.h>
|
#include <stb_truetype.h>
|
||||||
|
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "util/files.h"
|
#include "files.h"
|
||||||
|
|
||||||
namespace engine {
|
namespace engine {
|
||||||
|
|
||||||
Font::Font(const std::string& path)
|
Font::Font(const std::string& path)
|
||||||
{
|
{
|
||||||
m_font_buffer = util::ReadBinaryFile(path);
|
m_font_buffer = ReadBinaryFile(path);
|
||||||
m_font_info = std::make_unique<stbtt_fontinfo>();
|
m_font_info = std::make_unique<stbtt_fontinfo>();
|
||||||
|
|
||||||
if (stbtt_InitFont(m_font_info.get(), m_font_buffer->data(), 0) == 0) {
|
if (stbtt_InitFont(m_font_info.get(), m_font_buffer->data(), 0) == 0) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "resources/material.h"
|
#include "resource_material.h"
|
||||||
|
|
||||||
#include "resources/shader.h"
|
#include "resource_shader.h"
|
||||||
|
|
||||||
namespace engine {
|
namespace engine {
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "resources/mesh.h"
|
#include "resource_mesh.h"
|
||||||
|
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "gfx_device.h"
|
#include "gfx_device.h"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "resources/shader.h"
|
#include "resource_shader.h"
|
||||||
|
|
||||||
#include "application.h"
|
#include "application.h"
|
||||||
#include "gfx_device.h"
|
#include "gfx_device.h"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include "resources/texture.h"
|
#include "resource_texture.h"
|
||||||
|
|
||||||
#include "application.h"
|
#include "application.h"
|
||||||
#include "util/files.h"
|
#include "files.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@ -31,7 +31,7 @@ Texture::~Texture()
|
|||||||
std::unique_ptr<Texture> LoadTextureFromFile(const std::string& path, gfx::SamplerInfo samplerInfo, Renderer* renderer, bool srgb)
|
std::unique_ptr<Texture> LoadTextureFromFile(const std::string& path, gfx::SamplerInfo samplerInfo, Renderer* renderer, bool srgb)
|
||||||
{
|
{
|
||||||
int width, height;
|
int width, height;
|
||||||
auto bitmap = util::ReadImageFile(path, width, height);
|
auto bitmap = ReadImageFile(path, width, height);
|
||||||
return std::make_unique<Texture>(renderer, bitmap->data(), width, height, samplerInfo, srgb);
|
return std::make_unique<Texture>(renderer, bitmap->data(), width, height, samplerInfo, srgb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,15 +1,13 @@
|
|||||||
#include "scene.h"
|
#include "scene.h"
|
||||||
|
|
||||||
#include "components/transform.h"
|
#include "component_transform.h"
|
||||||
#include "components/collider.h"
|
#include "component_collider.h"
|
||||||
#include "components/custom.h"
|
#include "component_custom.h"
|
||||||
#include "components/mesh_renderable.h"
|
#include "component_mesh.h"
|
||||||
#include "components/ui_renderable.h"
|
#include "system_transform.h"
|
||||||
#include "systems/transform.h"
|
#include "system_mesh_render.h"
|
||||||
#include "systems/mesh_render_system.h"
|
#include "system_collisions.h"
|
||||||
#include "systems/ui_render_system.h"
|
#include "system_custom_behaviour.h"
|
||||||
#include "systems/collisions.h"
|
|
||||||
#include "systems/custom_behaviour.h"
|
|
||||||
|
|
||||||
namespace engine {
|
namespace engine {
|
||||||
|
|
||||||
@ -23,14 +21,12 @@ Scene::Scene(Application* app) : app_(app) {
|
|||||||
RegisterComponent<ColliderComponent>();
|
RegisterComponent<ColliderComponent>();
|
||||||
RegisterComponent<CustomComponent>();
|
RegisterComponent<CustomComponent>();
|
||||||
RegisterComponent<MeshRenderableComponent>();
|
RegisterComponent<MeshRenderableComponent>();
|
||||||
RegisterComponent<UIRenderableComponent>();
|
|
||||||
|
|
||||||
// Order here matters:
|
// Order here matters:
|
||||||
RegisterSystem<CustomBehaviourSystem>(); // potentially modifies transforms
|
RegisterSystem<CustomBehaviourSystem>(); // potentially modifies transforms
|
||||||
RegisterSystem<TransformSystem>();
|
RegisterSystem<TransformSystem>();
|
||||||
RegisterSystem<CollisionSystem>(); // depends on transformed world matrix
|
RegisterSystem<CollisionSystem>(); // depends on transformed world matrix
|
||||||
RegisterSystem<MeshRenderSystem>(); // depends on transformed world matrix
|
RegisterSystem<MeshRenderSystem>(); // depends on transformed world matrix
|
||||||
RegisterSystem<UIRenderSystem>(); // does nothing as of now
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Scene::~Scene() {}
|
Scene::~Scene() {}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include "scene_manager.h"
|
#include "scene_manager.h"
|
||||||
|
|
||||||
#include "scene.h"
|
#include "scene.h"
|
||||||
#include "resources/texture.h"
|
#include "resource_texture.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include "systems/collisions.h"
|
#include "system_collisions.h"
|
||||||
|
|
||||||
#include "components/transform.h"
|
#include "component_transform.h"
|
||||||
#include "components/collider.h"
|
#include "component_collider.h"
|
||||||
#include "scene.h"
|
#include "scene.h"
|
||||||
|
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#include "systems/custom_behaviour.h"
|
#include "system_custom_behaviour.h"
|
||||||
|
|
||||||
#include <typeinfo>
|
#include <typeinfo>
|
||||||
|
|
||||||
#include "components/custom.h"
|
#include "component_custom.h"
|
||||||
#include "components/transform.h"
|
#include "component_transform.h"
|
||||||
#include "scene.h"
|
#include "scene.h"
|
||||||
|
|
||||||
namespace engine {
|
namespace engine {
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#include "systems/mesh_render_system.h"
|
#include "system_mesh_render.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
#include "components/transform.h"
|
#include "component_transform.h"
|
||||||
#include "components/mesh_renderable.h"
|
#include "component_mesh.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
namespace engine {
|
namespace engine {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#include "systems/transform.h"
|
#include "system_transform.h"
|
||||||
|
|
||||||
#include "scene.h"
|
#include "scene.h"
|
||||||
#include "components/transform.h"
|
#include "component_transform.h"
|
||||||
|
|
||||||
#include <typeinfo>
|
#include <typeinfo>
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#include "vulkan_allocator.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#include <cstdio> // snprintf for vma
|
#include <cstdio> // snprintf for vma
|
||||||
@ -10,8 +12,6 @@
|
|||||||
#define VMA_IMPLEMENTATION
|
#define VMA_IMPLEMENTATION
|
||||||
#include <vk_mem_alloc.h>
|
#include <vk_mem_alloc.h>
|
||||||
|
|
||||||
#include "gpu_allocator.h"
|
|
||||||
|
|
||||||
namespace engine {
|
namespace engine {
|
||||||
|
|
||||||
VmaAllocator createAllocator(VkInstance instance, const Device& device)
|
VmaAllocator createAllocator(VkInstance instance, const Device& device)
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#include "vulkan_device.h"
|
||||||
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <array>
|
#include <array>
|
||||||
@ -7,8 +9,6 @@
|
|||||||
|
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
#include "device.h"
|
|
||||||
|
|
||||||
namespace engine {
|
namespace engine {
|
||||||
|
|
||||||
static bool checkQueueFamilySupportsPresent(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t familyIndex)
|
static bool checkQueueFamilySupportsPresent(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t familyIndex)
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#include "vulkan_instance.h"
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -9,8 +11,6 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
#include "instance.h"
|
|
||||||
|
|
||||||
namespace engine {
|
namespace engine {
|
||||||
|
|
||||||
static std::vector<const char*> getWindowExtensions(SDL_Window* window)
|
static std::vector<const char*> getWindowExtensions(SDL_Window* window)
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
|
#include "vulkan_swapchain.h"
|
||||||
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#include <SDL2/SDL_vulkan.h>
|
#include <SDL_vulkan.h>
|
||||||
|
#include <SDL_syswm.h>
|
||||||
|
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
#include "swapchain.h"
|
|
||||||
#include <SDL_syswm.h>
|
|
||||||
|
|
||||||
namespace engine {
|
namespace engine {
|
||||||
|
|
||||||
void createSwapchain(Swapchain* sc, const SwapchainInfo& info)
|
void createSwapchain(Swapchain* sc, const SwapchainInfo& info)
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
#include <imgui/imgui_impl_sdl2.h>
|
#include <imgui_impl_sdl2.h>
|
||||||
|
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
|
@ -6,15 +6,15 @@
|
|||||||
#include <glm/trigonometric.hpp>
|
#include <glm/trigonometric.hpp>
|
||||||
|
|
||||||
#include "application.h"
|
#include "application.h"
|
||||||
#include "components/transform.h"
|
#include "component_transform.h"
|
||||||
#include "ecs.h"
|
#include "ecs.h"
|
||||||
#include "input_manager.h"
|
#include "input_manager.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "scene.h"
|
#include "scene.h"
|
||||||
#include "scene_manager.h"
|
#include "scene_manager.h"
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
#include <systems/collisions.h>
|
#include "system_collisions.h"
|
||||||
#include <components/mesh_renderable.h>
|
#include "component_mesh.h"
|
||||||
|
|
||||||
CameraControllerSystem::CameraControllerSystem(engine::Scene* scene)
|
CameraControllerSystem::CameraControllerSystem(engine::Scene* scene)
|
||||||
: System(scene, {typeid(engine::TransformComponent).hash_code(), typeid(CameraControllerComponent).hash_code()})
|
: System(scene, {typeid(engine::TransformComponent).hash_code(), typeid(CameraControllerComponent).hash_code()})
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include <glm/vec3.hpp>
|
#include <glm/vec3.hpp>
|
||||||
|
|
||||||
#include "components/transform.h"
|
#include "component_transform.h"
|
||||||
#include "application.h"
|
#include "application.h"
|
||||||
#include "ecs.h"
|
#include "ecs.h"
|
||||||
|
|
||||||
|
@ -2,20 +2,20 @@
|
|||||||
|
|
||||||
#include "application.h"
|
#include "application.h"
|
||||||
#include "camera_controller.hpp"
|
#include "camera_controller.hpp"
|
||||||
#include "components/collider.h"
|
#include "component_collider.h"
|
||||||
#include "components/custom.h"
|
#include "component_custom.h"
|
||||||
#include "components/mesh_renderable.h"
|
#include "component_mesh.h"
|
||||||
#include "components/transform.h"
|
#include "component_transform.h"
|
||||||
#include "input_manager.h"
|
#include "input_manager.h"
|
||||||
#include "meshgen.hpp"
|
#include "meshgen.hpp"
|
||||||
#include "resources/font.h"
|
#include "resource_font.h"
|
||||||
#include "resources/material.h"
|
#include "resource_material.h"
|
||||||
#include "resources/texture.h"
|
#include "resource_texture.h"
|
||||||
#include "scene.h"
|
#include "scene.h"
|
||||||
#include "scene_manager.h"
|
#include "scene_manager.h"
|
||||||
#include "systems/mesh_render_system.h"
|
#include "system_mesh_render.h"
|
||||||
#include "systems/transform.h"
|
#include "system_transform.h"
|
||||||
#include "util/gltf_loader.h"
|
#include "gltf_loader.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
|
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
#include <glm/ext.hpp>
|
#include <glm/ext.hpp>
|
||||||
#include <glm/trigonometric.hpp>
|
#include <glm/trigonometric.hpp>
|
||||||
|
|
||||||
#include "resources/mesh.h"
|
#include "resource_mesh.h"
|
||||||
#include "util/gen_tangents.h"
|
#include "gen_tangents.h"
|
||||||
|
|
||||||
std::unique_ptr<engine::Mesh> GenSphereMesh(engine::GFXDevice* gfx, float r, int detail, bool wind_inside, bool flip_normals)
|
std::unique_ptr<engine::Mesh> GenSphereMesh(engine::GFXDevice* gfx, float r, int detail, bool wind_inside, bool flip_normals)
|
||||||
{
|
{
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "resources/mesh.h"
|
#include "resource_mesh.h"
|
||||||
|
|
||||||
std::unique_ptr<engine::Mesh> GenSphereMesh(engine::GFXDevice* gfx, float r, int detail, bool wind_inside = false, bool flip_normals = false);
|
std::unique_ptr<engine::Mesh> GenSphereMesh(engine::GFXDevice* gfx, float r, int detail, bool wind_inside = false, bool flip_normals = false);
|
||||||
|
|
||||||
|
4
vendor/imgui/CMakeLists.txt
vendored
4
vendor/imgui/CMakeLists.txt
vendored
@ -33,4 +33,6 @@ set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_EXTENSIONS OFF)
|
|||||||
target_include_directories(${PROJECT_NAME} PUBLIC include)
|
target_include_directories(${PROJECT_NAME} PUBLIC include)
|
||||||
target_include_directories(${PROJECT_NAME} PRIVATE src)
|
target_include_directories(${PROJECT_NAME} PRIVATE src)
|
||||||
|
|
||||||
# libraries go here
|
target_link_libraries(${PROJECT_NAME} PRIVATE SDL2::SDL2)
|
||||||
|
target_link_libraries(${PROJECT_NAME} PRIVATE stb)
|
||||||
|
target_link_libraries(${PROJECT_NAME} PRIVATE volk::volk)
|
2
vendor/imgui/src/imgui_internal.h
vendored
2
vendor/imgui/src/imgui_internal.h
vendored
@ -208,7 +208,7 @@ namespace ImStb
|
|||||||
#define STB_TEXTEDIT_GETWIDTH_NEWLINE (-1.0f)
|
#define STB_TEXTEDIT_GETWIDTH_NEWLINE (-1.0f)
|
||||||
#define STB_TEXTEDIT_UNDOSTATECOUNT 99
|
#define STB_TEXTEDIT_UNDOSTATECOUNT 99
|
||||||
#define STB_TEXTEDIT_UNDOCHARCOUNT 999
|
#define STB_TEXTEDIT_UNDOCHARCOUNT 999
|
||||||
#include "stb_textedit.h"
|
#include "imstb_textedit.h"
|
||||||
|
|
||||||
} // namespace ImStb
|
} // namespace ImStb
|
||||||
|
|
||||||
|
4
vendor/json/CMakeLists.txt
vendored
4
vendor/json/CMakeLists.txt
vendored
@ -8,4 +8,6 @@ set(INCLUDE_FILES
|
|||||||
|
|
||||||
add_library(${PROJECT_NAME} INTERFACE
|
add_library(${PROJECT_NAME} INTERFACE
|
||||||
${INCLUDE_FILES}
|
${INCLUDE_FILES}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
target_include_directories(${PROJECT_NAME} INTERFACE include)
|
23
vendor/mikktspace/CMakeLists.txt
vendored
Normal file
23
vendor/mikktspace/CMakeLists.txt
vendored
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.24)
|
||||||
|
|
||||||
|
project(mikktspace LANGUAGES C)
|
||||||
|
|
||||||
|
set(SRC_FILES
|
||||||
|
"src/mikktspace.c"
|
||||||
|
)
|
||||||
|
|
||||||
|
set(INCLUDE_FILES
|
||||||
|
"include/mikktspace.h"
|
||||||
|
)
|
||||||
|
|
||||||
|
add_library(${PROJECT_NAME} STATIC
|
||||||
|
${SRC_FILES}
|
||||||
|
${INCLUDE_FILES}
|
||||||
|
)
|
||||||
|
|
||||||
|
set_property(TARGET ${PROJECT_NAME} PROPERTY C_STANDARD 11)
|
||||||
|
set_property(TARGET ${PROJECT_NAME} PROPERTY C_STANDARD_REQUIRED ON)
|
||||||
|
set_property(TARGET ${PROJECT_NAME} PROPERTY C_EXTENSIONS OFF)
|
||||||
|
|
||||||
|
target_include_directories(${PROJECT_NAME} PUBLIC include)
|
||||||
|
target_include_directories(${PROJECT_NAME} PRIVATE src)
|
10
vendor/stb/CMakeLists.txt
vendored
10
vendor/stb/CMakeLists.txt
vendored
@ -1,9 +1,9 @@
|
|||||||
cmake_minimum_required(VERSION 3.24)
|
cmake_minimum_required(VERSION 3.24)
|
||||||
|
|
||||||
project(stb LANGUAGES C CXX)
|
project(stb LANGUAGES C)
|
||||||
|
|
||||||
set(SRC_FILES
|
set(SRC_FILES
|
||||||
"src/stb_impl.cpp"
|
"src/stb_impl.c"
|
||||||
)
|
)
|
||||||
|
|
||||||
set(INCLUDE_FILES
|
set(INCLUDE_FILES
|
||||||
@ -18,9 +18,9 @@ add_library(${PROJECT_NAME} STATIC
|
|||||||
${INCLUDE_FILES}
|
${INCLUDE_FILES}
|
||||||
)
|
)
|
||||||
|
|
||||||
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 20)
|
set_property(TARGET ${PROJECT_NAME} PROPERTY C_STANDARD 11)
|
||||||
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
|
set_property(TARGET ${PROJECT_NAME} PROPERTY C_STANDARD_REQUIRED ON)
|
||||||
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_EXTENSIONS OFF)
|
set_property(TARGET ${PROJECT_NAME} PROPERTY C_EXTENSIONS OFF)
|
||||||
|
|
||||||
target_include_directories(${PROJECT_NAME} PUBLIC include)
|
target_include_directories(${PROJECT_NAME} PUBLIC include)
|
||||||
target_include_directories(${PROJECT_NAME} PRIVATE src)
|
target_include_directories(${PROJECT_NAME} PRIVATE src)
|
26
vendor/tinygltf/CMakeLists.txt
vendored
Normal file
26
vendor/tinygltf/CMakeLists.txt
vendored
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.24)
|
||||||
|
|
||||||
|
project(tinygltf LANGUAGES CXX)
|
||||||
|
|
||||||
|
set(SRC_FILES
|
||||||
|
"src/tiny_gltf_impl.cpp"
|
||||||
|
)
|
||||||
|
|
||||||
|
set(INCLUDE_FILES
|
||||||
|
"include/tiny_gltf.h"
|
||||||
|
)
|
||||||
|
|
||||||
|
add_library(${PROJECT_NAME} STATIC
|
||||||
|
${SRC_FILES}
|
||||||
|
${INCLUDE_FILES}
|
||||||
|
)
|
||||||
|
|
||||||
|
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 20)
|
||||||
|
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
|
||||||
|
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_EXTENSIONS OFF)
|
||||||
|
|
||||||
|
target_include_directories(${PROJECT_NAME} PUBLIC include)
|
||||||
|
target_include_directories(${PROJECT_NAME} PRIVATE src)
|
||||||
|
|
||||||
|
target_link_libraries(${PROJECT_NAME} PRIVATE json)
|
||||||
|
target_link_libraries(${PROJECT_NAME} PRIVATE stb)
|
@ -1,2 +1,2 @@
|
|||||||
#define TINYGLTF_IMPLEMENTATION
|
#define TINYGLTF_IMPLEMENTATION
|
||||||
#include "libs/tiny_gltf.h"
|
#include "tiny_gltf.h"
|
23
vendor/weldmesh/CMakeLists.txt
vendored
Normal file
23
vendor/weldmesh/CMakeLists.txt
vendored
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.24)
|
||||||
|
|
||||||
|
project(weldmesh LANGUAGES C)
|
||||||
|
|
||||||
|
set(SRC_FILES
|
||||||
|
"src/weldmesh.c"
|
||||||
|
)
|
||||||
|
|
||||||
|
set(INCLUDE_FILES
|
||||||
|
"include/weldmesh.h"
|
||||||
|
)
|
||||||
|
|
||||||
|
add_library(${PROJECT_NAME} STATIC
|
||||||
|
${SRC_FILES}
|
||||||
|
${INCLUDE_FILES}
|
||||||
|
)
|
||||||
|
|
||||||
|
set_property(TARGET ${PROJECT_NAME} PROPERTY C_STANDARD 11)
|
||||||
|
set_property(TARGET ${PROJECT_NAME} PROPERTY C_STANDARD_REQUIRED ON)
|
||||||
|
set_property(TARGET ${PROJECT_NAME} PROPERTY C_EXTENSIONS OFF)
|
||||||
|
|
||||||
|
target_include_directories(${PROJECT_NAME} PUBLIC include)
|
||||||
|
target_include_directories(${PROJECT_NAME} PRIVATE src)
|
Loading…
Reference in New Issue
Block a user