Skip to content

Instantly share code, notes, and snippets.

@Lightnet
Lightnet / threejs_ecs_jolt02.js
Created November 19, 2024 21:13
threejs ecs jolt physics test 02
/*
Project Name: threepolygonenginejs
License: MIT
Created By: Lightnet
GitHub: https://github.com/Lightnet/threepolygonenginejs
*/
// Notes:
// simple ground and cube button create test
// create box on gui
@Lightnet
Lightnet / CMakeLists.txt
Created February 23, 2025 23:48
Grok SDL3 build test.
# CMake configuration for SDL 3.2.4 project with additional libraries (shared libraries)
# This file sets up a project to build an SDL 3 application in C, fetching SDL and its
# extension libraries (SDL_ttf, SDL_image, SDL_mixer) directly from GitHub repositories.
cmake_minimum_required(VERSION 3.11)
# Notes:
# - CMake 3.11+ is required for FetchContent, which downloads and builds external dependencies.
# - We're using C (not C++) for main.c, which uses SDL 3's callback-based main functions.
project(MySDLProject VERSION 1.0 DESCRIPTION "SDL 3.2.4 C test with callbacks" LANGUAGES C)
# Notes:
@Lightnet
Lightnet / CMakeLists.txt
Last active February 25, 2025 07:15
raylib dll and static build options
# Minimum CMake version required to build this project
cmake_minimum_required(VERSION 3.10)
# Define the project name and language (C)
project(RaylibExample C)
# Set C standard to C11 and make it required
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
@Lightnet
Lightnet / example_cameras.rs
Created February 26, 2025 22:54
example switch cameras
// example_cameras.rs
// A 3D first-person multi-camera example using Bevy 0.15.3 and Bevy Rapier3D 0.28.
// Features multiple players with switchable first-person cameras, mouse capture, WASD movement, Space key jumping, and a debug UI.
// Player with ID 0 is active by default; debug UI shows the current player ID via a dedicated 2D camera.
// --- Notes ---
// This application creates a 3D world with:
// - A static ground box and directional boxes (North, South, East, West) colored by world axes (Z, -Z, X, -X).
// - Players identified by `PlayerID`, each with a `Player` component and a `CameraPlayer` child (Camera3d).
// - Player 0 starts controllable with its camera active; Tab cycles through players.
# CMake configuration for SDL 3.2.4 project with SDL_ttf, SDL_image, SDL_mixer, and GLAD
cmake_minimum_required(VERSION 3.11)
project(MySDLProject VERSION 1.0 DESCRIPTION "SDL 3.2.4 C/C++ test with callbacks" LANGUAGES C CXX)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@Lightnet
Lightnet / CMakeLists.txt
Last active February 27, 2025 16:24
SDL3 Vulkan CMake Build Test
cmake_minimum_required(VERSION 3.16)
project(VulkanSDL3Project C)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
include(FetchContent)
FetchContent_Declare(
Vulkan-Headers
@Lightnet
Lightnet / CMakeLists.txt
Last active February 28, 2025 00:05
Grok3 SDL3 Vulkan CMake build. Most simple triangle test. Pure C Language. VS2022
cmake_minimum_required(VERSION 3.20)
project(VulkanSDL3Project C)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_CXX_COMPILER "")
set(CMAKE_CXX_FOUND FALSE)
include(FetchContent)
@Lightnet
Lightnet / README.md
Created March 24, 2025 23:58
Test raylib3d flecs transform hierarchy

Information:

This simple test build to make transform hierarchy node or system.

Red is parent Blue is child.

controls:

tab = for toggle position. W,A,S,D = movement Q,W,E,A,S,D = rotate

@Lightnet
Lightnet / CMakeLists.txt
Created March 26, 2025 06:13
raylib flecs render ode test
cmake_minimum_required(VERSION 3.14)
project(raylib_luajit LANGUAGES C CXX)
# Set up cache directory for built artifacts
set(CACHE_DIR "${CMAKE_BINARY_DIR}/cache")
file(MAKE_DIRECTORY ${CACHE_DIR})
if(NOT EXISTS "${CMAKE_BINARY_DIR}/cmake/CPM.cmake")
file(DOWNLOAD
"https://github.com/cpm-cmake/CPM.cmake/releases/latest/download/CPM.cmake"
@Lightnet
Lightnet / client.js
Last active March 27, 2025 02:42
vanjs markdown build test.
import van from "https://cdn.jsdelivr.net/gh/vanjs-org/van/public/van-1.5.3.min.js";
const { div, p, h1, h2, h3, h4, h5, h6, pre, code, button, textarea, strong, em, a, ul, ol, li, blockquote, br, table, thead, tbody, tr, th, td, img, span, hr, del, sup, section } = van.tags;
// Editor State
const editorState = van.state({
text: "# Sample Title\n\nHello, **bold** and *italic* world![^1]\n\n> This is a **blockquote** with *emphasis*\n> Another line\n\n| Header 1 | Header 2 |\n|----------|----------|\n| Cell 1 | **Cell 2** |\n| *Cell 3* | <span style=\"color: red;\">Cell 4</span> |\n\n![Sample Image](https://via.placeholder.com/150)\n\nHere's some <b>bold</b> and <i>italic</i> inline HTML.\nWith a break \nright here \nand more.[^2]\n\nasdddd\ndddddd\ndddddd\n\nddddd\nddddd\n\n[^1]: This is the first footnote.\n[^2]: This is the second footnote with **bold** text.\n\n---\n\n```javascript\nconsole.log('hi');\n```\n\n- Item 1\n- _Item 2_\n\n1. First\n2. ~~Second~~\n\n[Link](https://example.com)\n\n`inline