mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-05-02 09:45:00 +00:00
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>
This commit is contained in:
39
gameengine/debug_shader.cpp
Normal file
39
gameengine/debug_shader.cpp
Normal file
@@ -0,0 +1,39 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user