Development¶
Guidelines and resources for contributing to VulkanW3DViewer.
Overview¶
This section covers everything you need to know to contribute to the project.
Sections¶
-
Code Style
Formatting, naming conventions, and best practices
-
Testing
Writing and running tests
-
Contributing
How to submit changes and get involved
-
Publishing Docs
How to build and deploy the documentation site
Quick Start for Contributors¶
1. Set Up Development Environment¶
# Clone with submodules
git clone --recursive https://github.com/ViTeXFTW/VulkanW3DViewer.git
cd VulkanW3DViewer
# Build debug version
./scripts/rebuild.sh debug
# Run tests
ctest --preset test
2. Make Changes¶
- Create a feature branch
- Write tests first (TDD)
- Implement your changes
- Ensure tests pass
- Format code with clang-format
3. Submit Pull Request¶
- Push your branch
- Open a PR against the
devbranch - Wait for CI checks
- Address review feedback
Development Philosophy¶
RAII¶
All resources use RAII for automatic cleanup:
// Good
class Buffer {
vk::raii::Buffer buffer; // Automatic cleanup
public:
Buffer(VulkanContext& ctx, size_t size);
// No explicit cleanup needed
};
// Bad
class Buffer {
VkBuffer buffer; // Manual cleanup required
public:
~Buffer() { vkDestroyBuffer(...); } // Error-prone
};
Test-Driven Development¶
New features should follow TDD:
- Write failing test
- Implement feature
- Refactor if needed
- Verify test passes
Minimal Changes¶
Keep changes focused:
- One feature per PR
- No unrelated refactoring
- Avoid scope creep
Project Structure¶
src/
├── core/ # Vulkan foundation
├── w3d/ # W3D parsing
├── render/ # Rendering
└── ui/ # User interface
tests/
├── w3d/ # Parser tests
├── render/ # Rendering tests
└── stubs/ # Mock implementations
Key Resources¶
| Resource | Description |
|---|---|
| CLAUDE.md | AI assistant guidelines |
| .github/AGENTS.md | Agent environment tips |
legacy/ |
Original W3D reference code |
Communication¶
- Issues: Bug reports and feature requests
- Pull Requests: Code contributions
- Discussions: General questions
Build Configurations¶
| Preset | Use Case |
|---|---|
debug |
Development with symbols |
release |
Performance testing |
test |
Running test suite |