├── .codacy.yaml ├── .devcontainer └── devcontainer.json ├── .gitignore ├── .pylintrc ├── .vscode ├── c_cpp_properties.json ├── launch.json └── settings.json ├── CMakeLists.txt ├── CMakePresets.json ├── Dockerfile ├── License.txt ├── Readme.md ├── cmake ├── CPM.cmake ├── Clang.cmake ├── GNU.cmake ├── JoltPhysicsCompatibility.cmake ├── common_options.cmake ├── functions.cmake ├── msvc.cmake ├── toolchain │ ├── linux-clang-10.cmake │ ├── linux-clang-12.cmake │ ├── linux-clang-13.cmake │ ├── linux-clang-14.cmake │ ├── linux-clang.cmake │ ├── linux-gnu-gcc-10.cmake │ ├── linux-gnu-gcc-11.cmake │ ├── linux-gnu-gcc-8.cmake │ ├── linux-gnu-gcc-9.cmake │ ├── linux-gnu-gcc.cmake │ └── x86_64-windows-msvc-17.cmake └── vscode.cmake ├── doc ├── bindings.drawio ├── editor_classes.drawio ├── editor_rendering.md ├── imgui.md ├── msys2_clang.md └── notes.md ├── pylintrc ├── scripts ├── cmake_clean.sh ├── configure_ninja.bat ├── configure_ninja_linux.sh ├── configure_ninja_windows.sh ├── configure_nodeps_msbuild.bat ├── configure_vs2022.bat ├── configure_vs2022_asan.bat ├── configure_vs2022_glfw.bat ├── configure_vs2022_no_openxr.bat ├── configure_vs2022_no_pch.bat ├── configure_vs2022_no_tracy.bat ├── debug_tool.bat ├── dependencies_tags.sh ├── disable_page_heap_verification.bat ├── enable_page_heap_verification.bat ├── mirror.bat └── update_imgui.sh └── src ├── CMakeLists.txt ├── RectangleBinPack ├── CMakeLists.txt ├── GuillotineBinPack.cpp ├── GuillotineBinPack.h ├── MaxRectsBinPack.cpp ├── MaxRectsBinPack.h ├── Rect.cpp ├── Rect.h ├── ShelfBinPack.cpp ├── ShelfBinPack.h ├── ShelfNextFitBinPack.cpp ├── ShelfNextFitBinPack.h ├── SkylineBinPack.cpp ├── SkylineBinPack.h └── boost_binpacker.cpp ├── Superluminal ├── CMakeLists.txt ├── PerformanceAPI.cpp ├── PerformanceAPI.h ├── PerformanceAPI_capi.h └── PerformanceAPI_loader.h ├── editor ├── .gitignore ├── CMakeLists.txt ├── GenerateIconFontCppHeaders.py ├── LICENSE ├── cache │ └── bvh │ │ └── keep ├── editor.cpp ├── editor.hpp ├── editor_context.cpp ├── editor_context.hpp ├── editor_log.cpp ├── editor_log.hpp ├── editor_message.hpp ├── editor_message_bus.cpp ├── editor_message_bus.hpp ├── editor_rendering.cpp ├── editor_rendering.hpp ├── editor_scenes.cpp ├── editor_scenes.hpp ├── editor_settings.cpp ├── editor_settings.hpp ├── editor_view_client.cpp ├── editor_view_client.hpp ├── editor_windows.cpp ├── editor_windows.hpp ├── erhe.ini ├── graph │ ├── add.cpp │ ├── add.hpp │ ├── constant.cpp │ ├── constant.hpp │ ├── divide.cpp │ ├── divide.hpp │ ├── graph_window.cpp │ ├── graph_window.hpp │ ├── load.cpp │ ├── load.hpp │ ├── multiply.cpp │ ├── multiply.hpp │ ├── node_properties.cpp │ ├── node_properties.hpp │ ├── passthrough.cpp │ ├── passthrough.hpp │ ├── payload.cpp │ ├── payload.hpp │ ├── shader_graph.cpp │ ├── shader_graph.hpp │ ├── shader_graph_node.cpp │ ├── shader_graph_node.hpp │ ├── store.cpp │ ├── store.hpp │ ├── subtract.cpp │ └── subtract.hpp ├── graphics │ ├── gradients.cpp │ ├── gradients.hpp │ ├── icon_rasterization.cpp │ ├── icon_rasterization.hpp │ ├── icon_set.cpp │ ├── icon_set.hpp │ ├── shader_texture.cpp │ ├── shader_texture.hpp │ ├── textures.cpp │ ├── textures.hpp │ ├── thumbnails.cpp │ └── thumbnails.hpp ├── graphics_presets.ini ├── imgui_Hud Viewport.ini ├── imgui_window_imgui_host.ini ├── imgui_window_imgui_viewport.ini ├── input_state.cpp ├── input_state.hpp ├── logging.ini ├── main.cpp ├── net_test.cpp ├── openxr_windows.ini ├── operations │ ├── compound_operation.cpp │ ├── compound_operation.hpp │ ├── geometry_operations.cpp │ ├── geometry_operations.hpp │ ├── ioperation.hpp │ ├── item_insert_remove_operation.cpp │ ├── item_insert_remove_operation.hpp │ ├── item_parent_change_operation.cpp │ ├── item_parent_change_operation.hpp │ ├── item_reposition_in_parent_operation.cpp │ ├── item_reposition_in_parent_operation.hpp │ ├── merge_operation.cpp │ ├── merge_operation.hpp │ ├── mesh_operation.cpp │ ├── mesh_operation.hpp │ ├── node_attach_operation.cpp │ ├── node_attach_operation.hpp │ ├── node_transform_operation.cpp │ ├── node_transform_operation.hpp │ ├── operation_stack.cpp │ └── operation_stack.hpp ├── parsers │ ├── geogram.cpp │ ├── geogram.hpp │ ├── gltf.cpp │ ├── gltf.hpp │ ├── json_polyhedron.cpp │ ├── json_polyhedron.hpp │ ├── wavefront_obj.cpp │ └── wavefront_obj.hpp ├── renderable.hpp ├── renderers │ ├── composer.cpp │ ├── composer.hpp │ ├── deferred_renderer.cpp │ ├── deferred_renderer.hpp │ ├── frustum_tiler.cpp │ ├── frustum_tiler.hpp │ ├── id_renderer.cpp │ ├── id_renderer.hpp │ ├── light_debug_renderer.cpp │ ├── light_debug_renderer.hpp │ ├── light_mesh.cpp │ ├── light_mesh.hpp │ ├── mesh_memory.cpp │ ├── mesh_memory.hpp │ ├── programs.cpp │ ├── programs.hpp │ ├── render_context.cpp │ ├── render_context.hpp │ ├── render_style.cpp │ ├── render_style.hpp │ ├── renderpass.cpp │ ├── renderpass.hpp │ ├── viewport_config.cpp │ └── viewport_config.hpp ├── rendergraph │ ├── basic_scene_view_node.cpp │ ├── basic_scene_view_node.hpp │ ├── basic_scene_view_nodes.cpp │ ├── basic_scene_view_nodes.hpp │ ├── post_processing.cpp │ ├── post_processing.hpp │ ├── shadow_render_node.cpp │ └── shadow_render_node.hpp ├── rendertarget_imgui_host.cpp ├── rendertarget_imgui_host.hpp ├── rendertarget_mesh.cpp ├── rendertarget_mesh.hpp ├── res │ ├── .gitignore │ ├── assets │ │ ├── RiggedFigure │ │ │ ├── LICENSE.md │ │ │ └── RiggedFigure.glb │ │ └── SM_Deccer_Cubes_Textured.glb │ ├── fonts │ │ ├── OFL.txt │ │ ├── SourceCodePro-Semibold.otf │ │ └── SourceSansPro-Regular.otf │ ├── icons │ │ ├── anim.svg │ │ ├── armature_data.svg │ │ ├── bone_data.svg │ │ ├── brush_big.svg │ │ ├── brush_small.svg │ │ ├── brush_tool.svg │ │ ├── camera.svg │ │ ├── curve_path.svg │ │ ├── directional_light.svg │ │ ├── drag.svg │ │ ├── file.svg │ │ ├── filebrowser.svg │ │ ├── grid.svg │ │ ├── headset.svg │ │ ├── hud.svg │ │ ├── material.svg │ │ ├── mesh.svg │ │ ├── mesh_cone.svg │ │ ├── mesh_cube.svg │ │ ├── mesh_cylinder.svg │ │ ├── mesh_icosphere.svg │ │ ├── mesh_torus.svg │ │ ├── mesh_uvsphere.svg │ │ ├── mouse_lmb.svg │ │ ├── mouse_lmb_drag.svg │ │ ├── mouse_mmb.svg │ │ ├── mouse_mmb_drag.svg │ │ ├── mouse_move.svg │ │ ├── mouse_rmb.svg │ │ ├── mouse_rmb_drag.svg │ │ ├── move.svg │ │ ├── node.svg │ │ ├── physics.svg │ │ ├── point_light.svg │ │ ├── pull.svg │ │ ├── push.svg │ │ ├── rotate.svg │ │ ├── scale.svg │ │ ├── scene.svg │ │ ├── select.svg │ │ ├── space_mouse.svg │ │ ├── space_mouse_lmb.svg │ │ ├── space_mouse_rmb.svg │ │ ├── spot_light.svg │ │ ├── texture.svg │ │ ├── three_dots.svg │ │ ├── vive.svg │ │ ├── vive_menu.svg │ │ ├── vive_trackpad.svg │ │ └── vive_trigger.svg │ ├── images │ │ ├── background.png │ │ ├── gl16.png │ │ ├── gl16w.png │ │ ├── gl32.png │ │ ├── gl32w.png │ │ ├── gl48.png │ │ └── gl48w.png │ ├── models │ │ ├── SM_Deccer_Cubes.bin │ │ ├── SM_Deccer_Cubes.gltf │ │ ├── cobra_mk3.obj │ │ ├── spoon.mtl │ │ ├── spoon.obj │ │ ├── teacup.mtl │ │ ├── teacup.obj │ │ ├── teapot.mtl │ │ ├── teapot.obj │ │ └── teapot.obj.txt │ ├── polyhedra │ │ ├── 0 │ │ ├── 1 │ │ ├── 2 │ │ ├── 3 │ │ ├── 4 │ │ ├── 5 │ │ ├── 6 │ │ ├── 7 │ │ ├── 8 │ │ ├── 9 │ │ ├── 10 │ │ ├── 11 │ │ ├── 12 │ │ ├── 13 │ │ ├── 14 │ │ ├── 15 │ │ ├── 16 │ │ ├── 17 │ │ ├── 18 │ │ ├── 19 │ │ ├── 20 │ │ ├── 21 │ │ ├── 22 │ │ ├── 23 │ │ ├── 24 │ │ ├── 25 │ │ ├── 26 │ │ ├── 27 │ │ ├── 28 │ │ ├── 29 │ │ ├── 30 │ │ ├── 31 │ │ ├── 32 │ │ ├── 33 │ │ ├── 34 │ │ ├── 35 │ │ ├── 36 │ │ ├── 37 │ │ ├── 38 │ │ ├── 39 │ │ ├── 40 │ │ ├── 41 │ │ ├── 42 │ │ ├── 43 │ │ ├── 44 │ │ ├── 45 │ │ ├── 46 │ │ ├── 47 │ │ ├── 48 │ │ ├── 49 │ │ ├── 50 │ │ ├── 56 │ │ ├── 57 │ │ ├── 70 │ │ ├── 71 │ │ ├── 72 │ │ ├── 73 │ │ ├── 74 │ │ ├── 75 │ │ ├── 76 │ │ ├── 77 │ │ ├── 78 │ │ ├── 106 │ │ ├── 107 │ │ ├── 116 │ │ ├── 117 │ │ ├── 118 │ │ ├── 119 │ │ ├── 120 │ │ ├── 121 │ │ ├── 122 │ │ ├── 123 │ │ ├── 124 │ │ ├── 125 │ │ ├── 126 │ │ ├── 127 │ │ ├── 128 │ │ ├── 129 │ │ ├── 130 │ │ ├── 132 │ │ ├── 133 │ │ ├── 134 │ │ ├── 135 │ │ ├── 136 │ │ ├── 137 │ │ ├── 138 │ │ ├── 139 │ │ ├── 140 │ │ ├── 141 │ │ ├── 0.json │ │ ├── 1.json │ │ ├── 106.json │ │ ├── 107.json │ │ ├── 116.json │ │ ├── 117.json │ │ ├── 118.json │ │ ├── 119.json │ │ ├── 120.json │ │ ├── 121.json │ │ ├── 122.json │ │ ├── 123.json │ │ ├── 124.json │ │ ├── 125.json │ │ ├── 126.json │ │ ├── 127.json │ │ ├── 128.json │ │ ├── 129.json │ │ ├── 130.json │ │ ├── 132.json │ │ ├── 133.json │ │ ├── 134.json │ │ ├── 135.json │ │ ├── 136.json │ │ ├── 137.json │ │ ├── 138.json │ │ ├── 139.json │ │ ├── 140.json │ │ ├── 141.json │ │ ├── 2.json │ │ ├── 22.json │ │ ├── 23.json │ │ ├── 24.json │ │ ├── 25.json │ │ ├── 26.json │ │ ├── 27.json │ │ ├── 28.json │ │ ├── 29.json │ │ ├── 3.json │ │ ├── 30.json │ │ ├── 31.json │ │ ├── 33.json │ │ ├── 34.json │ │ ├── 35.json │ │ ├── 36.json │ │ ├── 37.json │ │ ├── 38.json │ │ ├── 39.json │ │ ├── 4.json │ │ ├── 40.json │ │ ├── 41.json │ │ ├── 42.json │ │ ├── 43.json │ │ ├── 44.json │ │ ├── 45.json │ │ ├── 46.json │ │ ├── 47.json │ │ ├── 48.json │ │ ├── 49.json │ │ ├── 5.json │ │ ├── 50.json │ │ ├── 56.json │ │ ├── 57.json │ │ ├── 6.json │ │ ├── 7.json │ │ ├── 70.json │ │ ├── 71.json │ │ ├── 72.json │ │ ├── 73.json │ │ ├── 74.json │ │ ├── 75.json │ │ ├── 76.json │ │ ├── 77.json │ │ ├── 78.json │ │ ├── 8.json │ │ ├── antiprisms.json │ │ ├── archimedean.json │ │ ├── cuboctahedron.wrl │ │ ├── great_rhombicuboctahedron.wrl │ │ ├── icosidodecahedron.wrl │ │ ├── johnson.json │ │ ├── platonic.json │ │ ├── prisms.json │ │ ├── rhombicosidodecahedron.wrl │ │ ├── rhombicuboctahedron.wrl │ │ ├── snub_cuboctahedron.wrl │ │ ├── snub_icosidodecahedron.wrl │ │ ├── truncated_cube.wrl │ │ ├── truncated_cuboctahedron.wrl │ │ ├── truncated_dodecahedron.wrl │ │ ├── truncated_icosahedron.wrl │ │ ├── truncated_icosidodecahedron.wrl │ │ ├── truncated_octahedron.wrl │ │ └── truncated_tetrahedron.wrl │ └── shaders │ │ ├── anisotropic_engine_ready.frag │ │ ├── anisotropic_engine_ready.vert │ │ ├── anisotropic_slope.frag │ │ ├── anisotropic_slope.vert │ │ ├── brdf_slice.frag │ │ ├── brdf_slice.vert │ │ ├── brush.frag │ │ ├── brush.vert │ │ ├── circular_brushed_metal.frag │ │ ├── circular_brushed_metal.vert │ │ ├── compose.frag │ │ ├── compute_before_line.comp │ │ ├── depth_only.frag │ │ ├── depth_only.vert │ │ ├── downsample.frag │ │ ├── downsample_lowpass.frag │ │ ├── downsample_x.frag │ │ ├── downsample_y.frag │ │ ├── edge_lines.frag │ │ ├── edge_lines.vert │ │ ├── erhe_bxdf.glsl │ │ ├── erhe_ggx.glsl │ │ ├── erhe_light.glsl │ │ ├── erhe_math.glsl │ │ ├── erhe_srgb.glsl │ │ ├── erhe_texture.glsl │ │ ├── erhe_tonemap.glsl │ │ ├── error.frag │ │ ├── error.vert │ │ ├── fat_triangle.frag │ │ ├── fat_triangle.geom │ │ ├── fat_triangle.vert │ │ ├── grid.frag │ │ ├── grid.vert │ │ ├── id.frag │ │ ├── id.vert │ │ ├── line_after_compute.frag │ │ ├── line_after_compute.vert │ │ ├── points.frag │ │ ├── points.vert │ │ ├── post_processing.vert │ │ ├── sky.frag │ │ ├── sky.vert │ │ ├── standard.frag │ │ ├── standard.vert │ │ ├── standard_debug.frag │ │ ├── standard_debug.vert │ │ ├── text.frag │ │ ├── text.vert │ │ ├── textured.frag │ │ ├── textured.vert │ │ ├── tile.frag │ │ ├── tile.vert │ │ ├── tool.frag │ │ ├── tool.vert │ │ ├── upsample.frag │ │ ├── visualize_depth.frag │ │ ├── visualize_depth.vert │ │ ├── wide_lines.frag │ │ ├── wide_lines.geom │ │ └── wide_lines.vert ├── robin_hood.h ├── scene │ ├── asset_browser.cpp │ ├── asset_browser.hpp │ ├── brush_placement.cpp │ ├── brush_placement.hpp │ ├── collision_generator.hpp │ ├── content_library.cpp │ ├── content_library.hpp │ ├── debug_draw.cpp │ ├── debug_draw.hpp │ ├── frame_controller.cpp │ ├── frame_controller.hpp │ ├── material_library.cpp │ ├── material_library.hpp │ ├── material_preview.cpp │ ├── material_preview.hpp │ ├── mesh_intersect.cpp │ ├── mesh_intersect.hpp │ ├── node_physics.cpp │ ├── node_physics.hpp │ ├── node_raytrace.cpp │ ├── node_raytrace.hpp │ ├── node_raytrace_mask.hpp │ ├── scene_builder.cpp │ ├── scene_builder.hpp │ ├── scene_commands.cpp │ ├── scene_commands.hpp │ ├── scene_root.cpp │ ├── scene_root.hpp │ ├── scene_view.cpp │ ├── scene_view.hpp │ ├── viewport_scene_view.cpp │ ├── viewport_scene_view.hpp │ ├── viewport_scene_views.cpp │ └── viewport_scene_views.hpp ├── settings.ini ├── task_queue.cpp ├── task_queue.hpp ├── time.cpp ├── time.hpp ├── tools │ ├── brushes │ │ ├── brush.cpp │ │ ├── brush.hpp │ │ ├── brush_palette.cpp │ │ ├── brush_palette.hpp │ │ ├── brush_tool.cpp │ │ ├── brush_tool.hpp │ │ ├── create │ │ │ ├── create.cpp │ │ │ ├── create.hpp │ │ │ ├── create_box.cpp │ │ │ ├── create_box.hpp │ │ │ ├── create_cone.cpp │ │ │ ├── create_cone.hpp │ │ │ ├── create_preview_settings.hpp │ │ │ ├── create_shape.cpp │ │ │ ├── create_shape.hpp │ │ │ ├── create_torus.cpp │ │ │ ├── create_torus.hpp │ │ │ ├── create_uv_sphere.cpp │ │ │ └── create_uv_sphere.hpp │ │ ├── reference_frame.cpp │ │ └── reference_frame.hpp │ ├── clipboard.cpp │ ├── clipboard.hpp │ ├── debug_visualizations.cpp │ ├── debug_visualizations.hpp │ ├── fly_camera_tool.cpp │ ├── fly_camera_tool.hpp │ ├── grid.cpp │ ├── grid.hpp │ ├── grid_tool.cpp │ ├── grid_tool.hpp │ ├── hotbar.cpp │ ├── hotbar.hpp │ ├── hover_tool.cpp │ ├── hover_tool.hpp │ ├── hud.cpp │ ├── hud.hpp │ ├── material_paint_tool.cpp │ ├── material_paint_tool.hpp │ ├── paint_tool.cpp │ ├── paint_tool.hpp │ ├── physics_tool.cpp │ ├── physics_tool.hpp │ ├── selection_tool.cpp │ ├── selection_tool.hpp │ ├── tool.cpp │ ├── tool.hpp │ ├── tools.cpp │ ├── tools.hpp │ ├── transform │ │ ├── handle_enums.cpp │ │ ├── handle_enums.hpp │ │ ├── handle_visualizations.cpp │ │ ├── handle_visualizations.hpp │ │ ├── move_tool.cpp │ │ ├── move_tool.hpp │ │ ├── rotate_tool.cpp │ │ ├── rotate_tool.hpp │ │ ├── rotation_inspector.cpp │ │ ├── rotation_inspector.hpp │ │ ├── scale_tool.cpp │ │ ├── scale_tool.hpp │ │ ├── subtool.cpp │ │ ├── subtool.hpp │ │ ├── transform_tool.cpp │ │ ├── transform_tool.hpp │ │ ├── transform_tool_settings.cpp │ │ └── transform_tool_settings.hpp │ └── trs_tool.cpp ├── windows.ini ├── windows │ ├── animation_curve.cpp │ ├── animation_curve.hpp │ ├── animation_window.cpp │ ├── animation_window.hpp │ ├── brdf_slice.cpp │ ├── brdf_slice.hpp │ ├── clipboard_window.cpp │ ├── clipboard_window.hpp │ ├── commands_window.cpp │ ├── commands_window.hpp │ ├── composer_window.cpp │ ├── composer_window.hpp │ ├── content_library_window.cpp │ ├── content_library_window.hpp │ ├── debug_view_window.cpp │ ├── debug_view_window.hpp │ ├── gradient_editor.cpp │ ├── gradient_editor.hpp │ ├── icon_browser.cpp │ ├── icon_browser.hpp │ ├── imgui_window_scene_view_node.cpp │ ├── imgui_window_scene_view_node.hpp │ ├── item_tree_window.cpp │ ├── item_tree_window.hpp │ ├── layers_window.cpp │ ├── layers_window.hpp │ ├── network_window.cpp │ ├── network_window.hpp │ ├── operations.cpp │ ├── operations.hpp │ ├── physics_window.cpp │ ├── physics_window.hpp │ ├── post_processing_window.cpp │ ├── post_processing_window.hpp │ ├── properties.cpp │ ├── properties.hpp │ ├── property_editor.cpp │ ├── property_editor.hpp │ ├── render_graph_window.cpp │ ├── render_graph_window.hpp │ ├── rendergraph_window.cpp │ ├── rendergraph_window.hpp │ ├── selection_window.cpp │ ├── selection_window.hpp │ ├── settings_window.cpp │ ├── settings_window.hpp │ ├── sheet_window.cpp │ ├── sheet_window.hpp │ ├── timeline_window.cpp │ ├── timeline_window.hpp │ ├── tool_properties_window.cpp │ ├── tool_properties_window.hpp │ ├── viewport_config_window.cpp │ └── viewport_config_window.hpp └── xr │ ├── controller_visualization.cpp │ ├── controller_visualization.hpp │ ├── hand_tracker.cpp │ ├── hand_tracker.hpp │ ├── headset_view.cpp │ ├── headset_view.hpp │ ├── headset_view_resources.cpp │ ├── headset_view_resources.hpp │ ├── null_headset_view.cpp │ ├── null_headset_view.hpp │ ├── theremin.cpp │ └── theremin.hpp ├── erhe ├── CMakeLists.txt ├── LICENSE ├── bit │ ├── CMakeLists.txt │ └── erhe_bit │ │ ├── bit_helpers.cpp │ │ └── bit_helpers.hpp ├── buffer │ ├── CMakeLists.txt │ └── erhe_buffer │ │ ├── ibuffer.cpp │ │ └── ibuffer.hpp ├── commands │ ├── CMakeLists.txt │ └── erhe_commands │ │ ├── command.cpp │ │ ├── command.hpp │ │ ├── command_binding.cpp │ │ ├── command_binding.hpp │ │ ├── commands.cpp │ │ ├── commands.hpp │ │ ├── commands_log.cpp │ │ ├── commands_log.hpp │ │ ├── controller_axis_binding.cpp │ │ ├── controller_axis_binding.hpp │ │ ├── controller_button_binding.cpp │ │ ├── controller_button_binding.hpp │ │ ├── input_arguments.cpp │ │ ├── input_arguments.hpp │ │ ├── key_binding.cpp │ │ ├── key_binding.hpp │ │ ├── menu_binding.cpp │ │ ├── menu_binding.hpp │ │ ├── mouse_binding.cpp │ │ ├── mouse_binding.hpp │ │ ├── mouse_button_binding.cpp │ │ ├── mouse_button_binding.hpp │ │ ├── mouse_drag_binding.cpp │ │ ├── mouse_drag_binding.hpp │ │ ├── mouse_motion_binding.cpp │ │ ├── mouse_motion_binding.hpp │ │ ├── mouse_wheel_binding.cpp │ │ ├── mouse_wheel_binding.hpp │ │ ├── state.cpp │ │ ├── state.hpp │ │ ├── update_binding.cpp │ │ ├── update_binding.hpp │ │ ├── xr_boolean_binding.cpp │ │ ├── xr_boolean_binding.hpp │ │ ├── xr_float_binding.cpp │ │ ├── xr_float_binding.hpp │ │ ├── xr_vector2f_binding.cpp │ │ └── xr_vector2f_binding.hpp ├── concurrency │ ├── CMakeLists.txt │ └── erhe_concurrency │ │ ├── concurrent_queue.cpp │ │ ├── concurrent_queue.hpp │ │ ├── serial_queue.cpp │ │ ├── serial_queue.hpp │ │ ├── thread_pool.cpp │ │ └── thread_pool.hpp ├── configuration │ ├── CMakeLists.txt │ └── erhe_configuration │ │ ├── configuration.cpp │ │ └── configuration.hpp ├── dataformat │ ├── CMakeLists.txt │ └── erhe_dataformat │ │ ├── dataformat.cpp │ │ ├── dataformat.hpp │ │ ├── dataformat_log.cpp │ │ ├── dataformat_log.hpp │ │ ├── vertex_format.cpp │ │ └── vertex_format.hpp ├── defer │ ├── CMakeLists.txt │ └── erhe_defer │ │ ├── defer.cpp │ │ └── defer.hpp ├── file │ ├── CMakeLists.txt │ └── erhe_file │ │ ├── file.cpp │ │ ├── file.hpp │ │ ├── file_log.cpp │ │ └── file_log.hpp ├── geometry │ ├── CMakeLists.txt │ ├── Readme.md │ ├── erhe_geometry │ │ ├── geometry.cpp │ │ ├── geometry.hpp │ │ ├── geometry_geogram_mesh.cpp │ │ ├── geometry_iterators.cpp │ │ ├── geometry_log.cpp │ │ ├── geometry_log.hpp │ │ ├── geometry_make.cpp │ │ ├── geometry_merge.cpp │ │ ├── geometry_tangents.cpp │ │ ├── operation │ │ │ ├── ambo.cpp │ │ │ ├── ambo.hpp │ │ │ ├── bake_transform.cpp │ │ │ ├── bake_transform.hpp │ │ │ ├── catmull_clark_subdivision.cpp │ │ │ ├── catmull_clark_subdivision.hpp │ │ │ ├── chamfer.cpp │ │ │ ├── chamfer.hpp │ │ │ ├── difference.cpp │ │ │ ├── difference.hpp │ │ │ ├── dual.cpp │ │ │ ├── dual.hpp │ │ │ ├── geometry_operation.cpp │ │ │ ├── geometry_operation.hpp │ │ │ ├── gyro.cpp │ │ │ ├── gyro.hpp │ │ │ ├── intersection.cpp │ │ │ ├── intersection.hpp │ │ │ ├── join.cpp │ │ │ ├── join.hpp │ │ │ ├── kis.cpp │ │ │ ├── kis.hpp │ │ │ ├── meta.cpp │ │ │ ├── meta.hpp │ │ │ ├── normalize.cpp │ │ │ ├── normalize.hpp │ │ │ ├── octree.hpp │ │ │ ├── repair.cpp │ │ │ ├── repair.hpp │ │ │ ├── reverse.cpp │ │ │ ├── reverse.hpp │ │ │ ├── sqrt3_subdivision.cpp │ │ │ ├── sqrt3_subdivision.hpp │ │ │ ├── subdivide.cpp │ │ │ ├── subdivide.hpp │ │ │ ├── triangulate.cpp │ │ │ ├── triangulate.hpp │ │ │ ├── truncate.cpp │ │ │ ├── truncate.hpp │ │ │ ├── union.cpp │ │ │ └── union.hpp │ │ ├── property_map_collection.hpp │ │ ├── property_map_collection.inl │ │ ├── shapes │ │ │ ├── box.cpp │ │ │ ├── box.hpp │ │ │ ├── cone.cpp │ │ │ ├── cone.hpp │ │ │ ├── convex_hull.cpp │ │ │ ├── convex_hull.hpp │ │ │ ├── disc.cpp │ │ │ ├── disc.hpp │ │ │ ├── regular_polygon.cpp │ │ │ ├── regular_polygon.hpp │ │ │ ├── regular_polyhedron.cpp │ │ │ ├── regular_polyhedron.hpp │ │ │ ├── sphere.cpp │ │ │ ├── sphere.hpp │ │ │ ├── torus.cpp │ │ │ └── torus.hpp │ │ └── types.hpp │ └── mikktspace │ │ ├── mikktspace.cpp │ │ └── mikktspace.hpp ├── geometry_renderer │ ├── CMakeLists.txt │ └── erhe_geometry_renderer │ │ ├── geometry_debug_renderer.cpp │ │ └── geometry_debug_renderer.hpp ├── gl │ ├── .gitignore │ ├── CMakeLists.txt │ ├── Readme.md │ ├── config.py │ ├── erhe_gl │ │ ├── draw_indirect.hpp │ │ ├── enum_bit_mask_operators.hpp │ │ ├── gl.cpp │ │ ├── gl.hpp │ │ ├── gl_helpers.cpp │ │ ├── gl_helpers.hpp │ │ ├── gl_log.cpp │ │ └── gl_log.hpp │ ├── generate_sources.py │ ├── gl.xml │ ├── gl_extra.xml │ ├── templates.py │ ├── templates │ │ ├── autogeneration_warning.inl │ │ ├── basic_enum_string_function_definition.inl │ │ ├── bitmask_enum_string_function_definition.inl │ │ ├── bitmask_enum_string_make_entry.inl │ │ ├── command_info.cpp │ │ ├── command_info.hpp │ │ ├── dynamic_load.cpp │ │ ├── dynamic_load.hpp │ │ ├── enum_base_zero_function_definition.inl │ │ ├── enum_base_zero_functions.cpp │ │ ├── enum_base_zero_functions.hpp │ │ ├── enum_string_functions.cpp │ │ ├── enum_string_functions.hpp │ │ ├── untyped_enum_string_function_definition.inl │ │ ├── wrapper_enum_declaration.inl │ │ ├── wrapper_enums.hpp │ │ ├── wrapper_function_definition.inl │ │ ├── wrapper_functions.cpp │ │ └── wrapper_functions.hpp │ └── util.py ├── gltf │ ├── CMakeLists.txt │ └── erhe_gltf │ │ ├── gltf.hpp │ │ ├── gltf_fastgltf.cpp │ │ ├── gltf_fastgltf.hpp │ │ ├── gltf_log.cpp │ │ ├── gltf_log.hpp │ │ ├── gltf_none.cpp │ │ ├── gltf_none.hpp │ │ ├── image_transfer.cpp │ │ └── image_transfer.hpp ├── graph │ ├── CMakeLists.txt │ └── erhe_graph │ │ ├── graph.cpp │ │ ├── graph.hpp │ │ ├── graph_log.cpp │ │ ├── graph_log.hpp │ │ ├── link.cpp │ │ ├── link.hpp │ │ ├── node.cpp │ │ ├── node.hpp │ │ ├── pin.cpp │ │ └── pin.hpp ├── graphics │ ├── CMakeLists.txt │ ├── Readme.md │ └── erhe_graphics │ │ ├── align.hpp │ │ ├── buffer.cpp │ │ ├── buffer.hpp │ │ ├── buffer_transfer_queue.cpp │ │ ├── buffer_transfer_queue.hpp │ │ ├── debug.cpp │ │ ├── debug.hpp │ │ ├── fragment_output.cpp │ │ ├── fragment_output.hpp │ │ ├── fragment_outputs.cpp │ │ ├── fragment_outputs.hpp │ │ ├── framebuffer.cpp │ │ ├── framebuffer.hpp │ │ ├── gl_context_provider.cpp │ │ ├── gl_context_provider.hpp │ │ ├── gl_objects.cpp │ │ ├── gl_objects.hpp │ │ ├── glsl_file_loader.cpp │ │ ├── glsl_file_loader.hpp │ │ ├── glsl_format_source.cpp │ │ ├── glsl_format_source.hpp │ │ ├── glsl_to_spirv.cpp │ │ ├── glsl_to_spirv.hpp │ │ ├── gpu_timer.cpp │ │ ├── gpu_timer.hpp │ │ ├── graphics_log.cpp │ │ ├── graphics_log.hpp │ │ ├── image_loader.hpp │ │ ├── image_loader_wuffs.cpp │ │ ├── image_loader_wuffs.hpp │ │ ├── instance.cpp │ │ ├── instance.hpp │ │ ├── opengl_state_tracker.cpp │ │ ├── opengl_state_tracker.hpp │ │ ├── pipeline.cpp │ │ ├── pipeline.hpp │ │ ├── png_loader_mango.cpp │ │ ├── png_loader_mango.hpp │ │ ├── png_loader_mango_spng.cpp │ │ ├── png_loader_mango_spng.hpp │ │ ├── png_loader_none.cpp │ │ ├── png_loader_none.hpp │ │ ├── renderbuffer.cpp │ │ ├── renderbuffer.hpp │ │ ├── sampler.cpp │ │ ├── sampler.hpp │ │ ├── scoped_buffer_mapping.cpp │ │ ├── scoped_buffer_mapping.hpp │ │ ├── shader_monitor.cpp │ │ ├── shader_monitor.hpp │ │ ├── shader_resource.cpp │ │ ├── shader_resource.hpp │ │ ├── shader_stages.cpp │ │ ├── shader_stages.hpp │ │ ├── shader_stages_create_info.cpp │ │ ├── shader_stages_prototype.cpp │ │ ├── span.hpp │ │ ├── state │ │ ├── color_blend_state.cpp │ │ ├── color_blend_state.hpp │ │ ├── depth_stencil_state.cpp │ │ ├── depth_stencil_state.hpp │ │ ├── input_assembly_state.cpp │ │ ├── input_assembly_state.hpp │ │ ├── multisample_state.cpp │ │ ├── multisample_state.hpp │ │ ├── rasterization_state.cpp │ │ ├── rasterization_state.hpp │ │ ├── vertex_input_state.cpp │ │ ├── vertex_input_state.hpp │ │ ├── viewport_state.cpp │ │ └── viewport_state.hpp │ │ ├── texture.cpp │ │ ├── texture.hpp │ │ └── wuffs-v0.4.c ├── graphics_buffer_sink │ ├── CMakeLists.txt │ └── erhe_graphics_buffer_sink │ │ ├── graphics_buffer_sink.cpp │ │ └── graphics_buffer_sink.hpp ├── hash │ ├── CMakeLists.txt │ └── erhe_hash │ │ ├── hash.cpp │ │ ├── hash.hpp │ │ └── xxhash.hpp ├── imgui │ ├── CMakeLists.txt │ └── erhe_imgui │ │ ├── crude_json.cpp │ │ ├── crude_json.h │ │ ├── file_dialog.cpp │ │ ├── file_dialog.hpp │ │ ├── imgui_bezier_math.h │ │ ├── imgui_bezier_math.inl │ │ ├── imgui_canvas.cpp │ │ ├── imgui_canvas.h │ │ ├── imgui_extra_math.h │ │ ├── imgui_extra_math.inl │ │ ├── imgui_helpers.cpp │ │ ├── imgui_helpers.hpp │ │ ├── imgui_host.cpp │ │ ├── imgui_host.hpp │ │ ├── imgui_log.cpp │ │ ├── imgui_log.hpp │ │ ├── imgui_node_editor.cpp │ │ ├── imgui_node_editor.h │ │ ├── imgui_node_editor_api.cpp │ │ ├── imgui_node_editor_internal.h │ │ ├── imgui_node_editor_internal.inl │ │ ├── imgui_renderer.cpp │ │ ├── imgui_renderer.hpp │ │ ├── imgui_window.cpp │ │ ├── imgui_window.hpp │ │ ├── imgui_windows.cpp │ │ ├── imgui_windows.hpp │ │ ├── scoped_imgui_context.cpp │ │ ├── scoped_imgui_context.hpp │ │ ├── window_imgui_host.cpp │ │ ├── window_imgui_host.hpp │ │ └── windows │ │ ├── framebuffer_window.cpp │ │ ├── framebuffer_window.hpp │ │ ├── graph.cpp │ │ ├── graph.hpp │ │ ├── graph_plotter.cpp │ │ ├── graph_plotter.hpp │ │ ├── log_window.cpp │ │ ├── log_window.hpp │ │ ├── performance_window.cpp │ │ ├── performance_window.hpp │ │ ├── pipelines.cpp │ │ └── pipelines.hpp ├── item │ ├── CMakeLists.txt │ └── erhe_item │ │ ├── constexpr-xxh3.h │ │ ├── hierarchy.cpp │ │ ├── hierarchy.hpp │ │ ├── item.cpp │ │ ├── item.hpp │ │ ├── item_host.cpp │ │ ├── item_host.hpp │ │ ├── item_log.cpp │ │ ├── item_log.hpp │ │ └── unique_id.hpp ├── log │ ├── CMakeLists.txt │ ├── Readme.md │ └── erhe_log │ │ ├── log.cpp │ │ ├── log.hpp │ │ ├── log_geogram.hpp │ │ ├── log_glm.hpp │ │ ├── timestamp.cpp │ │ └── timestamp.hpp ├── math │ ├── CMakeLists.txt │ └── erhe_math │ │ ├── aabb.cpp │ │ ├── aabb.hpp │ │ ├── input_axis.cpp │ │ ├── input_axis.hpp │ │ ├── math_log.cpp │ │ ├── math_log.hpp │ │ ├── math_util.cpp │ │ ├── math_util.hpp │ │ ├── sphere.cpp │ │ ├── sphere.hpp │ │ ├── viewport.cpp │ │ └── viewport.hpp ├── message_bus │ ├── CMakeLists.txt │ └── erhe_message_bus │ │ ├── message_bus.cpp │ │ └── message_bus.hpp ├── net │ ├── CMakeLists.txt │ └── erhe_net │ │ ├── client.cpp │ │ ├── client.hpp │ │ ├── net_common.cpp │ │ ├── net_linux.cpp │ │ ├── net_log.cpp │ │ ├── net_log.hpp │ │ ├── net_os.hpp │ │ ├── net_windows.cpp │ │ ├── ring_buffer.cpp │ │ ├── ring_buffer.hpp │ │ ├── select_sockets.cpp │ │ ├── select_sockets.hpp │ │ ├── server.cpp │ │ ├── server.hpp │ │ ├── socket.cpp │ │ └── socket.hpp ├── pch │ ├── CMakeLists.txt │ └── erhe_pch │ │ ├── erhe_pch.cpp │ │ └── erhe_windows.hpp ├── physics │ ├── CMakeLists.txt │ └── erhe_physics │ │ ├── icollision_shape.hpp │ │ ├── iconstraint.hpp │ │ ├── iconvex_hull_collision_shape.hpp │ │ ├── idebug_draw.hpp │ │ ├── imotion_state.hpp │ │ ├── irigid_body.hpp │ │ ├── iworld.hpp │ │ ├── jolt │ │ ├── glm_conversions.hpp │ │ ├── jolt_collision_shape.cpp │ │ ├── jolt_collision_shape.hpp │ │ ├── jolt_compound_shape.cpp │ │ ├── jolt_compound_shape.hpp │ │ ├── jolt_constraint.cpp │ │ ├── jolt_constraint.hpp │ │ ├── jolt_convex_hull_collision_shape.cpp │ │ ├── jolt_convex_hull_collision_shape.hpp │ │ ├── jolt_debug_renderer.cpp │ │ ├── jolt_debug_renderer.hpp │ │ ├── jolt_rigid_body.cpp │ │ ├── jolt_rigid_body.hpp │ │ ├── jolt_uniform_scaling_shape.cpp │ │ ├── jolt_uniform_scaling_shape.hpp │ │ ├── jolt_world.cpp │ │ └── jolt_world.hpp │ │ ├── null │ │ ├── null_collision_shape.cpp │ │ ├── null_collision_shape.hpp │ │ ├── null_compound_shape.cpp │ │ ├── null_compound_shape.hpp │ │ ├── null_constraint.cpp │ │ ├── null_constraint.hpp │ │ ├── null_convex_hull_collision_shape.cpp │ │ ├── null_convex_hull_collision_shape.hpp │ │ ├── null_rigid_body.cpp │ │ ├── null_rigid_body.hpp │ │ ├── null_uniform_scaling_shape.cpp │ │ ├── null_uniform_scaling_shape.hpp │ │ ├── null_world.cpp │ │ └── null_world.hpp │ │ ├── physics_log.cpp │ │ ├── physics_log.hpp │ │ └── transform.hpp ├── primitive │ ├── CMakeLists.txt │ ├── Readme.md │ └── erhe_primitive │ │ ├── buffer_info.cpp │ │ ├── buffer_info.hpp │ │ ├── buffer_mesh.cpp │ │ ├── buffer_mesh.hpp │ │ ├── buffer_range.cpp │ │ ├── buffer_range.hpp │ │ ├── buffer_sink.cpp │ │ ├── buffer_sink.hpp │ │ ├── buffer_writer.cpp │ │ ├── buffer_writer.hpp │ │ ├── build_info.cpp │ │ ├── build_info.hpp │ │ ├── enums.hpp │ │ ├── format_info.cpp │ │ ├── format_info.hpp │ │ ├── index_range.cpp │ │ ├── index_range.hpp │ │ ├── material.cpp │ │ ├── material.hpp │ │ ├── primitive.cpp │ │ ├── primitive.hpp │ │ ├── primitive_builder.cpp │ │ ├── primitive_builder.hpp │ │ ├── primitive_log.cpp │ │ ├── primitive_log.hpp │ │ ├── triangle_soup.cpp │ │ ├── triangle_soup.hpp │ │ ├── vertex_attribute_info.cpp │ │ └── vertex_attribute_info.hpp ├── profile │ ├── CMakeLists.txt │ └── erhe_profile │ │ ├── profile.cpp │ │ └── profile.hpp ├── raytrace │ ├── CMakeLists.txt │ └── erhe_raytrace │ │ ├── bvh │ │ ├── bvh_buffer.cpp │ │ ├── bvh_buffer.hpp │ │ ├── bvh_geometry.cpp │ │ ├── bvh_geometry.hpp │ │ ├── bvh_instance.cpp │ │ ├── bvh_instance.hpp │ │ ├── bvh_scene.cpp │ │ ├── bvh_scene.hpp │ │ └── glm_conversions.hpp │ │ ├── embree │ │ ├── embree_buffer.cpp │ │ ├── embree_buffer.hpp │ │ ├── embree_device.cpp │ │ ├── embree_device.hpp │ │ ├── embree_geometry.cpp │ │ ├── embree_geometry.hpp │ │ ├── embree_instance.cpp │ │ ├── embree_instance.hpp │ │ ├── embree_scene.cpp │ │ └── embree_scene.hpp │ │ ├── igeometry.hpp │ │ ├── iinstance.hpp │ │ ├── iscene.hpp │ │ ├── null │ │ ├── null_buffer.cpp │ │ ├── null_buffer.hpp │ │ ├── null_geometry.cpp │ │ ├── null_geometry.hpp │ │ ├── null_instance.cpp │ │ ├── null_instance.hpp │ │ ├── null_scene.cpp │ │ └── null_scene.hpp │ │ ├── ray.cpp │ │ ├── ray.hpp │ │ ├── raytrace_log.cpp │ │ └── raytrace_log.hpp ├── renderer │ ├── CMakeLists.txt │ └── erhe_renderer │ │ ├── buffer_writer.cpp │ │ ├── buffer_writer.hpp │ │ ├── debug_renderer.cpp │ │ ├── debug_renderer.hpp │ │ ├── debug_renderer_bucket.cpp │ │ ├── debug_renderer_bucket.hpp │ │ ├── draw_indirect_buffer.cpp │ │ ├── draw_indirect_buffer.hpp │ │ ├── enums.hpp │ │ ├── jolt_debug_renderer.cpp │ │ ├── jolt_debug_renderer.hpp │ │ ├── line_renderer.cpp │ │ ├── pipeline_renderpass.cpp │ │ ├── pipeline_renderpass.hpp │ │ ├── primitive_renderer.cpp │ │ ├── primitive_renderer.hpp │ │ ├── renderer_config.hpp │ │ ├── renderer_log.cpp │ │ ├── renderer_log.hpp │ │ ├── renderer_message.hpp │ │ ├── renderer_message_bus.cpp │ │ ├── renderer_message_bus.hpp │ │ ├── text_renderer.cpp │ │ ├── text_renderer.hpp │ │ ├── texture_renderer.cpp │ │ └── texture_renderer.hpp ├── rendergraph │ ├── CMakeLists.txt │ └── erhe_rendergraph │ │ ├── multisample_resolve.cpp │ │ ├── multisample_resolve.hpp │ │ ├── rendergraph.cpp │ │ ├── rendergraph.hpp │ │ ├── rendergraph_log.cpp │ │ ├── rendergraph_log.hpp │ │ ├── rendergraph_node.cpp │ │ ├── rendergraph_node.hpp │ │ ├── resource_routing.cpp │ │ ├── resource_routing.hpp │ │ ├── sink_rendergraph_node.cpp │ │ ├── sink_rendergraph_node.hpp │ │ ├── texture_rendergraph_node.cpp │ │ └── texture_rendergraph_node.hpp ├── scene │ ├── CMakeLists.txt │ ├── Readme.md │ └── erhe_scene │ │ ├── animation.cpp │ │ ├── animation.hpp │ │ ├── camera.cpp │ │ ├── camera.hpp │ │ ├── light.cpp │ │ ├── light.hpp │ │ ├── mesh.cpp │ │ ├── mesh.hpp │ │ ├── mesh_raytrace.cpp │ │ ├── mesh_raytrace.hpp │ │ ├── node.cpp │ │ ├── node.hpp │ │ ├── node_attachment.cpp │ │ ├── node_attachment.hpp │ │ ├── projection.cpp │ │ ├── projection.hpp │ │ ├── scene.cpp │ │ ├── scene.hpp │ │ ├── scene_host.cpp │ │ ├── scene_host.hpp │ │ ├── scene_log.cpp │ │ ├── scene_log.hpp │ │ ├── scene_message.hpp │ │ ├── scene_message_bus.cpp │ │ ├── scene_message_bus.hpp │ │ ├── scene_pch.hpp │ │ ├── skin.cpp │ │ ├── skin.hpp │ │ ├── transform.cpp │ │ ├── transform.hpp │ │ ├── trs_transform.cpp │ │ └── trs_transform.hpp ├── scene_renderer │ ├── CMakeLists.txt │ └── erhe_scene_renderer │ │ ├── buffer_binding_points.hpp │ │ ├── camera_buffer.cpp │ │ ├── camera_buffer.hpp │ │ ├── cube_instance_buffer.cpp │ │ ├── cube_instance_buffer.hpp │ │ ├── cube_renderer.cpp │ │ ├── cube_renderer.hpp │ │ ├── forward_renderer.cpp │ │ ├── forward_renderer.hpp │ │ ├── joint_buffer.cpp │ │ ├── joint_buffer.hpp │ │ ├── light_buffer.cpp │ │ ├── light_buffer.hpp │ │ ├── material_buffer.cpp │ │ ├── material_buffer.hpp │ │ ├── primitive_buffer.cpp │ │ ├── primitive_buffer.hpp │ │ ├── program_interface.cpp │ │ ├── program_interface.hpp │ │ ├── scene_renderer_log.cpp │ │ ├── scene_renderer_log.hpp │ │ ├── shadow_renderer.cpp │ │ └── shadow_renderer.hpp ├── time │ ├── CMakeLists.txt │ └── erhe_time │ │ ├── sleep.cpp │ │ ├── sleep.hpp │ │ ├── time_log.cpp │ │ ├── time_log.hpp │ │ ├── timer.cpp │ │ ├── timer.hpp │ │ ├── timestamp.cpp │ │ └── timestamp.hpp ├── ui │ ├── CMakeLists.txt │ └── erhe_ui │ │ ├── bitmap.hpp │ │ ├── color_picker.cpp │ │ ├── font.cpp │ │ ├── font.hpp │ │ ├── glyph.cpp │ │ ├── glyph.hpp │ │ ├── rectangle.hpp │ │ ├── ui_log.cpp │ │ └── ui_log.hpp ├── verify │ ├── CMakeLists.txt │ └── erhe_verify │ │ ├── verify.cpp │ │ └── verify.hpp ├── window │ ├── CMakeLists.txt │ ├── Readme.md │ └── erhe_window │ │ ├── glfw_window.cpp │ │ ├── glfw_window.hpp │ │ ├── renderdoc_app.h │ │ ├── renderdoc_capture.cpp │ │ ├── renderdoc_capture.hpp │ │ ├── sdl_window.cpp │ │ ├── sdl_window.hpp │ │ ├── window.cpp │ │ ├── window.hpp │ │ ├── window_configuration.hpp │ │ ├── window_event_handler.cpp │ │ ├── window_event_handler.hpp │ │ ├── window_log.cpp │ │ └── window_log.hpp └── xr │ ├── CMakeLists.txt │ └── erhe_xr │ ├── headset.cpp │ ├── headset.hpp │ ├── xr.cpp │ ├── xr.hpp │ ├── xr_action.cpp │ ├── xr_action.hpp │ ├── xr_instance.cpp │ ├── xr_instance.hpp │ ├── xr_log.cpp │ ├── xr_log.hpp │ ├── xr_session.cpp │ ├── xr_session.hpp │ ├── xr_swapchain_image.cpp │ └── xr_swapchain_image.hpp ├── example ├── .gitignore ├── CMakeLists.txt ├── LICENSE ├── erhe.ini ├── example.cpp ├── example.hpp ├── example_log.cpp ├── example_log.hpp ├── frame_controller.cpp ├── frame_controller.hpp ├── logging.ini ├── main.cpp ├── mesh_memory.cpp ├── mesh_memory.hpp ├── programs.cpp ├── programs.hpp └── res │ ├── models │ ├── Box.gltf │ ├── Box0.bin │ └── SM_Deccer_Cubes_Textured.glb │ └── shaders │ ├── depth.frag │ ├── depth.vert │ ├── standard.frag │ └── standard.vert ├── hextiles ├── .gitignore ├── CMakeLists.txt ├── FastNoiseLite.h ├── LICENSE ├── coordinate.cpp ├── coordinate.hpp ├── erhe.ini ├── file_util.cpp ├── file_util.hpp ├── game │ ├── game.cpp │ ├── game.hpp │ ├── player.cpp │ ├── player.hpp │ └── unit.hpp ├── hextiles.cpp ├── hextiles.hpp ├── hextiles_log.cpp ├── hextiles_log.hpp ├── hextiles_settings.cpp ├── hextiles_settings.hpp ├── imgui.ini ├── imgui_window_imgui_host.ini ├── imgui_window_imgui_viewport.ini ├── logging.ini ├── main.cpp ├── map.cpp ├── map.hpp ├── map_editor │ ├── map_editor.cpp │ ├── map_editor.hpp │ ├── map_tool_window.cpp │ ├── map_tool_window.hpp │ ├── terrain_palette_window.cpp │ └── terrain_palette_window.hpp ├── map_generator │ ├── biome.cpp │ ├── biome.hpp │ ├── fbm_noise.cpp │ ├── fbm_noise.hpp │ ├── map_generator.cpp │ ├── map_generator.hpp │ ├── terrain_variation.cpp │ ├── terrain_variation.hpp │ ├── variations.cpp │ └── variations.hpp ├── map_window.cpp ├── map_window.hpp ├── menu_window.cpp ├── menu_window.hpp ├── new_game_window.cpp ├── new_game_window.hpp ├── pixel_lookup.cpp ├── pixel_lookup.hpp ├── rendering.cpp ├── rendering.hpp ├── res │ ├── fonts │ │ ├── OFL.txt │ │ ├── SourceCodePro-SemiBold.ttf │ │ ├── SourceCodePro-Semibold.otf │ │ └── SourceSansPro-Regular.otf │ ├── hextiles │ │ ├── DEEP.wav │ │ ├── GND.wav │ │ ├── Help.png │ │ ├── March.wav │ │ ├── SEA.wav │ │ ├── UWD.wav │ │ ├── air.wav │ │ ├── amiga_Hex.png │ │ ├── amiga_Misc.png │ │ ├── amiga_Unit.png │ │ ├── chop1.wav │ │ ├── hextiles.pdn │ │ ├── hextiles.png │ │ ├── map_new │ │ ├── map_old │ │ ├── mask.png │ │ ├── mechinf.wav │ │ ├── motor0.wav │ │ ├── terrain_groups_v1.json │ │ ├── terrain_replacement_rules_v1.json │ │ ├── terrain_types_v1.json │ │ ├── terrain_types_v2.json │ │ ├── terrain_types_v3.json │ │ ├── terrain_types_v4.json │ │ ├── terrain_types_v5.json │ │ ├── unit_types_v1.json │ │ ├── unit_types_v2.json │ │ └── xpl4.wav │ ├── images │ │ ├── gl16.png │ │ ├── gl16w.png │ │ ├── gl32.png │ │ ├── gl32w.png │ │ ├── gl48.png │ │ └── gl48w.png │ └── shaders │ │ ├── font.frag │ │ ├── font.vert │ │ ├── line.frag │ │ ├── line.geom │ │ ├── line.vert │ │ ├── text.frag │ │ ├── text.vert │ │ ├── textured.frag │ │ ├── textured.vert │ │ ├── tile.frag │ │ └── tile.vert ├── stream.cpp ├── stream.hpp ├── terrain_type.cpp ├── terrain_type.hpp ├── texture_util.cpp ├── texture_util.hpp ├── tile_renderer.cpp ├── tile_renderer.hpp ├── tile_shape.cpp ├── tile_shape.hpp ├── tiles.cpp ├── tiles.hpp ├── type_editors │ ├── terrain_editor_window.cpp │ ├── terrain_editor_window.hpp │ ├── terrain_group_editor_window.cpp │ ├── terrain_group_editor_window.hpp │ ├── terrain_replacement_rule_editor_window.cpp │ ├── terrain_replacement_rule_editor_window.hpp │ ├── type_editor.cpp │ ├── type_editor.hpp │ ├── unit_editor_window.cpp │ └── unit_editor_window.hpp ├── types.cpp ├── types.hpp ├── unit_type.cpp ├── unit_type.hpp ├── util.hpp └── windows.ini ├── hidapi ├── CMakeLists.txt ├── hidapi.h ├── hidapi_linux.c └── hidapi_windows.c ├── imgui ├── CMakeLists.txt ├── LICENSE.txt └── imgui │ ├── LICENSE.txt │ ├── backends │ ├── .gitignore │ ├── imgui_impl_glfw.cpp │ ├── imgui_impl_glfw.h │ ├── imgui_impl_win32.cpp │ └── imgui_impl_win32.h │ ├── imconfig.h │ ├── imgui.cpp │ ├── imgui.h │ ├── imgui_demo.cpp │ ├── imgui_draw.cpp │ ├── imgui_internal.h │ ├── imgui_tables.cpp │ ├── imgui_widgets.cpp │ ├── imstb_rectpack.h │ ├── imstb_textedit.h │ ├── imstb_truetype.h │ └── misc │ ├── README.txt │ ├── cpp │ ├── README.txt │ ├── imgui_stdlib.cpp │ └── imgui_stdlib.h │ ├── debuggers │ ├── README.txt │ ├── imgui.gdb │ ├── imgui.natstepfilter │ └── imgui.natvis │ ├── freetype │ ├── README.md │ ├── imgui_freetype.cpp │ └── imgui_freetype.h │ └── single_file │ └── imgui_single_file.h ├── imgui_gradient ├── .clang-format ├── .clang-tidy ├── .gitignore ├── .gitmodules ├── CMakeLists.txt ├── Design Decisions.md ├── LICENSE ├── README.md ├── generate_flags_checkbox.py ├── generated │ └── checkboxes_for_all_flags.inl ├── imgui.ini ├── include │ └── imgui_gradient │ │ └── imgui_gradient.hpp ├── src │ ├── ColorRGBA.hpp │ ├── Flags.hpp │ ├── Gradient.cpp │ ├── Gradient.hpp │ ├── GradientWidget.cpp │ ├── GradientWidget.hpp │ ├── HoverChecker.cpp │ ├── HoverChecker.hpp │ ├── Interpolation.hpp │ ├── Mark.hpp │ ├── MarkId.hpp │ ├── RelativePosition.cpp │ ├── RelativePosition.hpp │ ├── Settings.hpp │ ├── Utils.hpp │ ├── WrapMode.hpp │ ├── color_conversions.cpp │ ├── color_conversions.hpp │ ├── extra_widgets.cpp │ ├── extra_widgets.hpp │ ├── imgui_draw.cpp │ ├── imgui_draw.hpp │ ├── imgui_internal.hpp │ ├── internal.hpp │ ├── maybe_disabled.cpp │ └── maybe_disabled.hpp ├── tests │ ├── CMakeLists.txt │ └── tests.cpp └── tooling │ ├── .clang-format │ ├── .clang-tidy │ ├── .github │ └── FUNDING.YML │ ├── .gitignore │ ├── LICENSE │ ├── README.md │ ├── apply_clang_format.py │ ├── generate_files.py │ ├── gitmoji.md │ ├── internal_utils.py │ ├── setup_all.py │ ├── setup_dev_tools.py │ └── setup_funding_file.py ├── khronos └── khronos │ ├── GL │ ├── glcorearb.h │ ├── glext.h │ ├── glxext.h │ └── wglext.h │ └── KHR │ └── khrplatform.h ├── mINI ├── CMakeLists.txt └── include │ └── mini │ └── ini.h ├── mango ├── CMakeLists.txt ├── include │ └── mango │ │ ├── core │ │ ├── adler32.hpp │ │ ├── aes.hpp │ │ ├── atomic.hpp │ │ ├── bits.hpp │ │ ├── buffer.hpp │ │ ├── compress.hpp │ │ ├── configure.hpp │ │ ├── core.hpp │ │ ├── cpuinfo.hpp │ │ ├── crc32.hpp │ │ ├── dynamic_library.hpp │ │ ├── endian.hpp │ │ ├── exception.hpp │ │ ├── half.hpp │ │ ├── hash.hpp │ │ ├── memory.hpp │ │ ├── pointer.hpp │ │ ├── stream.hpp │ │ ├── string.hpp │ │ ├── system.hpp │ │ ├── thread.hpp │ │ └── timer.hpp │ │ ├── filesystem │ │ ├── file.hpp │ │ ├── fileobserver.hpp │ │ ├── filesystem.hpp │ │ ├── mapper.hpp │ │ └── path.hpp │ │ ├── mango.hpp │ │ ├── math │ │ ├── accessor.hpp │ │ ├── geometry.hpp │ │ ├── math.hpp │ │ ├── matrix.hpp │ │ ├── matrix4x4.hpp │ │ ├── quaternion.hpp │ │ ├── spline.hpp │ │ ├── srgb.hpp │ │ ├── vector.hpp │ │ ├── vector128_int16x8.hpp │ │ ├── vector128_int32x4.hpp │ │ ├── vector128_int64x2.hpp │ │ ├── vector128_int8x16.hpp │ │ ├── vector128_uint16x8.hpp │ │ ├── vector128_uint32x4.hpp │ │ ├── vector128_uint64x2.hpp │ │ ├── vector128_uint8x16.hpp │ │ ├── vector256_int16x16.hpp │ │ ├── vector256_int32x8.hpp │ │ ├── vector256_int64x4.hpp │ │ ├── vector256_int8x32.hpp │ │ ├── vector256_uint16x16.hpp │ │ ├── vector256_uint32x8.hpp │ │ ├── vector256_uint64x4.hpp │ │ ├── vector256_uint8x32.hpp │ │ ├── vector512_int16x32.hpp │ │ ├── vector512_int32x16.hpp │ │ ├── vector512_int64x8.hpp │ │ ├── vector512_int8x64.hpp │ │ ├── vector512_uint16x32.hpp │ │ ├── vector512_uint32x16.hpp │ │ ├── vector512_uint64x8.hpp │ │ ├── vector512_uint8x64.hpp │ │ ├── vector_float16x4.hpp │ │ ├── vector_float32x16.hpp │ │ ├── vector_float32x2.hpp │ │ ├── vector_float32x3.hpp │ │ ├── vector_float32x4.hpp │ │ ├── vector_float32x8.hpp │ │ ├── vector_float64x2.hpp │ │ ├── vector_float64x4.hpp │ │ ├── vector_float64x8.hpp │ │ └── vector_gather.hpp │ │ └── simd │ │ ├── altivec_convert.hpp │ │ ├── altivec_double128.hpp │ │ ├── altivec_float128.hpp │ │ ├── altivec_int128.hpp │ │ ├── avx2_gather.hpp │ │ ├── avx2_int256.hpp │ │ ├── avx512_convert.hpp │ │ ├── avx512_double128.hpp │ │ ├── avx512_double256.hpp │ │ ├── avx512_double512.hpp │ │ ├── avx512_float128.hpp │ │ ├── avx512_float256.hpp │ │ ├── avx512_float512.hpp │ │ ├── avx512_gather.hpp │ │ ├── avx512_int128.hpp │ │ ├── avx512_int256.hpp │ │ ├── avx512_int512.hpp │ │ ├── avx_convert.hpp │ │ ├── avx_double256.hpp │ │ ├── avx_float256.hpp │ │ ├── avx_int256.hpp │ │ ├── common.hpp │ │ ├── common_gather.hpp │ │ ├── common_mask.hpp │ │ ├── composite_double256.hpp │ │ ├── composite_double512.hpp │ │ ├── composite_float256.hpp │ │ ├── composite_float512.hpp │ │ ├── composite_int256.hpp │ │ ├── composite_int512.hpp │ │ ├── msa_convert.hpp │ │ ├── msa_double128.hpp │ │ ├── msa_float128.hpp │ │ ├── msa_int128.hpp │ │ ├── neon_convert.hpp │ │ ├── neon_double128.hpp │ │ ├── neon_float128.hpp │ │ ├── neon_float64.hpp │ │ ├── neon_int128.hpp │ │ ├── neon_int64.hpp │ │ ├── scalar_convert.hpp │ │ ├── scalar_detail.hpp │ │ ├── scalar_double128.hpp │ │ ├── scalar_float128.hpp │ │ ├── scalar_float64.hpp │ │ ├── scalar_int128.hpp │ │ ├── scalar_int64.hpp │ │ ├── simd.hpp │ │ ├── sse2_convert.hpp │ │ ├── sse2_double128.hpp │ │ ├── sse2_float128.hpp │ │ └── sse2_int128.hpp ├── license └── source │ └── mango │ ├── core │ ├── buffer.cpp │ ├── cpuinfo.cpp │ ├── crc32.cpp │ ├── hash.cpp │ ├── md5.cpp │ ├── memory.cpp │ ├── sha1.cpp │ ├── sha2.cpp │ ├── string.cpp │ ├── system.cpp │ ├── thread.cpp │ ├── timer.cpp │ ├── unix │ │ └── dynamic_library.cpp │ └── win32 │ │ └── dynamic_library.cpp │ ├── filesystem │ ├── file.cpp │ ├── indexer.hpp │ ├── mapper.cpp │ ├── mapper_mgx.cpp │ ├── mapper_rar.cpp │ ├── mapper_zip.cpp │ ├── path.cpp │ ├── unix │ │ ├── file_observer.cpp │ │ ├── file_stream.cpp │ │ └── mapper_file.cpp │ └── win32 │ │ ├── file_observer.cpp │ │ ├── file_stream.cpp │ │ └── mapper_file.cpp │ └── math │ ├── geometry.cpp │ ├── math.cpp │ └── simd.cpp ├── miniaudio ├── CMakeLists.txt ├── miniaudio.c └── miniaudio.h ├── quickhull ├── CMakeLists.txt ├── README.md └── quickhull │ ├── ConvexHull.hpp │ ├── HalfEdgeMesh.hpp │ ├── MathUtils.hpp │ ├── QuickHull.cpp │ ├── QuickHull.hpp │ └── Structs │ ├── Mesh.hpp │ ├── Plane.hpp │ ├── Pool.hpp │ ├── Ray.hpp │ ├── Vector3.hpp │ └── VertexDataSource.hpp ├── rapidjson ├── CMakeLists.txt └── include │ └── rapidjson │ ├── allocators.h │ ├── cursorstreamwrapper.h │ ├── document.h │ ├── encodedstream.h │ ├── encodings.h │ ├── error │ ├── en.h │ └── error.h │ ├── filereadstream.h │ ├── filewritestream.h │ ├── fwd.h │ ├── internal │ ├── biginteger.h │ ├── clzll.h │ ├── diyfp.h │ ├── dtoa.h │ ├── ieee754.h │ ├── itoa.h │ ├── meta.h │ ├── pow10.h │ ├── regex.h │ ├── stack.h │ ├── strfunc.h │ ├── strtod.h │ └── swap.h │ ├── istreamwrapper.h │ ├── memorybuffer.h │ ├── memorystream.h │ ├── msinttypes │ ├── inttypes.h │ └── stdint.h │ ├── ostreamwrapper.h │ ├── pointer.h │ ├── prettywriter.h │ ├── rapidjson.h │ ├── reader.h │ ├── schema.h │ ├── stream.h │ ├── stringbuffer.h │ ├── uri.h │ └── writer.h ├── spng ├── CMakeLists.txt ├── miniz.c ├── miniz.h ├── spng.c └── spng.h └── tinyexpr ├── CMakeLists.txt └── tinyexpr ├── .travis.yml ├── CONTRIBUTING ├── LICENSE ├── Makefile ├── README.md ├── benchmark.c ├── doc ├── e1.dot ├── e1.png ├── e2.dot └── e2.png ├── example.c ├── example2.c ├── example3.c ├── minctest.h ├── repl.c ├── smoke.c ├── tinyexpr.c └── tinyexpr.h /.codacy.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | engines: 3 | cppcheck: 4 | language: c++ 5 | exclude_paths: 6 | - "build/**" 7 | - "src/hidapi/**" 8 | - "src/imgui/**" 9 | - "src/mikktspace/**" 10 | - "src/RectangleBinPack/**" 11 | - "src/miniaudio/**" 12 | - "src/optional_lite/**" 13 | - "src/mango/**" 14 | - "src/rapidjson/**" 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .vs 3 | .vscode/compile_commands.json 4 | erhe_cmake_profiling.json 5 | src/editor/user.ini 6 | src/editor/erhe_init_graph.dot 7 | src/editor/cache/bvh/* 8 | src/editor/windows/IconsMaterialDesignIcons.h 9 | src/editor/res/fonts/materialdesignicons-webfont.ttf 10 | src/editor/res/fonts/materialdesignicons.css 11 | !src/editor/cache/bvh/keep 12 | build 13 | cmake-build-debug 14 | vscode-cmake-build 15 | log.txt 16 | releases 17 | erhe_cmake_dependencies.dot* 18 | -------------------------------------------------------------------------------- /.pylintrc: -------------------------------------------------------------------------------- 1 | [FORMAT] 2 | max-line-length=120 3 | 4 | no-space-check=trailing-comma,dict-separator 5 | 6 | [DESIGN] 7 | max-attributes=12 8 | 9 | -------------------------------------------------------------------------------- /cmake/GNU.cmake: -------------------------------------------------------------------------------- 1 | # TODO restore warnings that can be restored without issues with Jolt 2 | #add_compile_options(-Wall;-Wextra;-Wno-unused;-Wno-unknown-pragmas;-Wno-sign-compare;-Wwrite-strings;-Wno-unused;-Wno-narrowing;-Wno-ignored-qualifiers;-Wno-inline) 3 | add_compile_definitions(JPH_NO_FORCE_INLINE=1) 4 | 5 | add_compile_options("$<$:-Woverloaded-virtual>") 6 | add_compile_options("$<$:-Wno-empty-body>") 7 | add_compile_options("$<$:-O3>") 8 | add_compile_options("$<$:-O0;-g3>") 9 | 10 | # Workaround for MinGW linker (ld) is failing due to relocation overflows 11 | if (WIN32) 12 | add_compile_options(-Wa,-mbig-obj) 13 | endif () 14 | 15 | function (erhe_target_settings_toolchain target) 16 | endfunction() 17 | -------------------------------------------------------------------------------- /cmake/toolchain/linux-clang-10.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_C_COMPILER "clang-10") 2 | set(CMAKE_CXX_COMPILER "clang++-10") 3 | -------------------------------------------------------------------------------- /cmake/toolchain/linux-clang-12.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_C_COMPILER "clang-12") 2 | set(CMAKE_CXX_COMPILER "clang++-12") 3 | -------------------------------------------------------------------------------- /cmake/toolchain/linux-clang-13.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_C_COMPILER "clang-13") 2 | set(CMAKE_CXX_COMPILER "clang++-13") 3 | -------------------------------------------------------------------------------- /cmake/toolchain/linux-clang-14.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_C_COMPILER "clang-13") 2 | set(CMAKE_CXX_COMPILER "clang++-13") 3 | -------------------------------------------------------------------------------- /cmake/toolchain/linux-clang.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_C_COMPILER "clang") 2 | set(CMAKE_CXX_COMPILER "clang++") 3 | -------------------------------------------------------------------------------- /cmake/toolchain/linux-gnu-gcc-8.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_C_COMPILER "gcc-8") 2 | set(CMAKE_CXX_COMPILER "g++-8") 3 | -------------------------------------------------------------------------------- /cmake/toolchain/linux-gnu-gcc.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_C_COMPILER "gcc") 2 | set(CMAKE_CXX_COMPILER "g++") 3 | -------------------------------------------------------------------------------- /cmake/vscode.cmake: -------------------------------------------------------------------------------- 1 | function (vscode_support) 2 | set(CMAKE_EXPORT_COMPILE_COMMANDS ON) 3 | option(FORCE_COLORED_OUTPUT "Always produce ANSI-colored output (GNU/Clang only)." TRUE) 4 | if (${FORCE_COLORED_OUTPUT}) 5 | # VSCode is currently unable to parse escape codes 6 | # and shows them as noise in build output. 7 | # 8 | # if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") 9 | # add_compile_options($<$:-fno-diagnostics-color>) 10 | # else 11 | if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") 12 | add_compile_options($<$:-fcolor-diagnostics>) 13 | endif () 14 | endif () 15 | endfunction () 16 | -------------------------------------------------------------------------------- /doc/editor_classes.drawio: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/doc/editor_classes.drawio -------------------------------------------------------------------------------- /doc/editor_rendering.md: -------------------------------------------------------------------------------- 1 | ## Stencil usage 2 | 3 | -------------------------------------------------------------------------------- /doc/imgui.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/doc/imgui.md -------------------------------------------------------------------------------- /doc/msys2_clang.md: -------------------------------------------------------------------------------- 1 | # msys2 clang64 2 | 3 | Read this first: 4 | 5 | - [https://www.msys2.org/docs/environments/] 6 | - [https://www.msys2.org/docs/terminals/] 7 | - Always use the *clang64* environment 8 | 9 | ## Updating all packages 10 | 11 | Repeat the following until it reports there is nothing to do: 12 | 13 | - `pacman -Suy` 14 | 15 | ## msys2 clang64 install compiler 16 | 17 | To install compiler and debugger, cmake and ninja 18 | 19 | - `pacman -S mingw-w64-clang-x86_64-clang mingw-w64-clang-x86_64-lldb` 20 | - `pacman -S mingw-w64-clang-x86_64-cmake mingw-w64-clang-x86_64-ninja` 21 | 22 | ## lldb break on ubsan report 23 | 24 | - `b __ubsan::ScopedReport::~ScopedReport` 25 | - `b __ubsan::Diag::~Diag` 26 | -------------------------------------------------------------------------------- /pylintrc: -------------------------------------------------------------------------------- 1 | [FORMAT] 2 | max-line-length=120 3 | 4 | no-space-check=trailing-comma,dict-separator 5 | 6 | disable=C0326 7 | 8 | [DESIGN] 9 | max-attributes=12 10 | 11 | -------------------------------------------------------------------------------- /scripts/cmake_clean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | rm -fr \ 4 | build/CMakefiles \ 5 | build/CPack* \ 6 | build/ALL_BUILD* \ 7 | build/INSTALL* \ 8 | build/PACKAGE* \ 9 | build/src \ 10 | build/x64 \ 11 | build/ZERO_CHECK* \ 12 | build/erhe.sln \ 13 | build/cmake_install.cmake \ 14 | build/CMakeCache.txt 15 | 16 | -------------------------------------------------------------------------------- /scripts/configure_ninja_linux.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # LD=ld.lld-15 CC=clang-15 CXX=clang++-15 scripts/configure_ninja.sh 4 | #-DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld \ 5 | #-DCMAKE_SHARED_LINKER_FLAGS=-fuse-ld=lld \ 6 | 7 | mkdir -p build/ninja 8 | cmake \ 9 | -G "Ninja" \ 10 | -B build/ninja \ 11 | -S . \ 12 | -DCMAKE_BUILD_TYPE=Release \ 13 | -DCMAKE_EXPORT_COMPILE_COMMANDS=1 \ 14 | -Wno-dev \ 15 | -DERHE_FONT_RASTERIZATION_LIBRARY=freetype \ 16 | -DERHE_GLTF_LIBRARY=fastgltf \ 17 | -DERHE_GUI_LIBRARY=imgui \ 18 | -DERHE_PHYSICS_LIBRARY=jolt \ 19 | -DERHE_PROFILE_LIBRARY=none \ 20 | -DERHE_RAYTRACE_LIBRARY=bvh \ 21 | -DERHE_SVG_LIBRARY=lunasvg \ 22 | -DERHE_TEXT_LAYOUT_LIBRARY=harfbuzz \ 23 | -DERHE_WINDOW_LIBRARY=glfw \ 24 | -DERHE_XR_LIBRARY=none 25 | -------------------------------------------------------------------------------- /scripts/configure_nodeps_msbuild.bat: -------------------------------------------------------------------------------- 1 | cmake ^ 2 | -G "Visual Studio 17 2022" ^ 3 | -A x64 ^ 4 | -Thost=x64 ^ 5 | -B build ^ 6 | -S . ^ 7 | -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ^ 8 | -Wno-dev ^ 9 | -DERHE_FONT_RASTERIZATION_LIBRARY=none ^ 10 | -DERHE_GLTF_LIBRARY=none ^ 11 | -DERHE_GUI_LIBRARY=none ^ 12 | -DERHE_PHYSICS_LIBRARY=none ^ 13 | -DERHE_PROFILE_LIBRARY=none ^ 14 | -DERHE_RAYTRACE_LIBRARY=none ^ 15 | -DERHE_SVG_LIBRARY=none ^ 16 | -DERHE_TEXT_LAYOUT_LIBRARY=none ^ 17 | -DERHE_WINDOW_LIBRARY=glfw ^ 18 | -DERHE_XR_LIBRARY=none 19 | -------------------------------------------------------------------------------- /scripts/configure_vs2022_asan.bat: -------------------------------------------------------------------------------- 1 | @rem TODO Re-enable -DERHE_USE_PRECOMPILED_HEADERS=ON 2 | @rem https://github.com/tksuoran/erhe/issues/139 3 | 4 | cmake ^ 5 | -G "Visual Studio 17 2022" ^ 6 | -A x64 ^ 7 | -B build ^ 8 | -S . ^ 9 | -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ^ 10 | -Wno-dev ^ 11 | -DERHE_USE_PRECOMPILED_HEADERS=OFF ^ 12 | -DERHE_FONT_RASTERIZATION_LIBRARY=freetype ^ 13 | -DERHE_GLTF_LIBRARY=fastgltf ^ 14 | -DERHE_GUI_LIBRARY=imgui ^ 15 | -DERHE_PHYSICS_LIBRARY=jolt ^ 16 | -DERHE_PROFILE_LIBRARY=none ^ 17 | -DERHE_RAYTRACE_LIBRARY=bvh ^ 18 | -DERHE_SVG_LIBRARY=lunasvg ^ 19 | -DERHE_TEXT_LAYOUT_LIBRARY=harfbuzz ^ 20 | -DERHE_WINDOW_LIBRARY=sdl ^ 21 | -DERHE_XR_LIBRARY=openxr ^ 22 | -DERHE_USE_ASAN:BOOL=ON 23 | -------------------------------------------------------------------------------- /scripts/configure_vs2022_glfw.bat: -------------------------------------------------------------------------------- 1 | @rem TODO Re-enable -DERHE_USE_PRECOMPILED_HEADERS=ON 2 | @rem https://github.com/tksuoran/erhe/issues/139 3 | 4 | cmake ^ 5 | -G "Visual Studio 17 2022" ^ 6 | -A x64 ^ 7 | -B build ^ 8 | -S . ^ 9 | -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ^ 10 | -Wno-dev ^ 11 | -DERHE_USE_PRECOMPILED_HEADERS=OFF ^ 12 | -DERHE_FONT_RASTERIZATION_LIBRARY=freetype ^ 13 | -DERHE_GLTF_LIBRARY=fastgltf ^ 14 | -DERHE_GUI_LIBRARY=imgui ^ 15 | -DERHE_PHYSICS_LIBRARY=jolt ^ 16 | -DERHE_PROFILE_LIBRARY=tracy ^ 17 | -DERHE_RAYTRACE_LIBRARY=bvh ^ 18 | -DERHE_SVG_LIBRARY=lunasvg ^ 19 | -DERHE_TEXT_LAYOUT_LIBRARY=harfbuzz ^ 20 | -DERHE_WINDOW_LIBRARY=glfw ^ 21 | -DERHE_XR_LIBRARY=openxr 22 | -------------------------------------------------------------------------------- /scripts/configure_vs2022_no_openxr.bat: -------------------------------------------------------------------------------- 1 | cmake ^ 2 | -G "Visual Studio 17 2022" ^ 3 | -A x64 ^ 4 | -B build ^ 5 | -S . ^ 6 | -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ^ 7 | -Wno-dev ^ 8 | -DERHE_FONT_RASTERIZATION_LIBRARY=freetype ^ 9 | -DERHE_GLTF_LIBRARY=fastgltf ^ 10 | -DERHE_GUI_LIBRARY=imgui ^ 11 | -DERHE_PHYSICS_LIBRARY=jolt ^ 12 | -DERHE_PROFILE_LIBRARY=tracy ^ 13 | -DERHE_RAYTRACE_LIBRARY=bvh ^ 14 | -DERHE_SVG_LIBRARY=lunasvg ^ 15 | -DERHE_TEXT_LAYOUT_LIBRARY=harfbuzz ^ 16 | -DERHE_WINDOW_LIBRARY=glfw ^ 17 | -DERHE_XR_LIBRARY=none 18 | -------------------------------------------------------------------------------- /scripts/configure_vs2022_no_tracy.bat: -------------------------------------------------------------------------------- 1 | cmake ^ 2 | -G "Visual Studio 17 2022" ^ 3 | -A x64 ^ 4 | -B build ^ 5 | -S . ^ 6 | -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ^ 7 | -Wno-dev ^ 8 | -DERHE_FONT_RASTERIZATION_LIBRARY=freetype ^ 9 | -DERHE_GLTF_LIBRARY=fastgltf ^ 10 | -DERHE_GUI_LIBRARY=imgui ^ 11 | -DERHE_PHYSICS_LIBRARY=jolt ^ 12 | -DERHE_PROFILE_LIBRARY=none ^ 13 | -DERHE_RAYTRACE_LIBRARY=bvh ^ 14 | -DERHE_SVG_LIBRARY=lunasvg ^ 15 | -DERHE_TEXT_LAYOUT_LIBRARY=harfbuzz ^ 16 | -DERHE_WINDOW_LIBRARY=glfw ^ 17 | -DERHE_XR_LIBRARY=openxr 18 | -------------------------------------------------------------------------------- /scripts/debug_tool.bat: -------------------------------------------------------------------------------- 1 | "%ProgramFiles%\Oculus\Support\oculus-diagnostics\OculusDebugTool.exe" 2 | -------------------------------------------------------------------------------- /scripts/disable_page_heap_verification.bat: -------------------------------------------------------------------------------- 1 | "C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\gflags.exe" /p /enable editor.exe 2 | -------------------------------------------------------------------------------- /scripts/enable_page_heap_verification.bat: -------------------------------------------------------------------------------- 1 | "C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\gflags.exe" /p /enable editor.exe 2 | -------------------------------------------------------------------------------- /scripts/mirror.bat: -------------------------------------------------------------------------------- 1 | "%ProgramFiles%\Oculus\Support\oculus-diagnostics\OculusMirror.exe" ^ 2 | --RightEyeOnly ^ 3 | --Size 1280 720 ^ 4 | -------------------------------------------------------------------------------- /src/RectangleBinPack/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | project(RectangleBinPack VERSION "1.0.0" LANGUAGES CXX) 4 | 5 | add_library(RectangleBinPack 6 | GuillotineBinPack.cpp 7 | MaxRectsBinPack.cpp 8 | Rect.cpp 9 | ShelfBinPack.cpp 10 | ShelfNextFitBinPack.cpp 11 | ShelfNextFitBinPack.cpp 12 | SkylineBinPack.cpp 13 | ) 14 | 15 | target_include_directories(RectangleBinPack 16 | PUBLIC 17 | ${CMAKE_CURRENT_SOURCE_DIR} 18 | ) 19 | 20 | add_library(RectangleBinPack::RectangleBinPack ALIAS RectangleBinPack) 21 | 22 | #add_executable(MaxRectsBinPackTest test/MaxRectsBinPackTest.cpp MaxRectsBinPack.cpp Rect.cpp) 23 | 24 | #target_include_directories(MaxRectsBinPackTest 25 | # PUBLIC 26 | # ${CMAKE_CURRENT_SOURCE_DIR} 27 | #) 28 | # 29 | -------------------------------------------------------------------------------- /src/Superluminal/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(_target "SuperluminalAPI") 2 | 3 | set(source_list 4 | PerformanceAPI.cpp 5 | PerformanceAPI.h 6 | PerformanceAPI_capi.h 7 | PerformanceAPI_loader.h 8 | ) 9 | 10 | add_library(${_target} ${source_list}) 11 | 12 | target_include_directories(${_target} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") 13 | 14 | foreach(source IN LISTS source_list) 15 | get_filename_component(source_path "${source}" PATH) 16 | string(REPLACE "/" "\\" source_path_msvc "${source_path}") 17 | source_group("${source_path_msvc}" FILES "${source}") 18 | endforeach() 19 | -------------------------------------------------------------------------------- /src/editor/.gitignore: -------------------------------------------------------------------------------- 1 | log.txt 2 | editor 3 | editor.exe 4 | net-test 5 | Debug 6 | Release 7 | RelWithDebInfo 8 | -------------------------------------------------------------------------------- /src/editor/cache/bvh/keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/editor/cache/bvh/keep -------------------------------------------------------------------------------- /src/editor/editor.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace editor { 4 | 5 | void run_editor(); 6 | 7 | } // namespace editor 8 | -------------------------------------------------------------------------------- /src/editor/editor_context.cpp: -------------------------------------------------------------------------------- 1 | #include "editor_context.hpp" 2 | 3 | namespace editor { 4 | 5 | } // namespace editor 6 | 7 | -------------------------------------------------------------------------------- /src/editor/editor_message_bus.cpp: -------------------------------------------------------------------------------- 1 | #include "editor_message_bus.hpp" 2 | 3 | namespace editor { 4 | 5 | Editor_message_bus::Editor_message_bus() = default; 6 | 7 | } // namespace editor 8 | -------------------------------------------------------------------------------- /src/editor/editor_message_bus.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "editor_message.hpp" 4 | 5 | #include "erhe_message_bus/message_bus.hpp" 6 | 7 | namespace editor { 8 | 9 | class Editor_message_bus : public erhe::message_bus::Message_bus 10 | { 11 | public: 12 | Editor_message_bus(); 13 | }; 14 | 15 | } // namespace editor 16 | -------------------------------------------------------------------------------- /src/editor/editor_view_client.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/editor/editor_view_client.cpp -------------------------------------------------------------------------------- /src/editor/editor_view_client.hpp: -------------------------------------------------------------------------------- 1 | #if 0 2 | #pragma once 3 | 4 | namespace editor 5 | { 6 | 7 | 8 | class Editor_view_client 9 | : public IUpdate_fixed_step 10 | { 11 | public: 12 | Editor_view_client(); 13 | 14 | // Implements erhe::components::IUpdate_fixed_step 15 | void update_fixed_step(const erhe::components::Time_context&) override; 16 | 17 | void update() override; 18 | }; 19 | 20 | } // namespace editor 21 | 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /src/editor/graph/add.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "graph/shader_graph_node.hpp" 4 | 5 | namespace editor { 6 | 7 | class Add : public Shader_graph_node 8 | { 9 | public: 10 | Add(); 11 | void evaluate(Shader_graph&) override; 12 | void imgui() override; 13 | }; 14 | 15 | } // namespace editor 16 | -------------------------------------------------------------------------------- /src/editor/graph/constant.cpp: -------------------------------------------------------------------------------- 1 | #include "graph/constant.hpp" 2 | #include "erhe_graph/pin.hpp" 3 | 4 | #include 5 | 6 | namespace editor { 7 | 8 | Constant::Constant() 9 | : Shader_graph_node{"Constant"} 10 | , m_payload{ 11 | .format = erhe::dataformat::Format::format_32_scalar_sint, 12 | .int_value = { 0, 0, 0, 0 }, 13 | .float_value = { 0.0f, 0.0f, 0.0f, 0.0f } 14 | } 15 | { 16 | make_output_pin(pin_key_todo, "out"); 17 | } 18 | 19 | void Constant::evaluate(Shader_graph&) 20 | { 21 | ERHE_VERIFY(get_output_pins().size() == 1); 22 | set_output(0, m_payload); 23 | } 24 | 25 | void Constant::imgui() 26 | { 27 | ImGui::SetNextItemWidth(80.0f); 28 | ImGui::InputInt("##", &m_payload.int_value[0]); 29 | } 30 | 31 | } // namespace editor 32 | -------------------------------------------------------------------------------- /src/editor/graph/constant.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "graph/shader_graph_node.hpp" 4 | 5 | namespace editor { 6 | 7 | class Constant : public Shader_graph_node 8 | { 9 | public: 10 | Constant(); 11 | 12 | void evaluate(Shader_graph&) override; 13 | void imgui () override; 14 | 15 | Payload m_payload; 16 | }; 17 | 18 | } // namespace editor 19 | -------------------------------------------------------------------------------- /src/editor/graph/divide.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "graph/shader_graph_node.hpp" 4 | 5 | namespace editor { 6 | 7 | class Divide : public Shader_graph_node 8 | { 9 | public: 10 | Divide(); 11 | 12 | void evaluate(Shader_graph&) override; 13 | void imgui () override; 14 | }; 15 | 16 | } // namespace editor 17 | -------------------------------------------------------------------------------- /src/editor/graph/load.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "graph/shader_graph_node.hpp" 4 | 5 | namespace editor { 6 | 7 | class Load : public Shader_graph_node 8 | { 9 | public: 10 | Load(); 11 | 12 | void evaluate(Shader_graph&) override; 13 | void imgui () override; 14 | 15 | private: 16 | int m_row{0}; 17 | int m_col{0}; 18 | Payload m_payload; 19 | }; 20 | 21 | } // namespace editor 22 | -------------------------------------------------------------------------------- /src/editor/graph/multiply.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "graph/shader_graph_node.hpp" 4 | 5 | namespace editor { 6 | 7 | class Multiply : public Shader_graph_node 8 | { 9 | public: 10 | Multiply(); 11 | 12 | void evaluate(Shader_graph&) override; 13 | void imgui () override; 14 | }; 15 | 16 | } // namespace editor 17 | -------------------------------------------------------------------------------- /src/editor/graph/passthrough.cpp: -------------------------------------------------------------------------------- 1 | #include "graph/passthrough.hpp" 2 | #include 3 | 4 | namespace editor { 5 | 6 | Passthrough::Passthrough() 7 | : Shader_graph_node{"Passthrough"} 8 | { 9 | make_input_pin(pin_key_todo, "in"); 10 | make_output_pin(pin_key_todo, "out"); 11 | } 12 | 13 | void Passthrough::evaluate(Shader_graph&) 14 | { 15 | const Payload& in = accumulate_input_from_links(0); 16 | set_output(0, in); 17 | } 18 | 19 | void Passthrough::imgui() 20 | { 21 | const Payload in = accumulate_input_from_links(0); 22 | const Payload out = get_output(0); 23 | ImGui::Text("%d", in.int_value[0]); // TODO Handle format 24 | } 25 | 26 | } // namespace editor 27 | -------------------------------------------------------------------------------- /src/editor/graph/passthrough.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "graph/shader_graph_node.hpp" 4 | 5 | namespace editor { 6 | 7 | class Passthrough : public Shader_graph_node 8 | { 9 | public: 10 | Passthrough(); 11 | void evaluate(Shader_graph&) override; 12 | void imgui() override; 13 | }; 14 | 15 | } // namespace editor 16 | -------------------------------------------------------------------------------- /src/editor/graph/shader_graph.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "erhe_graph/graph.hpp" 4 | 5 | namespace editor { 6 | 7 | class Sheet; 8 | 9 | class Shader_graph : public erhe::graph::Graph 10 | { 11 | public: 12 | void evaluate(Sheet* sheet); 13 | auto load (int row, int column) const -> double; 14 | void store (int row, int column, double value); 15 | 16 | private: 17 | Sheet* m_sheet{nullptr}; 18 | }; 19 | 20 | } // namespace editor 21 | -------------------------------------------------------------------------------- /src/editor/graph/store.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "graph/shader_graph_node.hpp" 4 | 5 | namespace editor { 6 | 7 | class Store : public Shader_graph_node 8 | { 9 | public: 10 | Store(); 11 | 12 | void evaluate(Shader_graph& graph) override; 13 | void imgui () override; 14 | 15 | private: 16 | int m_row{0}; 17 | int m_col{0}; 18 | Payload m_payload; 19 | }; 20 | 21 | } // namespace editor 22 | -------------------------------------------------------------------------------- /src/editor/graph/subtract.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "graph/shader_graph_node.hpp" 4 | 5 | namespace editor { 6 | 7 | class Subtract : public Shader_graph_node 8 | { 9 | public: 10 | Subtract(); 11 | 12 | void evaluate(Shader_graph&) override; 13 | void imgui () override; 14 | }; 15 | 16 | } // namespace editor 17 | -------------------------------------------------------------------------------- /src/editor/graphics/shader_texture.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace erhe::graphics { 6 | class Texture; 7 | } 8 | 9 | namespace editor { 10 | 11 | class Image_transfer; 12 | 13 | class Textures 14 | { 15 | public: 16 | Textures(); 17 | 18 | [[nodiscard]] auto load(const std::filesystem::path& path) -> std::shared_ptr; 19 | 20 | std::shared_ptr background; 21 | 22 | private: 23 | std::shared_ptr m_image_transfer; 24 | }; 25 | 26 | } // namespace editor 27 | -------------------------------------------------------------------------------- /src/editor/graphics/textures.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace erhe::graphics { 6 | class Texture; 7 | } 8 | 9 | namespace editor { 10 | 11 | class Textures 12 | { 13 | public: 14 | Textures (); 15 | ~Textures() noexcept override; 16 | 17 | // Public API 18 | [[nodiscard]] auto load(const std::filesystem::path& path) -> std::shared_ptr; 19 | 20 | std::shared_ptr background; 21 | }; 22 | 23 | } // namespace editor 24 | -------------------------------------------------------------------------------- /src/editor/graphics_presets.ini: -------------------------------------------------------------------------------- 1 | [low graphics preset] 2 | name=Low Graphics Preset 3 | msaa_sample_count=4 4 | shadow_enable=true 5 | shadow_resolution=3072 6 | shadow_light_count=5 7 | [high graphics preset] 8 | name=High Graphics Preset 9 | msaa_sample_count=8 10 | shadow_enable=true 11 | shadow_resolution=4096 12 | shadow_light_count=5 -------------------------------------------------------------------------------- /src/editor/input_state.cpp: -------------------------------------------------------------------------------- 1 | #include "input_state.hpp" 2 | -------------------------------------------------------------------------------- /src/editor/input_state.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "erhe_window/window_event_handler.hpp" 4 | 5 | #include 6 | 7 | namespace editor { 8 | 9 | class Input_state 10 | { 11 | public: 12 | bool mouse_button[static_cast(erhe::window::Mouse_button_count)]{}; 13 | glm::vec2 mouse_position{0.0f, 0.0f}; 14 | bool shift {false}; 15 | bool control{false}; 16 | bool alt {false}; 17 | }; 18 | 19 | } // namespace editor 20 | -------------------------------------------------------------------------------- /src/editor/main.cpp: -------------------------------------------------------------------------------- 1 | #include "editor.hpp" 2 | 3 | auto main(int, char**) -> int 4 | { 5 | editor::run_editor(); 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /src/editor/operations/ioperation.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "erhe_item/unique_id.hpp" 4 | 5 | #include 6 | 7 | namespace editor { 8 | 9 | class Editor_context; 10 | 11 | class Operation 12 | { 13 | public: 14 | virtual ~Operation() noexcept; 15 | 16 | virtual void execute (Editor_context& context) = 0; 17 | virtual void undo (Editor_context& context) = 0; 18 | virtual auto describe() const -> std::string = 0; 19 | 20 | [[nodiscard]] inline auto get_serial() const -> std::size_t { return m_id.get_id(); } 21 | 22 | private: 23 | erhe::Unique_id m_id{}; 24 | }; 25 | 26 | } // namespace editor 27 | -------------------------------------------------------------------------------- /src/editor/parsers/geogram.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace erhe::primitive { 6 | class Build_info; 7 | } 8 | 9 | namespace editor { 10 | 11 | class Scene_root; 12 | 13 | void import_geogram( 14 | erhe::primitive::Build_info build_info, 15 | Scene_root& scene_root, 16 | const std::filesystem::path& path 17 | ); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/editor/parsers/gltf.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace erhe::graphics { 8 | class Instance; 9 | } 10 | namespace erhe::gltf { 11 | class Image_transfer; 12 | } 13 | namespace erhe::primitive { 14 | class Build_info; 15 | } 16 | 17 | namespace editor { 18 | 19 | class Materials; 20 | class Scene_root; 21 | 22 | void import_gltf( 23 | erhe::graphics::Instance& graphics_instance, 24 | erhe::primitive::Build_info build_info, 25 | Scene_root& scene_root, 26 | const std::filesystem::path& path 27 | ); 28 | 29 | [[nodiscard]] auto scan_gltf(const std::filesystem::path& path) -> std::vector; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/editor/parsers/wavefront_obj.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace erhe::geometry { class Geometry; } 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | namespace editor { 10 | 11 | [[nodiscard]] auto parse_obj_geometry(const std::filesystem::path& path) -> std::vector>; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/editor/renderable.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace editor { 4 | 5 | class Render_context; 6 | 7 | class Renderable 8 | { 9 | public: 10 | virtual ~Renderable() noexcept = default; 11 | 12 | virtual void render(const Render_context& context) = 0; 13 | }; 14 | 15 | } // namespace editor 16 | -------------------------------------------------------------------------------- /src/editor/rendergraph/basic_scene_view_nodes.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "erhe_rendergraph/rendergraph_node.hpp" 4 | 5 | #include 6 | 7 | namespace editor 8 | { 9 | 10 | class Basic_viewport_window; 11 | 12 | class Basic_viewport_windows 13 | : public erhe::rendergraph::Rendergraph_node 14 | { 15 | public: 16 | Basic_viewport_windows(); 17 | 18 | private: 19 | std::vector> m_viewport_windows; 20 | }; 21 | 22 | } // namespace editor 23 | -------------------------------------------------------------------------------- /src/editor/res/.gitignore: -------------------------------------------------------------------------------- 1 | assets/* 2 | !/assets/RiggedFigure/ 3 | !/assets/SM_Deccer_Cubes_Textured.glb 4 | -------------------------------------------------------------------------------- /src/editor/res/assets/RiggedFigure/LICENSE.md: -------------------------------------------------------------------------------- 1 | # Rigged Figure 2 | 3 | This model is licensed under a [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/). 4 | -------------------------------------------------------------------------------- /src/editor/res/assets/RiggedFigure/RiggedFigure.glb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/editor/res/assets/RiggedFigure/RiggedFigure.glb -------------------------------------------------------------------------------- /src/editor/res/assets/SM_Deccer_Cubes_Textured.glb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/editor/res/assets/SM_Deccer_Cubes_Textured.glb -------------------------------------------------------------------------------- /src/editor/res/fonts/SourceCodePro-Semibold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/editor/res/fonts/SourceCodePro-Semibold.otf -------------------------------------------------------------------------------- /src/editor/res/fonts/SourceSansPro-Regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/editor/res/fonts/SourceSansPro-Regular.otf -------------------------------------------------------------------------------- /src/editor/res/icons/anim.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/editor/res/icons/armature_data.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/editor/res/icons/bone_data.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/editor/res/icons/curve_path.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/editor/res/icons/file.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/editor/res/icons/filebrowser.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/editor/res/icons/grid.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/editor/res/icons/headset.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/editor/res/icons/hud.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/editor/res/icons/material.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/editor/res/icons/mesh_cone.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/editor/res/icons/mesh_cube.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/editor/res/icons/mouse_lmb.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/editor/res/icons/mouse_lmb_drag.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/editor/res/icons/mouse_mmb.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/editor/res/icons/mouse_mmb_drag.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/editor/res/icons/mouse_rmb.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/editor/res/icons/mouse_rmb_drag.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/editor/res/icons/physics.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/editor/res/icons/scene.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/editor/res/icons/select.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/editor/res/icons/texture.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/editor/res/images/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/editor/res/images/background.png -------------------------------------------------------------------------------- /src/editor/res/images/gl16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/editor/res/images/gl16.png -------------------------------------------------------------------------------- /src/editor/res/images/gl16w.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/editor/res/images/gl16w.png -------------------------------------------------------------------------------- /src/editor/res/images/gl32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/editor/res/images/gl32.png -------------------------------------------------------------------------------- /src/editor/res/images/gl32w.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/editor/res/images/gl32w.png -------------------------------------------------------------------------------- /src/editor/res/images/gl48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/editor/res/images/gl48.png -------------------------------------------------------------------------------- /src/editor/res/images/gl48w.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/editor/res/images/gl48w.png -------------------------------------------------------------------------------- /src/editor/res/models/SM_Deccer_Cubes.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/editor/res/models/SM_Deccer_Cubes.bin -------------------------------------------------------------------------------- /src/editor/res/models/spoon.mtl: -------------------------------------------------------------------------------- 1 | newmtl FrontColor 2 | Ka 0.000000 0.000000 0.000000 3 | Kd 1.000000 1.000000 1.000000 4 | Ks 0.330000 0.330000 0.330000 -------------------------------------------------------------------------------- /src/editor/res/models/teacup.mtl: -------------------------------------------------------------------------------- 1 | newmtl FrontColor 2 | Ka 0.000000 0.000000 0.000000 3 | Kd 1.000000 1.000000 1.000000 4 | Ks 0.330000 0.330000 0.330000 5 | -------------------------------------------------------------------------------- /src/editor/res/models/teapot.mtl: -------------------------------------------------------------------------------- 1 | newmtl FrontColor 2 | Ka 0.000000 0.000000 0.000000 3 | Kd 1.000000 1.000000 1.000000 4 | Ks 0.330000 0.330000 0.330000 5 | -------------------------------------------------------------------------------- /src/editor/res/polyhedra/70: -------------------------------------------------------------------------------- 1 | :name 2 | gyrobifastigium (J26) 3 | :number 4 | 70 5 | :comment 6 | Modified by George W. Hart, Jan. 1996 to fix solid and vertices 7 | :symbol 8 | @gQ sub 2 @ 9 | :sfaces 10 | 8 4{3} 4{4} 11 | :svertices 12 | 8 4(@3@.@4 sup 2@) 4(@3@.@4@.@3@.@4@) 13 | :solid 14 | 8 4 15 | 4 0 4 5 3 16 | 4 2 5 4 1 17 | 4 0 6 7 1 18 | 4 2 7 6 3 19 | 3 4 0 1 20 | 3 5 2 3 21 | 3 6 0 3 22 | 3 7 2 1 23 | :vertices 24 | 8 0 25 | -.5 .5 0 26 | .5 .5 0 27 | .5 -.5 0 28 | -.5 -.5 0 29 | 0 .5 0.8660254 30 | 0 -.5 0.8660254 31 | -.5 0 -0.8660254 32 | .5 0 -0.8660254 33 | :EOF 34 | -------------------------------------------------------------------------------- /src/editor/res/shaders/edge_lines.frag: -------------------------------------------------------------------------------- 1 | layout(location = 0) in vec3 v_position; 2 | layout(location = 1) in flat uint v_material_index; 3 | 4 | void main() 5 | { 6 | vec3 view_position_in_world = vec3( 7 | camera.cameras[0].world_from_node[3][0], 8 | camera.cameras[0].world_from_node[3][1], 9 | camera.cameras[0].world_from_node[3][2] 10 | ); 11 | float d = distance(view_position_in_world, v_position); 12 | 13 | vec4 base_color = material.materials[v_material_index].base_color; 14 | //out_color.rgb = vec3(0.0, 0.0, 1.0); 15 | //out_color.a = 1.0; 16 | float thickness = 6.0; 17 | float distance_scale = min(thickness / d, 1.0); 18 | float alpha = distance_scale; 19 | out_color.rgb = vec3(0.01, 0.05, 0.1) * alpha; 20 | out_color.a = alpha; 21 | } 22 | -------------------------------------------------------------------------------- /src/editor/res/shaders/edge_lines.vert: -------------------------------------------------------------------------------- 1 | layout(location = 0) out vec3 v_position; 2 | layout(location = 1) out flat uint v_material_index; 3 | 4 | void main() 5 | { 6 | mat4 world_from_node = primitive.primitives[gl_DrawID].world_from_node; 7 | mat4 clip_from_world = camera.cameras[0].clip_from_world; 8 | vec4 position = world_from_node * vec4(a_position, 1.0); 9 | v_position = position.xyz; 10 | gl_Position = clip_from_world * position; 11 | v_material_index = primitive.primitives[gl_DrawID].material_index; 12 | } 13 | -------------------------------------------------------------------------------- /src/editor/res/shaders/erhe_math.glsl: -------------------------------------------------------------------------------- 1 | #ifndef ERHE_MATH_GLSL 2 | #define ERHE_MATH_GLSL 3 | 4 | const float m_pi = 3.1415926535897932384626434; 5 | const float m_i_pi = 0.3183098861837906715377675; 6 | 7 | float clamped_dot(vec3 x, vec3 y) { 8 | return clamp(dot(x, y), 0.001, 1.0); 9 | } 10 | 11 | float heaviside(float v) { 12 | if (v > 0.0) { 13 | return 1.0; 14 | } else { 15 | return 0.0; 16 | } 17 | } 18 | 19 | #endif // ERHE_MATH_GLSL 20 | -------------------------------------------------------------------------------- /src/editor/res/shaders/erhe_srgb.glsl: -------------------------------------------------------------------------------- 1 | #ifndef ERHE_SRGB_GLSL 2 | #define ERHE_SRGB_GLSL 3 | 4 | float srgb_to_linear(float x) { 5 | if (x <= 0.04045) { 6 | return x / 12.92; 7 | } else { 8 | return pow((x + 0.055) / 1.055, 2.4); 9 | } 10 | } 11 | 12 | vec3 srgb_to_linear(vec3 v) { 13 | return vec3( 14 | srgb_to_linear(v.x), 15 | srgb_to_linear(v.y), 16 | srgb_to_linear(v.z) 17 | ); 18 | } 19 | 20 | vec2 srgb_to_linear(vec2 v) { 21 | return vec2(srgb_to_linear(v.r), srgb_to_linear(v.g)); 22 | } 23 | 24 | #endif // ERHE_SRGB_GLSL 25 | -------------------------------------------------------------------------------- /src/editor/res/shaders/error.frag: -------------------------------------------------------------------------------- 1 | void main() 2 | { 3 | out_color.rgba = vec4(1.0, 0.0, 1.0, 1.0); 4 | } 5 | -------------------------------------------------------------------------------- /src/editor/res/shaders/id.frag: -------------------------------------------------------------------------------- 1 | layout(location = 0) in flat vec3 v_id; 2 | 3 | void main(void) 4 | { 5 | out_color = vec4(v_id, 1.0); 6 | //out_color = vec4(1.0, 1.0, 0.0, 1.0); 7 | } 8 | -------------------------------------------------------------------------------- /src/editor/res/shaders/id.vert: -------------------------------------------------------------------------------- 1 | #define a_id a_custom 2 | 3 | layout(location = 0) out flat vec3 v_id; 4 | 5 | void main() 6 | { 7 | mat4 world_from_node = primitive.primitives[gl_DrawID].world_from_node; 8 | mat4 clip_from_world = camera.cameras[0].clip_from_world; 9 | vec4 position_in_world = world_from_node * vec4(a_position, 1.0); 10 | gl_Position = clip_from_world * position_in_world; 11 | //// TODO 12 | ////v_id = a_id.rgb + primitive.primitives[gl_DrawID].color.xyz; 13 | } 14 | 15 | -------------------------------------------------------------------------------- /src/editor/res/shaders/line_after_compute.vert: -------------------------------------------------------------------------------- 1 | layout(location = 0) out float v_line_width; 2 | layout(location = 1) out vec4 v_color; 3 | layout(location = 2) out vec4 v_start_end; 4 | 5 | void main() 6 | { 7 | gl_Position = vec4(a_position.xyz, 1.0); 8 | v_line_width = a_position.w; 9 | v_color = a_color_0; 10 | v_start_end = a_custom_0; 11 | } 12 | -------------------------------------------------------------------------------- /src/editor/res/shaders/points.frag: -------------------------------------------------------------------------------- 1 | layout(location = 0) in vec3 v_normal; 2 | layout(location = 1) in vec4 v_color; 3 | 4 | void main() { 5 | 6 | //out_color.rgb = 0.5 * v_normal + vec3(0.5); 7 | //out_color.a = 1.0; 8 | out_color = v_color;; 9 | } 10 | -------------------------------------------------------------------------------- /src/editor/res/shaders/textured.vert: -------------------------------------------------------------------------------- 1 | layout(location = 0) out vec2 v_texcoord; 2 | layout(location = 1) out flat uvec2 v_texture; 3 | 4 | void main() 5 | { 6 | mat4 world_from_node = primitive.primitives[gl_DrawID].world_from_node; 7 | mat4 clip_from_world = camera.cameras[0].clip_from_world; 8 | uint material_index = primitive.primitives[gl_DrawID].material_index; 9 | 10 | vec4 position = world_from_node * vec4(a_position, 1.0); 11 | gl_Position = clip_from_world * position; 12 | v_texture = material.materials[material_index].base_color_texture; 13 | v_texcoord = a_texcoord_0; 14 | } 15 | -------------------------------------------------------------------------------- /src/editor/res/shaders/tile.frag: -------------------------------------------------------------------------------- 1 | layout(location = 0) in vec2 v_texcoord; 2 | layout(location = 1) in vec4 v_color; 3 | layout(location = 2) in flat uvec2 v_texture; 4 | 5 | void main(void) 6 | { 7 | sampler2D s_texture = sampler2D(v_texture); 8 | vec4 t_color = texture(s_texture, v_texcoord); 9 | 10 | out_color = v_color * t_color; 11 | } 12 | -------------------------------------------------------------------------------- /src/editor/res/shaders/tile.vert: -------------------------------------------------------------------------------- 1 | layout(location = 0) out vec2 v_texcoord; 2 | layout(location = 1) out vec4 v_color; 3 | layout(location = 2) out flat uvec2 v_texture; 4 | 5 | void main() 6 | { 7 | gl_Position = projection.clip_from_window * vec4(a_position, 1.0); 8 | v_texture = projection.texture; 9 | v_texcoord = a_texcoord_0; 10 | v_color = a_color_0; 11 | } 12 | 13 | -------------------------------------------------------------------------------- /src/editor/res/shaders/tool.vert: -------------------------------------------------------------------------------- 1 | layout(location = 0) out vec3 v_position; 2 | layout(location = 1) out vec3 v_normal; 3 | layout(location = 2) out flat uint v_material_index; 4 | 5 | void main() 6 | { 7 | mat4 world_from_node = primitive.primitives[gl_DrawID].world_from_node; 8 | mat4 world_from_node_normal = primitive.primitives[gl_DrawID].world_from_node_normal; 9 | mat4 clip_from_world = camera.cameras[0].clip_from_world; 10 | vec4 position = world_from_node * vec4(a_position, 1.0); 11 | 12 | v_position = position.xyz; 13 | v_normal = normalize(vec3(world_from_node_normal * vec4(a_normal, 0.0))); 14 | gl_Position = clip_from_world * position; 15 | v_material_index = primitive.primitives[gl_DrawID].material_index; 16 | } 17 | -------------------------------------------------------------------------------- /src/editor/scene/collision_generator.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace erhe::geometry { 7 | class Geometry; 8 | }; 9 | 10 | namespace erhe::physics { 11 | class ICollision_shape; 12 | }; 13 | 14 | namespace editor { 15 | 16 | using Collision_shape_generator = std::function(float)>; 17 | using Collision_volume_calculator = std::function; 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/editor/scene/material_library.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace editor { 4 | 5 | class Content_library; 6 | 7 | void add_default_materials(Content_library& library); 8 | 9 | } // namespace editor 10 | -------------------------------------------------------------------------------- /src/editor/scene/node_raytrace_mask.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace editor 6 | { 7 | 8 | class Raytrace_node_mask 9 | { 10 | public: 11 | static constexpr uint32_t none = 0u; 12 | static constexpr uint32_t content = (1u << 0); 13 | static constexpr uint32_t shadow_cast = (1u << 1); 14 | static constexpr uint32_t tool = (1u << 2); 15 | static constexpr uint32_t brush = (1u << 3); 16 | static constexpr uint32_t rendertarget = (1u << 4); 17 | static constexpr uint32_t controller = (1u << 5); 18 | static constexpr uint32_t grid = (1u << 6); 19 | }; 20 | 21 | } // namespace editor 22 | -------------------------------------------------------------------------------- /src/editor/settings.ini: -------------------------------------------------------------------------------- 1 | [graphics] 2 | preset=High Graphics Preset 3 | [imgui] 4 | primary_font=res/fonts/SourceSansPro-Regular.otf 5 | mono_font=res/fonts/SourceCodePro-Semibold.otf 6 | font_size=24 7 | vr_font_size=24 8 | [icons] 9 | small_icon_size=22 10 | large_icon_size=32 11 | hotbar_icon_size=128 -------------------------------------------------------------------------------- /src/editor/task_queue.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/editor/task_queue.cpp -------------------------------------------------------------------------------- /src/editor/task_queue.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/editor/task_queue.hpp -------------------------------------------------------------------------------- /src/editor/tools/brushes/brush_palette.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "erhe_imgui/imgui_window.hpp" 4 | 5 | #include 6 | 7 | #include 8 | 9 | namespace editor 10 | { 11 | 12 | class Brushes; 13 | 14 | class Brush_palette 15 | : public erhe::imgui::Imgui_window 16 | { 17 | public: 18 | static constexpr std::string_view c_title{"Brush Palette"}; 19 | 20 | Brush_palette(); 21 | 22 | // Implements Imgui_window 23 | void imgui() override; 24 | 25 | private: 26 | std::shared_ptr m_brushes; 27 | int m_selected_brush_index{0}; 28 | }; 29 | 30 | } // namespace editor 31 | -------------------------------------------------------------------------------- /src/editor/tools/brushes/create/create_box.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "tools/brushes/create/create_shape.hpp" 4 | 5 | #include 6 | 7 | namespace editor { 8 | 9 | class Brush; 10 | class Brush_data; 11 | 12 | class Create_box : public Create_shape 13 | { 14 | public: 15 | void render_preview(const Create_preview_settings& preview_settings) override; 16 | 17 | void imgui() override; 18 | 19 | auto create(Brush_data& brush_create_info) const -> std::shared_ptr override; 20 | 21 | private: 22 | glm::vec3 m_size {1.0f, 1.0f, 1.0f}; 23 | glm::ivec3 m_steps{3, 3, 3}; 24 | float m_power{1.0f}; 25 | }; 26 | 27 | } // namespace editor 28 | -------------------------------------------------------------------------------- /src/editor/tools/brushes/create/create_cone.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "tools/brushes/create/create_shape.hpp" 4 | 5 | namespace editor { 6 | 7 | class Create_cone : public Create_shape 8 | { 9 | public: 10 | void render_preview(const Create_preview_settings& preview_settings) override; 11 | 12 | void imgui() override; 13 | 14 | auto create(Brush_data& brush_create_info) const -> std::shared_ptr override; 15 | 16 | private: 17 | int m_slice_count {32}; 18 | int m_stack_count {1}; 19 | float m_height {1.33f}; 20 | float m_bottom_radius{1.0f}; 21 | float m_top_radius {0.5f}; 22 | bool m_use_top {true}; 23 | bool m_use_bottom {true}; 24 | }; 25 | 26 | 27 | } // namespace editor 28 | -------------------------------------------------------------------------------- /src/editor/tools/brushes/create/create_preview_settings.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace erhe::scene { 6 | class Transform; 7 | } 8 | 9 | namespace editor { 10 | 11 | class Render_context; 12 | 13 | class Create_preview_settings 14 | { 15 | public: 16 | const Render_context& render_context; 17 | const erhe::scene::Transform& transform; 18 | glm::vec4 major_color {1.0f, 1.0f, 1.0f, 1.0f}; 19 | glm::vec4 minor_color {1.0f, 1.0f, 1.0f, 0.5f}; 20 | const float major_thickness{6.0f}; 21 | const float minor_thickness{3.0f}; 22 | bool ideal_shape {false}; 23 | }; 24 | 25 | } // namespace editor 26 | -------------------------------------------------------------------------------- /src/editor/tools/brushes/create/create_shape.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace erhe::renderer { 6 | class Primitive_renderer; 7 | } 8 | 9 | namespace editor { 10 | 11 | class Create_preview_settings; 12 | class Brush; 13 | class Brush_data; 14 | 15 | class Create_shape 16 | { 17 | public: 18 | virtual void render_preview(const Create_preview_settings& preview_settings) = 0; 19 | virtual void imgui() = 0; 20 | [[nodiscard]] virtual auto create(Brush_data& brush_create_info) const -> std::shared_ptr = 0; 21 | 22 | auto get_line_renderer(const Create_preview_settings& preview_settings) -> erhe::renderer::Primitive_renderer; 23 | }; 24 | 25 | } // namespace editor 26 | -------------------------------------------------------------------------------- /src/editor/tools/brushes/create/create_uv_sphere.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "tools/brushes/create/create_shape.hpp" 4 | 5 | namespace editor { 6 | 7 | class Create_uv_sphere : public Create_shape 8 | { 9 | public: 10 | void render_preview(const Create_preview_settings& preview_settings) override; 11 | 12 | void imgui() override; 13 | 14 | auto create(Brush_data& brush_create_info) const -> std::shared_ptr override; 15 | 16 | private: 17 | int m_slice_count{8}; 18 | int m_stack_count{8}; 19 | float m_radius {1.0f}; 20 | }; 21 | 22 | } // namespace editor 23 | -------------------------------------------------------------------------------- /src/editor/tools/transform/transform_tool_settings.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/editor/tools/transform/transform_tool_settings.cpp -------------------------------------------------------------------------------- /src/editor/tools/transform/transform_tool_settings.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace editor { 4 | 5 | class Transform_tool_settings 6 | { 7 | public: 8 | bool cast_rays {false}; 9 | bool show_translate {true}; 10 | bool show_rotate {false}; 11 | bool show_scale {false}; 12 | bool hide_inactive {true}; 13 | bool local {false}; 14 | bool translate_snap_enable{false}; 15 | float translate_snap {0.1f}; 16 | bool rotate_snap_enable {true}; 17 | float rotate_snap {15.0f}; 18 | }; 19 | 20 | } // namespace editor 21 | -------------------------------------------------------------------------------- /src/editor/windows/animation_curve.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace erhe::scene { 4 | class Animation; 5 | } 6 | 7 | namespace editor { 8 | 9 | void animation_curve(erhe::scene::Animation& animation); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/editor/windows/animation_window.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/editor/windows/animation_window.cpp -------------------------------------------------------------------------------- /src/editor/windows/animation_window.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/editor/windows/animation_window.hpp -------------------------------------------------------------------------------- /src/editor/windows/clipboard_window.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "erhe_imgui/imgui_window.hpp" 4 | 5 | namespace erhe::imgui { 6 | class Imgui_windows; 7 | } 8 | 9 | namespace editor { 10 | 11 | class Editor_context; 12 | 13 | class Clipboard_window : public erhe::imgui::Imgui_window 14 | { 15 | public: 16 | Clipboard_window( 17 | erhe::imgui::Imgui_renderer& imgui_renderer, 18 | erhe::imgui::Imgui_windows& imgui_windows, 19 | Editor_context& editor 20 | ); 21 | 22 | // Implements Imgui_window 23 | void imgui() override; 24 | 25 | private: 26 | Editor_context& m_context; 27 | }; 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/editor/windows/composer_window.cpp: -------------------------------------------------------------------------------- 1 | #include "windows/composer_window.hpp" 2 | 3 | #include "editor_context.hpp" 4 | #include "editor_rendering.hpp" 5 | #include "erhe_imgui/imgui_host.hpp" 6 | #include "erhe_imgui/imgui_windows.hpp" 7 | 8 | namespace editor { 9 | 10 | Composer_window::Composer_window(erhe::imgui::Imgui_renderer& imgui_renderer, erhe::imgui::Imgui_windows& imgui_windows, Editor_context& editor_context) 11 | : erhe::imgui::Imgui_window{imgui_renderer, imgui_windows, "Composer", "composer"} 12 | , m_context {editor_context} 13 | { 14 | } 15 | 16 | void Composer_window::imgui() 17 | { 18 | m_context.editor_rendering->imgui(); 19 | } 20 | 21 | } // namespace editor -------------------------------------------------------------------------------- /src/editor/windows/composer_window.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "erhe_imgui/imgui_window.hpp" 4 | 5 | namespace erhe::imgui { 6 | class Imgui_windows; 7 | } 8 | 9 | namespace editor { 10 | 11 | class Editor_context; 12 | 13 | class Composer_window : public erhe::imgui::Imgui_window 14 | { 15 | public: 16 | Composer_window( 17 | erhe::imgui::Imgui_renderer& imgui_renderer, 18 | erhe::imgui::Imgui_windows& imgui_windows, 19 | Editor_context& editor 20 | ); 21 | 22 | // Implements Imgui_window 23 | void imgui() override; 24 | 25 | private: 26 | Editor_context& m_context; 27 | }; 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/editor/windows/content_library_window.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/editor/windows/content_library_window.cpp -------------------------------------------------------------------------------- /src/editor/windows/content_library_window.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/editor/windows/content_library_window.hpp -------------------------------------------------------------------------------- /src/editor/windows/gradient_editor.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "erhe_imgui/imgui_window.hpp" 4 | 5 | #include 6 | 7 | namespace erhe::imgui { class Imgui_windows; } 8 | namespace ImGG { class GradientWidget; } 9 | 10 | namespace editor { 11 | 12 | class Editor_context; 13 | 14 | class Gradient_editor : public erhe::imgui::Imgui_window 15 | { 16 | public: 17 | Gradient_editor( 18 | erhe::imgui::Imgui_renderer& imgui_renderer, 19 | erhe::imgui::Imgui_windows& imgui_windows 20 | ); 21 | ~Gradient_editor(); 22 | 23 | // Implements Imgui_window 24 | void imgui() override; 25 | 26 | private: 27 | std::unique_ptr m_gradient_widget; 28 | }; 29 | 30 | } // namespace editor 31 | -------------------------------------------------------------------------------- /src/editor/windows/icon_browser.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "erhe_imgui/imgui_window.hpp" 4 | 5 | #include 6 | 7 | namespace erhe::imgui { 8 | class Imgui_windows; 9 | } 10 | 11 | namespace editor { 12 | 13 | class Editor_context; 14 | 15 | class Icon_browser : public erhe::imgui::Imgui_window 16 | { 17 | public: 18 | Icon_browser( 19 | erhe::imgui::Imgui_renderer& imgui_renderer, 20 | erhe::imgui::Imgui_windows& imgui_windows, 21 | Editor_context& context 22 | ); 23 | 24 | // Implements Imgui_window 25 | void imgui() override; 26 | 27 | private: 28 | Editor_context& m_context; 29 | ImGuiTextFilter m_name_filter; 30 | }; 31 | 32 | } // namespace editor 33 | -------------------------------------------------------------------------------- /src/editor/windows/layers_window.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "erhe_imgui/imgui_window.hpp" 4 | 5 | namespace erhe::imgui { 6 | class Imgui_windows; 7 | } 8 | 9 | namespace editor { 10 | 11 | class Editor_context; 12 | 13 | class Layers_window : public erhe::imgui::Imgui_window 14 | { 15 | public: 16 | Layers_window(erhe::imgui::Imgui_renderer& imgui_renderer, erhe::imgui::Imgui_windows& imgui_windows, Editor_context& editor_context); 17 | 18 | // Implements Imgui_window 19 | void imgui() override; 20 | 21 | private: 22 | Editor_context& m_context; 23 | }; 24 | 25 | } // namespace editor 26 | -------------------------------------------------------------------------------- /src/editor/windows/render_graph_window.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "erhe_imgui/imgui_window.hpp" 4 | 5 | #include 6 | 7 | namespace erhe::application 8 | { 9 | class Rendergraph; 10 | } 11 | 12 | namespace editor 13 | { 14 | 15 | class Editor_scenes; 16 | 17 | class Rendergraph_window 18 | : public erhe::imgui::Imgui_window 19 | { 20 | public: 21 | static constexpr std::string_view c_title{"Render Graph"}; 22 | 23 | Rendergraph_window(); 24 | 25 | // Implements Imgui_window 26 | void imgui() override; 27 | 28 | private: 29 | Editor_scenes& m_editor_scenes; 30 | erhe::rendergraph::Rendergraph& m_render_graph; 31 | }; 32 | 33 | } // namespace editor 34 | -------------------------------------------------------------------------------- /src/editor/windows/selection_window.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "erhe_imgui/imgui_window.hpp" 4 | 5 | namespace erhe::imgui { 6 | class Imgui_windows; 7 | } 8 | 9 | namespace editor { 10 | 11 | class Editor_context; 12 | 13 | class Selection_window : public erhe::imgui::Imgui_window 14 | { 15 | public: 16 | Selection_window( 17 | erhe::imgui::Imgui_renderer& imgui_renderer, 18 | erhe::imgui::Imgui_windows& imgui_windows, 19 | Editor_context& editor 20 | ); 21 | 22 | // Implements Imgui_window 23 | void imgui() override; 24 | 25 | private: 26 | Editor_context& m_context; 27 | }; 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/editor/windows/tool_properties_window.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "erhe_imgui/imgui_window.hpp" 4 | 5 | namespace erhe::imgui { 6 | class Imgui_windows; 7 | } 8 | 9 | namespace editor { 10 | 11 | class Editor_context; 12 | 13 | class Tool_properties_window : public erhe::imgui::Imgui_window 14 | { 15 | public: 16 | Tool_properties_window( 17 | erhe::imgui::Imgui_renderer& imgui_renderer, 18 | erhe::imgui::Imgui_windows& imgui_windows, 19 | Editor_context& editor_context 20 | ); 21 | 22 | // Implements erhe::applications::Imgui_window 23 | void imgui() override; 24 | 25 | private: 26 | Editor_context& m_context; 27 | }; 28 | 29 | } // namespace editor 30 | -------------------------------------------------------------------------------- /src/erhe/bit/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(_target "erhe_bit") 2 | add_library(${_target}) 3 | add_library(erhe::bit ALIAS ${_target}) 4 | 5 | erhe_target_sources_grouped( 6 | ${_target} TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES 7 | erhe_bit/bit_helpers.cpp 8 | erhe_bit/bit_helpers.hpp 9 | ) 10 | 11 | target_include_directories(${_target} INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) 12 | 13 | erhe_target_settings(${_target} "erhe") 14 | -------------------------------------------------------------------------------- /src/erhe/bit/erhe_bit/bit_helpers.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/erhe/bit/erhe_bit/bit_helpers.cpp -------------------------------------------------------------------------------- /src/erhe/bit/erhe_bit/bit_helpers.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace erhe::bit { 4 | 5 | template 6 | auto test_all_rhs_bits_set(T lhs, T rhs) -> bool 7 | { 8 | return (lhs & rhs) == rhs; 9 | } 10 | 11 | template 12 | auto test_any_rhs_bits_set(T lhs, T rhs) -> bool 13 | { 14 | return (lhs & rhs) != T{0}; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/erhe/buffer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(_target "erhe_buffer") 2 | add_library(${_target}) 3 | add_library(erhe::buffer ALIAS ${_target}) 4 | 5 | erhe_target_sources_grouped( 6 | ${_target} TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES 7 | erhe_buffer/ibuffer.hpp 8 | erhe_buffer/ibuffer.cpp 9 | ) 10 | 11 | target_include_directories(${_target} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 12 | 13 | target_link_libraries(${_target} 14 | PRIVATE 15 | erhe::profile 16 | erhe::verify 17 | ) 18 | 19 | erhe_target_settings(${_target} "erhe") 20 | -------------------------------------------------------------------------------- /src/erhe/commands/erhe_commands/commands_log.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | namespace erhe::commands { 8 | 9 | extern std::shared_ptr log_command_state_transition; 10 | extern std::shared_ptr log_input; 11 | extern std::shared_ptr log_input_event; 12 | extern std::shared_ptr log_input_event_consumed; 13 | extern std::shared_ptr log_input_event_filtered; 14 | extern std::shared_ptr log_input_events; 15 | extern std::shared_ptr log_input_frame; 16 | 17 | void initialize_logging(); 18 | 19 | } // namespace namespace erhe::commands 20 | -------------------------------------------------------------------------------- /src/erhe/commands/erhe_commands/input_arguments.cpp: -------------------------------------------------------------------------------- 1 | #include "erhe_commands/input_arguments.hpp" 2 | 3 | namespace erhe::commands 4 | { 5 | 6 | } // namespace erhe::commands 7 | 8 | -------------------------------------------------------------------------------- /src/erhe/commands/erhe_commands/input_arguments.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | namespace erhe::commands { 9 | 10 | struct Input_arguments 11 | { 12 | uint32_t modifier_mask; 13 | int64_t timestamp_ns; 14 | 15 | union Variant { 16 | bool button_pressed; 17 | 18 | float float_value; 19 | 20 | struct Vector2 { 21 | glm::vec2 absolute_value; 22 | glm::vec2 relative_value; 23 | } vector2; 24 | 25 | struct Pose { 26 | glm::quat orientation; 27 | glm::vec3 position; 28 | } pose; 29 | } variant; 30 | }; 31 | 32 | } // namespace erhe::commands 33 | -------------------------------------------------------------------------------- /src/erhe/commands/erhe_commands/menu_binding.cpp: -------------------------------------------------------------------------------- 1 | #include "erhe_commands/menu_binding.hpp" 2 | #include "erhe_commands/command.hpp" 3 | 4 | namespace erhe::commands { 5 | 6 | Menu_binding::Menu_binding(Command* const command, std::string_view menu_path, std::function enabled_callback) 7 | : Command_binding{command} 8 | , m_menu_path{menu_path} 9 | , m_enabled_callback{enabled_callback} 10 | { 11 | } 12 | 13 | Menu_binding::Menu_binding() = default; 14 | 15 | auto Menu_binding::get_menu_path() const -> const std::string& 16 | { 17 | return m_menu_path; 18 | } 19 | 20 | auto Menu_binding::get_enabled() const -> bool 21 | { 22 | if (m_enabled_callback) { 23 | return m_enabled_callback(); 24 | } 25 | return false; 26 | } 27 | 28 | } // namespace erhe::commands 29 | 30 | -------------------------------------------------------------------------------- /src/erhe/commands/erhe_commands/menu_binding.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "erhe_commands/command_binding.hpp" 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | namespace erhe::commands { 10 | 11 | class Menu_binding : public Command_binding 12 | { 13 | public: 14 | Menu_binding(); 15 | Menu_binding(Command* command, std::string_view menu_path, std::function enabled_callback = {}); 16 | 17 | auto get_type() const -> Type override { return Command_binding::Type::Menu; } 18 | auto get_menu_path() const -> const std::string&; 19 | auto get_enabled() const -> bool; 20 | 21 | private: 22 | std::string m_menu_path; 23 | std::function m_enabled_callback; 24 | }; 25 | 26 | } // namespace erhe::commands 27 | 28 | -------------------------------------------------------------------------------- /src/erhe/commands/erhe_commands/mouse_motion_binding.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "erhe_commands/mouse_binding.hpp" 4 | 5 | namespace erhe::commands { 6 | 7 | class Mouse_motion_binding : public Mouse_binding 8 | { 9 | public: 10 | explicit Mouse_motion_binding(Command* command, const std::optional modifier_mask = {}); 11 | Mouse_motion_binding(); 12 | ~Mouse_motion_binding() noexcept override; 13 | 14 | auto get_type() const -> Type override { return Command_binding::Type::Mouse_motion; } 15 | auto on_motion(Input_arguments& input) -> bool override; 16 | }; 17 | 18 | } // namespace erhe::commands 19 | 20 | -------------------------------------------------------------------------------- /src/erhe/commands/erhe_commands/state.cpp: -------------------------------------------------------------------------------- 1 | #include "erhe_commands/state.hpp" 2 | 3 | #include 4 | 5 | namespace erhe::commands { 6 | 7 | auto c_str(const State state) -> const char* 8 | { 9 | return c_state_str[static_cast(state)]; 10 | } 11 | 12 | } // namespace erhe::commands 13 | -------------------------------------------------------------------------------- /src/erhe/commands/erhe_commands/state.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace erhe::commands 4 | { 5 | 6 | enum class State : unsigned int { 7 | Disabled = 0, 8 | Inactive, 9 | Ready, 10 | Active 11 | }; 12 | 13 | static constexpr const char* c_state_str[] = { 14 | "disabled", 15 | "inactive", 16 | "ready", 17 | "active" 18 | }; 19 | 20 | auto c_str(const State state) -> const char*; 21 | 22 | } // namespace erhe::commands 23 | -------------------------------------------------------------------------------- /src/erhe/commands/erhe_commands/update_binding.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "erhe_commands/command_binding.hpp" 4 | 5 | #include "erhe_window/window_event_handler.hpp" 6 | 7 | namespace erhe::commands { 8 | 9 | class Command; 10 | struct Input_arguments; 11 | 12 | class Update_binding : public Command_binding 13 | { 14 | public: 15 | explicit Update_binding(Command* command); 16 | Update_binding(); 17 | ~Update_binding() noexcept override; 18 | 19 | auto get_type() const -> Type override { return Command_binding::Type::Update; } 20 | 21 | virtual auto on_update() -> bool; 22 | }; 23 | 24 | 25 | } // namespace erhe::commands 26 | 27 | -------------------------------------------------------------------------------- /src/erhe/commands/erhe_commands/xr_float_binding.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "erhe_commands/command_binding.hpp" 4 | 5 | namespace erhe::xr { 6 | class Xr_action_float; 7 | } 8 | 9 | namespace erhe::commands { 10 | 11 | struct Input_arguments; 12 | 13 | class Xr_float_binding : public Command_binding 14 | { 15 | public: 16 | Xr_float_binding(Command* command, erhe::xr::Xr_action_float* xr_action); 17 | Xr_float_binding(); 18 | ~Xr_float_binding() noexcept override; 19 | 20 | auto get_type() const -> Type override; 21 | 22 | auto on_value_changed(Input_arguments& input) -> bool; 23 | 24 | erhe::xr::Xr_action_float* xr_action{nullptr}; 25 | }; 26 | 27 | } // namespace erhe::commands 28 | -------------------------------------------------------------------------------- /src/erhe/commands/erhe_commands/xr_vector2f_binding.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "erhe_commands/command_binding.hpp" 4 | 5 | namespace erhe::xr { 6 | class Xr_action_vector2f; 7 | } 8 | 9 | namespace erhe::commands { 10 | 11 | struct Input_arguments; 12 | 13 | class Xr_vector2f_binding : public Command_binding 14 | { 15 | public: 16 | Xr_vector2f_binding( 17 | Command* command, 18 | erhe::xr::Xr_action_vector2f* xr_action 19 | ); 20 | Xr_vector2f_binding(); 21 | ~Xr_vector2f_binding() noexcept override; 22 | 23 | auto get_type() const -> Type override; 24 | 25 | auto on_value_changed(Input_arguments& input) -> bool; 26 | 27 | erhe::xr::Xr_action_vector2f* xr_action{nullptr}; 28 | }; 29 | 30 | } // namespace erhe::commands 31 | -------------------------------------------------------------------------------- /src/erhe/concurrency/CMakeLists.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/erhe/concurrency/CMakeLists.txt -------------------------------------------------------------------------------- /src/erhe/concurrency/erhe_concurrency/concurrent_queue.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/erhe/concurrency/erhe_concurrency/concurrent_queue.cpp -------------------------------------------------------------------------------- /src/erhe/concurrency/erhe_concurrency/concurrent_queue.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/erhe/concurrency/erhe_concurrency/concurrent_queue.hpp -------------------------------------------------------------------------------- /src/erhe/concurrency/erhe_concurrency/serial_queue.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/erhe/concurrency/erhe_concurrency/serial_queue.cpp -------------------------------------------------------------------------------- /src/erhe/concurrency/erhe_concurrency/serial_queue.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/erhe/concurrency/erhe_concurrency/serial_queue.hpp -------------------------------------------------------------------------------- /src/erhe/concurrency/erhe_concurrency/thread_pool.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/erhe/concurrency/erhe_concurrency/thread_pool.cpp -------------------------------------------------------------------------------- /src/erhe/concurrency/erhe_concurrency/thread_pool.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/erhe/concurrency/erhe_concurrency/thread_pool.hpp -------------------------------------------------------------------------------- /src/erhe/configuration/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(_target erhe_configuration) 2 | add_library(${_target}) 3 | add_library(erhe::configuration ALIAS ${_target}) 4 | erhe_target_sources_grouped( 5 | ${_target} TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES 6 | erhe_configuration/configuration.cpp 7 | erhe_configuration/configuration.hpp 8 | ) 9 | 10 | target_include_directories(${_target} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 11 | 12 | target_link_libraries(${_target} 13 | PUBLIC 14 | mINI 15 | glm::glm-header-only 16 | erhe::profile 17 | PRIVATE 18 | etl::etl 19 | ) 20 | 21 | erhe_target_settings(${_target} "erhe") 22 | 23 | -------------------------------------------------------------------------------- /src/erhe/dataformat/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(_target "erhe_dataformat") 2 | add_library(${_target}) 3 | add_library(erhe::dataformat ALIAS ${_target}) 4 | erhe_target_sources_grouped( 5 | ${_target} TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES 6 | erhe_dataformat/dataformat.cpp 7 | erhe_dataformat/dataformat.hpp 8 | erhe_dataformat/dataformat_log.cpp 9 | erhe_dataformat/dataformat_log.hpp 10 | erhe_dataformat/vertex_format.cpp 11 | erhe_dataformat/vertex_format.hpp 12 | ) 13 | 14 | target_include_directories(${_target} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 15 | 16 | target_link_libraries(${_target} 17 | PUBLIC 18 | erhe::log 19 | erhe::verify 20 | fmt::fmt 21 | ) 22 | 23 | erhe_target_settings(${_target} "erhe") 24 | -------------------------------------------------------------------------------- /src/erhe/dataformat/erhe_dataformat/dataformat_log.cpp: -------------------------------------------------------------------------------- 1 | #include "erhe_dataformat/dataformat_log.hpp" 2 | #include "erhe_log/log.hpp" 3 | 4 | namespace erhe::dataformat { 5 | 6 | std::shared_ptr log_dataformat; 7 | 8 | void initialize_logging() 9 | { 10 | using namespace erhe::log; 11 | log_dataformat = make_logger("erhe.dataformat"); 12 | } 13 | 14 | } // namespace erhe::dataformat 15 | -------------------------------------------------------------------------------- /src/erhe/dataformat/erhe_dataformat/dataformat_log.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | namespace erhe::dataformat { 8 | 9 | extern std::shared_ptr log_dataformat; 10 | 11 | void initialize_logging(); 12 | 13 | } // namespace erhe::dataformat 14 | -------------------------------------------------------------------------------- /src/erhe/defer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(_target "erhe_defer") 2 | add_library(${_target}) 3 | add_library(erhe::defer ALIAS ${_target}) 4 | 5 | erhe_target_sources_grouped( 6 | ${_target} TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES 7 | erhe_defer/defer.cpp 8 | erhe_defer/defer.hpp 9 | ) 10 | 11 | target_include_directories(${_target} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 12 | 13 | erhe_target_settings(${_target} "erhe") 14 | -------------------------------------------------------------------------------- /src/erhe/defer/erhe_defer/defer.cpp: -------------------------------------------------------------------------------- 1 | #include "erhe_defer/defer.hpp" 2 | -------------------------------------------------------------------------------- /src/erhe/file/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(_target "erhe_file") 2 | add_library(${_target}) 3 | add_library(erhe::file ALIAS ${_target}) 4 | 5 | erhe_target_sources_grouped( 6 | ${_target} TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES 7 | erhe_file/file.cpp 8 | erhe_file/file.hpp 9 | erhe_file/file_log.cpp 10 | erhe_file/file_log.hpp 11 | ) 12 | 13 | target_include_directories(${_target} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 14 | 15 | target_link_libraries(${_target} 16 | PRIVATE 17 | erhe::defer 18 | erhe::log 19 | erhe::verify 20 | ) 21 | 22 | erhe_target_settings(${_target} "erhe") 23 | -------------------------------------------------------------------------------- /src/erhe/file/erhe_file/file_log.cpp: -------------------------------------------------------------------------------- 1 | #include "erhe_file/file_log.hpp" 2 | #include "erhe_log/log.hpp" 3 | 4 | namespace erhe::file { 5 | 6 | std::shared_ptr log_file; 7 | 8 | void initialize_logging() 9 | { 10 | using namespace erhe::log; 11 | log_file = make_logger("erhe.file"); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/erhe/file/erhe_file/file_log.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | namespace erhe::file { 8 | 9 | extern std::shared_ptr log_file; 10 | 11 | void initialize_logging(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/erhe/geometry/Readme.md: -------------------------------------------------------------------------------- 1 | erhe geometry 2 | ============= 3 | 4 | erhe geometry is a C++ library for manipulating geometric, polygon based 3D objects. 5 | 6 | geometry is collection of points, polygons, corners and their attributes. 7 | 8 | Arbitrary attributes can be associated with each point, polygon and corner. 9 | 10 | erhe geometry is designed for manipulating 3D objects, not for rendering them. 11 | See erhe mesh how to render geometry objects. 12 | -------------------------------------------------------------------------------- /src/erhe/geometry/erhe_geometry/geometry_geogram_mesh.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/erhe/geometry/erhe_geometry/geometry_geogram_mesh.cpp -------------------------------------------------------------------------------- /src/erhe/geometry/erhe_geometry/geometry_iterators.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/erhe/geometry/erhe_geometry/geometry_iterators.cpp -------------------------------------------------------------------------------- /src/erhe/geometry/erhe_geometry/geometry_make.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/erhe/geometry/erhe_geometry/geometry_make.cpp -------------------------------------------------------------------------------- /src/erhe/geometry/erhe_geometry/geometry_merge.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/erhe/geometry/erhe_geometry/geometry_merge.cpp -------------------------------------------------------------------------------- /src/erhe/geometry/erhe_geometry/operation/ambo.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace erhe::geometry { class Geometry; } 4 | 5 | namespace erhe::geometry::operation { 6 | 7 | // Conway ambo operator 8 | 9 | void ambo(const Geometry& source, Geometry& destination); 10 | 11 | } // namespace erhe::geometry::operation 12 | -------------------------------------------------------------------------------- /src/erhe/geometry/erhe_geometry/operation/bake_transform.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "erhe_geometry/geometry.hpp" 4 | 5 | namespace erhe::geometry { class Geometry; } 6 | 7 | namespace erhe::geometry::operation { 8 | 9 | void bake_transform(const Geometry& source, Geometry& destination, const GEO::mat4f& transform); 10 | 11 | } // namespace erhe::geometry::operation 12 | -------------------------------------------------------------------------------- /src/erhe/geometry/erhe_geometry/operation/catmull_clark_subdivision.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace erhe::geometry { class Geometry; } 4 | 5 | namespace erhe::geometry::operation { 6 | 7 | void catmull_clark_subdivision(const Geometry& source, Geometry& destination); 8 | 9 | } // namespace erhe::geometry::operation 10 | -------------------------------------------------------------------------------- /src/erhe/geometry/erhe_geometry/operation/chamfer.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace erhe::geometry { class Geometry; } 4 | 5 | namespace erhe::geometry::operation { 6 | 7 | void chamfer(const Geometry& source, Geometry& destination); 8 | 9 | } // namespace erhe::geometry::operation 10 | -------------------------------------------------------------------------------- /src/erhe/geometry/erhe_geometry/operation/difference.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace erhe::geometry { class Geometry; } 4 | 5 | namespace erhe::geometry::operation { 6 | 7 | void difference(const Geometry& lhs, const Geometry& rhs, Geometry& destination); 8 | 9 | } // namespace erhe::geometry::operation 10 | -------------------------------------------------------------------------------- /src/erhe/geometry/erhe_geometry/operation/dual.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace erhe::geometry { class Geometry; } 4 | 5 | namespace erhe::geometry::operation { 6 | 7 | void dual(const Geometry& source, Geometry& destination); 8 | 9 | } // namespace erhe::geometry::operation 10 | -------------------------------------------------------------------------------- /src/erhe/geometry/erhe_geometry/operation/gyro.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace erhe::geometry { class Geometry; } 4 | 5 | namespace erhe::geometry::operation { 6 | 7 | void gyro(const Geometry& source, Geometry& destination); 8 | 9 | } // namespace erhe::geometry::operation 10 | -------------------------------------------------------------------------------- /src/erhe/geometry/erhe_geometry/operation/intersection.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace erhe::geometry { class Geometry; } 4 | 5 | namespace erhe::geometry::operation { 6 | 7 | void intersection(const Geometry& lhs, const Geometry& rhs, Geometry& destination); 8 | 9 | } // namespace erhe::geometry::operation 10 | -------------------------------------------------------------------------------- /src/erhe/geometry/erhe_geometry/operation/join.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace erhe::geometry { class Geometry; } 4 | 5 | namespace erhe::geometry::operation { 6 | 7 | void join(const Geometry& source, Geometry& destination); 8 | 9 | } // namespace erhe::geometry::operation 10 | -------------------------------------------------------------------------------- /src/erhe/geometry/erhe_geometry/operation/kis.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace erhe::geometry { class Geometry; } 4 | 5 | namespace erhe::geometry::operation { 6 | 7 | void kis(const Geometry& source, Geometry& destination); 8 | 9 | } // namespace erhe::geometry::operation 10 | -------------------------------------------------------------------------------- /src/erhe/geometry/erhe_geometry/operation/meta.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace erhe::geometry { class Geometry; } 4 | 5 | namespace erhe::geometry::operation { 6 | 7 | void meta(const Geometry& source, Geometry& destination); 8 | 9 | } // namespace erhe::geometry::operation 10 | -------------------------------------------------------------------------------- /src/erhe/geometry/erhe_geometry/operation/normalize.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace erhe::geometry { class Geometry; } 4 | 5 | namespace erhe::geometry::operation { 6 | 7 | void normalize(const Geometry& source, Geometry& destination); 8 | 9 | } // namespace erhe::geometry::operation 10 | -------------------------------------------------------------------------------- /src/erhe/geometry/erhe_geometry/operation/repair.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace erhe::geometry { class Geometry; } 4 | 5 | namespace erhe::geometry::operation { 6 | 7 | void repair(const Geometry& source, Geometry& destination); 8 | 9 | void weld(const Geometry& source, Geometry& destination); 10 | 11 | } // namespace erhe::geometry::operation 12 | -------------------------------------------------------------------------------- /src/erhe/geometry/erhe_geometry/operation/reverse.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace erhe::geometry { class Geometry; } 4 | 5 | namespace erhe::geometry::operation { 6 | 7 | void reverse(const Geometry& source, Geometry& destination); 8 | 9 | } // namespace erhe::geometry::operation 10 | -------------------------------------------------------------------------------- /src/erhe/geometry/erhe_geometry/operation/sqrt3_subdivision.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace erhe::geometry { class Geometry; } 4 | 5 | namespace erhe::geometry::operation { 6 | 7 | void sqrt3_subdivision(const Geometry& source, Geometry& destination); 8 | 9 | } // namespace erhe::geometry::operation 10 | -------------------------------------------------------------------------------- /src/erhe/geometry/erhe_geometry/operation/subdivide.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace erhe::geometry { class Geometry; } 4 | 5 | namespace erhe::geometry::operation { 6 | 7 | void subdivide(const Geometry& source, Geometry& destination); 8 | 9 | } // namespace erhe::geometry::operation 10 | -------------------------------------------------------------------------------- /src/erhe/geometry/erhe_geometry/operation/triangulate.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace erhe::geometry { class Geometry; } 4 | 5 | namespace erhe::geometry::operation { 6 | 7 | void triangulate(const Geometry& source, Geometry& destination); 8 | 9 | } // namespace erhe::geometry::operation 10 | -------------------------------------------------------------------------------- /src/erhe/geometry/erhe_geometry/operation/truncate.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace erhe::geometry { class Geometry; } 4 | 5 | namespace erhe::geometry::operation { 6 | 7 | void truncate(const Geometry& source, Geometry& destination); 8 | 9 | } // namespace erhe::geometry::operation 10 | -------------------------------------------------------------------------------- /src/erhe/geometry/erhe_geometry/operation/union.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace erhe::geometry { class Geometry; } 4 | 5 | namespace erhe::geometry::operation { 6 | 7 | void union_(const Geometry& lhs, const Geometry& rhs, Geometry& destination); 8 | 9 | } // namespace erhe::geometry::operation 10 | -------------------------------------------------------------------------------- /src/erhe/geometry/erhe_geometry/property_map_collection.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/erhe/geometry/erhe_geometry/property_map_collection.hpp -------------------------------------------------------------------------------- /src/erhe/geometry/erhe_geometry/property_map_collection.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/erhe/geometry/erhe_geometry/property_map_collection.inl -------------------------------------------------------------------------------- /src/erhe/geometry/erhe_geometry/shapes/box.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace erhe::geometry::shapes { 6 | 7 | void make_box(GEO::Mesh& mesh, float x_size, float y_size, float z_size); 8 | void make_box(GEO::Mesh& mesh, float min_x, float max_x, float min_y, float max_y, float min_z, float max_z); 9 | void make_box(GEO::Mesh& mesh, float r); 10 | void make_box(GEO::Mesh& mesh, GEO::vec3f size, GEO::vec3i div, float p = 1.0); 11 | 12 | } // namespace erhe::geometry::shapes 13 | -------------------------------------------------------------------------------- /src/erhe/geometry/erhe_geometry/shapes/convex_hull.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | #include 7 | 8 | namespace GEO { class Mesh; } 9 | 10 | namespace erhe::geometry::shapes { 11 | 12 | void make_convex_hull(GEO::Mesh& mesh, const std::vector& points); 13 | 14 | } // namespace erhe::geometry::shapes 15 | -------------------------------------------------------------------------------- /src/erhe/geometry/erhe_geometry/shapes/disc.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace GEO { class Mesh; } 4 | 5 | namespace erhe::geometry::shapes { 6 | 7 | void make_disc(GEO::Mesh& mesh, float outer_radius, float inner_radius, int slice_count, int stack_count); 8 | 9 | void make_disc( 10 | GEO::Mesh& mesh, 11 | float outer_radius, 12 | float inner_radius, 13 | int slice_count, 14 | int stack_count, 15 | int slice_begin, 16 | int slice_end, 17 | int stack_begin, 18 | int stack_end 19 | ); 20 | 21 | } // namespace erhe::geometry::shapes 22 | -------------------------------------------------------------------------------- /src/erhe/geometry/erhe_geometry/shapes/regular_polygon.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace GEO { class Mesh; } 4 | 5 | namespace erhe::geometry::shapes { 6 | 7 | void make_triangle (GEO::Mesh& mesh, float radius); 8 | void make_quad (GEO::Mesh& mesh, float edge); 9 | void make_rectangle(GEO::Mesh& mesh, float width, float height, bool front_face = true, bool back_face = true); 10 | 11 | } // namespace erhe::geometry::shapes 12 | -------------------------------------------------------------------------------- /src/erhe/geometry/erhe_geometry/shapes/regular_polyhedron.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace GEO { class Mesh; } 4 | 5 | namespace erhe::geometry::shapes { 6 | 7 | void make_cuboctahedron(GEO::Mesh& mesh, float radius); 8 | void make_dodecahedron (GEO::Mesh& mesh, float radius); 9 | void make_icosahedron (GEO::Mesh& mesh, float radius); 10 | void make_octahedron (GEO::Mesh& mesh, float radius); 11 | void make_tetrahedron (GEO::Mesh& mesh, float radius); 12 | void make_cube (GEO::Mesh& mesh, float radius); 13 | 14 | } // namespace erhe::geometry::shapes 15 | -------------------------------------------------------------------------------- /src/erhe/geometry/erhe_geometry/shapes/sphere.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace GEO { class Mesh; } 4 | 5 | namespace erhe::geometry::shapes { 6 | 7 | void make_sphere(GEO::Mesh& mesh, float radius, unsigned int slice_count, unsigned int stack_division); 8 | 9 | } // namespace erhe::geometry::shapes 10 | -------------------------------------------------------------------------------- /src/erhe/geometry/erhe_geometry/shapes/torus.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace GEO { class Mesh; }; 4 | 5 | namespace erhe::geometry::shapes { 6 | 7 | void make_torus(GEO::Mesh& mesh, float major_radius, float minor_radius, int major_axis_steps, int minor_axis_steps); 8 | 9 | } // namespace erhe::geometry::shapes 10 | -------------------------------------------------------------------------------- /src/erhe/geometry/erhe_geometry/types.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/erhe/geometry/erhe_geometry/types.hpp -------------------------------------------------------------------------------- /src/erhe/geometry_renderer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(_target "erhe_geometry_renderer") 2 | add_library(${_target}) 3 | add_library(erhe::geometry_renderer ALIAS ${_target}) 4 | erhe_target_sources_grouped( 5 | ${_target} TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES 6 | erhe_geometry_renderer/geometry_debug_renderer.cpp 7 | erhe_geometry_renderer/geometry_debug_renderer.hpp 8 | ) 9 | target_link_libraries( 10 | ${_target} 11 | PUBLIC 12 | erhe::geometry 13 | erhe::math 14 | erhe::renderer 15 | erhe::profile 16 | erhe::verify 17 | ) 18 | 19 | target_include_directories(${_target} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 20 | 21 | erhe_target_settings(${_target} "erhe") 22 | -------------------------------------------------------------------------------- /src/erhe/gl/.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__ 2 | -------------------------------------------------------------------------------- /src/erhe/gl/Readme.md: -------------------------------------------------------------------------------- 1 | erhe gl 2 | ======= 3 | 4 | erhe gl is a C++ wrapper for OpenGL API. 5 | -------------------------------------------------------------------------------- /src/erhe/gl/erhe_gl/gl.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/erhe/gl/erhe_gl/gl.hpp -------------------------------------------------------------------------------- /src/erhe/gl/erhe_gl/gl_log.cpp: -------------------------------------------------------------------------------- 1 | #include "erhe_gl/gl_log.hpp" 2 | #include "erhe_log/log.hpp" 3 | 4 | namespace gl 5 | { 6 | 7 | std::shared_ptr log_gl; 8 | 9 | void initialize_logging() 10 | { 11 | // To enable logging GL calls, uncomment this version 12 | //log_gl = erhe::log::make_logger("gl", spdlog::level::trace); 13 | log_gl = erhe::log::make_logger("erhe.gl.helpers"); 14 | } 15 | 16 | } // namespace gl 17 | -------------------------------------------------------------------------------- /src/erhe/gl/erhe_gl/gl_log.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | namespace gl 8 | { 9 | 10 | extern std::shared_ptr log_gl; 11 | 12 | void initialize_logging(); 13 | 14 | } // namespace gl 15 | 16 | -------------------------------------------------------------------------------- /src/erhe/gl/templates/autogeneration_warning.inl: -------------------------------------------------------------------------------- 1 | // 2 | // This file has been autogenerated. 3 | // Do not edit manually. 4 | // 5 | 6 | -------------------------------------------------------------------------------- /src/erhe/gl/templates/basic_enum_string_function_definition.inl: -------------------------------------------------------------------------------- 1 | auto c_str(const {WRAPPER_ENUM_TYPE_NAME} value) -> const char* // {GROUP_NAME} 2 | {{ 3 | const auto ui_value = static_cast(value); 4 | switch (ui_value) {{ 5 | {GROUP_ENUM_STRING_ENTRIES} 6 | default: return enum_string(ui_value); 7 | }} 8 | }} 9 | -------------------------------------------------------------------------------- /src/erhe/gl/templates/bitmask_enum_string_function_definition.inl: -------------------------------------------------------------------------------- 1 | auto to_string(const {WRAPPER_ENUM_TYPE_NAME} value) -> std::string// {GROUP_NAME} 2 | {{ 3 | std::stringstream ss; 4 | bool is_empty = true; 5 | const auto ui_value = static_cast(value); 6 | 7 | {GROUP_ENUM_STRING_ENTRIES} 8 | 9 | static_cast(is_empty); 10 | 11 | return ss.str(); 12 | }} 13 | -------------------------------------------------------------------------------- /src/erhe/gl/templates/bitmask_enum_string_make_entry.inl: -------------------------------------------------------------------------------- 1 | if ((ui_value & {ENUM_VALUE}U) == {ENUM_VALUE}U) {{ 2 | if (!is_empty) {{ 3 | ss << " | "; 4 | }} 5 | ss << "{ENUM_STRING}"; 6 | is_empty = false; 7 | }} 8 | -------------------------------------------------------------------------------- /src/erhe/gl/templates/dynamic_load.cpp: -------------------------------------------------------------------------------- 1 | {AUTOGENERATION_WARNING} 2 | 3 | #include "erhe_gl/dynamic_load.hpp" 4 | 5 | namespace gl 6 | {{ 7 | 8 | void dynamic_load_init(const PFN_get_proc_address get_proc_address) 9 | {{ 10 | {DYNAMIC_FUNCTION_GET_STATEMENTS} 11 | }} 12 | 13 | {DYNAMIC_FUNCTION_DEFINITIONS} 14 | 15 | }} // namespace gl 16 | -------------------------------------------------------------------------------- /src/erhe/gl/templates/enum_base_zero_function_definition.inl: -------------------------------------------------------------------------------- 1 | auto base_zero(const {WRAPPER_ENUM_TYPE_NAME} value) -> std::size_t // {GROUP_NAME} 2 | {{ 3 | const auto ui_value = static_cast(value); 4 | switch (ui_value) {{ 5 | {GROUP_ENUM_TO_BASE_ZERO_ENTRIES} 6 | default: return std::numeric_limits::max(); 7 | }} 8 | }} 9 | 10 | auto {WRAPPER_ENUM_TYPE_NAME}_from_base_zero(const std::size_t ui_value) -> {WRAPPER_ENUM_TYPE_NAME} // {GROUP_NAME} 11 | {{ 12 | switch (ui_value) {{ 13 | {BASE_ZERO_TO_GROUP_ENUM_ENTRIES} 14 | default: return static_cast<{WRAPPER_ENUM_TYPE_NAME}>(0xffffu); 15 | }} 16 | }} 17 | -------------------------------------------------------------------------------- /src/erhe/gl/templates/enum_base_zero_functions.cpp: -------------------------------------------------------------------------------- 1 | {AUTOGENERATION_WARNING} 2 | 3 | #include "erhe_gl/enum_base_zero_functions.hpp" 4 | 5 | #include 6 | 7 | namespace gl 8 | {{ 9 | 10 | {ENUM_BASE_ZERO_FUNCTION_DEFINITIONS} 11 | 12 | }} // namespace gl 13 | -------------------------------------------------------------------------------- /src/erhe/gl/templates/enum_base_zero_functions.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | {AUTOGENERATION_WARNING} 3 | 4 | #include "erhe_gl/wrapper_enums.hpp" 5 | 6 | #include 7 | 8 | namespace gl 9 | {{ 10 | 11 | {ENUM_TO_BASE_ZERO_FUNCTION_DECLARATIONS} 12 | 13 | {BASE_ZERO_TO_ENUM_FUNCTION_DECLARATIONS} 14 | 15 | }} // namespace gl 16 | -------------------------------------------------------------------------------- /src/erhe/gl/templates/enum_string_functions.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | {AUTOGENERATION_WARNING} 3 | 4 | #include "erhe_gl/wrapper_enums.hpp" 5 | 6 | #include 7 | 8 | namespace gl 9 | {{ 10 | 11 | typedef unsigned char GLboolean; 12 | 13 | auto c_str (GLboolean value) -> const char*; 14 | auto enum_string(unsigned int value) -> const char*; 15 | auto enum_value (const std::string& name) -> unsigned int; 16 | 17 | {ENUM_STRING_FUNCTION_DECLARATIONS} 18 | 19 | {UNTYPED_ENUM_STRING_FUNCTION_DECLARATIONS} 20 | 21 | }} // namespace gl 22 | -------------------------------------------------------------------------------- /src/erhe/gl/templates/untyped_enum_string_function_definition.inl: -------------------------------------------------------------------------------- 1 | 2 | auto {WRAPPER_ENUM_STRING_FN_NAME}_string(const unsigned int value) -> const char* // {GROUP_NAME} 3 | {{ 4 | const auto typed_value = static_cast<{WRAPPER_ENUM_TYPE_NAME}>(value); 5 | return c_str(typed_value); 6 | }} 7 | -------------------------------------------------------------------------------- /src/erhe/gl/templates/wrapper_enum_declaration.inl: -------------------------------------------------------------------------------- 1 | enum class {WRAPPER_ENUM_TYPE_NAME} : unsigned int 2 | {{ 3 | {WRAPPER_ENUM_VALUE_DEFINITIONS} 4 | }}; 5 | -------------------------------------------------------------------------------- /src/erhe/gl/templates/wrapper_enums.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | {AUTOGENERATION_WARNING} 3 | 4 | namespace gl 5 | {{ 6 | 7 | {WRAPPER_ENUM_DECLARATIONS} 8 | 9 | }} // namespace gl 10 | -------------------------------------------------------------------------------- /src/erhe/gl/templates/wrapper_function_definition.inl: -------------------------------------------------------------------------------- 1 | auto {WRAPPER_NAME}({WRAPPER_ARGUMENTS}) -> {WRAPPER_RETURN_TYPE} 2 | {{ 3 | log_gl->trace( 4 | "{NATIVE_NAME}({LOG_FORMAT_STRING})" 5 | {LOG_FORMAT_ENTRIES} 6 | ); 7 | {CAPTURE_RESULT}{NATIVE_NAME}({ARGUMENT_LIST}); 8 | {WRAPPER_RETURN_STATEMENT}}} 9 | -------------------------------------------------------------------------------- /src/erhe/gl/templates/wrapper_functions.cpp: -------------------------------------------------------------------------------- 1 | {AUTOGENERATION_WARNING} 2 | 3 | #include "erhe_gl/wrapper_functions.hpp" 4 | #include "erhe_gl/enum_string_functions.hpp" 5 | #include "erhe_gl/dynamic_load.hpp" 6 | #include "erhe_gl/gl_log.hpp" 7 | 8 | #include 9 | 10 | #include 11 | #include 12 | 13 | namespace gl {{ 14 | 15 | extern void check_error(); 16 | 17 | auto glbitfield(const ::GLbitfield value) -> ::GLbitfield 18 | {{ 19 | return value; 20 | }} 21 | 22 | {ENUM_HELPER_DEFINITIONS} 23 | 24 | {WRAPPER_FUNCTION_DEFINITIONS} 25 | 26 | }} // namespace gl 27 | -------------------------------------------------------------------------------- /src/erhe/gltf/erhe_gltf/gltf.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if defined(ERHE_GLTF_LIBRARY_FASTGLTF) 4 | # include "gltf_fastgltf.hpp" 5 | #elif defined(ERHE_GLTF_LIBRARY_NONE) 6 | # include "gltf_none.hpp" 7 | #endif 8 | -------------------------------------------------------------------------------- /src/erhe/gltf/erhe_gltf/gltf_log.cpp: -------------------------------------------------------------------------------- 1 | #include "erhe_gltf/gltf_log.hpp" 2 | #include "erhe_log/log.hpp" 3 | 4 | namespace erhe::gltf { 5 | 6 | std::shared_ptr log_gltf; 7 | 8 | void initialize_logging() 9 | { 10 | log_gltf = erhe::log::make_logger("erhe.gltf.log"); 11 | } 12 | 13 | } // namespace erhe::gltf 14 | -------------------------------------------------------------------------------- /src/erhe/gltf/erhe_gltf/gltf_log.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | namespace erhe::gltf { 8 | 9 | extern std::shared_ptr log_gltf; 10 | 11 | void initialize_logging(); 12 | 13 | } // namespace erhe::gltf 14 | -------------------------------------------------------------------------------- /src/erhe/gltf/erhe_gltf/gltf_none.cpp: -------------------------------------------------------------------------------- 1 | #include "gltf.hpp" 2 | 3 | [[nodiscard]] auto parse_gltf(const Gltf_parse_arguments& arguments) -> Gltf_data 4 | { 5 | static_cast(arguments): 6 | } 7 | 8 | [[nodiscard]] auto scan_gltf(std::filesystem::path path) -> Gltf_scan 9 | { 10 | static_cast(path): 11 | } 12 | -------------------------------------------------------------------------------- /src/erhe/graph/erhe_graph/graph_log.cpp: -------------------------------------------------------------------------------- 1 | #include "erhe_graph/graph_log.hpp" 2 | #include "erhe_log/log.hpp" 3 | 4 | //#include 5 | 6 | namespace erhe::graph { 7 | 8 | std::shared_ptr log_graph; 9 | 10 | void initialize_logging() 11 | { 12 | using namespace erhe::log; 13 | log_graph = make_logger("erhe.graph"); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/erhe/graph/erhe_graph/graph_log.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace spdlog { class logger; } 6 | 7 | namespace erhe::graph { 8 | 9 | extern std::shared_ptr log_graph; 10 | 11 | void initialize_logging(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/erhe/graph/erhe_graph/link.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace erhe::graph { 4 | 5 | class Pin; 6 | class Link; 7 | 8 | class Link 9 | { 10 | public: 11 | Link(); 12 | Link(Link&& old); 13 | Link(const Link& other) = delete; 14 | Link& operator=(Link&& old); 15 | Link& operator=(const Link& other) = delete; 16 | Link(Pin* source, Pin* sink); 17 | virtual ~Link(); 18 | 19 | [[nodiscard]] auto get_id () const -> int; 20 | [[nodiscard]] auto get_source () const -> Pin*; 21 | [[nodiscard]] auto get_sink () const -> Pin*; 22 | [[nodiscard]] auto is_connected() const -> bool; 23 | void disconnect(); 24 | 25 | private: 26 | int m_id; 27 | Pin* m_source{nullptr}; 28 | Pin* m_sink {nullptr}; 29 | }; 30 | 31 | } // namespace erhe::graph 32 | -------------------------------------------------------------------------------- /src/erhe/graphics/Readme.md: -------------------------------------------------------------------------------- 1 | erhe graphics 2 | ============= 3 | 4 | erhe graphics is a C++ library for using OpenGL 4.6. It emphasizes managing state 5 | using pipelines a bit similar to Vulkan. 6 | -------------------------------------------------------------------------------- /src/erhe/graphics/erhe_graphics/align.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace erhe::graphics { 4 | 5 | inline auto align_offset(std::size_t offset, std::size_t alignment) -> std::size_t 6 | { 7 | return (alignment == 0) 8 | ? offset 9 | : (offset + alignment - 1) & ~(alignment - 1); 10 | } 11 | 12 | } // namespace erhe::graphics 13 | -------------------------------------------------------------------------------- /src/erhe/graphics/erhe_graphics/debug.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | typedef char GLchar; 7 | typedef unsigned int GLenum; 8 | typedef unsigned int GLuint; 9 | typedef int GLsizei; 10 | 11 | namespace erhe::graphics { 12 | 13 | void erhe_opengl_callback( 14 | GLenum gl_source, 15 | GLenum gl_type, 16 | GLuint id, 17 | GLenum gl_severity, 18 | GLsizei /*length*/, 19 | const GLchar* message, 20 | const void* /*userParam*/ 21 | ); 22 | 23 | class Scoped_debug_group final 24 | { 25 | public: 26 | explicit Scoped_debug_group(const std::string_view debug_label); 27 | ~Scoped_debug_group() noexcept; 28 | 29 | private: 30 | std::string m_debug_label; 31 | }; 32 | 33 | } // namespace erhe::graphics 34 | -------------------------------------------------------------------------------- /src/erhe/graphics/erhe_graphics/fragment_output.cpp: -------------------------------------------------------------------------------- 1 | #include "erhe_graphics/fragment_output.hpp" 2 | -------------------------------------------------------------------------------- /src/erhe/graphics/erhe_graphics/fragment_output.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "erhe_gl/wrapper_enums.hpp" 4 | 5 | #include 6 | 7 | namespace erhe::graphics { 8 | 9 | class Fragment_output 10 | { 11 | public: 12 | std::string name {}; 13 | gl::Fragment_shader_output_type type {gl::Fragment_shader_output_type::float_vec4}; 14 | unsigned int location{0}; 15 | }; 16 | 17 | } // namespace erhe::graphics 18 | -------------------------------------------------------------------------------- /src/erhe/graphics/erhe_graphics/fragment_outputs.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "erhe_graphics/fragment_output.hpp" 4 | 5 | #include 6 | 7 | namespace erhe::graphics { 8 | 9 | class Fragment_outputs 10 | { 11 | public: 12 | explicit Fragment_outputs(const std::initializer_list outputs); 13 | 14 | [[nodiscard]] auto source() const -> std::string; 15 | 16 | private: 17 | std::vector m_outputs; 18 | }; 19 | 20 | } // namespace erhe::graphics 21 | -------------------------------------------------------------------------------- /src/erhe/graphics/erhe_graphics/glsl_file_loader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | namespace erhe::graphics { 8 | 9 | class Glsl_file_loader 10 | { 11 | public: 12 | [[nodiscard]] auto process_includes(std::size_t source_string_index, const std::string& source) -> std::string; 13 | [[nodiscard]] auto read_shader_source_file(const std::filesystem::path& path) -> std::string; 14 | [[nodiscard]] auto get_file_paths() const -> const std::vector&; 15 | 16 | private: 17 | std::vector m_source_string_index_to_path; 18 | std::vector m_include_stack; 19 | }; 20 | 21 | } // namespace erhe::graphics 22 | -------------------------------------------------------------------------------- /src/erhe/graphics/erhe_graphics/glsl_format_source.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace erhe::graphics { 6 | 7 | [[nodiscard]] auto format_source(const std::string& source) -> std::string; 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/erhe/graphics/erhe_graphics/glsl_to_spirv.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "erhe_gl/wrapper_enums.hpp" 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | namespace glslang { 10 | class TShader; 11 | class TProgram; 12 | } 13 | 14 | namespace erhe::graphics { 15 | 16 | class Instance; 17 | 18 | [[nodiscard]] auto glsl_to_glslang( 19 | Instance& graphics_instance, 20 | gl::Shader_type gl_shader_type, 21 | std::string_view source, 22 | const std::string& name 23 | ) -> std::shared_ptr; 24 | 25 | } // namespace erhe::graphics 26 | -------------------------------------------------------------------------------- /src/erhe/graphics/erhe_graphics/image_loader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "erhe_graphics/image_loader_wuffs.hpp" 4 | -------------------------------------------------------------------------------- /src/erhe/graphics/erhe_graphics/png_loader_none.cpp: -------------------------------------------------------------------------------- 1 | #include "erhe_graphics/png_loader.hpp" 2 | 3 | namespace erhe::graphics 4 | { 5 | 6 | PNG_loader::PNG_loader() = default; 7 | 8 | PNG_loader::~PNG_loader() noexcept 9 | { 10 | close(); 11 | } 12 | 13 | auto PNG_loader::open(const std::filesystem::path&, Image_info&) -> bool 14 | { 15 | return false; 16 | } 17 | 18 | auto PNG_loader::load(std::span) -> bool 19 | { 20 | return false; 21 | } 22 | 23 | void PNG_loader::close() 24 | { 25 | } 26 | 27 | } // namespace erhe::graphics 28 | 29 | -------------------------------------------------------------------------------- /src/erhe/graphics/erhe_graphics/scoped_buffer_mapping.cpp: -------------------------------------------------------------------------------- 1 | #include "erhe_graphics/scoped_buffer_mapping.hpp" 2 | -------------------------------------------------------------------------------- /src/erhe/graphics_buffer_sink/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(_target "erhe_graphics_buffer_sink") 2 | add_library(${_target}) 3 | add_library(erhe::graphics_buffer_sink ALIAS ${_target}) 4 | 5 | erhe_target_sources_grouped( 6 | ${_target} TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES 7 | erhe_graphics_buffer_sink/graphics_buffer_sink.hpp 8 | erhe_graphics_buffer_sink/graphics_buffer_sink.cpp 9 | ) 10 | 11 | target_include_directories(${_target} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 12 | 13 | target_link_libraries(${_target} 14 | PUBLIC 15 | erhe::graphics 16 | erhe::primitive 17 | PRIVATE 18 | erhe::profile 19 | erhe::verify 20 | ) 21 | 22 | erhe_target_settings(${_target} "erhe") 23 | 24 | -------------------------------------------------------------------------------- /src/erhe/hash/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(_target "erhe_hash") 2 | add_library(${_target}) 3 | add_library(erhe::hash ALIAS ${_target}) 4 | 5 | erhe_target_sources_grouped( 6 | ${_target} TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES 7 | erhe_hash/hash.cpp 8 | erhe_hash/hash.hpp 9 | erhe_hash/xxhash.hpp 10 | ) 11 | 12 | target_include_directories(${_target} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 13 | 14 | target_link_libraries(${_target} PUBLIC glm::glm-header-only) 15 | 16 | erhe_target_settings(${_target} "erhe") 17 | -------------------------------------------------------------------------------- /src/erhe/hash/erhe_hash/hash.cpp: -------------------------------------------------------------------------------- 1 | #include "erhe_hash/hash.hpp" 2 | -------------------------------------------------------------------------------- /src/erhe/imgui/erhe_imgui/imgui_log.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | namespace erhe::imgui { 8 | 9 | extern std::shared_ptr log_performance; 10 | extern std::shared_ptr log_imgui; 11 | extern std::shared_ptr log_windows; 12 | extern std::shared_ptr log_frame; 13 | extern std::shared_ptr log_input_events; 14 | 15 | void initialize_logging(); 16 | 17 | } // namespace erhe::imgui 18 | -------------------------------------------------------------------------------- /src/erhe/imgui/erhe_imgui/scoped_imgui_context.cpp: -------------------------------------------------------------------------------- 1 | #include "erhe_imgui/scoped_imgui_context.hpp" 2 | #include "erhe_imgui/imgui_host.hpp" 3 | #include "erhe_imgui/imgui_renderer.hpp" 4 | 5 | namespace erhe::imgui { 6 | 7 | Scoped_imgui_context::Scoped_imgui_context(Imgui_host& imgui_host) 8 | : m_imgui_renderer{imgui_host.get_imgui_renderer()} 9 | { 10 | m_imgui_renderer.lock_mutex(); 11 | m_imgui_renderer.make_current(&imgui_host); 12 | } 13 | 14 | Scoped_imgui_context::~Scoped_imgui_context() noexcept 15 | { 16 | m_imgui_renderer.make_current(nullptr); 17 | m_imgui_renderer.unlock_mutex(); 18 | } 19 | 20 | } // namespace erhe::imgui 21 | -------------------------------------------------------------------------------- /src/erhe/imgui/erhe_imgui/scoped_imgui_context.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | struct ImGuiContext; 4 | 5 | namespace erhe::imgui { 6 | 7 | class Imgui_host; 8 | class Imgui_renderer; 9 | 10 | // TODO Is this actually needed any more / at all? 11 | class Scoped_imgui_context 12 | { 13 | public: 14 | explicit Scoped_imgui_context(Imgui_host& imgui_host); 15 | ~Scoped_imgui_context() noexcept; 16 | 17 | private: 18 | Imgui_renderer& m_imgui_renderer; 19 | }; 20 | 21 | } // namespace erhe::imgui 22 | -------------------------------------------------------------------------------- /src/erhe/imgui/erhe_imgui/windows/graph.cpp: -------------------------------------------------------------------------------- 1 | #include "erhe_imgui/windows/graph.hpp" 2 | -------------------------------------------------------------------------------- /src/erhe/item/erhe_item/item_log.cpp: -------------------------------------------------------------------------------- 1 | #include "erhe_item/item_log.hpp" 2 | #include "erhe_log/log.hpp" 3 | 4 | namespace erhe::item 5 | { 6 | 7 | std::shared_ptr log; 8 | std::shared_ptr log_frame; 9 | 10 | void initialize_logging() 11 | { 12 | using namespace erhe::log; 13 | log = make_logger ("erhe.item.log"); 14 | log_frame = make_frame_logger("erhe.item.log_frame"); 15 | } 16 | 17 | } // namespace erhe::item 18 | -------------------------------------------------------------------------------- /src/erhe/item/erhe_item/item_log.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | namespace erhe::item { 8 | 9 | extern std::shared_ptr log; 10 | extern std::shared_ptr log_frame; 11 | 12 | void initialize_logging(); 13 | 14 | } // namespace erhe::item 15 | -------------------------------------------------------------------------------- /src/erhe/log/Readme.md: -------------------------------------------------------------------------------- 1 | erhe log 2 | ======== 3 | 4 | erhe log is a simple C++ logging system. 5 | -------------------------------------------------------------------------------- /src/erhe/log/erhe_log/timestamp.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace erhe::log 6 | { 7 | 8 | auto timestamp () -> std::string; 9 | auto timestamp_short() -> std::string; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/erhe/math/erhe_math/aabb.cpp: -------------------------------------------------------------------------------- 1 | #include "erhe_math/aabb.hpp" 2 | 3 | namespace erhe::math { 4 | 5 | } // namespace erhe::math 6 | -------------------------------------------------------------------------------- /src/erhe/math/erhe_math/math_log.cpp: -------------------------------------------------------------------------------- 1 | #include "erhe_math/math_log.hpp" 2 | #include "erhe_log/log.hpp" 3 | 4 | namespace erhe::math { 5 | 6 | std::shared_ptr log_input_axis; 7 | std::shared_ptr log_input_axis_frame; 8 | 9 | void initialize_logging() 10 | { 11 | using namespace erhe::log; 12 | log_input_axis = make_logger("erhe.math.input_axis"); 13 | log_input_axis_frame = make_frame_logger("erhe.math.input_axis_frame"); 14 | } 15 | 16 | } // namespace erhe::math 17 | -------------------------------------------------------------------------------- /src/erhe/math/erhe_math/math_log.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | namespace erhe::math { 8 | 9 | extern std::shared_ptr log_input_axis; 10 | extern std::shared_ptr log_input_axis_frame; 11 | 12 | void initialize_logging(); 13 | 14 | } // namespace erhe::math 15 | -------------------------------------------------------------------------------- /src/erhe/message_bus/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(_target "erhe_message_bus") 2 | add_library(${_target}) 3 | add_library(erhe::message_bus ALIAS ${_target}) 4 | 5 | erhe_target_sources_grouped( 6 | ${_target} TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES 7 | erhe_message_bus/message_bus.cpp 8 | erhe_message_bus/message_bus.hpp 9 | ) 10 | 11 | target_include_directories(${_target} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 12 | 13 | target_link_libraries(${_target} PUBLIC erhe::profile) 14 | 15 | erhe_target_settings(${_target} "erhe") 16 | -------------------------------------------------------------------------------- /src/erhe/message_bus/erhe_message_bus/message_bus.cpp: -------------------------------------------------------------------------------- 1 | #include "erhe_message_bus/message_bus.hpp" 2 | -------------------------------------------------------------------------------- /src/erhe/net/erhe_net/net_log.cpp: -------------------------------------------------------------------------------- 1 | #include "erhe_net/net_log.hpp" 2 | #include "erhe_log/log.hpp" 3 | 4 | namespace erhe::net { 5 | 6 | std::shared_ptr log_net ; 7 | std::shared_ptr log_socket; 8 | std::shared_ptr log_client; 9 | std::shared_ptr log_server; 10 | 11 | void initialize_logging() 12 | { 13 | using namespace erhe::log; 14 | log_net = make_logger("erhe.net.net"); 15 | log_socket = make_logger("erhe.net.socket"); 16 | log_client = make_logger("erhe.net.client"); 17 | log_server = make_logger("erhe.net.server"); 18 | } 19 | 20 | } // namespace erhe::net 21 | -------------------------------------------------------------------------------- /src/erhe/net/erhe_net/net_log.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | namespace erhe::net { 8 | 9 | extern std::shared_ptr log_net; 10 | extern std::shared_ptr log_socket; 11 | extern std::shared_ptr log_client; 12 | extern std::shared_ptr log_server; 13 | 14 | void initialize_logging(); 15 | 16 | } // namespace erhe::net 17 | -------------------------------------------------------------------------------- /src/erhe/pch/erhe_pch/erhe_pch.cpp: -------------------------------------------------------------------------------- 1 | // dummy 2 | -------------------------------------------------------------------------------- /src/erhe/pch/erhe_pch/erhe_windows.hpp: -------------------------------------------------------------------------------- 1 | #if defined(_WIN32) 2 | # ifndef _CRT_SECURE_NO_WARNINGS 3 | # define _CRT_SECURE_NO_WARNINGS 4 | # endif 5 | # ifndef WIN32_LEAN_AND_MEAN 6 | # define WIN32_LEAN_AND_MEAN 7 | # endif 8 | # define VC_EXTRALEAN 9 | # ifndef STRICT 10 | # define STRICT 11 | # endif 12 | # ifndef NOMINMAX 13 | # define NOMINMAX // Macros min(a,b) and max(a,b) 14 | # endif 15 | # include 16 | #endif 17 | -------------------------------------------------------------------------------- /src/erhe/physics/erhe_physics/iconvex_hull_collision_shape.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace erhe::physics { 6 | 7 | class ICollision_shape 8 | { 9 | public: 10 | virtual void calculate_local_inertia(float mass, glm::vec3& inertia) const = 0; 11 | }; 12 | 13 | } // namespace erhe::physics 14 | -------------------------------------------------------------------------------- /src/erhe/physics/erhe_physics/imotion_state.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/erhe/physics/erhe_physics/imotion_state.hpp -------------------------------------------------------------------------------- /src/erhe/physics/erhe_physics/jolt/jolt_compound_shape.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "erhe_physics/jolt/jolt_collision_shape.hpp" 4 | 5 | #include 6 | #include 7 | 8 | namespace erhe::physics { 9 | 10 | class Jolt_compound_shape : public Jolt_collision_shape 11 | { 12 | public: 13 | explicit Jolt_compound_shape(const Compound_shape_create_info& create_info); 14 | 15 | // Implements ICollision_shape 16 | auto is_convex () const -> bool override; 17 | auto get_shape_settings() -> JPH::ShapeSettings& override; 18 | auto describe () const -> std::string override; 19 | 20 | private: 21 | JPH::Ref m_shape_settings; 22 | }; 23 | 24 | } // namespace erhe::physics 25 | -------------------------------------------------------------------------------- /src/erhe/physics/erhe_physics/jolt/jolt_convex_hull_collision_shape.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "erhe_physics/jolt/jolt_collision_shape.hpp" 4 | 5 | #include 6 | #include 7 | 8 | namespace erhe::physics { 9 | 10 | class Jolt_convex_hull_collision_shape : public Jolt_collision_shape 11 | { 12 | public: 13 | Jolt_convex_hull_collision_shape(const float* points, int point_count, int stride); 14 | 15 | auto get_shape_settings() -> JPH::ShapeSettings& override; 16 | auto describe () const -> std::string override; 17 | 18 | private: 19 | JPH::Ref m_shape_settings; 20 | }; 21 | 22 | } // namespace erhe::physics 23 | -------------------------------------------------------------------------------- /src/erhe/physics/erhe_physics/jolt/jolt_uniform_scaling_shape.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "erhe_physics/jolt/jolt_collision_shape.hpp" 4 | 5 | #include 6 | #include 7 | 8 | namespace erhe::physics { 9 | 10 | class Jolt_uniform_scaling_shape : public Jolt_collision_shape 11 | { 12 | public: 13 | Jolt_uniform_scaling_shape(ICollision_shape* shape, float scale); 14 | 15 | auto get_shape_settings() -> JPH::ShapeSettings& override; 16 | auto describe () const -> std::string override; 17 | 18 | private: 19 | JPH::Ref m_shape_settings; 20 | }; 21 | 22 | } // namespace erhe::physics 23 | -------------------------------------------------------------------------------- /src/erhe/physics/erhe_physics/null/null_compound_shape.cpp: -------------------------------------------------------------------------------- 1 | #include "erhe_physics/null/null_compound_shape.hpp" 2 | #include "erhe_verify/verify.hpp" 3 | 4 | namespace erhe::physics 5 | { 6 | 7 | auto ICollision_shape::create_compound_shape(const Compound_shape_create_info& create_info) -> ICollision_shape* 8 | { 9 | return new Null_compound_shape(create_info); 10 | } 11 | 12 | auto ICollision_shape::create_compound_shape_shared(const Compound_shape_create_info& create_info) -> std::shared_ptr 13 | { 14 | return std::make_shared(create_info); 15 | } 16 | 17 | 18 | } // namespace erhe::physics 19 | -------------------------------------------------------------------------------- /src/erhe/physics/erhe_physics/null/null_compound_shape.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "erhe_physics/null/null_collision_shape.hpp" 4 | 5 | #include 6 | 7 | #include 8 | #include 9 | 10 | namespace erhe::physics 11 | { 12 | 13 | class Null_compound_shape 14 | : public Null_collision_shape 15 | { 16 | public: 17 | explicit Null_compound_shape(const Compound_shape_create_info& create_info) 18 | { 19 | static_cast(create_info); 20 | } 21 | 22 | // Implements ICollision_shape 23 | auto is_convex() const -> bool override 24 | { 25 | return false; 26 | } 27 | }; 28 | 29 | } // namespace erhe::physics 30 | -------------------------------------------------------------------------------- /src/erhe/physics/erhe_physics/null/null_constraint.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "erhe_physics/iconstraint.hpp" 4 | 5 | #include 6 | 7 | #include 8 | 9 | namespace erhe::physics 10 | { 11 | 12 | class IRigid_body; 13 | 14 | class Null_point_to_point_constraint 15 | : public IConstraint 16 | { 17 | public: 18 | explicit Null_point_to_point_constraint( 19 | const Point_to_point_constraint_settings& settings 20 | ) 21 | : m_settings{settings} 22 | { 23 | } 24 | 25 | private: 26 | Point_to_point_constraint_settings m_settings; 27 | }; 28 | 29 | } // namespace erhe::physics 30 | -------------------------------------------------------------------------------- /src/erhe/physics/erhe_physics/null/null_convex_hull_collision_shape.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "erhe_physics/null/null_collision_shape.hpp" 4 | 5 | #include 6 | 7 | #include 8 | 9 | namespace erhe::physics 10 | { 11 | 12 | class Null_convex_hull_collision_shape 13 | : public Null_collision_shape 14 | { 15 | public: 16 | Null_convex_hull_collision_shape(const float* points, const int numPoints, const int stride); 17 | }; 18 | 19 | } // namespace erhe::physics 20 | -------------------------------------------------------------------------------- /src/erhe/physics/erhe_physics/physics_log.cpp: -------------------------------------------------------------------------------- 1 | #include "erhe_physics/physics_log.hpp" 2 | #include "erhe_log/log.hpp" 3 | 4 | namespace erhe::physics { 5 | 6 | std::shared_ptr log_physics; 7 | std::shared_ptr log_physics_frame; 8 | 9 | void initialize_logging() 10 | { 11 | using namespace erhe::log; 12 | log_physics = make_logger ("erhe.physics.physics"); 13 | log_physics_frame = make_frame_logger("erhe.physics.physics_frame"); 14 | } 15 | 16 | } // namespace erhe::physics 17 | -------------------------------------------------------------------------------- /src/erhe/physics/erhe_physics/physics_log.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | namespace erhe::physics { 8 | 9 | extern std::shared_ptr log_physics; 10 | extern std::shared_ptr log_physics_frame; 11 | 12 | void initialize_logging(); 13 | 14 | } // namespace erhe::physics 15 | -------------------------------------------------------------------------------- /src/erhe/primitive/Readme.md: -------------------------------------------------------------------------------- 1 | erhe primitive 2 | ============== 3 | 4 | erhe mesh is a C++ library for creating renderable vertex and index buffers 5 | from erhe geometry objects. 6 | -------------------------------------------------------------------------------- /src/erhe/primitive/erhe_primitive/buffer_info.cpp: -------------------------------------------------------------------------------- 1 | #include "erhe_primitive/buffer_info.hpp" 2 | -------------------------------------------------------------------------------- /src/erhe/primitive/erhe_primitive/buffer_info.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "erhe_dataformat/vertex_format.hpp" 4 | #include "erhe_primitive/enums.hpp" 5 | 6 | namespace erhe::primitive { 7 | 8 | class Buffer_sink; 9 | 10 | class Buffer_info 11 | { 12 | public: 13 | Normal_style normal_style {Normal_style::corner_normals}; 14 | erhe::dataformat::Format index_type {erhe::dataformat::Format::format_16_scalar_uint}; 15 | const erhe::dataformat::Vertex_format& vertex_format; 16 | Buffer_sink& buffer_sink; 17 | }; 18 | 19 | } // namesapce erhe::primitive 20 | -------------------------------------------------------------------------------- /src/erhe/primitive/erhe_primitive/buffer_range.cpp: -------------------------------------------------------------------------------- 1 | #include "erhe_primitive/buffer_range.hpp" 2 | -------------------------------------------------------------------------------- /src/erhe/primitive/erhe_primitive/buffer_range.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace erhe::primitive { 6 | 7 | class Buffer_range 8 | { 9 | public: 10 | [[nodiscard]] auto get_byte_size() const -> std::size_t { return count * element_size; } 11 | 12 | std::size_t count {0}; 13 | std::size_t element_size{0}; 14 | std::size_t byte_offset {0}; 15 | std::size_t stream {0}; 16 | }; 17 | 18 | } // namespace erhe::primitive 19 | -------------------------------------------------------------------------------- /src/erhe/primitive/erhe_primitive/build_info.cpp: -------------------------------------------------------------------------------- 1 | #include "erhe_primitive/build_info.hpp" 2 | -------------------------------------------------------------------------------- /src/erhe/primitive/erhe_primitive/format_info.cpp: -------------------------------------------------------------------------------- 1 | #include "erhe_primitive/format_info.hpp" 2 | 3 | namespace erhe::primitive { 4 | 5 | } // namespace erhe::primitive 6 | -------------------------------------------------------------------------------- /src/erhe/primitive/erhe_primitive/index_range.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "erhe_primitive/enums.hpp" 4 | 5 | #include 6 | 7 | namespace erhe::primitive { 8 | 9 | /// Holds index range for specified GL primitive type 10 | class Index_range 11 | { 12 | public: 13 | [[nodiscard]] auto get_primitive_count() const -> std::size_t; 14 | [[nodiscard]] auto get_point_count () const -> std::size_t; 15 | [[nodiscard]] auto get_line_count () const -> std::size_t; 16 | [[nodiscard]] auto get_triangle_count () const -> std::size_t; 17 | 18 | Primitive_type primitive_type{Primitive_type::triangles}; 19 | std::size_t first_index {0}; 20 | std::size_t index_count {0}; 21 | }; 22 | 23 | } // namespace erhe::primitive 24 | -------------------------------------------------------------------------------- /src/erhe/primitive/erhe_primitive/primitive_log.cpp: -------------------------------------------------------------------------------- 1 | #include "erhe_primitive/primitive_log.hpp" 2 | #include "erhe_log/log.hpp" 3 | 4 | namespace erhe::primitive { 5 | 6 | std::shared_ptr log_primitive_builder; 7 | std::shared_ptr log_primitive; 8 | 9 | void initialize_logging() 10 | { 11 | using namespace erhe::log; 12 | log_primitive_builder = make_logger("erhe.primitive.primitive_builder"); 13 | log_primitive = make_logger("erhe.primitive.primitive" ); 14 | } 15 | 16 | } // namespace erhe::primitive 17 | -------------------------------------------------------------------------------- /src/erhe/primitive/erhe_primitive/primitive_log.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | namespace erhe::primitive { 8 | 9 | extern std::shared_ptr log_primitive_builder; 10 | extern std::shared_ptr log_primitive; 11 | 12 | void initialize_logging(); 13 | 14 | } // namespace erhe::primitive 15 | -------------------------------------------------------------------------------- /src/erhe/profile/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(_target "erhe_profile") 2 | add_library(${_target}) 3 | add_library(erhe::profile ALIAS ${_target}) 4 | erhe_target_sources_grouped( 5 | ${_target} TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES 6 | erhe_profile/profile.cpp 7 | erhe_profile/profile.hpp 8 | ) 9 | 10 | target_include_directories(${_target} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 11 | 12 | if (DEFINED ERHE_PROFILE_TARGET) 13 | target_link_libraries(${_target} PUBLIC ${ERHE_PROFILE_TARGET}) 14 | endif () 15 | 16 | erhe_target_settings(${_target} "erhe") 17 | -------------------------------------------------------------------------------- /src/erhe/profile/erhe_profile/profile.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/erhe/profile/erhe_profile/profile.cpp -------------------------------------------------------------------------------- /src/erhe/raytrace/erhe_raytrace/bvh/bvh_buffer.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/erhe/raytrace/erhe_raytrace/bvh/bvh_buffer.cpp -------------------------------------------------------------------------------- /src/erhe/raytrace/erhe_raytrace/bvh/bvh_buffer.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/erhe/raytrace/erhe_raytrace/bvh/bvh_buffer.hpp -------------------------------------------------------------------------------- /src/erhe/raytrace/erhe_raytrace/bvh/glm_conversions.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace erhe::raytrace 7 | { 8 | 9 | [[nodiscard]] inline auto from_bvh(const bvh::v2::Vec v) -> glm::vec3 10 | { 11 | return glm::vec3{ 12 | v[0], 13 | v[1], 14 | v[2] 15 | }; 16 | } 17 | 18 | [[nodiscard]] inline auto to_bvh(const glm::vec3 v) -> bvh::v2::Vec 19 | { 20 | return bvh::v2::Vec{v.x, v.y, v.z}; 21 | } 22 | 23 | } // namespace erhe::physics 24 | -------------------------------------------------------------------------------- /src/erhe/raytrace/erhe_raytrace/null/null_buffer.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/erhe/raytrace/erhe_raytrace/null/null_buffer.cpp -------------------------------------------------------------------------------- /src/erhe/raytrace/erhe_raytrace/null/null_buffer.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/erhe/raytrace/erhe_raytrace/null/null_buffer.hpp -------------------------------------------------------------------------------- /src/erhe/raytrace/erhe_raytrace/ray.cpp: -------------------------------------------------------------------------------- 1 | #include "erhe_raytrace/ray.hpp" 2 | 3 | namespace erhe::raytrace { 4 | 5 | auto Ray::transform(const glm::mat4& matrix) const -> Ray 6 | { 7 | return Ray{ 8 | .origin = glm::vec3{matrix * glm::vec4{origin, 1.0}}, 9 | .t_near = t_near, 10 | .direction = glm::vec3{matrix * glm::vec4{direction, 0.0}}, 11 | .time = time, 12 | .t_far = t_far, 13 | .mask = mask, 14 | .id = id, 15 | .flags = flags 16 | }; 17 | } 18 | 19 | } // namespace 20 | -------------------------------------------------------------------------------- /src/erhe/raytrace/erhe_raytrace/raytrace_log.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | namespace erhe::raytrace { 8 | 9 | extern std::shared_ptr log_buffer; 10 | extern std::shared_ptr log_device; 11 | extern std::shared_ptr log_geometry; 12 | extern std::shared_ptr log_instance; 13 | extern std::shared_ptr log_scene; 14 | extern std::shared_ptr log_embree; 15 | extern std::shared_ptr log_frame; 16 | 17 | void initialize_logging(); 18 | 19 | } // namespace erhe::primitive 20 | -------------------------------------------------------------------------------- /src/erhe/renderer/erhe_renderer/buffer_writer.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/erhe/renderer/erhe_renderer/buffer_writer.cpp -------------------------------------------------------------------------------- /src/erhe/renderer/erhe_renderer/buffer_writer.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | -------------------------------------------------------------------------------- /src/erhe/renderer/erhe_renderer/enums.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace erhe::renderer 4 | { 5 | 6 | //enum class Fill_mode : int 7 | //{ 8 | // fill = 0, 9 | // outline = 1 10 | //}; 11 | 12 | enum class Blend_mode : int 13 | { 14 | opaque = 0, 15 | translucent = 1 16 | }; 17 | 18 | //enum class Selection_mode : int 19 | //{ 20 | // not_selected = 0, 21 | // selected = 1, 22 | // any = 2 23 | //}; 24 | 25 | // TODO This does not? belong to erhe::renderer? 26 | enum class Visualization_mode : unsigned int 27 | { 28 | off = 0, 29 | selected, 30 | all 31 | }; 32 | 33 | 34 | } // namespace erhe::renderer 35 | -------------------------------------------------------------------------------- /src/erhe/renderer/erhe_renderer/pipeline_renderpass.cpp: -------------------------------------------------------------------------------- 1 | #include "erhe_renderer/pipeline_renderpass.hpp" 2 | 3 | namespace erhe::renderer { 4 | 5 | Pipeline_renderpass::Pipeline_renderpass(erhe::graphics::Pipeline&& pipeline) 6 | : pipeline{pipeline} 7 | { 8 | } 9 | 10 | Pipeline_renderpass::Pipeline_renderpass( 11 | erhe::graphics::Pipeline&& pipeline, 12 | std::function begin, 13 | std::function end 14 | ) 15 | : pipeline{pipeline} 16 | , begin{begin} 17 | , end{end} 18 | { 19 | } 20 | 21 | void Pipeline_renderpass::reset() 22 | { 23 | pipeline.reset(); 24 | begin = {}; 25 | end = {}; 26 | } 27 | 28 | } // namespace erhe::renderer 29 | -------------------------------------------------------------------------------- /src/erhe/renderer/erhe_renderer/pipeline_renderpass.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "erhe_graphics/pipeline.hpp" 4 | 5 | #include 6 | 7 | namespace erhe::renderer { 8 | 9 | class Pipeline_renderpass 10 | { 11 | public: 12 | void reset(); 13 | 14 | explicit Pipeline_renderpass(erhe::graphics::Pipeline&& pipeline); 15 | Pipeline_renderpass( 16 | erhe::graphics::Pipeline&& pipeline, 17 | std::function begin, 18 | std::function end 19 | ); 20 | 21 | erhe::graphics::Pipeline pipeline; 22 | std::function begin; 23 | std::function end; 24 | }; 25 | 26 | } // namespace erhe::renderer 27 | -------------------------------------------------------------------------------- /src/erhe/renderer/erhe_renderer/renderer_config.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace erhe::renderer { 4 | 5 | } // namespace erhe::renderer 6 | -------------------------------------------------------------------------------- /src/erhe/renderer/erhe_renderer/renderer_log.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | namespace erhe::renderer { 8 | 9 | extern std::shared_ptr log_draw; 10 | extern std::shared_ptr log_render; 11 | extern std::shared_ptr log_startup; 12 | extern std::shared_ptr log_buffer_writer; 13 | extern std::shared_ptr log_gpu_ring_buffer; 14 | 15 | void initialize_logging(); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/erhe/renderer/erhe_renderer/renderer_message_bus.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/erhe/renderer/erhe_renderer/renderer_message_bus.cpp -------------------------------------------------------------------------------- /src/erhe/renderer/erhe_renderer/renderer_message_bus.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/erhe/renderer/erhe_renderer/renderer_message_bus.hpp -------------------------------------------------------------------------------- /src/erhe/rendergraph/erhe_rendergraph/rendergraph_log.cpp: -------------------------------------------------------------------------------- 1 | #include "erhe_rendergraph/rendergraph_log.hpp" 2 | #include "erhe_log/log.hpp" 3 | 4 | namespace erhe::rendergraph { 5 | 6 | std::shared_ptr log_tail; 7 | std::shared_ptr log_frame; 8 | 9 | void initialize_logging() 10 | { 11 | using namespace erhe::log; 12 | log_tail = make_logger ("erhe.rendergraph.tail" ); 13 | log_frame = make_frame_logger("erhe.rendergraph.frame"); 14 | } 15 | 16 | } // namespace erhe::rendergraph 17 | -------------------------------------------------------------------------------- /src/erhe/rendergraph/erhe_rendergraph/rendergraph_log.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | namespace erhe::rendergraph { 8 | 9 | extern std::shared_ptr log_tail; 10 | extern std::shared_ptr log_frame; 11 | 12 | void initialize_logging(); 13 | 14 | } // namespace erhe::rendergraph 15 | -------------------------------------------------------------------------------- /src/erhe/rendergraph/erhe_rendergraph/sink_rendergraph_node.cpp: -------------------------------------------------------------------------------- 1 | #include "erhe_rendergraph/sink_rendergraph_node.hpp" 2 | 3 | namespace erhe::rendergraph { 4 | 5 | Sink_rendergraph_node::Sink_rendergraph_node(Rendergraph& rendergraph, const std::string_view name) 6 | : Rendergraph_node{rendergraph, name} 7 | { 8 | } 9 | 10 | void Sink_rendergraph_node::execute_rendergraph_node() 11 | { 12 | } 13 | 14 | auto Sink_rendergraph_node::outputs_allowed() const -> bool 15 | { 16 | return false; 17 | } 18 | 19 | } // namespace erhe::rendergraph 20 | -------------------------------------------------------------------------------- /src/erhe/scene/Readme.md: -------------------------------------------------------------------------------- 1 | erhe scene 2 | ========== 3 | 4 | erhe scene is a C++ library for maintaining 3D transformations 5 | for scene objects, cameras and lights. 6 | -------------------------------------------------------------------------------- /src/erhe/scene/erhe_scene/scene_host.cpp: -------------------------------------------------------------------------------- 1 | #include "erhe_scene/scene_host.hpp" 2 | 3 | namespace erhe::scene { 4 | 5 | Scene_host::~Scene_host() noexcept = default; 6 | 7 | } // namespace erhe::scene 8 | 9 | -------------------------------------------------------------------------------- /src/erhe/scene/erhe_scene/scene_log.cpp: -------------------------------------------------------------------------------- 1 | #include "erhe_scene/scene_log.hpp" 2 | #include "erhe_log/log.hpp" 3 | 4 | namespace erhe::scene { 5 | 6 | std::shared_ptr log; 7 | std::shared_ptr log_frame; 8 | std::shared_ptr log_mesh_raytrace; 9 | 10 | void initialize_logging() 11 | { 12 | using namespace erhe::log; 13 | log = make_logger ("erhe.scene.log" ); 14 | log_frame = make_frame_logger("erhe.scene.log_frame" ); 15 | log_mesh_raytrace = make_frame_logger("erhe.scene.mesh_raytrace"); 16 | } 17 | 18 | } // namespace erhe::scene 19 | -------------------------------------------------------------------------------- /src/erhe/scene/erhe_scene/scene_log.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | namespace erhe::scene { 8 | 9 | extern std::shared_ptr log; 10 | extern std::shared_ptr log_frame; 11 | extern std::shared_ptr log_mesh_raytrace; 12 | 13 | void initialize_logging(); 14 | 15 | } // namespace erhe::scene 16 | -------------------------------------------------------------------------------- /src/erhe/scene/erhe_scene/scene_message.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace erhe::scene { 6 | 7 | class Node; 8 | class Scene; 9 | 10 | enum class Scene_event_type : int { 11 | invalid, 12 | node_added_to_scene, 13 | node_removed_from_scene, 14 | node_replaced, 15 | node_changed, 16 | selection_changed 17 | }; 18 | 19 | class Scene_message 20 | { 21 | public: 22 | Scene_event_type event_type{Scene_event_type::invalid}; 23 | Scene* scene{nullptr}; 24 | std::shared_ptr lhs{}; 25 | std::shared_ptr rhs{}; 26 | }; 27 | 28 | } // namespace erhe::scene 29 | -------------------------------------------------------------------------------- /src/erhe/scene/erhe_scene/scene_message_bus.cpp: -------------------------------------------------------------------------------- 1 | #include "erhe_scene/scene_message_bus.hpp" 2 | 3 | namespace erhe::scene { 4 | 5 | Scene_message_bus::Scene_message_bus() = default; 6 | 7 | } // namespace erhe::scene 8 | -------------------------------------------------------------------------------- /src/erhe/scene/erhe_scene/scene_message_bus.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "erhe_message_bus/message_bus.hpp" 4 | #include "erhe_scene/scene_message.hpp" 5 | 6 | namespace erhe::scene { 7 | 8 | class Scene_message_bus : public erhe::message_bus::Message_bus 9 | { 10 | public: 11 | Scene_message_bus(); 12 | }; 13 | 14 | } // namespace erhe::scene 15 | -------------------------------------------------------------------------------- /src/erhe/scene/erhe_scene/scene_pch.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | -------------------------------------------------------------------------------- /src/erhe/scene_renderer/erhe_scene_renderer/buffer_binding_points.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace erhe::scene_renderer { 4 | 5 | #define material_buffer_binding_point 0 6 | 7 | #define light_buffer_binding_point 1 8 | #define light_control_buffer_binding_point 2 9 | 10 | #define primitive_buffer_binding_point 3 11 | 12 | #define camera_buffer_binding_point 4 13 | 14 | #define cube_instance_buffer_binding_point 5 15 | #define cube_control_buffer_binding_point 6 16 | 17 | #define joint_buffer_binding_point 7 18 | 19 | } // namespace erhe::scene_renderer 20 | -------------------------------------------------------------------------------- /src/erhe/scene_renderer/erhe_scene_renderer/scene_renderer_log.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | namespace erhe::scene_renderer { 8 | 9 | extern std::shared_ptr log_draw; 10 | extern std::shared_ptr log_render; 11 | extern std::shared_ptr log_program_interface; 12 | extern std::shared_ptr log_forward_renderer; 13 | extern std::shared_ptr log_shadow_renderer; 14 | extern std::shared_ptr log_startup; 15 | extern std::shared_ptr log_material_buffer; 16 | extern std::shared_ptr log_primitive_buffer; 17 | 18 | void initialize_logging(); 19 | 20 | } // namespace erhe::scene_renderer 21 | -------------------------------------------------------------------------------- /src/erhe/time/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(_target "erhe_time") 2 | add_library(${_target}) 3 | add_library(erhe::time ALIAS ${_target}) 4 | erhe_target_sources_grouped( 5 | ${_target} TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES 6 | erhe_time/sleep.cpp 7 | erhe_time/sleep.hpp 8 | erhe_time/time_log.cpp 9 | erhe_time/time_log.hpp 10 | erhe_time/timer.cpp 11 | erhe_time/timer.hpp 12 | erhe_time/timestamp.cpp 13 | erhe_time/timestamp.hpp 14 | ) 15 | 16 | target_include_directories(${_target} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 17 | 18 | target_link_libraries(${_target} 19 | PUBLIC 20 | fmt::fmt 21 | PRIVATE 22 | erhe::log 23 | erhe::profile 24 | ) 25 | 26 | erhe_target_settings(${_target} "erhe") 27 | -------------------------------------------------------------------------------- /src/erhe/time/erhe_time/sleep.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace erhe::time { 7 | 8 | auto sleep_initialize() -> bool; 9 | void sleep_for(std::chrono::duration time_to_sleep); 10 | void sleep_for_100ns(int64_t time_to_sleep_in_100ns); 11 | 12 | } // namespace erhe::time 13 | -------------------------------------------------------------------------------- /src/erhe/time/erhe_time/time_log.cpp: -------------------------------------------------------------------------------- 1 | #include "erhe_time/time_log.hpp" 2 | #include "erhe_log/log.hpp" 3 | 4 | namespace erhe::time { 5 | 6 | std::shared_ptr log_time; 7 | 8 | void initialize_logging() 9 | { 10 | using namespace erhe::log; 11 | log_time = make_logger("erhe.time"); 12 | } 13 | 14 | } // namespace erhe::time 15 | -------------------------------------------------------------------------------- /src/erhe/time/erhe_time/time_log.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | namespace erhe::time { 8 | 9 | extern std::shared_ptr log_time; 10 | 11 | void initialize_logging(); 12 | 13 | } // namespace erhe::time 14 | -------------------------------------------------------------------------------- /src/erhe/time/erhe_time/timestamp.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace erhe::time { 6 | 7 | [[nodiscard]] auto timestamp () -> std::string; 8 | [[nodiscard]] auto timestamp_short() -> std::string; 9 | 10 | } // namespace erhe::time 11 | -------------------------------------------------------------------------------- /src/erhe/ui/erhe_ui/ui_log.cpp: -------------------------------------------------------------------------------- 1 | #include "erhe_ui/ui_log.hpp" 2 | #include "erhe_log/log.hpp" 3 | 4 | namespace erhe::ui { 5 | 6 | std::shared_ptr log_text_buffer; 7 | std::shared_ptr log_font; 8 | 9 | void initialize_logging() 10 | { 11 | using namespace erhe::log; 12 | log_text_buffer = make_logger("erhe.ui.text_buffer"); 13 | log_font = make_logger("erhe.ui.font" ); 14 | } 15 | 16 | } // namespace erhe::ui 17 | -------------------------------------------------------------------------------- /src/erhe/ui/erhe_ui/ui_log.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | namespace erhe::ui { 8 | 9 | extern std::shared_ptr log_text_buffer; 10 | extern std::shared_ptr log_font; 11 | 12 | void initialize_logging(); 13 | 14 | } // namespace erhe::ui 15 | -------------------------------------------------------------------------------- /src/erhe/verify/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(_target "erhe_verify") 2 | add_library(${_target}) 3 | add_library(erhe::verify ALIAS ${_target}) 4 | erhe_target_sources_grouped( 5 | ${_target} TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES 6 | erhe_verify/verify.cpp 7 | erhe_verify/verify.hpp 8 | ) 9 | 10 | target_include_directories(${_target} INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) 11 | 12 | erhe_target_settings(${_target} "erhe") 13 | -------------------------------------------------------------------------------- /src/erhe/verify/erhe_verify/verify.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/erhe/verify/erhe_verify/verify.cpp -------------------------------------------------------------------------------- /src/erhe/window/Readme.md: -------------------------------------------------------------------------------- 1 | erhe window 2 | ============ 3 | 4 | erhe windo is a C++ wrapper/abstraction for SDL / glfw. 5 | -------------------------------------------------------------------------------- /src/erhe/window/erhe_window/renderdoc_capture.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace erhe::window { 4 | 5 | class Context_window; 6 | 7 | void initialize_frame_capture(); 8 | void start_frame_capture (const Context_window& context_window); 9 | void end_frame_capture (const Context_window& context_window); 10 | 11 | } // namespace erhe::window 12 | -------------------------------------------------------------------------------- /src/erhe/window/erhe_window/window.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if defined(ERHE_WINDOW_LIBRARY_GLFW) 4 | # include "erhe_window/glfw_window.hpp" 5 | #endif 6 | #if defined(ERHE_WINDOW_LIBRARY_SDL) 7 | # include "erhe_window/sdl_window.hpp" 8 | #endif 9 | 10 | #include 11 | 12 | namespace erhe::window { 13 | 14 | [[nodiscard]] auto format_window_title(const char* window_name) -> std::string; 15 | 16 | } // namespace erhe::window 17 | -------------------------------------------------------------------------------- /src/erhe/window/erhe_window/window_log.cpp: -------------------------------------------------------------------------------- 1 | #include "erhe_window/window_log.hpp" 2 | #include "erhe_log/log.hpp" 3 | 4 | namespace erhe::window { 5 | 6 | std::shared_ptr log_space_mouse; 7 | std::shared_ptr log_window; 8 | std::shared_ptr log_window_event; 9 | std::shared_ptr log_renderdoc; 10 | 11 | void initialize_logging() 12 | { 13 | using namespace erhe::log; 14 | log_space_mouse = make_logger("erhe.window.space_mouse" ); 15 | log_window = make_logger("erhe.window.window" ); 16 | log_window_event = make_logger("erhe.window.window_event"); 17 | log_renderdoc = make_logger("erhe.window.renderdoc" ); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/erhe/window/erhe_window/window_log.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | namespace erhe::window { 8 | 9 | extern std::shared_ptr log_space_mouse; 10 | extern std::shared_ptr log_window; 11 | extern std::shared_ptr log_window_event; 12 | extern std::shared_ptr log_renderdoc; 13 | 14 | void initialize_logging(); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/erhe/xr/erhe_xr/xr_log.cpp: -------------------------------------------------------------------------------- 1 | #include "erhe_xr/xr_log.hpp" 2 | #include "erhe_log/log.hpp" 3 | 4 | namespace erhe::xr { 5 | 6 | std::shared_ptr log_xr; 7 | 8 | void initialize_logging() 9 | { 10 | using namespace erhe::log; 11 | log_xr = make_logger("erhe.xr.log"); 12 | } 13 | 14 | } // namespace erhe::ui 15 | -------------------------------------------------------------------------------- /src/erhe/xr/erhe_xr/xr_log.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | namespace erhe::xr { 8 | 9 | extern std::shared_ptr log_xr; 10 | 11 | void initialize_logging(); 12 | 13 | } // namespace erhe::xr 14 | -------------------------------------------------------------------------------- /src/example/.gitignore: -------------------------------------------------------------------------------- 1 | log.txt 2 | example 3 | example.exe 4 | Debug 5 | Release 6 | RelWithDebInfo 7 | -------------------------------------------------------------------------------- /src/example/example.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace example { 4 | 5 | void run_example(); 6 | 7 | } // namespace example 8 | -------------------------------------------------------------------------------- /src/example/example_log.cpp: -------------------------------------------------------------------------------- 1 | #include "example_log.hpp" 2 | #include "erhe_log/log.hpp" 3 | 4 | namespace example { 5 | 6 | std::shared_ptr log_startup; 7 | std::shared_ptr log_gltf; 8 | 9 | void initialize_logging() 10 | { 11 | using namespace erhe::log; 12 | log_startup = make_logger("example.startup"); 13 | log_gltf = make_logger("example.gltf" ); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/example/example_log.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include 6 | 7 | namespace example { 8 | 9 | extern std::shared_ptr log_startup; 10 | extern std::shared_ptr log_gltf; 11 | 12 | void initialize_logging(); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/example/main.cpp: -------------------------------------------------------------------------------- 1 | #include "example.hpp" 2 | 3 | auto main(int, char**) -> int 4 | { 5 | example::run_example(); 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /src/example/res/models/Box0.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/example/res/models/Box0.bin -------------------------------------------------------------------------------- /src/example/res/models/SM_Deccer_Cubes_Textured.glb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/example/res/models/SM_Deccer_Cubes_Textured.glb -------------------------------------------------------------------------------- /src/example/res/shaders/depth.frag: -------------------------------------------------------------------------------- 1 | void main(void) 2 | { 3 | } 4 | -------------------------------------------------------------------------------- /src/example/res/shaders/depth.vert: -------------------------------------------------------------------------------- 1 | void main() 2 | { 3 | mat4 world_from_node = primitive.primitives[gl_DrawID].world_from_node; 4 | mat4 clip_from_world = light_block.lights[light_control_block.light_index].clip_from_world; 5 | vec4 position_in_world = world_from_node * vec4(a_position, 1.0); 6 | gl_Position = clip_from_world * position_in_world; 7 | } 8 | 9 | -------------------------------------------------------------------------------- /src/hextiles/.gitignore: -------------------------------------------------------------------------------- 1 | log.txt 2 | hextiles 3 | hextiles.exe 4 | Debug 5 | Release 6 | RelWithDebInfo 7 | -------------------------------------------------------------------------------- /src/hextiles/coordinate.cpp: -------------------------------------------------------------------------------- 1 | #include "coordinate.hpp" 2 | -------------------------------------------------------------------------------- /src/hextiles/file_util.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace hextiles { 7 | 8 | auto read_file (const char* path) -> std::vector; 9 | auto read_file_string(const char* path) -> std::string; 10 | auto write_file (const char* path, const unsigned char* buffer, std::size_t length) -> bool; 11 | auto write_file (const char* path, const std::string& text) -> bool; 12 | auto get_string (const std::vector& data, std::size_t offset, std::size_t length) -> std::string; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/hextiles/hextiles.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace hextiles { 4 | 5 | void run_hextiles(); 6 | 7 | } 8 | 9 | -------------------------------------------------------------------------------- /src/hextiles/hextiles_settings.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "erhe_imgui/imgui_renderer.hpp" 4 | 5 | namespace erhe::window { 6 | class Context_window; 7 | } 8 | 9 | namespace hextiles { 10 | 11 | class Hextiles_settings 12 | { 13 | public: 14 | explicit Hextiles_settings(erhe::window::Context_window& context_window); 15 | 16 | erhe::imgui::Imgui_settings imgui; 17 | }; 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/hextiles/main.cpp: -------------------------------------------------------------------------------- 1 | #include "hextiles.hpp" 2 | #include 3 | 4 | auto main(int, char**) -> int 5 | { 6 | hextiles::run_hextiles(); 7 | 8 | return EXIT_SUCCESS; 9 | } 10 | -------------------------------------------------------------------------------- /src/hextiles/map_editor/terrain_palette_window.cpp: -------------------------------------------------------------------------------- 1 | #include "map_editor/terrain_palette_window.hpp" 2 | 3 | #include "map_editor/map_editor.hpp" 4 | 5 | #include "erhe_imgui/imgui_windows.hpp" 6 | 7 | namespace hextiles 8 | { 9 | 10 | Terrain_palette_window::Terrain_palette_window( 11 | erhe::imgui::Imgui_renderer& imgui_renderer, 12 | erhe::imgui::Imgui_windows& imgui_windows, 13 | Map_editor& map_editor 14 | ) 15 | : Imgui_window{imgui_renderer, imgui_windows, "Terrain Palette", "terrain_palete"} 16 | , m_map_editor{map_editor} 17 | { 18 | hide_window(); 19 | } 20 | 21 | void Terrain_palette_window::imgui() 22 | { 23 | m_map_editor.terrain_palette(); 24 | } 25 | 26 | } // namespace hextiles 27 | -------------------------------------------------------------------------------- /src/hextiles/map_editor/terrain_palette_window.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "erhe_imgui/imgui_window.hpp" 4 | 5 | namespace erhe::imgui { 6 | class Imgui_windows; 7 | } 8 | 9 | namespace hextiles { 10 | 11 | class Map_editor; 12 | 13 | class Terrain_palette_window : public erhe::imgui::Imgui_window 14 | { 15 | public: 16 | Terrain_palette_window( 17 | erhe::imgui::Imgui_renderer& imgui_renderer, 18 | erhe::imgui::Imgui_windows& imgui_windows, 19 | Map_editor& map_editor 20 | ); 21 | 22 | // Implements Imgui_window 23 | void imgui() override; 24 | 25 | private: 26 | Map_editor& m_map_editor; 27 | }; 28 | 29 | } // namespace hextiles 30 | -------------------------------------------------------------------------------- /src/hextiles/map_generator/biome.cpp: -------------------------------------------------------------------------------- 1 | #include "map_generator/biome.hpp" 2 | 3 | -------------------------------------------------------------------------------- /src/hextiles/map_generator/biome.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "types.hpp" 4 | 5 | namespace hextiles { 6 | 7 | struct Biome 8 | { 9 | terrain_t base_terrain; 10 | terrain_t variation; 11 | int priority; 12 | float min_temperature; 13 | float max_temperature; 14 | float min_humidity; 15 | float max_humidity; 16 | }; 17 | 18 | } // namespace hextiles 19 | -------------------------------------------------------------------------------- /src/hextiles/map_generator/fbm_noise.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace hextiles { 6 | 7 | class Fbm_noise 8 | { 9 | public: 10 | void prepare (); 11 | auto generate(float s, float t, glm::vec4 seed) -> float; 12 | void imgui (); 13 | 14 | private: 15 | auto generate(float x, float y, float z, float w, glm::vec4 seed) -> float; 16 | 17 | float m_bounding {0.0f}; 18 | float m_frequency {0.4f}; 19 | float m_lacunarity {1.50f}; 20 | float m_gain {0.75f}; 21 | int m_octaves {5}; 22 | float m_location[2]{0.0f, 0.0f}; 23 | }; 24 | 25 | } // namespace hextiles 26 | -------------------------------------------------------------------------------- /src/hextiles/map_generator/terrain_variation.cpp: -------------------------------------------------------------------------------- 1 | #include "map_generator/terrain_variation.hpp" 2 | 3 | -------------------------------------------------------------------------------- /src/hextiles/map_generator/terrain_variation.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "terrain_type.hpp" 4 | 5 | namespace hextiles { 6 | 7 | struct Terrain_variation 8 | { 9 | int id {0}; 10 | terrain_t base_terrain {0}; 11 | terrain_t variation_terrain{0}; 12 | float ratio {1.0f}; 13 | float normalized_ratio {1.0f}; 14 | float threshold {0.0f}; 15 | }; 16 | 17 | } // namespace hextiles 18 | -------------------------------------------------------------------------------- /src/hextiles/rendering.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/hextiles/rendering.cpp -------------------------------------------------------------------------------- /src/hextiles/rendering.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/hextiles/rendering.hpp -------------------------------------------------------------------------------- /src/hextiles/res/fonts/SourceCodePro-SemiBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/hextiles/res/fonts/SourceCodePro-SemiBold.ttf -------------------------------------------------------------------------------- /src/hextiles/res/fonts/SourceCodePro-Semibold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/hextiles/res/fonts/SourceCodePro-Semibold.otf -------------------------------------------------------------------------------- /src/hextiles/res/fonts/SourceSansPro-Regular.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/hextiles/res/fonts/SourceSansPro-Regular.otf -------------------------------------------------------------------------------- /src/hextiles/res/hextiles/DEEP.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/hextiles/res/hextiles/DEEP.wav -------------------------------------------------------------------------------- /src/hextiles/res/hextiles/GND.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/hextiles/res/hextiles/GND.wav -------------------------------------------------------------------------------- /src/hextiles/res/hextiles/Help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/hextiles/res/hextiles/Help.png -------------------------------------------------------------------------------- /src/hextiles/res/hextiles/March.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/hextiles/res/hextiles/March.wav -------------------------------------------------------------------------------- /src/hextiles/res/hextiles/SEA.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/hextiles/res/hextiles/SEA.wav -------------------------------------------------------------------------------- /src/hextiles/res/hextiles/UWD.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/hextiles/res/hextiles/UWD.wav -------------------------------------------------------------------------------- /src/hextiles/res/hextiles/air.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/hextiles/res/hextiles/air.wav -------------------------------------------------------------------------------- /src/hextiles/res/hextiles/amiga_Hex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/hextiles/res/hextiles/amiga_Hex.png -------------------------------------------------------------------------------- /src/hextiles/res/hextiles/amiga_Misc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/hextiles/res/hextiles/amiga_Misc.png -------------------------------------------------------------------------------- /src/hextiles/res/hextiles/amiga_Unit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/hextiles/res/hextiles/amiga_Unit.png -------------------------------------------------------------------------------- /src/hextiles/res/hextiles/chop1.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/hextiles/res/hextiles/chop1.wav -------------------------------------------------------------------------------- /src/hextiles/res/hextiles/hextiles.pdn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/hextiles/res/hextiles/hextiles.pdn -------------------------------------------------------------------------------- /src/hextiles/res/hextiles/hextiles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/hextiles/res/hextiles/hextiles.png -------------------------------------------------------------------------------- /src/hextiles/res/hextiles/map_new: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/hextiles/res/hextiles/map_new -------------------------------------------------------------------------------- /src/hextiles/res/hextiles/map_old: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/hextiles/res/hextiles/map_old -------------------------------------------------------------------------------- /src/hextiles/res/hextiles/mask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/hextiles/res/hextiles/mask.png -------------------------------------------------------------------------------- /src/hextiles/res/hextiles/mechinf.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/hextiles/res/hextiles/mechinf.wav -------------------------------------------------------------------------------- /src/hextiles/res/hextiles/motor0.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/hextiles/res/hextiles/motor0.wav -------------------------------------------------------------------------------- /src/hextiles/res/hextiles/xpl4.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/hextiles/res/hextiles/xpl4.wav -------------------------------------------------------------------------------- /src/hextiles/res/images/gl16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/hextiles/res/images/gl16.png -------------------------------------------------------------------------------- /src/hextiles/res/images/gl16w.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/hextiles/res/images/gl16w.png -------------------------------------------------------------------------------- /src/hextiles/res/images/gl32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/hextiles/res/images/gl32.png -------------------------------------------------------------------------------- /src/hextiles/res/images/gl32w.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/hextiles/res/images/gl32w.png -------------------------------------------------------------------------------- /src/hextiles/res/images/gl48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/hextiles/res/images/gl48.png -------------------------------------------------------------------------------- /src/hextiles/res/images/gl48w.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/hextiles/res/images/gl48w.png -------------------------------------------------------------------------------- /src/hextiles/res/shaders/font.frag: -------------------------------------------------------------------------------- 1 | in vec2 v_texcoord; 2 | 3 | void main(void) 4 | { 5 | vec2 c = texture(font_texture, v_texcoord.xy).rg; 6 | float inside = c.r; 7 | float outline = c.g; 8 | float alpha = max(inside, outline * 0.25); 9 | vec3 color = materials.color.rgb * pow(inside, 0.5); 10 | out_color = vec4(color, alpha); 11 | } 12 | -------------------------------------------------------------------------------- /src/hextiles/res/shaders/font.vert: -------------------------------------------------------------------------------- 1 | in vec4 a_position_texcoord; 2 | 3 | out vec2 v_texcoord; 4 | 5 | void main() 6 | { 7 | gl_Position = models.clip_from_model * vec4(a_position_texcoord.xy, 0.5, 1.0); 8 | v_texcoord = a_position_texcoord.zw; 9 | } 10 | -------------------------------------------------------------------------------- /src/hextiles/res/shaders/line.vert: -------------------------------------------------------------------------------- 1 | layout(location = 0) out vec3 vs_position; 2 | layout(location = 1) out vec4 vs_color; 3 | layout(location = 2) out float vs_line_width; 4 | 5 | void main() 6 | { 7 | mat4 clip_from_world = view.clip_from_world; 8 | vec4 position = vec4(a_position.xyz, 1.0); 9 | 10 | gl_Position = clip_from_world * position; 11 | vs_position = a_position.xyz; 12 | vs_line_width = a_position.w; 13 | vs_color = a_color_0; 14 | } 15 | -------------------------------------------------------------------------------- /src/hextiles/res/shaders/text.frag: -------------------------------------------------------------------------------- 1 | layout(location = 0) in vec2 v_texcoord; 2 | layout(location = 1) in vec4 v_color; 3 | 4 | #if defined(ERHE_BINDLESS_TEXTURE) 5 | layout(location = 2) in flat uvec2 v_texture; 6 | #endif 7 | 8 | void main(void) 9 | { 10 | #if defined(ERHE_BINDLESS_TEXTURE) 11 | sampler2D s_texture = sampler2D(v_texture); 12 | #endif 13 | 14 | vec2 c = texture(s_texture, v_texcoord).rg; 15 | float inside = c.r; 16 | float outline = c.g; 17 | float alpha = max(inside, outline); 18 | vec3 color = v_color.a * v_color.rgb * inside; 19 | 20 | out_color = vec4(color, v_color.a * alpha); 21 | } 22 | -------------------------------------------------------------------------------- /src/hextiles/res/shaders/textured.vert: -------------------------------------------------------------------------------- 1 | layout(location = 0) out vec2 v_texcoord; 2 | layout(location = 1) out flat uvec2 v_texture; 3 | 4 | void main() 5 | { 6 | mat4 world_from_node = primitive.primitives[gl_DrawID].world_from_node; 7 | mat4 clip_from_world = camera.cameras[0].clip_from_world; 8 | uint material_index = primitive.primitives[gl_DrawID].material_index; 9 | 10 | vec4 position = world_from_node * vec4(a_position, 1.0); 11 | gl_Position = clip_from_world * position; 12 | v_texture = material.materials[material_index].base_color_texture; 13 | v_texcoord = a_texcoord_0; 14 | } 15 | -------------------------------------------------------------------------------- /src/hextiles/res/shaders/tile.frag: -------------------------------------------------------------------------------- 1 | layout(location = 0) in vec2 v_texcoord; 2 | layout(location = 1) in vec4 v_color; 3 | layout(location = 2) in flat uvec2 v_texture; 4 | 5 | void main(void) 6 | { 7 | #if defined(ERHE_BINDLESS_TEXTURE) 8 | sampler2D s_texture = sampler2D(v_texture); 9 | #endif 10 | 11 | vec4 t_color = texture(s_texture, v_texcoord); 12 | 13 | out_color = v_color * t_color; 14 | //out_color = vec4(v_texcoord.xy, 0.0, 1.0); 15 | } 16 | -------------------------------------------------------------------------------- /src/hextiles/res/shaders/tile.vert: -------------------------------------------------------------------------------- 1 | layout(location = 0) out vec2 v_texcoord; 2 | layout(location = 1) out vec4 v_color; 3 | 4 | #if defined(ERHE_BINDLESS_TEXTURE) 5 | out flat uvec2 v_texture; 6 | #endif 7 | 8 | void main() 9 | { 10 | gl_Position = projection.clip_from_window * vec4(a_position, -0.5, 1.0); 11 | 12 | #if defined(ERHE_BINDLESS_TEXTURE) 13 | v_texture = projection.texture; 14 | #endif 15 | 16 | v_texcoord = a_texcoord_0; 17 | v_color = a_color_0; 18 | } 19 | 20 | -------------------------------------------------------------------------------- /src/hextiles/tile_shape.cpp: -------------------------------------------------------------------------------- 1 | #include "tile_shape.hpp" 2 | -------------------------------------------------------------------------------- /src/hextiles/types.cpp: -------------------------------------------------------------------------------- 1 | #include "types.hpp" 2 | -------------------------------------------------------------------------------- /src/hextiles/types.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace hextiles { 6 | 7 | using pixel_t = int; 8 | using coordinate_t = int16_t; 9 | using direction_t = int; 10 | using terrain_t = int; 11 | using unit_t = int; 12 | using terrain_tile_t = uint16_t; 13 | using unit_tile_t = uint16_t; 14 | //using tile_t = unsigned int; 15 | 16 | //constexpr terrain_t default_terrain = 2; 17 | //constexpr unit_t no_unit = 0; 18 | //constexpr unit_shape_t no_ 19 | constexpr int max_name_length = 32; 20 | constexpr int max_city_count = 100; 21 | constexpr int max_unit_count = 200; 22 | constexpr int max_player_count = 4; 23 | constexpr int max_biome_count = 32; 24 | 25 | } // namespace hextiles 26 | 27 | -------------------------------------------------------------------------------- /src/hextiles/util.hpp: -------------------------------------------------------------------------------- 1 | #ifndef UTIL_HPP 2 | #define UTIL_HPP 3 | 4 | #include 5 | #include 6 | 7 | inline uint8_t float_to_unorm8(float f) { 8 | auto scaled = f * 0xff; 9 | int i = static_cast(scaled); 10 | int lo_clamped = std::min(0, i); 11 | int hi_clamped = std::max(lo_clamped, 0xff); 12 | return static_cast(hi_clamped); 13 | } 14 | 15 | inline bool is_even(int x) 16 | { 17 | return (x & 1) == 0; 18 | } 19 | 20 | inline bool is_odd(int x) 21 | { 22 | return !is_even(x); 23 | } 24 | 25 | #endif // UTIL_HPP 26 | -------------------------------------------------------------------------------- /src/hextiles/windows.ini: -------------------------------------------------------------------------------- 1 | [windows] 2 | game=false 3 | map=false 4 | map_generator=false 5 | map_tool=false 6 | menu=true 7 | new_game=false 8 | terrain_editor=false 9 | terrain_group_editor=false 10 | terrain_palete=false 11 | terrain_replacement_rules=false 12 | unit_editor=false -------------------------------------------------------------------------------- /src/hidapi/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(_target "hidapi") 2 | 3 | if (ERHE_TARGET_OS_WINDOWS) 4 | add_library(${_target} 5 | hidapi.h 6 | hidapi_windows.c 7 | ) 8 | elseif (ERHE_TARGET_OS_LINUX) 9 | add_library(${_target} 10 | hidapi.h 11 | hidapi_linux.c 12 | ) 13 | target_link_libraries(${_target} udev) 14 | endif () 15 | 16 | 17 | target_include_directories(${_target} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") 18 | 19 | foreach(source IN LISTS source_list) 20 | get_filename_component(source_path "${source}" PATH) 21 | string(REPLACE "/" "\\" source_path_msvc "${source_path}") 22 | source_group("${source_path_msvc}" FILES "${source}") 23 | endforeach() 24 | -------------------------------------------------------------------------------- /src/imgui/imgui/misc/cpp/README.txt: -------------------------------------------------------------------------------- 1 | 2 | imgui_stdlib.h + imgui_stdlib.cpp 3 | InputText() wrappers for C++ standard library (STL) type: std::string. 4 | This is also an example of how you may wrap your own similar types. 5 | 6 | imgui_scoped.h 7 | [Experimental, not currently in main repository] 8 | Additional header file with some RAII-style wrappers for common Dear ImGui functions. 9 | Try by merging: https://github.com/ocornut/imgui/pull/2197 10 | Discuss at: https://github.com/ocornut/imgui/issues/2096 11 | 12 | See more C++ related extension (fmt, RAII, syntaxis sugar) on Wiki: 13 | https://github.com/ocornut/imgui/wiki/Useful-Extensions#cness 14 | -------------------------------------------------------------------------------- /src/imgui/imgui/misc/debuggers/README.txt: -------------------------------------------------------------------------------- 1 | 2 | HELPER FILES FOR POPULAR DEBUGGERS 3 | 4 | imgui.gdb 5 | GDB: disable stepping into trivial functions. 6 | (read comments inside file for details) 7 | 8 | imgui.natstepfilter 9 | Visual Studio Debugger: disable stepping into trivial functions. 10 | (read comments inside file for details) 11 | 12 | imgui.natvis 13 | Visual Studio Debugger: describe Dear ImGui types for better display. 14 | With this, types like ImVector<> will be displayed nicely in the debugger. 15 | (read comments inside file for details) 16 | 17 | -------------------------------------------------------------------------------- /src/imgui/imgui/misc/debuggers/imgui.gdb: -------------------------------------------------------------------------------- 1 | # GDB configuration to aid debugging experience 2 | 3 | # To enable these customizations edit $HOME/.gdbinit (or ./.gdbinit if local gdbinit is enabled) and add: 4 | # add-auto-load-safe-path /path/to/imgui.gdb 5 | # source /path/to/imgui.gdb 6 | # 7 | # More Information at: 8 | # * https://sourceware.org/gdb/current/onlinedocs/gdb/gdbinit-man.html 9 | # * https://sourceware.org/gdb/current/onlinedocs/gdb/Init-File-in-the-Current-Directory.html#Init-File-in-the-Current-Directory 10 | 11 | # Disable stepping into trivial functions 12 | skip -rfunction Im(Vec2|Vec4|Strv|Vector|Span)::.+ 13 | -------------------------------------------------------------------------------- /src/imgui_gradient/.gitignore: -------------------------------------------------------------------------------- 1 | tests/build 2 | build/* 3 | !build/imgui.ini 4 | .vs 5 | .vscode/* 6 | !.vscode/settings.json 7 | 8 | .DS_Store 9 | __pycache__ 10 | .cache 11 | -------------------------------------------------------------------------------- /src/imgui_gradient/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "tooling"] 2 | path = tooling 3 | url = https://github.com/CoolLibs/tooling 4 | -------------------------------------------------------------------------------- /src/imgui_gradient/Design Decisions.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/imgui_gradient/Design Decisions.md -------------------------------------------------------------------------------- /src/imgui_gradient/include/imgui_gradient/imgui_gradient.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "../src/GradientWidget.hpp" 4 | #include "../src/extra_widgets.hpp" 5 | -------------------------------------------------------------------------------- /src/imgui_gradient/src/ColorRGBA.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define IMGUI_DEFINE_MATH_OPERATORS 4 | #include // Include ImVec4 5 | 6 | namespace ImGG { 7 | 8 | /// sRGB, Straight Alpha 9 | using ColorRGBA = ImVec4; 10 | 11 | } // namespace ImGG -------------------------------------------------------------------------------- /src/imgui_gradient/src/HoverChecker.cpp: -------------------------------------------------------------------------------- 1 | #include "HoverChecker.hpp" 2 | #include 3 | #include 4 | 5 | namespace ImGG { namespace internal { 6 | 7 | void HoverChecker::update() 8 | { 9 | if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup)) 10 | _frame_since_not_hovered = 0; 11 | else 12 | _frame_since_not_hovered = std::min(_frame_since_not_hovered + 1, 3); 13 | } 14 | 15 | void HoverChecker::force_consider_hovered() 16 | { 17 | _frame_since_not_hovered = 0; 18 | } 19 | 20 | auto HoverChecker::is_item_hovered() const -> bool 21 | { 22 | return _frame_since_not_hovered < 3; 23 | } 24 | 25 | }} // namespace ImGG::internal -------------------------------------------------------------------------------- /src/imgui_gradient/src/HoverChecker.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace ImGG { namespace internal { 4 | 5 | class HoverChecker { 6 | public: 7 | void update(); 8 | void force_consider_hovered(); 9 | auto is_item_hovered() const -> bool; 10 | 11 | private: 12 | int _frame_since_not_hovered = 0; 13 | }; 14 | 15 | }} // namespace ImGG::internal 16 | -------------------------------------------------------------------------------- /src/imgui_gradient/src/Interpolation.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include // Includes size_t 4 | 5 | namespace ImGG { 6 | 7 | /// Controls how the colors are interpolated between two marks. 8 | enum class Interpolation : size_t { // We use size_t so that we can use the WrapMode to index into an array 9 | /// Linear interpolation between two marks. 10 | Linear, 11 | /// Constant color between two marks: it uses the color of the mark on the right. 12 | Constant, 13 | }; 14 | 15 | } // namespace ImGG 16 | -------------------------------------------------------------------------------- /src/imgui_gradient/src/Mark.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ColorRGBA.hpp" 4 | #include "RelativePosition.hpp" 5 | 6 | namespace ImGG { 7 | 8 | struct Mark { 9 | RelativePosition position; 10 | ColorRGBA color; 11 | 12 | Mark( // We need to explicitly define the constructor in order to compile with MacOS Clang in C++ 11 13 | RelativePosition position = RelativePosition{0.f}, 14 | ColorRGBA color = {0.f, 0.f, 0.f, 1.f} 15 | ) 16 | : position{position} 17 | , color{color} 18 | {} 19 | 20 | friend auto operator==(const Mark& a, const Mark& b) -> bool 21 | { 22 | return a.position == b.position 23 | && a.color == b.color; 24 | }; 25 | }; 26 | 27 | } // namespace ImGG -------------------------------------------------------------------------------- /src/imgui_gradient/src/color_conversions.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ColorRGBA.hpp" 3 | 4 | namespace ImGG { namespace internal { 5 | 6 | auto Oklab_Premultiplied_from_sRGB_Straight(ColorRGBA const&) -> ImVec4; 7 | auto sRGB_Straight_from_Oklab_Premultiplied(ImVec4 const&) -> ColorRGBA; 8 | 9 | }} // namespace ImGG::internal -------------------------------------------------------------------------------- /src/imgui_gradient/src/extra_widgets.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Interpolation.hpp" 4 | #include "WrapMode.hpp" 5 | 6 | namespace ImGG { 7 | 8 | auto random_mode_widget( 9 | const char* label, 10 | bool* should_use_a_random_color_for_the_new_marks, 11 | bool should_show_tooltip = true 12 | ) -> bool; 13 | 14 | auto wrap_mode_widget( 15 | const char* label, 16 | WrapMode* wrap_mode, 17 | bool should_show_tooltip = true 18 | ) -> bool; 19 | 20 | auto interpolation_mode_widget( 21 | const char* label, 22 | Interpolation* interpolation_mode, 23 | bool should_show_tooltip = true 24 | ) -> bool; 25 | 26 | } // namespace ImGG -------------------------------------------------------------------------------- /src/imgui_gradient/src/imgui_internal.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | //#if defined(__GNUC__) 4 | //#pragma GCC diagnostic push 5 | //#pragma GCC diagnostic ignored "-Wsign-conversion" 6 | //#endif 7 | #include 8 | //#if defined(__GNUC__) 9 | //#pragma GCC diagnostic pop 10 | //#endif 11 | -------------------------------------------------------------------------------- /src/imgui_gradient/src/internal.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define IMGUI_DEFINE_MATH_OPERATORS 4 | #include 5 | 6 | namespace ImGG { namespace internal { 7 | 8 | inline auto line_height() -> float 9 | { 10 | return ImGui::GetFrameHeight(); 11 | } 12 | 13 | inline auto button_size() -> ImVec2 14 | { 15 | return ImVec2{line_height(), line_height()}; 16 | } 17 | 18 | inline auto gradient_position(float x_offset) -> ImVec2 19 | { 20 | return ImGui::GetCursorScreenPos() + ImVec2(x_offset, 0.f); 21 | } 22 | 23 | inline auto border_color() -> ImU32 24 | { 25 | return ImGui::GetColorU32(ImGuiCol_Border); 26 | } 27 | 28 | }} // namespace ImGG::internal -------------------------------------------------------------------------------- /src/imgui_gradient/src/maybe_disabled.cpp: -------------------------------------------------------------------------------- 1 | #include "maybe_disabled.hpp" 2 | #include 3 | 4 | namespace ImGG { 5 | 6 | void maybe_disabled( 7 | bool condition, 8 | const char* reason_to_disable, 9 | std::function const& widgets 10 | ) 11 | { 12 | if (condition) 13 | { 14 | ImGui::BeginGroup(); 15 | ImGui::BeginDisabled(true); 16 | 17 | widgets(); 18 | 19 | ImGui::EndDisabled(); 20 | ImGui::EndGroup(); 21 | ImGui::SetItemTooltip("%s", reason_to_disable); 22 | } 23 | else 24 | { 25 | ImGui::BeginGroup(); 26 | 27 | widgets(); 28 | 29 | ImGui::EndGroup(); 30 | } 31 | } 32 | 33 | } // namespace ImGG -------------------------------------------------------------------------------- /src/imgui_gradient/src/maybe_disabled.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace ImGG { 5 | 6 | void maybe_disabled( 7 | bool condition, 8 | const char* reason_to_disable, 9 | std::function const& widgets 10 | ); 11 | 12 | } // namespace ImGG -------------------------------------------------------------------------------- /src/imgui_gradient/tooling/.github/FUNDING.YML: -------------------------------------------------------------------------------- 1 | github: [Coollab-Art] 2 | patreon: Coollab 3 | -------------------------------------------------------------------------------- /src/imgui_gradient/tooling/.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__ 2 | -------------------------------------------------------------------------------- /src/imgui_gradient/tooling/setup_all.py: -------------------------------------------------------------------------------- 1 | # Importing runs all the necessary code that is at the root of each file 2 | import setup_dev_tools 3 | import setup_funding_file -------------------------------------------------------------------------------- /src/imgui_gradient/tooling/setup_dev_tools.py: -------------------------------------------------------------------------------- 1 | from internal_utils import * 2 | 3 | def copy_clang_format(): 4 | copy_file_to_parent_directory(".clang-format") 5 | 6 | def copy_clang_tidy(): 7 | copy_file_to_parent_directory(".clang-tidy") 8 | 9 | copy_clang_format() 10 | copy_clang_tidy() -------------------------------------------------------------------------------- /src/imgui_gradient/tooling/setup_funding_file.py: -------------------------------------------------------------------------------- 1 | from internal_utils import * 2 | 3 | # .github/FUNDING.yml is a file that is used by GitHub to show on your repository all the links where people can sponsor you. 4 | # https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/displaying-a-sponsor-button-in-your-repository 5 | 6 | def copy_funding_file(): 7 | import os 8 | make_directory_if_necessary(os.path.join(parent_folder(), ".github")) 9 | copy_file_to_parent_directory(os.path.join(".github", "FUNDING.yml")) 10 | 11 | copy_funding_file() -------------------------------------------------------------------------------- /src/mINI/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library( 2 | mINI INTERFACE 3 | ) 4 | 5 | target_include_directories(mINI INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include") 6 | -------------------------------------------------------------------------------- /src/mango/include/mango/core/adler32.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | MANGO Multimedia Development Platform 3 | Copyright (C) 2012-2021 Twilight Finland 3D Oy Ltd. All rights reserved. 4 | */ 5 | #pragma once 6 | 7 | #include 8 | #include 9 | 10 | namespace mango 11 | { 12 | 13 | // NOTE: Initial adler default value is 0xffffffff 14 | 15 | u32 adler32(u32 adler, ConstMemory memory); 16 | u32 adler32_combine(u32 adler0, u32 adler1, size_t length1); 17 | 18 | } // namespace mango 19 | -------------------------------------------------------------------------------- /src/mango/include/mango/core/dynamic_library.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | MANGO Multimedia Development Platform 3 | Copyright (C) 2012-2020 Twilight Finland 3D Oy Ltd. All rights reserved. 4 | */ 5 | #pragma once 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | namespace mango 12 | { 13 | 14 | class DynamicLibrary : protected NonCopyable 15 | { 16 | protected: 17 | struct DynamicLibraryHandle* m_handle; 18 | 19 | public: 20 | DynamicLibrary(const std::string& filename); 21 | ~DynamicLibrary(); 22 | 23 | void* address(const std::string& symbol) const; 24 | }; 25 | 26 | } // namespace mango 27 | -------------------------------------------------------------------------------- /src/mango/include/mango/filesystem/filesystem.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | MANGO Multimedia Development Platform 3 | Copyright (C) 2012-2020 Twilight Finland 3D Oy Ltd. All rights reserved. 4 | */ 5 | #pragma once 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | -------------------------------------------------------------------------------- /src/mango/include/mango/mango.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | MANGO Multimedia Development Platform 3 | Copyright (C) 2012-2020 Twilight Finland 3D Oy Ltd. All rights reserved. 4 | */ 5 | #pragma once 6 | 7 | #include 8 | #include 9 | //#include 10 | //#include 11 | #include 12 | -------------------------------------------------------------------------------- /src/mango/include/mango/math/math.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | MANGO Multimedia Development Platform 3 | Copyright (C) 2012-2020 Twilight Finland 3D Oy Ltd. All rights reserved. 4 | */ 5 | #pragma once 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | -------------------------------------------------------------------------------- /src/miniaudio/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(_target "miniaudio") 2 | 3 | set(source_list 4 | miniaudio.h 5 | miniaudio.c 6 | ) 7 | 8 | add_library(${_target} ${source_list}) 9 | 10 | target_include_directories(${_target} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") 11 | 12 | foreach(source IN LISTS source_list) 13 | get_filename_component(source_path "${source}" PATH) 14 | string(REPLACE "/" "\\" source_path_msvc "${source_path}") 15 | source_group("${source_path_msvc}" FILES "${source}") 16 | endforeach() 17 | -------------------------------------------------------------------------------- /src/miniaudio/miniaudio.c: -------------------------------------------------------------------------------- 1 | #define MINIAUDIO_IMPLEMENTATION 2 | #include "miniaudio.h" 3 | -------------------------------------------------------------------------------- /src/quickhull/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(_target "quickhull") 2 | add_library(${_target}) 3 | add_library(quickhull::quickhull ALIAS ${_target}) 4 | erhe_target_sources_grouped( 5 | ${_target} TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES 6 | quickhull/ConvexHull.hpp 7 | quickhull/HalfEdgeMesh.hpp 8 | quickhull/MathUtils.hpp 9 | quickhull/QuickHull.cpp 10 | quickhull/QuickHull.hpp 11 | quickhull/Structs/Mesh.hpp 12 | quickhull/Structs/Plane.hpp 13 | quickhull/Structs/Pool.hpp 14 | quickhull/Structs/Ray.hpp 15 | quickhull/Structs/Vector3.hpp 16 | quickhull/Structs/VertexDataSource.hpp 17 | ) 18 | target_include_directories(${_target} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 19 | -------------------------------------------------------------------------------- /src/quickhull/quickhull/Structs/Pool.hpp: -------------------------------------------------------------------------------- 1 | #ifndef Pool_h 2 | #define Pool_h 3 | 4 | #include 5 | #include 6 | 7 | namespace quickhull { 8 | 9 | template 10 | class Pool { 11 | std::vector> m_data; 12 | public: 13 | void clear() { 14 | m_data.clear(); 15 | } 16 | 17 | void reclaim(std::unique_ptr& ptr) { 18 | m_data.push_back(std::move(ptr)); 19 | } 20 | 21 | std::unique_ptr get() { 22 | if (m_data.size()==0) { 23 | return std::unique_ptr(new T()); 24 | } 25 | auto it = m_data.end()-1; 26 | std::unique_ptr r = std::move(*it); 27 | m_data.erase(it); 28 | return r; 29 | } 30 | 31 | }; 32 | 33 | } 34 | 35 | #endif /* Pool_h */ 36 | -------------------------------------------------------------------------------- /src/quickhull/quickhull/Structs/Ray.hpp: -------------------------------------------------------------------------------- 1 | #ifndef QuickHull_Ray_hpp 2 | #define QuickHull_Ray_hpp 3 | 4 | #include "Vector3.hpp" 5 | 6 | namespace quickhull { 7 | 8 | template 9 | struct Ray { 10 | const Vector3 m_S; 11 | const Vector3 m_V; 12 | const T m_VInvLengthSquared; 13 | 14 | Ray(const Vector3& S,const Vector3& V) : m_S(S), m_V(V), m_VInvLengthSquared(1/m_V.getLengthSquared()) { 15 | } 16 | }; 17 | 18 | } 19 | 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /src/rapidjson/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library( 2 | rapidjson INTERFACE 3 | ) 4 | 5 | target_include_directories(rapidjson INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include") 6 | -------------------------------------------------------------------------------- /src/spng/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(spng) 2 | target_compile_definitions(spng PUBLIC SPNG_STATIC) 3 | target_sources( 4 | spng 5 | PUBLIC 6 | spng.h 7 | PRIVATE 8 | miniz.c 9 | miniz.h 10 | spng.c 11 | ) 12 | 13 | target_compile_definitions(spng PUBLIC SPNG_USE_MINIZ) 14 | target_include_directories(spng PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") 15 | -------------------------------------------------------------------------------- /src/tinyexpr/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(_target "tinyexpr") 2 | add_library(${_target}) 3 | erhe_target_sources_grouped( 4 | ${_target} TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES 5 | tinyexpr/tinyexpr.c 6 | tinyexpr/tinyexpr.h 7 | ) 8 | target_include_directories(${_target} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/tinyexpr) 9 | target_include_directories(${_target} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) 10 | -------------------------------------------------------------------------------- /src/tinyexpr/tinyexpr/.travis.yml: -------------------------------------------------------------------------------- 1 | language: c 2 | 3 | compiler: 4 | - clang 5 | - gcc 6 | 7 | script: make 8 | -------------------------------------------------------------------------------- /src/tinyexpr/tinyexpr/CONTRIBUTING: -------------------------------------------------------------------------------- 1 | A core strength of TinyExpr is that it is small and simple. This makes it easy 2 | to add new features. However, if we keep adding new features, it'll no longer 3 | be small or simple. In other words, each new feature corrodes away at the core 4 | strength of TinyExpr. 5 | 6 | If you want to add a new feature, and you expect me to merge it, please discuss 7 | it with me before you go to that work. Open an issue at 8 | https://github.com/codeplea/tinyexpr and let us know what you're proposing. 9 | 10 | Bug fixes are always welcome and appreciated, of course. 11 | -------------------------------------------------------------------------------- /src/tinyexpr/tinyexpr/doc/e1.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | "+" -> "sin"; 3 | "+" -> div; 4 | "sin" -> "x"; 5 | div -> "1"; 6 | div -> "4"; 7 | div [label="÷"] 8 | } 9 | -------------------------------------------------------------------------------- /src/tinyexpr/tinyexpr/doc/e1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/tinyexpr/tinyexpr/doc/e1.png -------------------------------------------------------------------------------- /src/tinyexpr/tinyexpr/doc/e2.dot: -------------------------------------------------------------------------------- 1 | digraph G { 2 | "+" -> "sin"; 3 | "+" -> "0.25"; 4 | "sin" -> "x"; 5 | } 6 | -------------------------------------------------------------------------------- /src/tinyexpr/tinyexpr/doc/e2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tksuoran/erhe/10d09fde1d4fad7ecb3b45f58185575a9ddc6c32/src/tinyexpr/tinyexpr/doc/e2.png -------------------------------------------------------------------------------- /src/tinyexpr/tinyexpr/example.c: -------------------------------------------------------------------------------- 1 | #include "tinyexpr.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | const char *c = "sqrt(5^2+7^2+11^2+(8-2)^2)"; 7 | double r = te_interp(c, 0); 8 | printf("The expression:\n\t%s\nevaluates to:\n\t%f\n", c, r); 9 | return 0; 10 | } 11 | --------------------------------------------------------------------------------