Skip to main content

Module render_queue

Module render_queue 

Source
Expand description

§RyDit Render Queue - Command Queue + Double Buffering + Platform Sync

TRES CAPAS CRÍTICAS PARA RENDIMIENTO Y COMPATIBILIDAD

  1. Command Queue (8192+ draw calls) - Acumular comandos de dibujado
  2. Double Buffering - Separar lógica de renderizado
  3. 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§

DoubleBuffer
Double Buffer para draw commands
PlatformSync
Platform Sync - sincronización de frame multiplataforma
RenderQueue
Command Queue para draw calls
RenderQueueStats
Estadísticas de la render queue

Enums§

DrawCommand
Comandos de dibujado para la queue
PlatformSyncMode
Modo de sincronización

Traits§

RyditGfxExt
Extensión para RyditGfx con render queue