Fix Issue #416: Implement dynamic resource file location for testbed#428
Open
killerdevildog wants to merge 1 commit intoDanielChappuis:masterfrom
Open
Fix Issue #416: Implement dynamic resource file location for testbed#428killerdevildog wants to merge 1 commit intoDanielChappuis:masterfrom
killerdevildog wants to merge 1 commit intoDanielChappuis:masterfrom
Conversation
…n for testbed This commit addresses the hardcoded relative path issue that caused problems when different compilers/IDEs placed executables in different directories. Key Changes: - Added ResourceManager class for dynamic resource path discovery - Searches up to 4 parent directories for testbed/shaders and testbed/meshes - Supports RP3D_RESOURCE_PATH environment variable override - Maintains backwards compatibility with fallback to relative paths - Uses std::filesystem for cross-platform path handling Files Added: - testbed/common/ResourceManager.h - Header with dynamic path discovery API - testbed/common/ResourceManager.cpp - Implementation with filesystem search - dynamicresourcefilelocation.md - Comprehensive documentation Files Modified: - testbed/src/SceneDemo.cpp - Updated shader and mesh folder paths - testbed/common/*.cpp - Updated all hardcoded mesh paths (Box, Sphere, etc.) - testbed/scenes/*/*.cpp - Updated scene-specific mesh paths - testbed/CMakeLists.txt - Added ResourceManager to build system Benefits: - Cross-platform compatibility across different build environments - No manual configuration required for developers - Robust error handling with informative fallback warnings - Performance optimized with path caching Tested successfully with CMake build system - application now runs without file not found errors regardless of build directory structure.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit addresses the hardcoded relative path issue that caused problems when different compilers/IDEs placed executables in different directories.
Key Changes:
Files Added:
Files Modified:
Benefits:
Tested successfully with CMake build system - application now runs without file not found errors regardless of build directory structure.