Files
fn_registry/cpp/functions/gfx/uniform_panel.h
T
egutierrez c7821c4c99 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>
2026-04-24 21:02:35 +02:00

25 lines
782 B
C++

#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