Files
metabuilder/gameengine/debug_shader.cpp
johndoe6345789 6fbc47a2db feat: Add SDL3CPlusPlus game engine to gameengine/
Import SDL3CPlusPlus C++ game engine with:
- SDL3 + bgfx rendering backend
- Vulkan/Metal/DirectX shader support
- MaterialX material system
- Scene framework with ECS architecture
- Comprehensive test suite (TDD approach)
- Conan package management
- CMake build system

This provides the native C++ foundation for the Universal Platform's
Game and 3D capability modules.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 16:29:20 +00:00

40 lines
1.2 KiB
C++

#include <iostream>
#include <fstream>
#include "src/services/impl/materialx_shader_generator.hpp"
int main() {
sdl3cpp::services::impl::MaterialXShaderGenerator generator(nullptr);
sdl3cpp::services::impl::MaterialXConfig config;
config.enabled = true;
config.shaderKey = "materialx";
config.useConstantColor = true;
config.constantColor = {0.8f, 0.2f, 0.2f};
config.libraryPath = "MaterialX/libraries";
try {
auto paths = generator.Generate(config, std::filesystem::path("./scripts"));
std::cout << "===== VERTEX SHADER =====\n";
std::cout << paths.vertexSource << std::endl;
std::cout << "\n===== FRAGMENT SHADER =====\n";
std::cout << paths.fragmentSource << std::endl;
// Save to files
std::ofstream vfile("debug_vertex.glsl");
vfile << paths.vertexSource;
vfile.close();
std::ofstream ffile("debug_fragment.glsl");
ffile << paths.fragmentSource;
ffile.close();
std::cout << "\nShaders saved to debug_vertex.glsl and debug_fragment.glsl\n";
} catch (const std::exception& e) {
std::cerr << "Error: " << e.what() << std::endl;
return 1;
}
return 0;
}