From 7a80d0fd61dcaf433afc0982cf2a15ffbef5ad86 Mon Sep 17 00:00:00 2001 From: Gregory Wells Date: Tue, 24 Jun 2025 12:03:14 -0400 Subject: [PATCH] move some shit around (DOES NOT COMPILE) --- .gitmodules | 3 + CMakeLists.txt | 82 ++++++++++--------- .../apis}/metal/CMakeLists.txt | 12 +-- src/apis/metal/depends/SPIRV-Cross | 1 + .../apis/metal/src}/buffer/metal_buffer.h | 0 .../apis/metal/src}/buffer/metal_buffer.m | 0 .../command_buffer/metal_command_buffer.h | 0 .../command_buffer/metal_command_buffer.m | 0 .../command_pool/metal_command_pool.h | 0 .../command_pool/metal_command_pool.m | 0 .../src}/commands/commands/metal_commands.m | 0 .../apis/metal/src}/debugger/metal_debugger.m | 0 .../metal/src}/devices/metal_output_device.m | 0 .../metal/src}/devices/metal_output_devices.h | 0 .../src}/devices/metal_physical_device.m | 0 .../src}/framebuffers/metal_framebuffer.h | 0 .../src}/framebuffers/metal_framebuffer.m | 0 .../apis/metal/src}/instance/metal_instance.h | 0 .../apis/metal/src}/instance/metal_instance.m | 0 .../metal_graphics_pipeline.h | 0 .../metal_graphics_pipeline.m | 0 .../apis/metal/src}/present/metal_present.m | 0 .../metal_presentation_queue.h | 0 .../metal_presentation_queue.m | 0 .../metal/src}/renderpass/metal_render_pass.h | 0 .../metal/src}/renderpass/metal_render_pass.m | 0 .../src}/shader_module/metal_shader_module.h | 0 .../src}/shader_module/metal_shader_module.m | 0 .../apis/metal/src}/submit/metal_submit.m | 0 .../apis/metal/src}/surface/metal_surface.h | 0 .../apis/metal/src}/surface/metal_surface.m | 0 .../apis/metal/src}/sync/fence/metal_fence.h | 0 .../apis/metal/src}/sync/fence/metal_fence.m | 0 .../src}/sync/semaphore/metal_semaphore.h | 0 .../src}/sync/semaphore/metal_semaphore.m | 0 .../apis/metal/src}/texture/metal_texture.h | 0 .../apis/metal/src}/uniforms/metal_uniform.c | 0 .../apis/metal/src}/uniforms/metal_uniform.h | 0 .../metal/src}/uniforms/metal_uniform_pool.c | 0 .../metal/src}/uniforms/metal_uniform_pool.h | 0 .../apis}/vulkan/CMakeLists.txt | 26 ++---- .../apis}/vulkan/src/buffers/vulkan_buffer.c | 0 .../apis}/vulkan/src/buffers/vulkan_buffer.h | 0 .../command_buffer/vulkan_command_buffer.c | 0 .../command_buffer/vulkan_command_buffer.h | 0 .../command_pool/vulkan_command_pool.c | 0 .../command_pool/vulkan_command_pool.h | 0 .../src/commands/commands/vulkan_commands.c | 0 .../vulkan/src/debugger/vulkan_debugger.c | 0 .../vulkan/src/debugger/vulkan_debugger.h | 0 .../src/framebuffers/vulkan_framebuffer.c | 0 .../src/framebuffers/vulkan_framebuffer.h | 0 .../vulkan/src/instance/vulkan_instance.c | 0 .../vulkan/src/instance/vulkan_instance.h | 0 .../output_device/vulkan_device_extensions.c | 0 .../output_device/vulkan_device_extensions.h | 0 .../src/output_device/vulkan_output_device.c | 0 .../src/output_device/vulkan_output_devices.h | 0 .../output_device/vulkan_physical_device.c | 0 .../output_device/vulkan_physical_device.h | 0 .../vulkan_graphics_pipeline.c | 0 .../vulkan_graphics_pipeline.h | 0 .../apis}/vulkan/src/present/vulkan_present.c | 0 .../vulkan_presentation_queue.c | 0 .../vulkan_presentation_queue.h | 0 .../vulkan_swapchain_support.c | 0 .../vulkan_swapchain_support.h | 0 .../vulkan_render_pass_descriptor.c | 0 .../vulkan_render_pass_descriptor.h | 0 .../src/shader_module/vulkan_shader_module.c | 0 .../src/shader_module/vulkan_shader_module.h | 0 .../apis}/vulkan/src/submit/vulkan_submit.c | 0 .../vulkan/src/sync/fence/vulkan_fence.c | 0 .../vulkan/src/sync/fence/vulkan_fence.h | 0 .../src/sync/semaphore/vulkan_semaphore.c | 0 .../src/sync/semaphore/vulkan_semaphore.h | 0 .../vulkan/src/textures/vulkan_texture.c | 0 .../vulkan/src/textures/vulkan_texture.h | 0 .../vulkan/src/uniforms/vulkan_uniform.c | 0 .../vulkan/src/uniforms/vulkan_uniform.h | 0 .../src/uniforms/vulkan_uniform_layout.c | 0 .../src/uniforms/vulkan_uniform_layout.h | 0 .../vulkan/src/uniforms/vulkan_uniform_pool.c | 0 .../vulkan/src/uniforms/vulkan_uniform_pool.h | 0 .../src/vulkan_surface/vulkan_surface.c | 0 .../src/vulkan_surface/vulkan_surface.h | 0 .../src/vulkan_surface/vulkan_surface.m | 0 src/core/CMakeLists.txt | 15 ++++ src/core/instance/gryphn_instance.c | 27 ------ src/core/{ => src}/buffers/gryphn_buffer.c | 4 +- src/core/{ => src}/buffers/gryphn_buffer.h | 2 +- .../command_buffer/gryphn_command_buffer.c | 2 +- .../command_buffer/gryphn_command_buffer.h | 2 +- .../command_pool/gryphn_command_pool.c | 4 +- .../command_pool/gryphn_command_pool.h | 2 +- .../command/commands/gryphn_command.c | 6 +- .../command/commands/gryphn_command.h | 8 +- src/core/{ => src}/debugger/gryphn_debugger.c | 2 +- src/core/{ => src}/debugger/gryphn_debugger.h | 2 +- .../framebuffer/gryphn_framebuffer.c | 2 +- .../framebuffer/gryphn_framebuffer.h | 2 +- src/core/{ => src}/gryphn_handles.h | 0 .../{ => src}/gryphn_platform_functions.h | 18 ++-- src/core/{ => src}/gryphn_rendering_api.h | 0 src/core/{ => src}/gryphn_support.h | 0 src/core/src/instance/gryphn_instance.c | 26 ++++++ src/core/{ => src}/instance/gryphn_instance.h | 4 +- .../instance/init/gryphn_dynamic_library.h | 0 .../{ => src}/instance/init/gryphn_init.c | 0 .../{ => src}/instance/init/gryphn_init.h | 4 +- .../output_device/gryphn_output_device.c | 6 +- .../output_device/gryphn_output_device.h | 2 +- .../gryphn_physical_output_device.c | 2 +- .../gryphn_physical_output_device.h | 2 +- .../gryphn_graphics_pipeline.c | 2 +- .../gryphn_graphics_pipeline.h | 12 +-- src/core/{ => src}/present/gryphn_present.c | 2 +- src/core/{ => src}/present/gryphn_present.h | 2 +- .../gryphn_presentation_queue.c | 2 +- .../gryphn_presentation_queue.h | 8 +- .../{ => src}/renderpass/gryphn_render_pass.h | 2 +- .../gryphn_render_pass_descriptor.c | 2 +- .../gryphn_render_pass_descriptor.h | 2 +- .../shader_input/gryphn_shader_layout.h | 0 .../shader_module/gryphn_shader_module.c | 2 +- .../shader_module/gryphn_shader_module.h | 2 +- src/core/{ => src}/submit/gryphn_submit.c | 2 +- src/core/{ => src}/submit/gryphn_submit.h | 4 +- src/core/{ => src}/sync/fence/gryphn_fence.c | 3 +- src/core/{ => src}/sync/fence/gryphn_fence.h | 2 +- .../sync/semaphore/gryphn_semaphore.c | 2 +- .../sync/semaphore/gryphn_semaphore.h | 2 +- src/core/{ => src}/textures/gryphn_texture.c | 2 +- src/core/{ => src}/textures/gryphn_texture.h | 2 +- src/core/{ => src}/uniforms/gryphn_uniform.c | 4 +- src/core/{ => src}/uniforms/gryphn_uniform.h | 2 +- .../uniforms/gryphn_uniform_layout.h | 2 +- .../{ => src}/uniforms/gryphn_uniform_pool.c | 4 +- .../{ => src}/uniforms/gryphn_uniform_pool.h | 6 +- .../{ => src}/window_surface/gryphn_surface.c | 2 +- .../{ => src}/window_surface/gryphn_surface.h | 4 +- .../gryphn_surface_create_functions.c | 4 +- .../gryphn_surface_create_functions.h | 2 +- src/platform/gryphn_platform_include.h | 2 +- 144 files changed, 177 insertions(+), 180 deletions(-) rename {rendering_api => src/apis}/metal/CMakeLists.txt (64%) create mode 160000 src/apis/metal/depends/SPIRV-Cross rename {rendering_api/metal/src/core => src/apis/metal/src}/buffer/metal_buffer.h (100%) rename {rendering_api/metal/src/core => src/apis/metal/src}/buffer/metal_buffer.m (100%) rename {rendering_api/metal/src/core => src/apis/metal/src}/commands/command_buffer/metal_command_buffer.h (100%) rename {rendering_api/metal/src/core => src/apis/metal/src}/commands/command_buffer/metal_command_buffer.m (100%) rename {rendering_api/metal/src/core => src/apis/metal/src}/commands/command_pool/metal_command_pool.h (100%) rename {rendering_api/metal/src/core => src/apis/metal/src}/commands/command_pool/metal_command_pool.m (100%) rename {rendering_api/metal/src/core => src/apis/metal/src}/commands/commands/metal_commands.m (100%) rename {rendering_api/metal/src/core => src/apis/metal/src}/debugger/metal_debugger.m (100%) rename {rendering_api/metal/src/core => src/apis/metal/src}/devices/metal_output_device.m (100%) rename {rendering_api/metal/src/core => src/apis/metal/src}/devices/metal_output_devices.h (100%) rename {rendering_api/metal/src/core => src/apis/metal/src}/devices/metal_physical_device.m (100%) rename {rendering_api/metal/src/core => src/apis/metal/src}/framebuffers/metal_framebuffer.h (100%) rename {rendering_api/metal/src/core => src/apis/metal/src}/framebuffers/metal_framebuffer.m (100%) rename {rendering_api/metal/src/core => src/apis/metal/src}/instance/metal_instance.h (100%) rename {rendering_api/metal/src/core => src/apis/metal/src}/instance/metal_instance.m (100%) rename {rendering_api/metal/src/core => src/apis/metal/src}/pipelines/graphics_pipeline/metal_graphics_pipeline.h (100%) rename {rendering_api/metal/src/core => src/apis/metal/src}/pipelines/graphics_pipeline/metal_graphics_pipeline.m (100%) rename {rendering_api/metal/src/core => src/apis/metal/src}/present/metal_present.m (100%) rename {rendering_api/metal/src/core => src/apis/metal/src}/presentation_queue/metal_presentation_queue.h (100%) rename {rendering_api/metal/src/core => src/apis/metal/src}/presentation_queue/metal_presentation_queue.m (100%) rename {rendering_api/metal/src/core => src/apis/metal/src}/renderpass/metal_render_pass.h (100%) rename {rendering_api/metal/src/core => src/apis/metal/src}/renderpass/metal_render_pass.m (100%) rename {rendering_api/metal/src/core => src/apis/metal/src}/shader_module/metal_shader_module.h (100%) rename {rendering_api/metal/src/core => src/apis/metal/src}/shader_module/metal_shader_module.m (100%) rename {rendering_api/metal/src/core => src/apis/metal/src}/submit/metal_submit.m (100%) rename {rendering_api/metal/src/core => src/apis/metal/src}/surface/metal_surface.h (100%) rename {rendering_api/metal/src/core => src/apis/metal/src}/surface/metal_surface.m (100%) rename {rendering_api/metal/src/core => src/apis/metal/src}/sync/fence/metal_fence.h (100%) rename {rendering_api/metal/src/core => src/apis/metal/src}/sync/fence/metal_fence.m (100%) rename {rendering_api/metal/src/core => src/apis/metal/src}/sync/semaphore/metal_semaphore.h (100%) rename {rendering_api/metal/src/core => src/apis/metal/src}/sync/semaphore/metal_semaphore.m (100%) rename {rendering_api/metal/src/core => src/apis/metal/src}/texture/metal_texture.h (100%) rename {rendering_api/metal/src/core => src/apis/metal/src}/uniforms/metal_uniform.c (100%) rename {rendering_api/metal/src/core => src/apis/metal/src}/uniforms/metal_uniform.h (100%) rename {rendering_api/metal/src/core => src/apis/metal/src}/uniforms/metal_uniform_pool.c (100%) rename {rendering_api/metal/src/core => src/apis/metal/src}/uniforms/metal_uniform_pool.h (100%) rename {rendering_api => src/apis}/vulkan/CMakeLists.txt (59%) rename {rendering_api => src/apis}/vulkan/src/buffers/vulkan_buffer.c (100%) rename {rendering_api => src/apis}/vulkan/src/buffers/vulkan_buffer.h (100%) rename {rendering_api => src/apis}/vulkan/src/commands/command_buffer/vulkan_command_buffer.c (100%) rename {rendering_api => src/apis}/vulkan/src/commands/command_buffer/vulkan_command_buffer.h (100%) rename {rendering_api => src/apis}/vulkan/src/commands/command_pool/vulkan_command_pool.c (100%) rename {rendering_api => src/apis}/vulkan/src/commands/command_pool/vulkan_command_pool.h (100%) rename {rendering_api => src/apis}/vulkan/src/commands/commands/vulkan_commands.c (100%) rename {rendering_api => src/apis}/vulkan/src/debugger/vulkan_debugger.c (100%) rename {rendering_api => src/apis}/vulkan/src/debugger/vulkan_debugger.h (100%) rename {rendering_api => src/apis}/vulkan/src/framebuffers/vulkan_framebuffer.c (100%) rename {rendering_api => src/apis}/vulkan/src/framebuffers/vulkan_framebuffer.h (100%) rename {rendering_api => src/apis}/vulkan/src/instance/vulkan_instance.c (100%) rename {rendering_api => src/apis}/vulkan/src/instance/vulkan_instance.h (100%) rename {rendering_api => src/apis}/vulkan/src/output_device/vulkan_device_extensions.c (100%) rename {rendering_api => src/apis}/vulkan/src/output_device/vulkan_device_extensions.h (100%) rename {rendering_api => src/apis}/vulkan/src/output_device/vulkan_output_device.c (100%) rename {rendering_api => src/apis}/vulkan/src/output_device/vulkan_output_devices.h (100%) rename {rendering_api => src/apis}/vulkan/src/output_device/vulkan_physical_device.c (100%) rename {rendering_api => src/apis}/vulkan/src/output_device/vulkan_physical_device.h (100%) rename {rendering_api => src/apis}/vulkan/src/pipelines/graphics_pipeline/vulkan_graphics_pipeline.c (100%) rename {rendering_api => src/apis}/vulkan/src/pipelines/graphics_pipeline/vulkan_graphics_pipeline.h (100%) rename {rendering_api => src/apis}/vulkan/src/present/vulkan_present.c (100%) rename {rendering_api => src/apis}/vulkan/src/presentation_queue/vulkan_presentation_queue.c (100%) rename {rendering_api => src/apis}/vulkan/src/presentation_queue/vulkan_presentation_queue.h (100%) rename {rendering_api => src/apis}/vulkan/src/presentation_queue/vulkan_swapchain_support.c (100%) rename {rendering_api => src/apis}/vulkan/src/presentation_queue/vulkan_swapchain_support.h (100%) rename {rendering_api => src/apis}/vulkan/src/renderpass/vulkan_render_pass_descriptor.c (100%) rename {rendering_api => src/apis}/vulkan/src/renderpass/vulkan_render_pass_descriptor.h (100%) rename {rendering_api => src/apis}/vulkan/src/shader_module/vulkan_shader_module.c (100%) rename {rendering_api => src/apis}/vulkan/src/shader_module/vulkan_shader_module.h (100%) rename {rendering_api => src/apis}/vulkan/src/submit/vulkan_submit.c (100%) rename {rendering_api => src/apis}/vulkan/src/sync/fence/vulkan_fence.c (100%) rename {rendering_api => src/apis}/vulkan/src/sync/fence/vulkan_fence.h (100%) rename {rendering_api => src/apis}/vulkan/src/sync/semaphore/vulkan_semaphore.c (100%) rename {rendering_api => src/apis}/vulkan/src/sync/semaphore/vulkan_semaphore.h (100%) rename {rendering_api => src/apis}/vulkan/src/textures/vulkan_texture.c (100%) rename {rendering_api => src/apis}/vulkan/src/textures/vulkan_texture.h (100%) rename {rendering_api => src/apis}/vulkan/src/uniforms/vulkan_uniform.c (100%) rename {rendering_api => src/apis}/vulkan/src/uniforms/vulkan_uniform.h (100%) rename {rendering_api => src/apis}/vulkan/src/uniforms/vulkan_uniform_layout.c (100%) rename {rendering_api => src/apis}/vulkan/src/uniforms/vulkan_uniform_layout.h (100%) rename {rendering_api => src/apis}/vulkan/src/uniforms/vulkan_uniform_pool.c (100%) rename {rendering_api => src/apis}/vulkan/src/uniforms/vulkan_uniform_pool.h (100%) rename {rendering_api => src/apis}/vulkan/src/vulkan_surface/vulkan_surface.c (100%) rename {rendering_api => src/apis}/vulkan/src/vulkan_surface/vulkan_surface.h (100%) rename {rendering_api => src/apis}/vulkan/src/vulkan_surface/vulkan_surface.m (100%) create mode 100644 src/core/CMakeLists.txt delete mode 100644 src/core/instance/gryphn_instance.c rename src/core/{ => src}/buffers/gryphn_buffer.c (88%) rename src/core/{ => src}/buffers/gryphn_buffer.h (97%) rename src/core/{ => src}/command/command_buffer/gryphn_command_buffer.c (96%) rename src/core/{ => src}/command/command_buffer/gryphn_command_buffer.h (97%) rename src/core/{ => src}/command/command_pool/gryphn_command_pool.c (90%) rename src/core/{ => src}/command/command_pool/gryphn_command_pool.h (94%) rename src/core/{ => src}/command/commands/gryphn_command.c (92%) rename src/core/{ => src}/command/commands/gryphn_command.h (83%) rename src/core/{ => src}/debugger/gryphn_debugger.c (86%) rename src/core/{ => src}/debugger/gryphn_debugger.h (98%) rename src/core/{ => src}/framebuffer/gryphn_framebuffer.c (91%) rename src/core/{ => src}/framebuffer/gryphn_framebuffer.h (94%) rename src/core/{ => src}/gryphn_handles.h (100%) rename src/core/{ => src}/gryphn_platform_functions.h (94%) rename src/core/{ => src}/gryphn_rendering_api.h (100%) rename src/core/{ => src}/gryphn_support.h (100%) create mode 100644 src/core/src/instance/gryphn_instance.c rename src/core/{ => src}/instance/gryphn_instance.h (92%) rename src/core/{ => src}/instance/init/gryphn_dynamic_library.h (100%) rename src/core/{ => src}/instance/init/gryphn_init.c (100%) rename src/core/{ => src}/instance/init/gryphn_init.h (85%) rename src/core/{ => src}/output_device/gryphn_output_device.c (89%) rename src/core/{ => src}/output_device/gryphn_output_device.h (94%) rename src/core/{ => src}/output_device/gryphn_physical_output_device.c (98%) rename src/core/{ => src}/output_device/gryphn_physical_output_device.h (98%) rename src/core/{ => src}/pipelines/graphics_pipeline/gryphn_graphics_pipeline.c (93%) rename src/core/{ => src}/pipelines/graphics_pipeline/gryphn_graphics_pipeline.h (92%) rename src/core/{ => src}/present/gryphn_present.c (79%) rename src/core/{ => src}/present/gryphn_present.h (92%) rename src/core/{ => src}/presentation_queue/gryphn_presentation_queue.c (96%) rename src/core/{ => src}/presentation_queue/gryphn_presentation_queue.h (87%) rename src/core/{ => src}/renderpass/gryphn_render_pass.h (90%) rename src/core/{ => src}/renderpass/gryphn_render_pass_descriptor.c (93%) rename src/core/{ => src}/renderpass/gryphn_render_pass_descriptor.h (98%) rename src/core/{ => src}/shader_input/gryphn_shader_layout.h (100%) rename src/core/{ => src}/shader_module/gryphn_shader_module.c (92%) rename src/core/{ => src}/shader_module/gryphn_shader_module.h (96%) rename src/core/{ => src}/submit/gryphn_submit.c (78%) rename src/core/{ => src}/submit/gryphn_submit.h (82%) rename src/core/{ => src}/sync/fence/gryphn_fence.c (93%) rename src/core/{ => src}/sync/fence/gryphn_fence.h (94%) rename src/core/{ => src}/sync/semaphore/gryphn_semaphore.c (90%) rename src/core/{ => src}/sync/semaphore/gryphn_semaphore.h (92%) rename src/core/{ => src}/textures/gryphn_texture.c (92%) rename src/core/{ => src}/textures/gryphn_texture.h (96%) rename src/core/{ => src}/uniforms/gryphn_uniform.c (80%) rename src/core/{ => src}/uniforms/gryphn_uniform.h (95%) rename src/core/{ => src}/uniforms/gryphn_uniform_layout.h (93%) rename src/core/{ => src}/uniforms/gryphn_uniform_pool.c (90%) rename src/core/{ => src}/uniforms/gryphn_uniform_pool.h (81%) rename src/core/{ => src}/window_surface/gryphn_surface.c (98%) rename src/core/{ => src}/window_surface/gryphn_surface.h (94%) rename src/core/{ => src}/window_surface/gryphn_surface_create_functions.c (95%) rename src/core/{ => src}/window_surface/gryphn_surface_create_functions.h (97%) diff --git a/.gitmodules b/.gitmodules index 0444dfa..fc18a43 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "src/utils"] path = src/utils url = https://github.com/GregoryWells2007/GryphnUtils.git +[submodule "src/apis/metal/depends/SPIRV-Cross"] + path = src/apis/metal/depends/SPIRV-Cross + url = https://github.com/KhronosGroup/SPIRV-Cross.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 53d48ca..93e21fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,46 +1,50 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS on) project(Gryphn) -file(GLOB_RECURSE SOURCE_FILES CONFIGURE_DEPENDS - "src/*.cpp" "src/*.hpp" - "src/*.c" "src/*.h" -) -if(APPLE) - file(GLOB_RECURSE METAL_FILES CONFIGURE_DEPENDS "src/*.m") -endif() -add_library(Gryphn ${SOURCE_FILES} ${METAL_FILES}) -target_include_directories(Gryphn PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src/) -target_include_directories(Gryphn PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include/) -target_include_directories(Gryphn PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src/utils) -target_include_directories(Gryphn PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src/utils/utils) -add_compile_definitions(GN_REVEAL_IMPL) +add_compile_definitions(GN_PLATFORM_LINUX GN_WINDOW_X11 GN_REVEAL_IMPL) -make_directory(${CMAKE_BINARY_DIR}/gryphn/rendering_apis/) +add_subdirectory(src/core/) # build gryphn code +add_subdirectory(src/apis/vulkan/) -if(WIN32) - add_compile_definitions(GN_PLATFORM_WIN32) - # add_subdirectory(rendering_api/dirctx/) - add_subdirectory(rendering_api/vulkan/) -endif() -if(APPLE) - add_compile_definitions(GN_PLATFORM_MACOS) - add_subdirectory(rendering_api/metal/) - add_subdirectory(rendering_api/vulkan/) +add_library(Gryphn INTERFACE) +target_link_libraries(Gryphn INTERFACE GryphnCore GryphnVulkanImpl) - target_link_libraries(Gryphn - "-framework IOKit" - "-framework CoreFoundation" - "-framework CoreGraphics" - "-framework AppKit" - "-framework Metal" - "-framework QuartzCore" - "-framework MetalKit" - ) -endif() -if(UNIX AND NOT APPLE) - add_compile_definitions(GN_PLATFORM_LINUX) - add_compile_definitions(GN_WINDOW_X11) - add_subdirectory(rendering_api/vulkan/) -endif() +# set(CMAKE_EXPORT_COMPILE_COMMANDS on) +# project(Gryphn) +# add_library(Gryphn STATIC "") -target_link_libraries(Gryphn) +# # build gryphn core +# add_subdirectory(src/core/) +# target_link_libraries(Gryphn GryphnCore) + +# # build the selected apis +# if(WIN32) +# add_compile_definitions(GN_PLATFORM_WIN32) +# add_subdirectory(src/apis/vulkan/) + +# target_link_libraries(Gryphn GryphnVulkanImpl) +# endif() +# if(APPLE) +# add_compile_definitions(GN_PLATFORM_MACOS) +# add_subdirectory(src/apis/metal/) +# add_subdirectory(src/apis/vulkan/) + +# target_link_libraries(Gryphn +# "-framework IOKit" +# "-framework CoreFoundation" +# "-framework CoreGraphics" +# "-framework AppKit" +# "-framework Metal" +# "-framework QuartzCore" +# "-framework MetalKit" +# ) + +# target_link_libraries(Gryphn GryphnVulkanImpl GryphnMetalImpl) +# endif() +# if(UNIX AND NOT APPLE) +# add_compile_definitions(GN_PLATFORM_LINUX) +# add_compile_definitions(GN_WINDOW_X11) +# add_subdirectory(src/apis/vulkan/) + +# target_link_libraries(Gryphn GryphnVulkanImpl) +# endif() diff --git a/rendering_api/metal/CMakeLists.txt b/src/apis/metal/CMakeLists.txt similarity index 64% rename from rendering_api/metal/CMakeLists.txt rename to src/apis/metal/CMakeLists.txt index 8aa88da..dceaf16 100644 --- a/rendering_api/metal/CMakeLists.txt +++ b/src/apis/metal/CMakeLists.txt @@ -3,11 +3,9 @@ set(CMAKE_CXX_STANDARD 17) project(GryphnMetalImpl) file(GLOB_RECURSE SOURCE_FILES CONFIGURE_DEPENDS - "src/*.cpp" "src/*.hpp" - "src/*.c" "src/*.h" - "src/*.mm" "src/*.m" + "src/*.c" "src/*.h" "src/*.m" ) -add_library(GryphnMetalImpl SHARED ${SOURCE_FILES}) +add_library(GryphnMetalImpl STATIC ${SOURCE_FILES}) target_include_directories(GryphnMetalImpl PUBLIC ${CMAKE_SOURCE_DIR}/gryphn/include/ ${CMAKE_SOURCE_DIR}/gryphn/src/ @@ -15,7 +13,6 @@ target_include_directories(GryphnMetalImpl PUBLIC src/ depends/SPIRV-Cross/ ) -# target_link_options(GryphnMetalImpl PRIVATE -rdynamic) add_compile_definitions(GN_REVEAL_IMPL) add_subdirectory(depends/SPIRV-Cross) @@ -29,8 +26,3 @@ target_link_libraries(GryphnMetalImpl "-framework Metal" "-framework QuartzCore" ) - -file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/gryphn/rendering_apis) -add_custom_command(TARGET GryphnMetalImpl POST_BUILD - COMMAND mv libGryphnMetalImpl.dylib ../../rendering_apis/GryphnMetalImpl.dylib -) diff --git a/src/apis/metal/depends/SPIRV-Cross b/src/apis/metal/depends/SPIRV-Cross new file mode 160000 index 0000000..2345c78 --- /dev/null +++ b/src/apis/metal/depends/SPIRV-Cross @@ -0,0 +1 @@ +Subproject commit 2345c781f7fc56e32a84730dd249144655e550cd diff --git a/rendering_api/metal/src/core/buffer/metal_buffer.h b/src/apis/metal/src/buffer/metal_buffer.h similarity index 100% rename from rendering_api/metal/src/core/buffer/metal_buffer.h rename to src/apis/metal/src/buffer/metal_buffer.h diff --git a/rendering_api/metal/src/core/buffer/metal_buffer.m b/src/apis/metal/src/buffer/metal_buffer.m similarity index 100% rename from rendering_api/metal/src/core/buffer/metal_buffer.m rename to src/apis/metal/src/buffer/metal_buffer.m diff --git a/rendering_api/metal/src/core/commands/command_buffer/metal_command_buffer.h b/src/apis/metal/src/commands/command_buffer/metal_command_buffer.h similarity index 100% rename from rendering_api/metal/src/core/commands/command_buffer/metal_command_buffer.h rename to src/apis/metal/src/commands/command_buffer/metal_command_buffer.h diff --git a/rendering_api/metal/src/core/commands/command_buffer/metal_command_buffer.m b/src/apis/metal/src/commands/command_buffer/metal_command_buffer.m similarity index 100% rename from rendering_api/metal/src/core/commands/command_buffer/metal_command_buffer.m rename to src/apis/metal/src/commands/command_buffer/metal_command_buffer.m diff --git a/rendering_api/metal/src/core/commands/command_pool/metal_command_pool.h b/src/apis/metal/src/commands/command_pool/metal_command_pool.h similarity index 100% rename from rendering_api/metal/src/core/commands/command_pool/metal_command_pool.h rename to src/apis/metal/src/commands/command_pool/metal_command_pool.h diff --git a/rendering_api/metal/src/core/commands/command_pool/metal_command_pool.m b/src/apis/metal/src/commands/command_pool/metal_command_pool.m similarity index 100% rename from rendering_api/metal/src/core/commands/command_pool/metal_command_pool.m rename to src/apis/metal/src/commands/command_pool/metal_command_pool.m diff --git a/rendering_api/metal/src/core/commands/commands/metal_commands.m b/src/apis/metal/src/commands/commands/metal_commands.m similarity index 100% rename from rendering_api/metal/src/core/commands/commands/metal_commands.m rename to src/apis/metal/src/commands/commands/metal_commands.m diff --git a/rendering_api/metal/src/core/debugger/metal_debugger.m b/src/apis/metal/src/debugger/metal_debugger.m similarity index 100% rename from rendering_api/metal/src/core/debugger/metal_debugger.m rename to src/apis/metal/src/debugger/metal_debugger.m diff --git a/rendering_api/metal/src/core/devices/metal_output_device.m b/src/apis/metal/src/devices/metal_output_device.m similarity index 100% rename from rendering_api/metal/src/core/devices/metal_output_device.m rename to src/apis/metal/src/devices/metal_output_device.m diff --git a/rendering_api/metal/src/core/devices/metal_output_devices.h b/src/apis/metal/src/devices/metal_output_devices.h similarity index 100% rename from rendering_api/metal/src/core/devices/metal_output_devices.h rename to src/apis/metal/src/devices/metal_output_devices.h diff --git a/rendering_api/metal/src/core/devices/metal_physical_device.m b/src/apis/metal/src/devices/metal_physical_device.m similarity index 100% rename from rendering_api/metal/src/core/devices/metal_physical_device.m rename to src/apis/metal/src/devices/metal_physical_device.m diff --git a/rendering_api/metal/src/core/framebuffers/metal_framebuffer.h b/src/apis/metal/src/framebuffers/metal_framebuffer.h similarity index 100% rename from rendering_api/metal/src/core/framebuffers/metal_framebuffer.h rename to src/apis/metal/src/framebuffers/metal_framebuffer.h diff --git a/rendering_api/metal/src/core/framebuffers/metal_framebuffer.m b/src/apis/metal/src/framebuffers/metal_framebuffer.m similarity index 100% rename from rendering_api/metal/src/core/framebuffers/metal_framebuffer.m rename to src/apis/metal/src/framebuffers/metal_framebuffer.m diff --git a/rendering_api/metal/src/core/instance/metal_instance.h b/src/apis/metal/src/instance/metal_instance.h similarity index 100% rename from rendering_api/metal/src/core/instance/metal_instance.h rename to src/apis/metal/src/instance/metal_instance.h diff --git a/rendering_api/metal/src/core/instance/metal_instance.m b/src/apis/metal/src/instance/metal_instance.m similarity index 100% rename from rendering_api/metal/src/core/instance/metal_instance.m rename to src/apis/metal/src/instance/metal_instance.m diff --git a/rendering_api/metal/src/core/pipelines/graphics_pipeline/metal_graphics_pipeline.h b/src/apis/metal/src/pipelines/graphics_pipeline/metal_graphics_pipeline.h similarity index 100% rename from rendering_api/metal/src/core/pipelines/graphics_pipeline/metal_graphics_pipeline.h rename to src/apis/metal/src/pipelines/graphics_pipeline/metal_graphics_pipeline.h diff --git a/rendering_api/metal/src/core/pipelines/graphics_pipeline/metal_graphics_pipeline.m b/src/apis/metal/src/pipelines/graphics_pipeline/metal_graphics_pipeline.m similarity index 100% rename from rendering_api/metal/src/core/pipelines/graphics_pipeline/metal_graphics_pipeline.m rename to src/apis/metal/src/pipelines/graphics_pipeline/metal_graphics_pipeline.m diff --git a/rendering_api/metal/src/core/present/metal_present.m b/src/apis/metal/src/present/metal_present.m similarity index 100% rename from rendering_api/metal/src/core/present/metal_present.m rename to src/apis/metal/src/present/metal_present.m diff --git a/rendering_api/metal/src/core/presentation_queue/metal_presentation_queue.h b/src/apis/metal/src/presentation_queue/metal_presentation_queue.h similarity index 100% rename from rendering_api/metal/src/core/presentation_queue/metal_presentation_queue.h rename to src/apis/metal/src/presentation_queue/metal_presentation_queue.h diff --git a/rendering_api/metal/src/core/presentation_queue/metal_presentation_queue.m b/src/apis/metal/src/presentation_queue/metal_presentation_queue.m similarity index 100% rename from rendering_api/metal/src/core/presentation_queue/metal_presentation_queue.m rename to src/apis/metal/src/presentation_queue/metal_presentation_queue.m diff --git a/rendering_api/metal/src/core/renderpass/metal_render_pass.h b/src/apis/metal/src/renderpass/metal_render_pass.h similarity index 100% rename from rendering_api/metal/src/core/renderpass/metal_render_pass.h rename to src/apis/metal/src/renderpass/metal_render_pass.h diff --git a/rendering_api/metal/src/core/renderpass/metal_render_pass.m b/src/apis/metal/src/renderpass/metal_render_pass.m similarity index 100% rename from rendering_api/metal/src/core/renderpass/metal_render_pass.m rename to src/apis/metal/src/renderpass/metal_render_pass.m diff --git a/rendering_api/metal/src/core/shader_module/metal_shader_module.h b/src/apis/metal/src/shader_module/metal_shader_module.h similarity index 100% rename from rendering_api/metal/src/core/shader_module/metal_shader_module.h rename to src/apis/metal/src/shader_module/metal_shader_module.h diff --git a/rendering_api/metal/src/core/shader_module/metal_shader_module.m b/src/apis/metal/src/shader_module/metal_shader_module.m similarity index 100% rename from rendering_api/metal/src/core/shader_module/metal_shader_module.m rename to src/apis/metal/src/shader_module/metal_shader_module.m diff --git a/rendering_api/metal/src/core/submit/metal_submit.m b/src/apis/metal/src/submit/metal_submit.m similarity index 100% rename from rendering_api/metal/src/core/submit/metal_submit.m rename to src/apis/metal/src/submit/metal_submit.m diff --git a/rendering_api/metal/src/core/surface/metal_surface.h b/src/apis/metal/src/surface/metal_surface.h similarity index 100% rename from rendering_api/metal/src/core/surface/metal_surface.h rename to src/apis/metal/src/surface/metal_surface.h diff --git a/rendering_api/metal/src/core/surface/metal_surface.m b/src/apis/metal/src/surface/metal_surface.m similarity index 100% rename from rendering_api/metal/src/core/surface/metal_surface.m rename to src/apis/metal/src/surface/metal_surface.m diff --git a/rendering_api/metal/src/core/sync/fence/metal_fence.h b/src/apis/metal/src/sync/fence/metal_fence.h similarity index 100% rename from rendering_api/metal/src/core/sync/fence/metal_fence.h rename to src/apis/metal/src/sync/fence/metal_fence.h diff --git a/rendering_api/metal/src/core/sync/fence/metal_fence.m b/src/apis/metal/src/sync/fence/metal_fence.m similarity index 100% rename from rendering_api/metal/src/core/sync/fence/metal_fence.m rename to src/apis/metal/src/sync/fence/metal_fence.m diff --git a/rendering_api/metal/src/core/sync/semaphore/metal_semaphore.h b/src/apis/metal/src/sync/semaphore/metal_semaphore.h similarity index 100% rename from rendering_api/metal/src/core/sync/semaphore/metal_semaphore.h rename to src/apis/metal/src/sync/semaphore/metal_semaphore.h diff --git a/rendering_api/metal/src/core/sync/semaphore/metal_semaphore.m b/src/apis/metal/src/sync/semaphore/metal_semaphore.m similarity index 100% rename from rendering_api/metal/src/core/sync/semaphore/metal_semaphore.m rename to src/apis/metal/src/sync/semaphore/metal_semaphore.m diff --git a/rendering_api/metal/src/core/texture/metal_texture.h b/src/apis/metal/src/texture/metal_texture.h similarity index 100% rename from rendering_api/metal/src/core/texture/metal_texture.h rename to src/apis/metal/src/texture/metal_texture.h diff --git a/rendering_api/metal/src/core/uniforms/metal_uniform.c b/src/apis/metal/src/uniforms/metal_uniform.c similarity index 100% rename from rendering_api/metal/src/core/uniforms/metal_uniform.c rename to src/apis/metal/src/uniforms/metal_uniform.c diff --git a/rendering_api/metal/src/core/uniforms/metal_uniform.h b/src/apis/metal/src/uniforms/metal_uniform.h similarity index 100% rename from rendering_api/metal/src/core/uniforms/metal_uniform.h rename to src/apis/metal/src/uniforms/metal_uniform.h diff --git a/rendering_api/metal/src/core/uniforms/metal_uniform_pool.c b/src/apis/metal/src/uniforms/metal_uniform_pool.c similarity index 100% rename from rendering_api/metal/src/core/uniforms/metal_uniform_pool.c rename to src/apis/metal/src/uniforms/metal_uniform_pool.c diff --git a/rendering_api/metal/src/core/uniforms/metal_uniform_pool.h b/src/apis/metal/src/uniforms/metal_uniform_pool.h similarity index 100% rename from rendering_api/metal/src/core/uniforms/metal_uniform_pool.h rename to src/apis/metal/src/uniforms/metal_uniform_pool.h diff --git a/rendering_api/vulkan/CMakeLists.txt b/src/apis/vulkan/CMakeLists.txt similarity index 59% rename from rendering_api/vulkan/CMakeLists.txt rename to src/apis/vulkan/CMakeLists.txt index 3bb6569..5e9d2aa 100644 --- a/rendering_api/vulkan/CMakeLists.txt +++ b/src/apis/vulkan/CMakeLists.txt @@ -3,23 +3,22 @@ set(CMAKE_CXX_STANDARD 17) project(GryphnVulkanImpl) file(GLOB_RECURSE SOURCE_FILES CONFIGURE_DEPENDS - "src/*.cpp" "src/*.hpp" "src/*.c" "src/*.h" ) if (APPLE) file(GLOB_RECURSE METAL_FILES CONFIGURE_DEPENDS "src/*.m" -) + ) endif() find_package(Vulkan REQUIRED) -add_library(GryphnVulkanImpl SHARED ${SOURCE_FILES} ${METAL_FILES}) +add_library(GryphnVulkanImpl STATIC ${SOURCE_FILES} ${METAL_FILES}) target_include_directories(GryphnVulkanImpl PUBLIC ${Vulkan_INCLUDE_DIRS} - ${CMAKE_CURRENT_SOURCE_DIR}/../../include/ - ${CMAKE_CURRENT_SOURCE_DIR}/../../src/ - ${CMAKE_CURRENT_SOURCE_DIR}/../../src/utils/ + ${CMAKE_CURRENT_SOURCE_DIR}/../../../include/ + ${CMAKE_CURRENT_SOURCE_DIR}/../../ + ${CMAKE_CURRENT_SOURCE_DIR}/../../utils/ src/ ) add_compile_definitions(GN_REVEAL_IMPL) @@ -29,7 +28,6 @@ if(WIN32) add_compile_definitions(GN_PLATFORM_WIN32) endif() if(APPLE) - target_link_libraries(GryphnVulkanImpl "-framework IOKit" "-framework CoreFoundation" @@ -38,22 +36,8 @@ if(APPLE) "-framework Metal" "-framework QuartzCore" ) - add_compile_definitions(GN_PLATFORM_MACOS) endif() if(UNIX AND NOT APPLE) add_compile_definitions(GN_PLATFORM_LINUX) endif() - -if (APPLE) - add_custom_command(TARGET GryphnVulkanImpl POST_BUILD - COMMAND mv libGryphnVulkanImpl.dylib - ${CMAKE_BINARY_DIR}/gryphn/rendering_apis/GryphnVulkanImpl.dylib - ) -endif() -if (UNIX AND NOT APPLE) - add_custom_command(TARGET GryphnVulkanImpl POST_BUILD - COMMAND mv libGryphnVulkanImpl.so - ${CMAKE_BINARY_DIR}/gryphn/rendering_apis/GryphnVulkanImpl.so - ) -endif() diff --git a/rendering_api/vulkan/src/buffers/vulkan_buffer.c b/src/apis/vulkan/src/buffers/vulkan_buffer.c similarity index 100% rename from rendering_api/vulkan/src/buffers/vulkan_buffer.c rename to src/apis/vulkan/src/buffers/vulkan_buffer.c diff --git a/rendering_api/vulkan/src/buffers/vulkan_buffer.h b/src/apis/vulkan/src/buffers/vulkan_buffer.h similarity index 100% rename from rendering_api/vulkan/src/buffers/vulkan_buffer.h rename to src/apis/vulkan/src/buffers/vulkan_buffer.h diff --git a/rendering_api/vulkan/src/commands/command_buffer/vulkan_command_buffer.c b/src/apis/vulkan/src/commands/command_buffer/vulkan_command_buffer.c similarity index 100% rename from rendering_api/vulkan/src/commands/command_buffer/vulkan_command_buffer.c rename to src/apis/vulkan/src/commands/command_buffer/vulkan_command_buffer.c diff --git a/rendering_api/vulkan/src/commands/command_buffer/vulkan_command_buffer.h b/src/apis/vulkan/src/commands/command_buffer/vulkan_command_buffer.h similarity index 100% rename from rendering_api/vulkan/src/commands/command_buffer/vulkan_command_buffer.h rename to src/apis/vulkan/src/commands/command_buffer/vulkan_command_buffer.h diff --git a/rendering_api/vulkan/src/commands/command_pool/vulkan_command_pool.c b/src/apis/vulkan/src/commands/command_pool/vulkan_command_pool.c similarity index 100% rename from rendering_api/vulkan/src/commands/command_pool/vulkan_command_pool.c rename to src/apis/vulkan/src/commands/command_pool/vulkan_command_pool.c diff --git a/rendering_api/vulkan/src/commands/command_pool/vulkan_command_pool.h b/src/apis/vulkan/src/commands/command_pool/vulkan_command_pool.h similarity index 100% rename from rendering_api/vulkan/src/commands/command_pool/vulkan_command_pool.h rename to src/apis/vulkan/src/commands/command_pool/vulkan_command_pool.h diff --git a/rendering_api/vulkan/src/commands/commands/vulkan_commands.c b/src/apis/vulkan/src/commands/commands/vulkan_commands.c similarity index 100% rename from rendering_api/vulkan/src/commands/commands/vulkan_commands.c rename to src/apis/vulkan/src/commands/commands/vulkan_commands.c diff --git a/rendering_api/vulkan/src/debugger/vulkan_debugger.c b/src/apis/vulkan/src/debugger/vulkan_debugger.c similarity index 100% rename from rendering_api/vulkan/src/debugger/vulkan_debugger.c rename to src/apis/vulkan/src/debugger/vulkan_debugger.c diff --git a/rendering_api/vulkan/src/debugger/vulkan_debugger.h b/src/apis/vulkan/src/debugger/vulkan_debugger.h similarity index 100% rename from rendering_api/vulkan/src/debugger/vulkan_debugger.h rename to src/apis/vulkan/src/debugger/vulkan_debugger.h diff --git a/rendering_api/vulkan/src/framebuffers/vulkan_framebuffer.c b/src/apis/vulkan/src/framebuffers/vulkan_framebuffer.c similarity index 100% rename from rendering_api/vulkan/src/framebuffers/vulkan_framebuffer.c rename to src/apis/vulkan/src/framebuffers/vulkan_framebuffer.c diff --git a/rendering_api/vulkan/src/framebuffers/vulkan_framebuffer.h b/src/apis/vulkan/src/framebuffers/vulkan_framebuffer.h similarity index 100% rename from rendering_api/vulkan/src/framebuffers/vulkan_framebuffer.h rename to src/apis/vulkan/src/framebuffers/vulkan_framebuffer.h diff --git a/rendering_api/vulkan/src/instance/vulkan_instance.c b/src/apis/vulkan/src/instance/vulkan_instance.c similarity index 100% rename from rendering_api/vulkan/src/instance/vulkan_instance.c rename to src/apis/vulkan/src/instance/vulkan_instance.c diff --git a/rendering_api/vulkan/src/instance/vulkan_instance.h b/src/apis/vulkan/src/instance/vulkan_instance.h similarity index 100% rename from rendering_api/vulkan/src/instance/vulkan_instance.h rename to src/apis/vulkan/src/instance/vulkan_instance.h diff --git a/rendering_api/vulkan/src/output_device/vulkan_device_extensions.c b/src/apis/vulkan/src/output_device/vulkan_device_extensions.c similarity index 100% rename from rendering_api/vulkan/src/output_device/vulkan_device_extensions.c rename to src/apis/vulkan/src/output_device/vulkan_device_extensions.c diff --git a/rendering_api/vulkan/src/output_device/vulkan_device_extensions.h b/src/apis/vulkan/src/output_device/vulkan_device_extensions.h similarity index 100% rename from rendering_api/vulkan/src/output_device/vulkan_device_extensions.h rename to src/apis/vulkan/src/output_device/vulkan_device_extensions.h diff --git a/rendering_api/vulkan/src/output_device/vulkan_output_device.c b/src/apis/vulkan/src/output_device/vulkan_output_device.c similarity index 100% rename from rendering_api/vulkan/src/output_device/vulkan_output_device.c rename to src/apis/vulkan/src/output_device/vulkan_output_device.c diff --git a/rendering_api/vulkan/src/output_device/vulkan_output_devices.h b/src/apis/vulkan/src/output_device/vulkan_output_devices.h similarity index 100% rename from rendering_api/vulkan/src/output_device/vulkan_output_devices.h rename to src/apis/vulkan/src/output_device/vulkan_output_devices.h diff --git a/rendering_api/vulkan/src/output_device/vulkan_physical_device.c b/src/apis/vulkan/src/output_device/vulkan_physical_device.c similarity index 100% rename from rendering_api/vulkan/src/output_device/vulkan_physical_device.c rename to src/apis/vulkan/src/output_device/vulkan_physical_device.c diff --git a/rendering_api/vulkan/src/output_device/vulkan_physical_device.h b/src/apis/vulkan/src/output_device/vulkan_physical_device.h similarity index 100% rename from rendering_api/vulkan/src/output_device/vulkan_physical_device.h rename to src/apis/vulkan/src/output_device/vulkan_physical_device.h diff --git a/rendering_api/vulkan/src/pipelines/graphics_pipeline/vulkan_graphics_pipeline.c b/src/apis/vulkan/src/pipelines/graphics_pipeline/vulkan_graphics_pipeline.c similarity index 100% rename from rendering_api/vulkan/src/pipelines/graphics_pipeline/vulkan_graphics_pipeline.c rename to src/apis/vulkan/src/pipelines/graphics_pipeline/vulkan_graphics_pipeline.c diff --git a/rendering_api/vulkan/src/pipelines/graphics_pipeline/vulkan_graphics_pipeline.h b/src/apis/vulkan/src/pipelines/graphics_pipeline/vulkan_graphics_pipeline.h similarity index 100% rename from rendering_api/vulkan/src/pipelines/graphics_pipeline/vulkan_graphics_pipeline.h rename to src/apis/vulkan/src/pipelines/graphics_pipeline/vulkan_graphics_pipeline.h diff --git a/rendering_api/vulkan/src/present/vulkan_present.c b/src/apis/vulkan/src/present/vulkan_present.c similarity index 100% rename from rendering_api/vulkan/src/present/vulkan_present.c rename to src/apis/vulkan/src/present/vulkan_present.c diff --git a/rendering_api/vulkan/src/presentation_queue/vulkan_presentation_queue.c b/src/apis/vulkan/src/presentation_queue/vulkan_presentation_queue.c similarity index 100% rename from rendering_api/vulkan/src/presentation_queue/vulkan_presentation_queue.c rename to src/apis/vulkan/src/presentation_queue/vulkan_presentation_queue.c diff --git a/rendering_api/vulkan/src/presentation_queue/vulkan_presentation_queue.h b/src/apis/vulkan/src/presentation_queue/vulkan_presentation_queue.h similarity index 100% rename from rendering_api/vulkan/src/presentation_queue/vulkan_presentation_queue.h rename to src/apis/vulkan/src/presentation_queue/vulkan_presentation_queue.h diff --git a/rendering_api/vulkan/src/presentation_queue/vulkan_swapchain_support.c b/src/apis/vulkan/src/presentation_queue/vulkan_swapchain_support.c similarity index 100% rename from rendering_api/vulkan/src/presentation_queue/vulkan_swapchain_support.c rename to src/apis/vulkan/src/presentation_queue/vulkan_swapchain_support.c diff --git a/rendering_api/vulkan/src/presentation_queue/vulkan_swapchain_support.h b/src/apis/vulkan/src/presentation_queue/vulkan_swapchain_support.h similarity index 100% rename from rendering_api/vulkan/src/presentation_queue/vulkan_swapchain_support.h rename to src/apis/vulkan/src/presentation_queue/vulkan_swapchain_support.h diff --git a/rendering_api/vulkan/src/renderpass/vulkan_render_pass_descriptor.c b/src/apis/vulkan/src/renderpass/vulkan_render_pass_descriptor.c similarity index 100% rename from rendering_api/vulkan/src/renderpass/vulkan_render_pass_descriptor.c rename to src/apis/vulkan/src/renderpass/vulkan_render_pass_descriptor.c diff --git a/rendering_api/vulkan/src/renderpass/vulkan_render_pass_descriptor.h b/src/apis/vulkan/src/renderpass/vulkan_render_pass_descriptor.h similarity index 100% rename from rendering_api/vulkan/src/renderpass/vulkan_render_pass_descriptor.h rename to src/apis/vulkan/src/renderpass/vulkan_render_pass_descriptor.h diff --git a/rendering_api/vulkan/src/shader_module/vulkan_shader_module.c b/src/apis/vulkan/src/shader_module/vulkan_shader_module.c similarity index 100% rename from rendering_api/vulkan/src/shader_module/vulkan_shader_module.c rename to src/apis/vulkan/src/shader_module/vulkan_shader_module.c diff --git a/rendering_api/vulkan/src/shader_module/vulkan_shader_module.h b/src/apis/vulkan/src/shader_module/vulkan_shader_module.h similarity index 100% rename from rendering_api/vulkan/src/shader_module/vulkan_shader_module.h rename to src/apis/vulkan/src/shader_module/vulkan_shader_module.h diff --git a/rendering_api/vulkan/src/submit/vulkan_submit.c b/src/apis/vulkan/src/submit/vulkan_submit.c similarity index 100% rename from rendering_api/vulkan/src/submit/vulkan_submit.c rename to src/apis/vulkan/src/submit/vulkan_submit.c diff --git a/rendering_api/vulkan/src/sync/fence/vulkan_fence.c b/src/apis/vulkan/src/sync/fence/vulkan_fence.c similarity index 100% rename from rendering_api/vulkan/src/sync/fence/vulkan_fence.c rename to src/apis/vulkan/src/sync/fence/vulkan_fence.c diff --git a/rendering_api/vulkan/src/sync/fence/vulkan_fence.h b/src/apis/vulkan/src/sync/fence/vulkan_fence.h similarity index 100% rename from rendering_api/vulkan/src/sync/fence/vulkan_fence.h rename to src/apis/vulkan/src/sync/fence/vulkan_fence.h diff --git a/rendering_api/vulkan/src/sync/semaphore/vulkan_semaphore.c b/src/apis/vulkan/src/sync/semaphore/vulkan_semaphore.c similarity index 100% rename from rendering_api/vulkan/src/sync/semaphore/vulkan_semaphore.c rename to src/apis/vulkan/src/sync/semaphore/vulkan_semaphore.c diff --git a/rendering_api/vulkan/src/sync/semaphore/vulkan_semaphore.h b/src/apis/vulkan/src/sync/semaphore/vulkan_semaphore.h similarity index 100% rename from rendering_api/vulkan/src/sync/semaphore/vulkan_semaphore.h rename to src/apis/vulkan/src/sync/semaphore/vulkan_semaphore.h diff --git a/rendering_api/vulkan/src/textures/vulkan_texture.c b/src/apis/vulkan/src/textures/vulkan_texture.c similarity index 100% rename from rendering_api/vulkan/src/textures/vulkan_texture.c rename to src/apis/vulkan/src/textures/vulkan_texture.c diff --git a/rendering_api/vulkan/src/textures/vulkan_texture.h b/src/apis/vulkan/src/textures/vulkan_texture.h similarity index 100% rename from rendering_api/vulkan/src/textures/vulkan_texture.h rename to src/apis/vulkan/src/textures/vulkan_texture.h diff --git a/rendering_api/vulkan/src/uniforms/vulkan_uniform.c b/src/apis/vulkan/src/uniforms/vulkan_uniform.c similarity index 100% rename from rendering_api/vulkan/src/uniforms/vulkan_uniform.c rename to src/apis/vulkan/src/uniforms/vulkan_uniform.c diff --git a/rendering_api/vulkan/src/uniforms/vulkan_uniform.h b/src/apis/vulkan/src/uniforms/vulkan_uniform.h similarity index 100% rename from rendering_api/vulkan/src/uniforms/vulkan_uniform.h rename to src/apis/vulkan/src/uniforms/vulkan_uniform.h diff --git a/rendering_api/vulkan/src/uniforms/vulkan_uniform_layout.c b/src/apis/vulkan/src/uniforms/vulkan_uniform_layout.c similarity index 100% rename from rendering_api/vulkan/src/uniforms/vulkan_uniform_layout.c rename to src/apis/vulkan/src/uniforms/vulkan_uniform_layout.c diff --git a/rendering_api/vulkan/src/uniforms/vulkan_uniform_layout.h b/src/apis/vulkan/src/uniforms/vulkan_uniform_layout.h similarity index 100% rename from rendering_api/vulkan/src/uniforms/vulkan_uniform_layout.h rename to src/apis/vulkan/src/uniforms/vulkan_uniform_layout.h diff --git a/rendering_api/vulkan/src/uniforms/vulkan_uniform_pool.c b/src/apis/vulkan/src/uniforms/vulkan_uniform_pool.c similarity index 100% rename from rendering_api/vulkan/src/uniforms/vulkan_uniform_pool.c rename to src/apis/vulkan/src/uniforms/vulkan_uniform_pool.c diff --git a/rendering_api/vulkan/src/uniforms/vulkan_uniform_pool.h b/src/apis/vulkan/src/uniforms/vulkan_uniform_pool.h similarity index 100% rename from rendering_api/vulkan/src/uniforms/vulkan_uniform_pool.h rename to src/apis/vulkan/src/uniforms/vulkan_uniform_pool.h diff --git a/rendering_api/vulkan/src/vulkan_surface/vulkan_surface.c b/src/apis/vulkan/src/vulkan_surface/vulkan_surface.c similarity index 100% rename from rendering_api/vulkan/src/vulkan_surface/vulkan_surface.c rename to src/apis/vulkan/src/vulkan_surface/vulkan_surface.c diff --git a/rendering_api/vulkan/src/vulkan_surface/vulkan_surface.h b/src/apis/vulkan/src/vulkan_surface/vulkan_surface.h similarity index 100% rename from rendering_api/vulkan/src/vulkan_surface/vulkan_surface.h rename to src/apis/vulkan/src/vulkan_surface/vulkan_surface.h diff --git a/rendering_api/vulkan/src/vulkan_surface/vulkan_surface.m b/src/apis/vulkan/src/vulkan_surface/vulkan_surface.m similarity index 100% rename from rendering_api/vulkan/src/vulkan_surface/vulkan_surface.m rename to src/apis/vulkan/src/vulkan_surface/vulkan_surface.m diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt new file mode 100644 index 0000000..eac8e32 --- /dev/null +++ b/src/core/CMakeLists.txt @@ -0,0 +1,15 @@ +set(CMAKE_EXPORT_COMPILE_COMMANDS on) +project(GryphnCore) +add_compile_definitions(GN_REVEAL_IMPL) + +file(GLOB_RECURSE SOURCE_FILES CONFIGURE_DEPENDS "src/*.c") +if(APPLE) + file(GLOB_RECURSE METAL_FILES CONFIGURE_DEPENDS "src/*.m") +endif() +add_library(GryphnCore ${SOURCE_FILES} ${METAL_FILES}) + +target_include_directories(GryphnCore PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../) +target_include_directories(GryphnCore PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src/) +target_include_directories(GryphnCore PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../include/) +target_include_directories(GryphnCore PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../utils) +target_include_directories(GryphnCore PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../utils) diff --git a/src/core/instance/gryphn_instance.c b/src/core/instance/gryphn_instance.c deleted file mode 100644 index 48b7e62..0000000 --- a/src/core/instance/gryphn_instance.c +++ /dev/null @@ -1,27 +0,0 @@ -#include "gryphn_instance.h" -#include "init/gryphn_init.h" -#include -#include "core/instance/gryphn_instance.h" -#include "core/debugger/gryphn_debugger.h" -#include "core/gryphn_handles.h" -#include "stdio.h" -gnReturnCode gnCreateInstance(gnInstanceHandle* instanceHandlePtr, gnInstanceInfo info) { - *instanceHandlePtr = malloc(sizeof(struct gnInstance_t)); - gnInstanceHandle instance = *instanceHandlePtr; - if (!gnIsAPISupported(info.renderingAPI)) return GN_UNSUPPORTED_RENDERING_API; - instance->loadDeviceFunctions = gnFalse; - instance->dynamicLib = gnLoadRenderingDLL(info.renderingAPI); - if (instance->dynamicLib == NULL) return GN_UNABLE_TO_LOAD_DYNAMIC_LIBARRY; - instance->functions = gnLoadFunctions(instance); - - if (info.debugger) - instance->debugger = info.debugger; - - instance->loadCommandFunctions = gnFalse; - instance->loadDeviceFunctions = gnFalse; - return instance->functions->_gnCreateInstance(instance, info); -} - -void gnDestroyInstance(gnInstanceHandle instance) { - instance->functions->_gnDestroyInstance(instance); -} diff --git a/src/core/buffers/gryphn_buffer.c b/src/core/src/buffers/gryphn_buffer.c similarity index 88% rename from src/core/buffers/gryphn_buffer.c rename to src/core/src/buffers/gryphn_buffer.c index 00b51c0..c2bbce2 100644 --- a/src/core/buffers/gryphn_buffer.c +++ b/src/core/src/buffers/gryphn_buffer.c @@ -1,6 +1,6 @@ #include "gryphn_buffer.h" -#include "core/output_device/gryphn_output_device.h" -#include "core/gryphn_platform_functions.h" +#include "output_device/gryphn_output_device.h" +#include "gryphn_platform_functions.h" gnReturnCode gnCreateBuffer(gnBufferHandle* buffer, gnOutputDeviceHandle device, gnBufferInfo info) { *buffer = malloc(sizeof(struct gnBuffer_t)); diff --git a/src/core/buffers/gryphn_buffer.h b/src/core/src/buffers/gryphn_buffer.h similarity index 97% rename from src/core/buffers/gryphn_buffer.h rename to src/core/src/buffers/gryphn_buffer.h index f1a4ca5..5df6d90 100644 --- a/src/core/buffers/gryphn_buffer.h +++ b/src/core/src/buffers/gryphn_buffer.h @@ -2,7 +2,7 @@ #include "stdlib.h" #include "utils/gryphn_error_code.h" #include "utils/lists/gryphn_array_list.h" -#include +#include typedef enum gnIndexType { GN_UINT16, GN_UINT32 diff --git a/src/core/command/command_buffer/gryphn_command_buffer.c b/src/core/src/command/command_buffer/gryphn_command_buffer.c similarity index 96% rename from src/core/command/command_buffer/gryphn_command_buffer.c rename to src/core/src/command/command_buffer/gryphn_command_buffer.c index beb89f1..b4c5d92 100644 --- a/src/core/command/command_buffer/gryphn_command_buffer.c +++ b/src/core/src/command/command_buffer/gryphn_command_buffer.c @@ -1,5 +1,5 @@ #include "gryphn_command_buffer.h" -#include "core/gryphn_platform_functions.h" +#include "gryphn_platform_functions.h" gnReturnCode gnCommandPoolAllocateCommandBuffersFromPointer(gnCommandBufferHandle* buffers, uint32_t count, gnCommandPoolHandle commandPool) { for (int i = 0; i < count; i++) { diff --git a/src/core/command/command_buffer/gryphn_command_buffer.h b/src/core/src/command/command_buffer/gryphn_command_buffer.h similarity index 97% rename from src/core/command/command_buffer/gryphn_command_buffer.h rename to src/core/src/command/command_buffer/gryphn_command_buffer.h index cecfcff..ff6a055 100644 --- a/src/core/command/command_buffer/gryphn_command_buffer.h +++ b/src/core/src/command/command_buffer/gryphn_command_buffer.h @@ -2,7 +2,7 @@ #include "stdint.h" #include "utils/gryphn_error_code.h" #include "utils/lists/gryphn_array_list.h" -#include "core/gryphn_handles.h" +#include "gryphn_handles.h" #ifdef GN_REVEAL_IMPL struct gnCommandBuffer_t { diff --git a/src/core/command/command_pool/gryphn_command_pool.c b/src/core/src/command/command_pool/gryphn_command_pool.c similarity index 90% rename from src/core/command/command_pool/gryphn_command_pool.c rename to src/core/src/command/command_pool/gryphn_command_pool.c index 9d8368f..9d402a6 100644 --- a/src/core/command/command_pool/gryphn_command_pool.c +++ b/src/core/src/command/command_pool/gryphn_command_pool.c @@ -1,6 +1,6 @@ #include "gryphn_command_pool.h" -#include "core/gryphn_platform_functions.h" -#include "core/instance/init/gryphn_init.h" +#include "gryphn_platform_functions.h" +#include "instance/init/gryphn_init.h" gnReturnCode gnCreateCommandPool(gnCommandPoolHandle* commandPool, gnOutputDeviceHandle device, struct gnCommandPoolInfo_t info) { *commandPool = malloc(sizeof(struct gnCommandPool_t)); diff --git a/src/core/command/command_pool/gryphn_command_pool.h b/src/core/src/command/command_pool/gryphn_command_pool.h similarity index 94% rename from src/core/command/command_pool/gryphn_command_pool.h rename to src/core/src/command/command_pool/gryphn_command_pool.h index 778dd03..bfc84a7 100644 --- a/src/core/command/command_pool/gryphn_command_pool.h +++ b/src/core/src/command/command_pool/gryphn_command_pool.h @@ -1,7 +1,7 @@ #pragma once #include "stdint.h" #include -#include "core/gryphn_handles.h" +#include "gryphn_handles.h" typedef struct gnCommandPoolInfo_t { uint32_t queueIndex; diff --git a/src/core/command/commands/gryphn_command.c b/src/core/src/command/commands/gryphn_command.c similarity index 92% rename from src/core/command/commands/gryphn_command.c rename to src/core/src/command/commands/gryphn_command.c index 3b46695..b9bd0f8 100644 --- a/src/core/command/commands/gryphn_command.c +++ b/src/core/src/command/commands/gryphn_command.c @@ -1,7 +1,7 @@ #include "gryphn_command.h" -#include "core/command/command_buffer/gryphn_command_buffer.h" -#include "core/command/command_pool/gryphn_command_pool.h" -#include "core/gryphn_platform_functions.h" +#include "command/command_buffer/gryphn_command_buffer.h" +#include "command/command_pool/gryphn_command_pool.h" +#include "gryphn_platform_functions.h" void gnCommandBeginRenderPass(struct gnCommandBuffer_t* buffer, struct gnRenderPassInfo_t passInfo) { buffer->commandPool->commandFunctions->_gnCommandBeginRenderPass(buffer, passInfo); diff --git a/src/core/command/commands/gryphn_command.h b/src/core/src/command/commands/gryphn_command.h similarity index 83% rename from src/core/command/commands/gryphn_command.h rename to src/core/src/command/commands/gryphn_command.h index ce2a550..ec02309 100644 --- a/src/core/command/commands/gryphn_command.h +++ b/src/core/src/command/commands/gryphn_command.h @@ -1,17 +1,17 @@ -#include "core/gryphn_handles.h" +#include "gryphn_handles.h" -#include "core/renderpass/gryphn_render_pass.h" +#include "renderpass/gryphn_render_pass.h" void gnCommandBeginRenderPass(gnCommandBufferHandle buffer, gnRenderPassInfo passInfo); void gnCommandEndRenderPass(gnCommandBufferHandle buffer); -#include "core/pipelines/graphics_pipeline/gryphn_graphics_pipeline.h" +#include "pipelines/graphics_pipeline/gryphn_graphics_pipeline.h" void gnCommandBindGraphicsPipeline(gnCommandBufferHandle buffer, gnGraphicsPipelineHandle graphicsPipeline); void gnCommandSetViewport(gnCommandBufferHandle buffer, gnViewport viewport); void gnCommandSetScissor(gnCommandBufferHandle buffer, gnScissor scissor); void gnCommandBindUniform(gnCommandBufferHandle buffer, gnUniform uniform, uint32_t set); void gnCommandPushConstant(gnCommandBufferHandle buffer, gnPushConstantLayout layout, void* data); -#include "core/buffers/gryphn_buffer.h" +#include "buffers/gryphn_buffer.h" void gnCommandBindBuffer(gnCommandBufferHandle buffer, gnBufferHandle bufferToBind, gnBufferType type); void gnCommandDraw(gnCommandBufferHandle buffer, int vertexCount, int firstVertex, int instanceCount, int firstInstance); diff --git a/src/core/debugger/gryphn_debugger.c b/src/core/src/debugger/gryphn_debugger.c similarity index 86% rename from src/core/debugger/gryphn_debugger.c rename to src/core/src/debugger/gryphn_debugger.c index 6c38bae..1e18ba5 100644 --- a/src/core/debugger/gryphn_debugger.c +++ b/src/core/src/debugger/gryphn_debugger.c @@ -1,5 +1,5 @@ #include "gryphn_debugger.h" -#include +#include gnReturnCode gnCreateDebugger(gnDebuggerHandle* debugger, const gnDebuggerInfo info) { *debugger = malloc(sizeof(struct gnDebugger_t)); diff --git a/src/core/debugger/gryphn_debugger.h b/src/core/src/debugger/gryphn_debugger.h similarity index 98% rename from src/core/debugger/gryphn_debugger.h rename to src/core/src/debugger/gryphn_debugger.h index d9bc83b..71e7def 100644 --- a/src/core/debugger/gryphn_debugger.h +++ b/src/core/src/debugger/gryphn_debugger.h @@ -2,7 +2,7 @@ #include "stdint.h" #include "utils/gryphn_string.h" #include "utils/gryphn_error_code.h" -#include "core/gryphn_handles.h" +#include "gryphn_handles.h" struct gnPlatformDebugger_t; diff --git a/src/core/framebuffer/gryphn_framebuffer.c b/src/core/src/framebuffer/gryphn_framebuffer.c similarity index 91% rename from src/core/framebuffer/gryphn_framebuffer.c rename to src/core/src/framebuffer/gryphn_framebuffer.c index fbd80e5..b8ed297 100644 --- a/src/core/framebuffer/gryphn_framebuffer.c +++ b/src/core/src/framebuffer/gryphn_framebuffer.c @@ -1,5 +1,5 @@ #include "gryphn_framebuffer.h" -#include "core/gryphn_platform_functions.h" +#include "gryphn_platform_functions.h" gnReturnCode gnCreateFramebuffer(gnFramebuffer* framebuffer, gnOutputDeviceHandle device, gnFramebufferInfo framebufferInfo) { *framebuffer = malloc(sizeof(struct gnFramebuffer_t)); diff --git a/src/core/framebuffer/gryphn_framebuffer.h b/src/core/src/framebuffer/gryphn_framebuffer.h similarity index 94% rename from src/core/framebuffer/gryphn_framebuffer.h rename to src/core/src/framebuffer/gryphn_framebuffer.h index 5d3d668..2c7e296 100644 --- a/src/core/framebuffer/gryphn_framebuffer.h +++ b/src/core/src/framebuffer/gryphn_framebuffer.h @@ -1,7 +1,7 @@ #pragma once #include "utils/math/gryphn_vec2.h" #include "utils/gryphn_error_code.h" -#include "core/gryphn_handles.h" +#include "gryphn_handles.h" typedef struct gnFramebufferInfo_t { gnRenderPassDescriptorHandle renderPassDescriptor; diff --git a/src/core/gryphn_handles.h b/src/core/src/gryphn_handles.h similarity index 100% rename from src/core/gryphn_handles.h rename to src/core/src/gryphn_handles.h diff --git a/src/core/gryphn_platform_functions.h b/src/core/src/gryphn_platform_functions.h similarity index 94% rename from src/core/gryphn_platform_functions.h rename to src/core/src/gryphn_platform_functions.h index 87be4c8..f048f2f 100644 --- a/src/core/gryphn_platform_functions.h +++ b/src/core/src/gryphn_platform_functions.h @@ -2,23 +2,23 @@ // theoretically you could have multible gryphn instances running in one application, // why I dont know #include "instance/gryphn_instance.h" -// #include "debugger/gryphn_debugger.h" +#include #include "output_device/gryphn_physical_output_device.h" #include "output_device/gryphn_output_device.h" #include "window_surface/gryphn_surface.h" -#include +#include #include "shader_module/gryphn_shader_module.h" #include "renderpass/gryphn_render_pass_descriptor.h" #include "pipelines/graphics_pipeline/gryphn_graphics_pipeline.h" #include "framebuffer/gryphn_framebuffer.h" #include "command/command_pool/gryphn_command_pool.h" #include "renderpass/gryphn_render_pass.h" -#include "core/submit/gryphn_submit.h" -#include "core/present/gryphn_present.h" -#include "core/buffers/gryphn_buffer.h" -#include "core/uniforms/gryphn_uniform.h" -#include "core/textures/gryphn_texture.h" -#include "core/uniforms/gryphn_uniform_pool.h" +#include "submit/gryphn_submit.h" +#include "present/gryphn_present.h" +#include "buffers/gryphn_buffer.h" +#include "uniforms/gryphn_uniform.h" +#include "textures/gryphn_texture.h" +#include "uniforms/gryphn_uniform_pool.h" typedef struct gnInstanceFunctions { gnReturnCode (*_gnCreateInstance)(gnInstanceHandle instance, gnInstanceInfo info); @@ -53,7 +53,7 @@ typedef struct gnInstanceFunctions { gnSurfaceDetails (*_gnGetSurfaceDetails)(gnWindowSurfaceHandle windowSurface, struct gnPhysicalDevice_t device); } gnInstanceFunctions; -#include "core/presentation_queue/gryphn_presentation_queue.h" +#include "presentation_queue/gryphn_presentation_queue.h" typedef struct gnDeviceFunctions_t { gnReturnCode (*_gnCreatePresentationQueue)(gnPresentationQueueHandle presentationQueue, const gnOutputDeviceHandle device, gnPresentationQueueInfo presentationInfo); gnReturnCode (*_gnPresentationQueueGetImage)(gnPresentationQueueHandle presentationQueue, uint64_t timeout, gnSemaphoreHandle semaphore, uint32_t* imageIndex); diff --git a/src/core/gryphn_rendering_api.h b/src/core/src/gryphn_rendering_api.h similarity index 100% rename from src/core/gryphn_rendering_api.h rename to src/core/src/gryphn_rendering_api.h diff --git a/src/core/gryphn_support.h b/src/core/src/gryphn_support.h similarity index 100% rename from src/core/gryphn_support.h rename to src/core/src/gryphn_support.h diff --git a/src/core/src/instance/gryphn_instance.c b/src/core/src/instance/gryphn_instance.c new file mode 100644 index 0000000..4245212 --- /dev/null +++ b/src/core/src/instance/gryphn_instance.c @@ -0,0 +1,26 @@ +#include "gryphn_instance.h" +#include +#include "instance/gryphn_instance.h" +#include "gryphn_handles.h" + +gnReturnCode gnCreateInstance(gnInstanceHandle* instanceHandlePtr, gnInstanceInfo info) { + // *instanceHandlePtr = malloc(sizeof(struct gnInstance_t)); + // gnInstanceHandle instance = *instanceHandlePtr; + // if (!gnIsAPISupported(info.renderingAPI)) return GN_UNSUPPORTED_RENDERING_API; + // instance->loadDeviceFunctions = gnFalse; + // instance->dynamicLib = gnLoadRenderingDLL(info.renderingAPI); + // if (instance->dynamicLib == NULL) return GN_UNABLE_TO_LOAD_DYNAMIC_LIBARRY; + // instance->functions = gnLoadFunctions(instance); + + // if (info.debugger) + // instance->debugger = info.debugger; + + // instance->loadCommandFunctions = gnFalse; + // instance->loadDeviceFunctions = gnFalse; + // return instance->functions->_gnCreateInstance(instance, info); + return GN_SUCCESS; +} + +void gnDestroyInstance(gnInstanceHandle instance) { + instance->functions->_gnDestroyInstance(instance); +} diff --git a/src/core/instance/gryphn_instance.h b/src/core/src/instance/gryphn_instance.h similarity index 92% rename from src/core/instance/gryphn_instance.h rename to src/core/src/instance/gryphn_instance.h index 45472ec..eff2eb4 100644 --- a/src/core/instance/gryphn_instance.h +++ b/src/core/src/instance/gryphn_instance.h @@ -1,7 +1,7 @@ #pragma once #include -#include "core/gryphn_rendering_api.h" -#include "core/gryphn_handles.h" +#include "gryphn_rendering_api.h" +#include "gryphn_handles.h" typedef struct gnInstanceFunctions gnInstanceFunctions; diff --git a/src/core/instance/init/gryphn_dynamic_library.h b/src/core/src/instance/init/gryphn_dynamic_library.h similarity index 100% rename from src/core/instance/init/gryphn_dynamic_library.h rename to src/core/src/instance/init/gryphn_dynamic_library.h diff --git a/src/core/instance/init/gryphn_init.c b/src/core/src/instance/init/gryphn_init.c similarity index 100% rename from src/core/instance/init/gryphn_init.c rename to src/core/src/instance/init/gryphn_init.c diff --git a/src/core/instance/init/gryphn_init.h b/src/core/src/instance/init/gryphn_init.h similarity index 85% rename from src/core/instance/init/gryphn_init.h rename to src/core/src/instance/init/gryphn_init.h index ca68bce..413d16d 100644 --- a/src/core/instance/init/gryphn_init.h +++ b/src/core/src/instance/init/gryphn_init.h @@ -1,7 +1,7 @@ #pragma once #include -#include -#include "core/gryphn_platform_functions.h" +#include +#include "gryphn_platform_functions.h" // #include "utils/gryphn_error_code.h" gnBool gnIsAPISupported(gnRenderingAPI RenderingAPI); diff --git a/src/core/output_device/gryphn_output_device.c b/src/core/src/output_device/gryphn_output_device.c similarity index 89% rename from src/core/output_device/gryphn_output_device.c rename to src/core/src/output_device/gryphn_output_device.c index 52329b9..974c857 100644 --- a/src/core/output_device/gryphn_output_device.c +++ b/src/core/src/output_device/gryphn_output_device.c @@ -1,7 +1,7 @@ #include "gryphn_output_device.h" -#include "core/instance/gryphn_instance.h" -#include "core/gryphn_platform_functions.h" -#include "core/instance/init/gryphn_init.h" +#include "instance/gryphn_instance.h" +#include "gryphn_platform_functions.h" +#include "instance/init/gryphn_init.h" #include "utils/gryphn_bool.h" gnReturnCode gnCreateOutputDevice(gnOutputDeviceHandle* outputDevice, gnInstanceHandle instance, struct gnOutputDeviceInfo_t deviceInfo) { diff --git a/src/core/output_device/gryphn_output_device.h b/src/core/src/output_device/gryphn_output_device.h similarity index 94% rename from src/core/output_device/gryphn_output_device.h rename to src/core/src/output_device/gryphn_output_device.h index 7490397..f64f0ab 100644 --- a/src/core/output_device/gryphn_output_device.h +++ b/src/core/src/output_device/gryphn_output_device.h @@ -1,5 +1,5 @@ #pragma once -#include +#include #include struct gnPlatformOutputDevice_t; diff --git a/src/core/output_device/gryphn_physical_output_device.c b/src/core/src/output_device/gryphn_physical_output_device.c similarity index 98% rename from src/core/output_device/gryphn_physical_output_device.c rename to src/core/src/output_device/gryphn_physical_output_device.c index d895f8d..adb012b 100644 --- a/src/core/output_device/gryphn_physical_output_device.c +++ b/src/core/src/output_device/gryphn_physical_output_device.c @@ -1,5 +1,5 @@ #include "gryphn_physical_output_device.h" -#include "core/gryphn_platform_functions.h" +#include "gryphn_platform_functions.h" gnPhysicalDevice* gnGetPhyscialDevices(gnInstanceHandle instance, uint32_t* count) { gnPhysicalDevice* devices = instance->functions->_gnGetPhysicalDevices(instance, count); diff --git a/src/core/output_device/gryphn_physical_output_device.h b/src/core/src/output_device/gryphn_physical_output_device.h similarity index 98% rename from src/core/output_device/gryphn_physical_output_device.h rename to src/core/src/output_device/gryphn_physical_output_device.h index 3a56375..b8cfdcb 100644 --- a/src/core/output_device/gryphn_physical_output_device.h +++ b/src/core/src/output_device/gryphn_physical_output_device.h @@ -1,7 +1,7 @@ #pragma once #include "stdint.h" #include "utils/gryphn_string.h" -#include "core/gryphn_handles.h" +#include "gryphn_handles.h" struct gnPlatformPhysicalDevice_t; diff --git a/src/core/pipelines/graphics_pipeline/gryphn_graphics_pipeline.c b/src/core/src/pipelines/graphics_pipeline/gryphn_graphics_pipeline.c similarity index 93% rename from src/core/pipelines/graphics_pipeline/gryphn_graphics_pipeline.c rename to src/core/src/pipelines/graphics_pipeline/gryphn_graphics_pipeline.c index cec7b77..8f71238 100644 --- a/src/core/pipelines/graphics_pipeline/gryphn_graphics_pipeline.c +++ b/src/core/src/pipelines/graphics_pipeline/gryphn_graphics_pipeline.c @@ -1,5 +1,5 @@ #include "gryphn_graphics_pipeline.h" -#include "core/gryphn_platform_functions.h" +#include "gryphn_platform_functions.h" gnReturnCode gnCreateGraphicsPipeline(gnGraphicsPipelineHandle* graphicsPipeline, gnDevice device, gnGraphicsPipelineInfo info) { *graphicsPipeline = malloc(sizeof(struct gnGraphicsPipeline_t)); diff --git a/src/core/pipelines/graphics_pipeline/gryphn_graphics_pipeline.h b/src/core/src/pipelines/graphics_pipeline/gryphn_graphics_pipeline.h similarity index 92% rename from src/core/pipelines/graphics_pipeline/gryphn_graphics_pipeline.h rename to src/core/src/pipelines/graphics_pipeline/gryphn_graphics_pipeline.h index ea2debf..978cc72 100644 --- a/src/core/pipelines/graphics_pipeline/gryphn_graphics_pipeline.h +++ b/src/core/src/pipelines/graphics_pipeline/gryphn_graphics_pipeline.h @@ -1,11 +1,11 @@ #pragma once -#include -#include -#include -#include +#include +#include +#include +#include #include "utils/math/gryphn_vec2.h" -#include "core/gryphn_handles.h" -#include "core/shader_input/gryphn_shader_layout.h" +#include "gryphn_handles.h" +#include "shader_input/gryphn_shader_layout.h" typedef enum gnDynamicState_e { GN_DYNAMIC_VIEWPORT, diff --git a/src/core/present/gryphn_present.c b/src/core/src/present/gryphn_present.c similarity index 79% rename from src/core/present/gryphn_present.c rename to src/core/src/present/gryphn_present.c index 172b7ce..ef897c8 100644 --- a/src/core/present/gryphn_present.c +++ b/src/core/src/present/gryphn_present.c @@ -1,4 +1,4 @@ -#include "core/gryphn_platform_functions.h" +#include "gryphn_platform_functions.h" #include "gryphn_present.h" gnReturnCode gnPresent(gnOutputDeviceHandle device, gnPresentInfo info) { diff --git a/src/core/present/gryphn_present.h b/src/core/src/present/gryphn_present.h similarity index 92% rename from src/core/present/gryphn_present.h rename to src/core/src/present/gryphn_present.h index 832d174..1b88326 100644 --- a/src/core/present/gryphn_present.h +++ b/src/core/src/present/gryphn_present.h @@ -1,7 +1,7 @@ #pragma once #include "utils/gryphn_error_code.h" #include "stdint.h" -#include "core/gryphn_handles.h" +#include "gryphn_handles.h" typedef struct gnPresentInfo_t { uint32_t waitCount; diff --git a/src/core/presentation_queue/gryphn_presentation_queue.c b/src/core/src/presentation_queue/gryphn_presentation_queue.c similarity index 96% rename from src/core/presentation_queue/gryphn_presentation_queue.c rename to src/core/src/presentation_queue/gryphn_presentation_queue.c index 9978ba7..67827b1 100644 --- a/src/core/presentation_queue/gryphn_presentation_queue.c +++ b/src/core/src/presentation_queue/gryphn_presentation_queue.c @@ -1,5 +1,5 @@ #include "gryphn_presentation_queue.h" -#include "core/gryphn_platform_functions.h" +#include "gryphn_platform_functions.h" gnReturnCode gnCreatePresentationQueue(gnPresentationQueueHandle* presentationQueue, gnOutputDeviceHandle device, gnPresentationQueueInfo presentationInfo){ *presentationQueue = malloc(sizeof(struct gnPresentationQueue_t)); diff --git a/src/core/presentation_queue/gryphn_presentation_queue.h b/src/core/src/presentation_queue/gryphn_presentation_queue.h similarity index 87% rename from src/core/presentation_queue/gryphn_presentation_queue.h rename to src/core/src/presentation_queue/gryphn_presentation_queue.h index 4769b12..dbf474d 100644 --- a/src/core/presentation_queue/gryphn_presentation_queue.h +++ b/src/core/src/presentation_queue/gryphn_presentation_queue.h @@ -1,10 +1,10 @@ #pragma once #include -#include -#include #include -#include -#include "core/gryphn_handles.h" +#include +#include +#include +#include "gryphn_handles.h" typedef struct gnPresentationQueueInfo_t { uint32_t minImageCount; diff --git a/src/core/renderpass/gryphn_render_pass.h b/src/core/src/renderpass/gryphn_render_pass.h similarity index 90% rename from src/core/renderpass/gryphn_render_pass.h rename to src/core/src/renderpass/gryphn_render_pass.h index d54a286..ab1d044 100644 --- a/src/core/renderpass/gryphn_render_pass.h +++ b/src/core/src/renderpass/gryphn_render_pass.h @@ -1,7 +1,7 @@ #pragma once #include "utils/gryphn_color.h" #include "utils/math/gryphn_vec2.h" -#include "core/gryphn_handles.h" +#include "gryphn_handles.h" typedef struct gnRenderPassInfo_t { gnRenderPassDescriptorHandle renderPassDescriptor; diff --git a/src/core/renderpass/gryphn_render_pass_descriptor.c b/src/core/src/renderpass/gryphn_render_pass_descriptor.c similarity index 93% rename from src/core/renderpass/gryphn_render_pass_descriptor.c rename to src/core/src/renderpass/gryphn_render_pass_descriptor.c index bea203a..a8273ea 100644 --- a/src/core/renderpass/gryphn_render_pass_descriptor.c +++ b/src/core/src/renderpass/gryphn_render_pass_descriptor.c @@ -1,5 +1,5 @@ #include "gryphn_render_pass_descriptor.h" -#include "core/gryphn_platform_functions.h" +#include "gryphn_platform_functions.h" gnReturnCode gnCreateRenderPassDescriptor(gnRenderPassDescriptorHandle* renderPass, gnOutputDeviceHandle device, gnRenderPassDescriptorInfo info) { *renderPass = malloc(sizeof(struct gnRenderPassDescriptor_t)); diff --git a/src/core/renderpass/gryphn_render_pass_descriptor.h b/src/core/src/renderpass/gryphn_render_pass_descriptor.h similarity index 98% rename from src/core/renderpass/gryphn_render_pass_descriptor.h rename to src/core/src/renderpass/gryphn_render_pass_descriptor.h index 72bbabb..17604c7 100644 --- a/src/core/renderpass/gryphn_render_pass_descriptor.h +++ b/src/core/src/renderpass/gryphn_render_pass_descriptor.h @@ -2,7 +2,7 @@ #include "stdint.h" #include "utils/gryphn_image_format.h" #include "utils/gryphn_error_code.h" -#include "core/gryphn_handles.h" +#include "gryphn_handles.h" typedef enum gnRenderPassStage { GN_COLOR_ATTACHMENT_OUTPUT = 1, diff --git a/src/core/shader_input/gryphn_shader_layout.h b/src/core/src/shader_input/gryphn_shader_layout.h similarity index 100% rename from src/core/shader_input/gryphn_shader_layout.h rename to src/core/src/shader_input/gryphn_shader_layout.h diff --git a/src/core/shader_module/gryphn_shader_module.c b/src/core/src/shader_module/gryphn_shader_module.c similarity index 92% rename from src/core/shader_module/gryphn_shader_module.c rename to src/core/src/shader_module/gryphn_shader_module.c index 3eae456..dd1dea3 100644 --- a/src/core/shader_module/gryphn_shader_module.c +++ b/src/core/src/shader_module/gryphn_shader_module.c @@ -1,4 +1,4 @@ -#include +#include #include "gryphn_shader_module.h" gnReturnCode gnCreateShaderModule(gnShaderModuleHandle* module, gnOutputDeviceHandle device, struct gnShaderModuleInfo_t shaderModuleInfo) { diff --git a/src/core/shader_module/gryphn_shader_module.h b/src/core/src/shader_module/gryphn_shader_module.h similarity index 96% rename from src/core/shader_module/gryphn_shader_module.h rename to src/core/src/shader_module/gryphn_shader_module.h index 3e73619..4734ce2 100644 --- a/src/core/shader_module/gryphn_shader_module.h +++ b/src/core/src/shader_module/gryphn_shader_module.h @@ -2,7 +2,7 @@ #include "stdint.h" #include "utils/gryphn_string.h" #include "utils/gryphn_error_code.h" -#include "core/gryphn_handles.h" +#include "gryphn_handles.h" typedef enum gnShaderModuleStage_e { GN_VERTEX_SHADER_MODULE = 0x00000001, diff --git a/src/core/submit/gryphn_submit.c b/src/core/src/submit/gryphn_submit.c similarity index 78% rename from src/core/submit/gryphn_submit.c rename to src/core/src/submit/gryphn_submit.c index 2968d8f..7e45b17 100644 --- a/src/core/submit/gryphn_submit.c +++ b/src/core/src/submit/gryphn_submit.c @@ -1,5 +1,5 @@ #include "gryphn_submit.h" -#include "core/gryphn_platform_functions.h" +#include "gryphn_platform_functions.h" gnReturnCode gnSubmit(gnOutputDevice device, gnSubmitInfo info) { return device->deviceFunctions->_gnSubmit(device, info); diff --git a/src/core/submit/gryphn_submit.h b/src/core/src/submit/gryphn_submit.h similarity index 82% rename from src/core/submit/gryphn_submit.h rename to src/core/src/submit/gryphn_submit.h index c589ac2..cd0b47f 100644 --- a/src/core/submit/gryphn_submit.h +++ b/src/core/src/submit/gryphn_submit.h @@ -1,7 +1,7 @@ #pragma once #include "stdint.h" -#include "core/renderpass/gryphn_render_pass_descriptor.h" -#include "core/gryphn_handles.h" +#include "renderpass/gryphn_render_pass_descriptor.h" +#include "gryphn_handles.h" typedef struct gnSubmitInfo_t { uint32_t waitCount; diff --git a/src/core/sync/fence/gryphn_fence.c b/src/core/src/sync/fence/gryphn_fence.c similarity index 93% rename from src/core/sync/fence/gryphn_fence.c rename to src/core/src/sync/fence/gryphn_fence.c index 3f57b24..74143d6 100644 --- a/src/core/sync/fence/gryphn_fence.c +++ b/src/core/src/sync/fence/gryphn_fence.c @@ -1,6 +1,5 @@ #include "gryphn_fence.h" -#include "core/gryphn_platform_functions.h" -#include "stdio.h" +#include "gryphn_platform_functions.h" gnReturnCode gnCreateFence(gnFenceHandle* fence, struct gnOutputDevice_t* device) { *fence = malloc(sizeof(struct gnFence_t)); diff --git a/src/core/sync/fence/gryphn_fence.h b/src/core/src/sync/fence/gryphn_fence.h similarity index 94% rename from src/core/sync/fence/gryphn_fence.h rename to src/core/src/sync/fence/gryphn_fence.h index cf573d6..e3cb518 100644 --- a/src/core/sync/fence/gryphn_fence.h +++ b/src/core/src/sync/fence/gryphn_fence.h @@ -3,7 +3,7 @@ #include #include "utils/gryphn_error_code.h" #include "utils/lists/gryphn_array_list.h" -#include "core/gryphn_handles.h" +#include "gryphn_handles.h" #ifdef GN_REVEAL_IMPL struct gnFence_t { diff --git a/src/core/sync/semaphore/gryphn_semaphore.c b/src/core/src/sync/semaphore/gryphn_semaphore.c similarity index 90% rename from src/core/sync/semaphore/gryphn_semaphore.c rename to src/core/src/sync/semaphore/gryphn_semaphore.c index dbbd426..fb69559 100644 --- a/src/core/sync/semaphore/gryphn_semaphore.c +++ b/src/core/src/sync/semaphore/gryphn_semaphore.c @@ -1,5 +1,5 @@ #include "gryphn_semaphore.h" -#include "core/gryphn_platform_functions.h" +#include "gryphn_platform_functions.h" gnReturnCode gnCreateSemaphore(gnSemaphore* semaphore, struct gnOutputDevice_t* device) { *semaphore = malloc(sizeof(struct gnSemaphore_t)); diff --git a/src/core/sync/semaphore/gryphn_semaphore.h b/src/core/src/sync/semaphore/gryphn_semaphore.h similarity index 92% rename from src/core/sync/semaphore/gryphn_semaphore.h rename to src/core/src/sync/semaphore/gryphn_semaphore.h index 58f8ca3..881eb12 100644 --- a/src/core/sync/semaphore/gryphn_semaphore.h +++ b/src/core/src/sync/semaphore/gryphn_semaphore.h @@ -1,7 +1,7 @@ #pragma once -#include "core/gryphn_handles.h" #include "utils/gryphn_error_code.h" #include "utils/lists/gryphn_array_list.h" +#include "gryphn_handles.h" #ifdef GN_REVEAL_IMPL struct gnSemaphore_t { diff --git a/src/core/textures/gryphn_texture.c b/src/core/src/textures/gryphn_texture.c similarity index 92% rename from src/core/textures/gryphn_texture.c rename to src/core/src/textures/gryphn_texture.c index 6ce8b33..d74a888 100644 --- a/src/core/textures/gryphn_texture.c +++ b/src/core/src/textures/gryphn_texture.c @@ -1,5 +1,5 @@ #include "gryphn_texture.h" -#include "core/gryphn_platform_functions.h" +#include "gryphn_platform_functions.h" gnReturnCode gnCreateTexture(gnTexture* texture, gnDevice device, const gnTextureInfo info) { *texture = malloc(sizeof(struct gnTexture_t)); diff --git a/src/core/textures/gryphn_texture.h b/src/core/src/textures/gryphn_texture.h similarity index 96% rename from src/core/textures/gryphn_texture.h rename to src/core/src/textures/gryphn_texture.h index c2ccd4e..1b38f06 100644 --- a/src/core/textures/gryphn_texture.h +++ b/src/core/src/textures/gryphn_texture.h @@ -2,7 +2,7 @@ #include "stdint.h" #include "utils/gryphn_image_format.h" #include "utils/gryphn_error_code.h" -#include +#include typedef enum gnTextureType { GN_TEXTURE_2D diff --git a/src/core/uniforms/gryphn_uniform.c b/src/core/src/uniforms/gryphn_uniform.c similarity index 80% rename from src/core/uniforms/gryphn_uniform.c rename to src/core/src/uniforms/gryphn_uniform.c index c859a7e..a38c19a 100644 --- a/src/core/uniforms/gryphn_uniform.c +++ b/src/core/src/uniforms/gryphn_uniform.c @@ -1,7 +1,7 @@ #include "gryphn_uniform.h" #include "gryphn_uniform_pool.h" -#include "core/output_device/gryphn_output_device.h" -#include "core/gryphn_platform_functions.h" +#include "output_device/gryphn_output_device.h" +#include "gryphn_platform_functions.h" void gnUpdateBufferUniform(gnUniform uniform, gnBufferUniformInfo bufferInfo) { uniform->pool->device->deviceFunctions->_gnUpdateBufferUniform(uniform, &bufferInfo); diff --git a/src/core/uniforms/gryphn_uniform.h b/src/core/src/uniforms/gryphn_uniform.h similarity index 95% rename from src/core/uniforms/gryphn_uniform.h rename to src/core/src/uniforms/gryphn_uniform.h index fd4e904..0a132b8 100644 --- a/src/core/uniforms/gryphn_uniform.h +++ b/src/core/src/uniforms/gryphn_uniform.h @@ -2,7 +2,7 @@ #include "stdint.h" #include "stdlib.h" #include "utils/lists/gryphn_array_list.h" -#include "core/gryphn_handles.h" +#include "gryphn_handles.h" typedef struct gnBufferUniformInfo { uint32_t binding; diff --git a/src/core/uniforms/gryphn_uniform_layout.h b/src/core/src/uniforms/gryphn_uniform_layout.h similarity index 93% rename from src/core/uniforms/gryphn_uniform_layout.h rename to src/core/src/uniforms/gryphn_uniform_layout.h index a3b1aa7..d56ff56 100644 --- a/src/core/uniforms/gryphn_uniform_layout.h +++ b/src/core/src/uniforms/gryphn_uniform_layout.h @@ -1,6 +1,6 @@ #pragma once #include "stdint.h" -#include "core/shader_module/gryphn_shader_module.h" +#include "shader_module/gryphn_shader_module.h" typedef enum gnUniformType { GN_UNIFORM_BUFFER_DESCRIPTOR, diff --git a/src/core/uniforms/gryphn_uniform_pool.c b/src/core/src/uniforms/gryphn_uniform_pool.c similarity index 90% rename from src/core/uniforms/gryphn_uniform_pool.c rename to src/core/src/uniforms/gryphn_uniform_pool.c index d9f72ab..b690fa9 100644 --- a/src/core/uniforms/gryphn_uniform_pool.c +++ b/src/core/src/uniforms/gryphn_uniform_pool.c @@ -1,6 +1,6 @@ #include "gryphn_uniform_pool.h" -#include "core/output_device/gryphn_output_device.h" -#include "core/gryphn_platform_functions.h" +#include "output_device/gryphn_output_device.h" +#include "gryphn_platform_functions.h" #include "gryphn_uniform.h" #include "stdlib.h" diff --git a/src/core/uniforms/gryphn_uniform_pool.h b/src/core/src/uniforms/gryphn_uniform_pool.h similarity index 81% rename from src/core/uniforms/gryphn_uniform_pool.h rename to src/core/src/uniforms/gryphn_uniform_pool.h index e10d681..80828bc 100644 --- a/src/core/uniforms/gryphn_uniform_pool.h +++ b/src/core/src/uniforms/gryphn_uniform_pool.h @@ -1,8 +1,8 @@ #pragma once -#include "core/gryphn_handles.h" #include "utils/gryphn_error_code.h" -#include "core/uniforms/gryphn_uniform_layout.h" -#include "core/uniforms/gryphn_uniform.h" +#include "uniforms/gryphn_uniform_layout.h" +#include "uniforms/gryphn_uniform.h" +#include "gryphn_handles.h" #ifdef GN_REVEAL_IMPL struct gnUniformPool_t { diff --git a/src/core/window_surface/gryphn_surface.c b/src/core/src/window_surface/gryphn_surface.c similarity index 98% rename from src/core/window_surface/gryphn_surface.c rename to src/core/src/window_surface/gryphn_surface.c index bd4622f..4d02df9 100644 --- a/src/core/window_surface/gryphn_surface.c +++ b/src/core/src/window_surface/gryphn_surface.c @@ -1,5 +1,5 @@ #include "gryphn_surface.h" -#include "core/gryphn_platform_functions.h" +#include "gryphn_platform_functions.h" void gnDestroyWindowSurface(gnWindowSurfaceHandle windowSurface) { windowSurface->instance->functions->_gnDestroyWindowSurface(windowSurface); diff --git a/src/core/window_surface/gryphn_surface.h b/src/core/src/window_surface/gryphn_surface.h similarity index 94% rename from src/core/window_surface/gryphn_surface.h rename to src/core/src/window_surface/gryphn_surface.h index ba78228..96c0d1a 100644 --- a/src/core/window_surface/gryphn_surface.h +++ b/src/core/src/window_surface/gryphn_surface.h @@ -1,8 +1,8 @@ #pragma once -#include #include #include -#include "core/output_device/gryphn_physical_output_device.h" +#include +#include "output_device/gryphn_physical_output_device.h" typedef struct gnSurfaceFormat_t { gnImageFormat format; diff --git a/src/core/window_surface/gryphn_surface_create_functions.c b/src/core/src/window_surface/gryphn_surface_create_functions.c similarity index 95% rename from src/core/window_surface/gryphn_surface_create_functions.c rename to src/core/src/window_surface/gryphn_surface_create_functions.c index ee67caf..08e0650 100644 --- a/src/core/window_surface/gryphn_surface_create_functions.c +++ b/src/core/src/window_surface/gryphn_surface_create_functions.c @@ -1,6 +1,6 @@ #include "gryphn_surface_create_functions.h" -#include "core/instance/gryphn_instance.h" -#include "core/gryphn_platform_functions.h" +#include "instance/gryphn_instance.h" +#include "gryphn_platform_functions.h" #ifdef GN_PLATFORM_LINUX #ifdef GN_WINDOW_X11 diff --git a/src/core/window_surface/gryphn_surface_create_functions.h b/src/core/src/window_surface/gryphn_surface_create_functions.h similarity index 97% rename from src/core/window_surface/gryphn_surface_create_functions.h rename to src/core/src/window_surface/gryphn_surface_create_functions.h index fdbae65..5a5d070 100644 --- a/src/core/window_surface/gryphn_surface_create_functions.h +++ b/src/core/src/window_surface/gryphn_surface_create_functions.h @@ -3,7 +3,7 @@ #define GN_WINDOW_X11 #endif #include -#include +#include #include diff --git a/src/platform/gryphn_platform_include.h b/src/platform/gryphn_platform_include.h index 8caaab3..4a97b62 100644 --- a/src/platform/gryphn_platform_include.h +++ b/src/platform/gryphn_platform_include.h @@ -1,5 +1,5 @@ #pragma once -#include "core/gryphn_rendering_api.h" +#include "gryphn_rendering_api.h" #ifdef GN_PLATFORM_LINUX #include