Visage C++ Library Documentation
repository·main·Indexed 20 days ago
https://github.com/vitalaudio/visageA GPU-accelerated, cross-platform C++ library for native UI frameworks and creative 2D graphics. Visage supports Direct3D11 on Windows, Metal on MacOS, Vulkan on Linux, and WebGL via Emscripten, featuring automatic shape batching and partial rendering for high-performance interfaces.
What's inside Visage
- Visage is a GPU-accelerated, cross-platform C++ library designed for both native UI and 2D creative graphics. It provides high-performance rendering through automatic shape batching and partial rendering (redrawing only dirty regions).
Create a basic application with Visage
mainTo create a native windowed application, use
visage::ApplicationWindow. You can define custom drawing logic by assigning a lambda to theonDraw()callback, which provides avisage::Canvasobject. Thecanvasobject allows you to set colors and draw shapes like rectangles. Useapp.show(width, height)to initialize the window dimensions andapp.runEventLoop()to start processing window events. The loop will block until the window is closed.#include <visage/app.h> int main() { visage::ApplicationWindow app; app.onDraw() = [&app](visage::Canvas& canvas) { canvas.setColor(0xffff00ff); canvas.fill(0, 0, app.width(), app.height()); }; app.show(800, 600); // Opens as 800 x 600 pixel window app.runEventLoop(); // Runs window events. Returns when window is closed. return 0; }Supported platforms and graphics APIs
mainVisage abstracts different graphics backends depending on the target platform:
- Windows: Direct3D11
- MacOS: Metal
- Linux: Vulkan
- Web/Emscripten: WebGL