This directory contains the VS Code devcontainer configuration for MetaImGUI development.
A development container (devcontainer) is a Docker container configured specifically for development. It provides:
- Consistent environment across all developers
- Pre-installed tools and dependencies
- Isolated development from your host system
- Quick onboarding for new contributors
- Docker installed and running
- Visual Studio Code
- Dev Containers extension
- Open VS Code
- Open the MetaImGUI project folder
- When prompted, click "Reopen in Container" (or press F1 and select "Dev Containers: Reopen in Container")
- Wait for the container to build (first time only, takes 5-10 minutes)
- The environment is ready when you see the terminal prompt
- GCC 12
- Clang 15
- CMake 3.22+
- Ninja build system
- ccache (for faster rebuilds)
- clangd (language server)
- clang-format (code formatting)
- clang-tidy (static analysis)
- GDB and LLDB (debuggers)
- lcov & gcovr (code coverage)
- Google Benchmark (performance testing)
- Address/Thread/UB Sanitizers
- Doxygen (API documentation)
- Graphviz (diagram generation)
Pre-installed extensions:
- C/C++ Tools
- CMake Tools
- clangd
- GitLens
- GitHub Copilot (if you have it)
# Configure (already done by post-create script)
cmake -B build -DCMAKE_BUILD_TYPE=Debug
# Build
cmake --build build --parallel
# Or use VS Code CMake Tools (Ctrl+Shift+P -> CMake: Build)# Run all tests
cd build && ctest --output-on-failure
# Or press Ctrl+Shift+P -> CMake: Run Tests./scripts/run_coverage.sh./scripts/run_sanitizers.sh ALL# Format all code
find src include -name "*.cpp" -o -name "*.h" | xargs clang-format -i
# Or save files in VS Code (format on save is enabled)The devcontainer is configured to forward X11 to your host machine (Linux only). To run the GUI application:
./build/MetaImGUIFor macOS and Windows, you'll need to set up X11 forwarding separately:
macOS:
- Install XQuartz
- Run:
xhost +localhost - Set
DISPLAYin the container:export DISPLAY=host.docker.internal:0
Windows:
- Install VcXsrv
- Run XLaunch with "Disable access control" checked
- Set
DISPLAYin the container:export DISPLAY=host.docker.internal:0.0
Edit .devcontainer/Dockerfile and rebuild:
RUN apt-get update && apt-get install -y \
your-package-hereThen rebuild the container:
- Press F1
- Select "Dev Containers: Rebuild Container"
Edit .devcontainer/devcontainer.json to modify VS Code settings or add extensions.
# Clean Docker cache and rebuild
docker system prune -a
# Then rebuild in VS Code# Check X11 forwarding
echo $DISPLAY
xeyes # Should show a window
# Allow X11 connections (Linux host)
xhost +local:dockerThe container uses ccache by default. After the first build, subsequent builds should be much faster.
# Check ccache stats
ccache -s# Fix file ownership if needed
sudo chown -R $USER:$USER /workspace- Use named volumes for better I/O performance
- Enable Docker resource limits if memory-constrained
- Use ccache (already configured)
- Build with Ninja (already configured)
- Make changes in VS Code
- Code is automatically formatted on save
- Build with
Ctrl+Shift+Bor CMake Tools - Run tests with CMake Tools test button
- Commit with pre-commit hook (auto-formatting)
If you encounter issues:
- Check the troubleshooting section above
- Review container logs: View -> Output -> Dev Containers
- Open an issue on GitHub