feat(shaders_lab): uniform annotations → auto-generated ImGui controls
- cpp/functions/gfx/uniform_parser: regex-based parser of @slider/@color/@toggle/@xy annotations (+ inline tests) - cpp/functions/gfx/uniform_panel: ImGui widgets + value store + glUniform* apply - shader_canvas: optional uniforms callback invoked per-frame - gl_loader: +glUniform1i/3f/4f - seed plasma: demo uniforms u_speed + u_color - rebuild Windows .exe Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
#pragma once
|
||||
#include <array>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include "gfx/uniform_parser.h"
|
||||
|
||||
namespace fn::gfx {
|
||||
|
||||
struct UniformStore {
|
||||
std::unordered_map<std::string, std::array<float, 4>> values;
|
||||
};
|
||||
|
||||
// Mantiene el store sincronizado con los descriptores actuales.
|
||||
void uniforms_sync(UniformStore& store, const std::vector<UniformDescriptor>& descs);
|
||||
|
||||
// Renderiza widgets ImGui en el panel actual (llamar entre Begin/End).
|
||||
void uniforms_panel(UniformStore& store, const std::vector<UniformDescriptor>& descs);
|
||||
|
||||
// Llama glUniform* sobre el programa GL activo (el caller debe haber llamado glUseProgram).
|
||||
void uniforms_apply(const UniformStore& store, const std::vector<UniformDescriptor>& descs, unsigned int program);
|
||||
|
||||
} // namespace fn::gfx
|
||||
Reference in New Issue
Block a user