使用rust语言+SDL2库写游戏
1. 安装rust curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh 2. 设置rust国内源 #当前用户目录下 /linuxidc/.cargo/ 的.cargo 文件夹,进入.cargo 当前目录,在当前目下创建 config 文件 source.crates-io] registry = "https://github.com/rust-lang/crates.io-index" replace-with = 'ustc' [source.ustc] registry = "git://mirrors.ustc.edu.cn/crates.io-index" 3. 安装SDL库 dnf install SDL2 dnf install SDL2-devel dnf install SDL2_image-devel dnf install SDL2_gfx-devel dnf install SDL2_mixer-devel dnf install SDL2_ttf-devel 4. 创建rust项目 cargo new testSDL cd testSDL 编辑cargo.toml,加入sdl2依赖 [dongfeng@localhost testSDL]$ cat Cargo.toml [package] name = "testsdl" version = "0.……