Expand description
§RyDit Render Queue - Command Queue + Double Buffering + Platform Sync
TRES CAPAS CRÍTICAS PARA RENDIMIENTO Y COMPATIBILIDAD
- Command Queue (8192+ draw calls) - Acumular comandos de dibujado
- Double Buffering - Separar lógica de renderizado
- Platform Sync (XFlush/XSync) - Sincronización con X11
§Arquitectura
┌─────────────────────────────────────────────────────────┐
│ RYDIT RENDER QUEUE │
├─────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────────────────────────────────────────┐ │
│ │ 1. COMMAND QUEUE (8192+ draw calls) │ │
│ │ - Acumular: circle, rect, line, text, etc. │ │
│ │ - Ejecutar: batch processing │ │
│ │ - Buffer circular: head, tail, capacity │ │
│ └─────────────────────────────────────────────────┘ │
│ │ │
│ ┌──────────────────────▼──────────────────────────┐ │
│ │ 2. DOUBLE BUFFERING │ │
│ │ - Front buffer: lógica (executor) │ │
│ │ - Back buffer: render (draw calls) │ │
│ │ - Swap: intercambiar buffers por frame │ │
│ └─────────────────────────────────────────────────┘ │
│ │ │
│ ┌──────────────────────▼──────────────────────────┐ │
│ │ 3. PLATFORM SYNC (X11) │ │
│ │ - XFlush: forzar flush de comandos │ │
│ │ - XSync: sincronizar con servidor X11 │ │
│ │ - glFlush: OpenGL buffer swap │ │
│ └─────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────┘§Uso
use ry_gfx::render_queue::{RenderQueue, DrawCommand};
let mut queue = RenderQueue::with_capacity(8192);
// Acumular comandos (front buffer - lógica)
queue.push(DrawCommand::Circle { x: 400, y: 300, radius: 50, color: "rojo" });
queue.push(DrawCommand::Rect { x: 100, y: 100, w: 100, h: 100, color: "verde" });
// Ejecutar todos los comandos (back buffer - render)
queue.execute(&mut gfx);
// Platform sync (X11)
queue.platform_sync();Structs§
- Double
Buffer - Double Buffer para draw commands
- Platform
Sync - Platform Sync - sincronización de frame multiplataforma
- Render
Queue - Command Queue para draw calls
- Render
Queue Stats - Estadísticas de la render queue
Enums§
- Draw
Command - Comandos de dibujado para la queue
- Platform
Sync Mode - Modo de sincronización
Traits§
- Rydit
GfxExt - Extensión para RyditGfx con render queue