Skip to content

Commit

Permalink
code refine
Browse files Browse the repository at this point in the history
  • Loading branch information
K1ngst0m committed Jan 28, 2024
1 parent 54ea164 commit aaaa9eb
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 10 deletions.
1 change: 0 additions & 1 deletion cmake/AphExternal.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ CPMAddPackage(
"SPIRV_CROSS_ENABLE_TESTS ON"
)

add_subdirectory(${APH_EXTERNAL_DIR})
add_subdirectory(${APH_EXTERNAL_DIR}/volk EXCLUDE_FROM_ALL)
add_subdirectory(${APH_EXTERNAL_DIR}/imgui EXCLUDE_FROM_ALL)
add_subdirectory(${APH_EXTERNAL_DIR}/slang EXCLUDE_FROM_ALL)
Expand Down
9 changes: 7 additions & 2 deletions engine/api/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
file(GLOB API_VULKAN_SRC ${APH_ENGINE_API_DIR}/vulkan/*.cpp)
add_library(api STATIC ${API_VULKAN_SRC})
aph_compiler_options(api)

target_include_directories(api PRIVATE
${APH_ENGINE_DIR}
)

target_include_directories(api SYSTEM
PRIVATE
${APH_EXTERNAL_DIR}/vulkan
${spirv-cross_SOURCE_DIR}
${vma_SOURCE_DIR}/include

PUBLIC
${APH_EXTERNAL_DIR}/volk
)
)

target_link_libraries(api PRIVATE
common
aph_allocator
Expand Down
2 changes: 1 addition & 1 deletion engine/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ target_include_directories(common PUBLIC
)

if (APH_ENABLE_TRACING)
target_include_directories(common PUBLIC
target_include_directories(common SYSTEM PUBLIC
${APH_EXTERNAL_DIR}/tracy/public
)
target_compile_definitions(common PRIVATE APH_ENABLE_TRACER)
Expand Down
2 changes: 1 addition & 1 deletion engine/math/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
file(GLOB APH_MATH_SRC ${APH_ENGINE_MATH_DIR}/*.cpp)
add_library(aph_math STATIC ${APH_MATH_SRC})
aph_compiler_options(aph_math)
target_include_directories(aph_math PUBLIC ${glm_SOURCE_DIR})
target_include_directories(aph_math SYSTEM PUBLIC ${glm_SOURCE_DIR})
1 change: 0 additions & 1 deletion engine/wsi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ if(APH_WSI_BACKEND STREQUAL "Auto" OR APH_WSI_BACKEND STREQUAL "GLFW")
${APH_ENGINE_WSI_DIR}/wsi_glfw.cpp
${APH_ENGINE_WSI_DIR}/imgui_impl_glfw.cpp
)
target_include_directories(wsi PRIVATE ${GLFW_SOURCE_DIR}/include)
target_link_libraries(wsi PRIVATE glfw)
elseif(APH_WSI_BACKEND STREQUAL "SDL2")
if(NOT SDL2_FOUND)
Expand Down
2 changes: 1 addition & 1 deletion engine/wsi/wsi.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class WSI

public:
bool initUI();
void deInitUI();
void deInitUI() const;
uint32_t getWidth() const { return m_width; }
uint32_t getHeight() const { return m_height; }
void resize(uint32_t width, uint32_t height);
Expand Down
4 changes: 2 additions & 2 deletions engine/wsi/wsi_glfw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ static void buttonCB(GLFWwindow* window, int button, int action, int _)
double x, y;
glfwGetCursorPos(window, &x, &y);

EventManager::GetInstance().pushEvent(MouseButtonEvent{btn, x, y, action == GLFW_PRESS});
EventManager::GetInstance().pushEvent(MouseButtonEvent{btn, static_cast<int>(x), static_cast<int>(y), action == GLFW_PRESS});
}

static void errorCB(int error, const char* description)
Expand Down Expand Up @@ -255,7 +255,7 @@ bool WSI::initUI()
return false;
};

void aph::WSI::deInitUI()
void aph::WSI::deInitUI() const
{
if(m_enabledUI)
{
Expand Down
1 change: 0 additions & 1 deletion external/CMakeLists.txt

This file was deleted.

0 comments on commit aaaa9eb

Please sign in to comment.