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.
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
[env:esp32s3]
|
||||
platform = https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip
|
||||
framework = arduino
|
||||
board = esp32-s3-devkitc-1
|
||||
monitor_speed = 115200
|
||||
|
||||
; Point to the library one level up
|
||||
lib_deps = ../..
|
||||
|
||||
board_build.partitions = default.csv
|
||||
board_build.arduino.memory_type = qio_opi
|
||||
|
||||
; Enable PSRAM
|
||||
build_flags =
|
||||
-DBOARD_HAS_PSRAM
|
||||
@@ -0,0 +1,52 @@
|
||||
#include <Arduino.h>
|
||||
#include <raylib_esp32.h>
|
||||
#include <raylib.h>
|
||||
|
||||
static Camera3D camera = {0};
|
||||
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(115200);
|
||||
Serial.println("raylib-esp32 hello_3d example");
|
||||
|
||||
raylib_esp32_display_config_t disp = {
|
||||
.driver = RAYLIB_DRIVER_GC9A01,
|
||||
.spi_host = SPI2_HOST,
|
||||
.pin_sclk = 12,
|
||||
.pin_mosi = 11,
|
||||
.pin_cs = 10,
|
||||
.pin_dc = 9,
|
||||
.pin_rst = 8,
|
||||
.pin_bl = 7,
|
||||
.width = 240,
|
||||
.height = 240,
|
||||
.spi_freq_hz = 40000000,
|
||||
};
|
||||
ESP_ERROR_CHECK(raylib_esp32_init(&disp));
|
||||
|
||||
InitWindow(240, 240, "hello_3d");
|
||||
|
||||
camera.position = (Vector3){4.0f, 4.0f, 4.0f};
|
||||
camera.target = (Vector3){0.0f, 0.0f, 0.0f};
|
||||
camera.up = (Vector3){0.0f, 1.0f, 0.0f};
|
||||
camera.fovy = 45.0f;
|
||||
camera.projection = CAMERA_PERSPECTIVE;
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
BeginDrawing();
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
|
||||
BeginMode3D(camera);
|
||||
DrawCube((Vector3){0}, 2.0f, 2.0f, 2.0f, RED);
|
||||
DrawCubeWires((Vector3){0}, 2.0f, 2.0f, 2.0f, MAROON);
|
||||
DrawGrid(10, 1.0f);
|
||||
EndMode3D();
|
||||
|
||||
DrawFPS(4, 4);
|
||||
DrawText("raylib on ESP32!", 10, 220, 10, DARKGRAY);
|
||||
|
||||
EndDrawing();
|
||||
}
|
||||
Reference in New Issue
Block a user