sdl3-sample-简明教程,指导如何在包括移动和 Web 在内的各种平台上构建和使用 SDL3

sdl3-sample-简明教程,指导如何在包括移动和 Web 在内的各种平台上构建和使用 SDL3

sdl3-sample源代码地址为:https://github.com/Ravbug/sdl3-sample

sdl3-sample

sdl3-example是SDL3的简明教程,指导如何在包括移动和 Web 在内的各种平台上构建和使用 SDL3。还包含 SDL_mixer、SDL_Image 和 SDL_ttf!
在线网站运行示例为:https://www.ravbug.com/sdl3-sample/

https://www.ravbug.com/sdl3-sample/官网在线运行结果:

在这里插入图片描述

SDL3 App From Source Minimal Example

This is a minimal example for building and using SDL3, SDL_Mixer, SDL_Image, and SDL_ttf_ from source
using C++ and CMake. It also demonstrates setting up things like macOS/iOS
bundles.
See src/main.cpp for the code.

Building And Running

Are you a complete beginner? If so, read this!
Otherwise, install CMake and your favorite compiler, and follow the commands below:

# You need to clone with submodules, otherwise SDL will not download. git clone https://github.com/Ravbug/sdl3-sample --depth=1 --recurse-submodules cd sdl3-sample cmake -S . -B build 

You can also use an init script inside config/. Then open the IDE project inside build/
(If you had CMake generate one) and run!

Supported Platforms

I have tested the following:

PlatformArchitectureGenerator
macOSx86_64, arm64Xcode
iOSx86_64, arm64Xcode
tvOSx86_64, arm64Xcode
visionOS*arm64Xcode
Windowsx86_64, arm64Visual Studio
Linuxx86_64, arm64Ninja, Make
Web*wasmNinja, Make
Android*x86, x64, arm, arm64Ninja via Android Studio

*See further instructions in config/

Note: UWP support was removed from SDL3 during its development. For historical reasons, you can get a working UWP sample via this commit: df270da

Updating SDL

Just update the submodule:

cd SDL git pull cd .. cd SDL_ttf git pull 

You don’t need to use a submodule, you can also copy the source in directly. This
repository uses a submodule to keep its size to a minimum.

Reporting issues

Is something not working? Create an Issue or send a Pull Request on this repository!

当在自己的MacOS、Windows、Ubuntu等Linux系统中安装了CMake安装包后,可以按照官网说的如下命令执行:

# You need to clone with submodules, otherwise SDL will not download.git clone https://github.com/Ravbug/sdl3-sample --depth=1 --recurse-submodules cd sdl3-sample cmake -S . -B build cmake --build build make

在MacOS中运行结果

在MacOS中运行结果

在Windows11中运行结果

在Windows11中运行结果

参考资料

Read more

【保姆级教程】从零部署宇树 Unitree 机器人 ROS 2 环境 (Go2/B2/H1) (Humble + 真实硬件)

摘要 本文为希望在ROS 2 (Humble) 环境下开发宇树 (Unitree) 机器人(支持 Go2, B2, H1)的开发者提供了一篇详尽的、从零开始的部署指南。我们将首先在 Ubuntu 22.04 上安装 ROS 2 Humble,然后重点讲解如何配置 unitree_ros2 功能包,实现 ROS 2 节点与机器人底层 DDS 系统的直接通信。本教程基于官方文档,并针对 Humble 环境进行了优化,可跳过 Foxy 版本复杂的 CycloneDDS 编译步骤。 核心环境: * 操作系统: Ubuntu 22.04 (Jammy) * ROS 2 版本: Humble

By Ne0inhk
基于FPGA的SPI控制FLASH读写

基于FPGA的SPI控制FLASH读写

基于FPGA的SPI控制FLASH读写 文章目录 * 基于FPGA的SPI控制FLASH读写 * 一、SPI简介 * 二、FLASH_M25P16简介 * 信号描述 * 功能操作 * 注意时序 * 三、设计思路 * 框图设计 * 状态机设计 * 四、上板验证 * 1、读ID * 2、读数据 * 3、扇区擦除+写数据 * 五、总结 * 六、代码 一、SPI简介 SPI是Serial Peripheral interface的缩写,顾名思义就是串行外围设备接口。是由Motorola(摩托罗拉)公司推出的一种全双工、同步串行总线接口,只需要四根信号线即可实现多个芯片之间的主从连接结构,节约引脚,同时有利于PCB的布局。它主要应用在如:Flash存储器、EEPROM存储器、ADC、DAC、RTC等,实现主控器与芯片之间的串行数据传输。 SPI通信需要四根信号线,分别为sck、

By Ne0inhk
手把手教你用 OpenClaw + 飞书,打造专属 AI 机器人

手把手教你用 OpenClaw + 飞书,打造专属 AI 机器人

手把手教你用 OpenClaw + 飞书,打造专属 AI 机器人 当前版本 OpenClaw(2026.2.22-2)已内置飞书插件,无需额外安装。 你有没有想过,在飞书里直接跟 AI 对话,就像跟同事聊天一样自然? 今天这篇文章,带你从零开始,用 OpenClaw 搭建一个飞书 AI 机器人。全程命令行操作,10 分钟搞定。 一、准备工作 1.1 安装 Node.js(版本 ≥ 22) OpenClaw 依赖 Node.js 运行,首先确保你的 Node 版本不低于 22。 推荐使用 nvm 管理 Node

By Ne0inhk

OpenClaw 安装 + 接入飞书机器人完整教程

OpenClaw 安装 + 接入飞书机器人完整教程 OpenClaw 曾用名:ClawdBot → MoltBot → OpenClaw(同一软件,勿混淆) 适用系统:Windows 10/11 最后更新:2026年3月 一、什么是 OpenClaw? OpenClaw 是一款 2026 年爆火的开源个人 AI 助手,GitHub 星标已超过 10 万颗。 与普通 AI 聊天机器人的核心区别: * 真正的执行能力:不只回答问题,能实际操作你的电脑 * 24/7 全天候待命:睡觉时也能主动完成任务 * 完全开源免费:数据完全掌控在自己手中 * 支持国内平台:飞书、钉钉等均已支持接入 二、安装前准备:安装 Node.js 建议提前手动安装

By Ne0inhk