Skip to content

Wsh7Ash/gui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

b3b3 GUI Framework

A lightweight, flexible, and modern GUI framework for C++ applications. Designed to be easily integrated into various projects including game modifications, tools, and applications.

Features

  • 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

Requirements

  • C++17 or later
  • CMake 3.15 or later
  • One of the following graphics APIs:
    • DirectX 11
    • DirectX 12
    • OpenGL

Building

mkdir build
cd build
cmake ..
cmake --build .

Usage

Basic GUI Setup

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();
}

Shader System Usage

The framework includes a powerful shader system with various features:

Creating Shaders

// 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});

Shader Analysis and Visualization

// 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");

Shader Effects Examples

// 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");

Shader Debugging and Profiling

// 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);

Shader Visualization Tools

// 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");

Built-in Shader Effects

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)

Performance Analysis Features

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

License

MIT License - See LICENSE file for details

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors