图形学、01 | GAMES101 + VSCODE + XMake + Win11 作业环境配置

发布时间 2023-10-15 18:03:17作者: 小能日记

GAMES101 + VSCODE + XMAKE + Win11 环境配置

安装

  • 安装 C++ 编译工具链,如 MSVC(visual studio)
  • 安装 Xmake: Xmake
  • VSCODE 安装插件
    • C/C++
    • XMake
    • CodeLLDB

获取作业

git clone https://github.com/star-hengxing/GAMES101-xmake.git

测试并安装所需第三方库

cd src/Assignment1
xmake -y
xmake run
  • 所有作业文档在 doc 目录
  • 所有模型在 models 目录
  • 每个作业运行环境都在自己作业目录下,有需要可以在 xmake.lua 里修改set_rundir的路径

打开任意作业

  1. 按 Ctrl + Shift + P 执行 \>XMake: UpdateIntellisense
  2. 当前目录下新建文件 ./vscode/settings.json
{
  "clangd.arguments": [
    "--compile-commands-dir=.vscode",
  ],
  // "xmake.debugConfigType": "codelldb",
}
  1. Reload 项目
  2. Build 并运行项目
image-20231015174148974

解决乱码

也能解决问题: Executing task: 参数格式不正确 - -Command

修改全局 settings.json 添加如下代码

  "terminal.integrated.profiles.windows": {
    "powershell": {
      "source": "PowerShell",
      "args": [
        "chcp 65001; powershell -NoLogo"
      ]
    }
  },
  "terminal.integrated.defaultProfile.windows": "powershell",