A lightweight, flexible, and modern GUI framework for C++ applications. Designed to be easily integrated into various projects including game modifications, tools, and applications.
- Cross-graphics API support (DirectX 11, DirectX 12, OpenGL)
- Modern, customizable UI components
- Advanced shader system with effects and analysis tools
- Easy integration into existing projects
- Lightweight and performant
- Modular design for extensibility
- C++17 or later
- CMake 3.15 or later
- One of the following graphics APIs:
- DirectX 11
- DirectX 12
- OpenGL
mkdir build
cd build
cmake ..
cmake --build .Include the b3b3 header in your project:
#include <b3b3/b3b3.hpp>
// Initialize the GUI
b3b3::Gui gui;
// Create a window
auto window = gui.createWindow("My Window");
// Add elements
window->addButton("Click Me", []() {
// Button callback
});
// Render in your main loop
while (running) {
gui.beginFrame();
// Your rendering code
gui.endFrame();
}The framework includes a powerful shader system with various features:
// Load shaders
auto vertexShader = b3b3::shader::loadVertexShader("shaders/vertex.glsl");
auto fragmentShader = b3b3::shader::loadFragmentShader("shaders/fragment.glsl");
// Create shader effects
b3b3::shader_effects::createHoverEffect(shader, 0.1f);
b3b3::shader_effects::createPressedEffect(shader, 0.1f);
b3b3::shader_effects::createTextOutline(shader, 0.02f, {0.0f, 0.0f, 0.0f, 1.0f});// Get shader analyzer instance
auto& analyzer = b3b3::shader_analyzer::EnhancedShaderAnalyzer::getInstance();
// Analyze shader performance
auto metrics = analyzer.getAdvancedAnalysis(shader);
// Get shader visualizer instance
auto& visualizer = b3b3::shader_visualizer::ShaderVisualizer::getInstance();
// Generate performance graphs
auto performanceGraph = visualizer.generatePerformanceGraph(shader);
auto complexityGraph = visualizer.generateComplexityGraph(shader);
// Export analysis data
visualizer.exportPerformanceData("performance.csv");
visualizer.exportAnalysisData("analysis.csv");// Create a button shader with hover and ripple effects
auto buttonShader = b3b3::shader_effects::createExampleShader("button");
// Create a text shader with outline and glow effects
auto textShader = b3b3::shader_effects::createExampleShader("text");
// Create a panel shader with wave and shadow effects
auto panelShader = b3b3::shader_effects::createExampleShader("panel");
// Create a noise shader with color effects
auto noiseShader = b3b3::shader_effects::createExampleShader("noise");
// Create a distortion shader with color effects
auto distortionShader = b3b3::shader_effects::createExampleShader("distortion");// Enable shader debugging
auto& debugger = b3b3::shader_debug::ShaderDebugger::getInstance();
debugger.setEnabled(true);
// Get debug info for a shader
auto debugInfo = debugger.getDebugInfo(shader);
// Start shader profiling
auto& profiler = b3b3::shader_profiler::ShaderProfiler::getInstance();
profiler.beginProfile();
// Profile shader operations
profiler.profileOperation("shader_operation", []() {
// Your shader operation
});
// End profiling and get metrics
profiler.endProfile();
auto metrics = profiler.getMetrics(shader);// Generate various visualization graphs
auto controlFlowGraph = visualizer.generateControlFlowGraph(shader);
auto dataFlowGraph = visualizer.generateDataFlowGraph(shader);
auto registerPressureGraph = visualizer.generateRegisterPressureGraph(shader);
auto cacheLineUtilization = visualizer.generateCacheLineUtilization(shader);
// Export visualization data
visualizer.exportControlFlowGraph("control_flow.dot");
visualizer.exportDataFlowGraph("data_flow.dot");
visualizer.exportRegisterPressureData("register_pressure.csv");
visualizer.exportCacheLineData("cache_line.csv");The framework includes several built-in shader effects:
- Hover effects
- Pressed effects
- Text outline and glow
- Gradient effects
- Shadow effects
- Blur effects
- Wave effects
- Ripple effects
- Particle effects
- Noise effects
- Distortion effects
- Color effects (brightness, contrast, saturation, hue shift, tint)
The shader system includes comprehensive performance analysis tools:
- Instruction scheduling analysis
- Register allocation analysis
- Memory access pattern analysis
- Cache line utilization analysis
- Pipeline stall analysis
- Resource conflict analysis
- Real-time performance monitoring
- Performance visualization tools
MIT License - See LICENSE file for details