Files
Dejvino 0f22c6afca Add raylib-esp32 lib and FloorPlan3D demo (3D floor plan via rlsw)
Vendor raylib-esp32 v1.0.3 (63db94b) under lib/ — raylib 6.x core with
the rlsw software renderer plus the ESP32-S3 port layer (SPI display
drivers, async double-buffered flush). raylib/examples, projects, tools
and logo are trimmed (~80 MB of content nothing here compiles); see
lib/raylib-esp32/VENDOR.md for provenance.

New floorplan3d-demo (emulator-template base) renders the NetDeck demo
map (nd_demomap.h) as a 3D floor plan — bulkhead walls, blast door,
cover crates, airlock pad, terminal — through the real on-device 3D
stack on the desktop:

- rcore_emu.c: desktop PLATFORM_CUSTOM layer mirroring rcore_esp32.c,
  flushing the RGB565 sw-renderer buffer into emuGfx::fb instead of SPI
- raylib_emu_config.h: same module/limit defines as the device build
- HUD via 3x5 bitmap font into fb: rlsw's 2D textured-quad path
  (DrawText/DrawRectangle) misplaces/flips quads and samples wrong
  atlas texels in this build; the 3D path is pixel-accurate

Verified: dual build (make netdeck) green, demo smoke test clean at
~59 FPS, 600-frame stability run OK.
2026-11-16 21:46:31 +01:00

56 lines
1.4 KiB
C

#ifndef RAYLIB_ESP32_H
#define RAYLIB_ESP32_H
#ifdef __cplusplus
extern "C" {
#endif
#include "esp_err.h"
#include "driver/spi_master.h"
#include "raylib_esp32_displays.h"
typedef struct {
raylib_display_driver_e driver;
spi_host_device_t spi_host;
int pin_sclk;
int pin_mosi;
int pin_cs;
int pin_dc;
int pin_rst;
int pin_bl;
uint16_t width;
uint16_t height;
uint32_t spi_freq_hz; /* 0 → use driver default */
} raylib_esp32_display_config_t;
/**
* Initialize display hardware and the raylib port layer.
* Must be called before InitWindow().
*
* Sets up: SPI bus → panel driver → port layer (DMA flush, semaphores).
* Also turns on the backlight via pin_bl (active-high).
*/
esp_err_t raylib_esp32_init(const raylib_esp32_display_config_t *config);
/**
* Mount a LittleFS partition so that raylib's LoadModel / LoadTexture /
* LoadFont can read from it via standard fopen().
*
* @param mount_point VFS path, e.g. "/data"
* @param partition Partition label in the partition table (usually "spiffs")
* @return ESP_OK on success
*/
esp_err_t raylib_esp32_mount_fs(const char *mount_point,
const char *partition_label);
/**
* Tear down the port layer and free the display framebuffer.
*/
void raylib_esp32_deinit(void);
#ifdef __cplusplus
}
#endif
#endif /* RAYLIB_ESP32_H */