Skip to content

Commit 5c749c2

Browse files
committed
Restructure into Infinite OpenGL learning engine
- Modular engine under src/: core, platform, input, math, scene, graphics, assets, animation, resources - 19 runnable examples with shared ExampleRun/FreeCameraController helpers - CTest suites with cpu/graphics labels and smoke-test support - CMake presets for MSYS2 UCRT64 toolchain, resource sync, packaging scripts - Remove legacy flat demo files (Mesh/Renderer/Shader/Window/main.cpp)
1 parent 6a77534 commit 5c749c2

364 files changed

Lines changed: 29484 additions & 571 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/build.yml‎

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Build and test
2+
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
windows-ucrt64:
13+
runs-on: windows-latest
14+
timeout-minutes: 30
15+
defaults:
16+
run:
17+
shell: msys2 {0}
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: msys2/setup-msys2@v2
21+
with:
22+
msystem: UCRT64
23+
update: true
24+
install: >-
25+
mingw-w64-ucrt-x86_64-gcc
26+
mingw-w64-ucrt-x86_64-cmake
27+
mingw-w64-ucrt-x86_64-ninja
28+
mingw-w64-ucrt-x86_64-glfw
29+
mingw-w64-ucrt-x86_64-glew
30+
mingw-w64-ucrt-x86_64-glm
31+
mingw-w64-ucrt-x86_64-stb
32+
# 云端安装盘符不同,不使用为本机E盘配置的Preset。
33+
- name: Configure
34+
run: cmake -S . -B build-ci -G Ninja -DCMAKE_CXX_COMPILER=/ucrt64/bin/g++.exe -DCMAKE_PREFIX_PATH=/ucrt64 -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON
35+
- name: Build framework, examples and tests
36+
run: cmake --build build-ci --parallel 1
37+
# Windows托管机不保证OpenGL 3.3上下文;图形回归由下一个软件渲染任务执行。
38+
- name: CPU tests
39+
run: ctest --test-dir build-ci -L cpu --output-on-failure --no-tests=error
40+
41+
software-opengl:
42+
runs-on: ubuntu-latest
43+
timeout-minutes: 20
44+
env:
45+
LIBGL_ALWAYS_SOFTWARE: "1"
46+
steps:
47+
- uses: actions/checkout@v4
48+
- name: Install build and software rendering dependencies
49+
run: |
50+
sudo apt-get update
51+
sudo apt-get install -y cmake ninja-build g++ libgl1-mesa-dev libgl1-mesa-dri libglx-mesa0 libglfw3-dev libglew-dev libglm-dev libstb-dev xvfb xauth
52+
- name: Configure
53+
run: cmake -S . -B build-ci -G Ninja -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON
54+
- name: Build
55+
run: cmake --build build-ci --parallel 1
56+
# Xvfb提供虚拟显示,Mesa在CPU上执行真实OpenGL调用,不跳过像素断言。
57+
- name: Full suite including graphics and example smoke tests
58+
run: xvfb-run -a -s "-screen 0 1280x1024x24" ctest --test-dir build-ci --output-on-failure --no-tests=error

‎.gitignore‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/build*/
2+
/cmake-build-*/
3+
CMakeCache.txt
4+
CMakeFiles/
5+
cmake_install.cmake
6+
Makefile
7+
CMakeUserPresets.json
8+
# 示例运行日志是本机诊断信息,不作为源码提交。
9+
/runtime/examples/*/logs/
10+
# 构建产物与旧版可执行文件,体积大且可由构建重新生成。
11+
/runtime/examples/
12+
/runtime/_legacy/
13+
# 设计草稿与本机工具数据,不属于仓库内容。
14+
/docs/
15+
/.workbuddy/
16+
/后续设计相关-不放git上.md

‎CMakeLists.txt‎

Lines changed: 315 additions & 0 deletions
Large diffs are not rendered by default.

‎CMakePresets.json‎

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"version": 6,
3+
"cmakeMinimumRequired": { "major": 3, "minor": 25, "patch": 0 },
4+
"configurePresets": [
5+
{
6+
"name": "msys2-ucrt64-debug",
7+
"displayName": "MSYS2 UCRT64 Debug (E drive)",
8+
"description": "本机E盘工具链;默认开启测试,单线程编译避免内存不足。",
9+
"generator": "Ninja",
10+
"binaryDir": "${sourceDir}/build-ucrt64",
11+
"environment": {
12+
"INFINITE_UCRT64_ROOT": "E:/msys64/ucrt64",
13+
"PATH": "$env{INFINITE_UCRT64_ROOT}/bin;$penv{PATH}"
14+
},
15+
"cacheVariables": {
16+
"CMAKE_CXX_COMPILER": "$env{INFINITE_UCRT64_ROOT}/bin/g++.exe",
17+
"CMAKE_MAKE_PROGRAM": "$env{INFINITE_UCRT64_ROOT}/bin/ninja.exe",
18+
"CMAKE_PREFIX_PATH": "$env{INFINITE_UCRT64_ROOT}",
19+
"CMAKE_BUILD_TYPE": "Debug",
20+
"BUILD_TESTING": "ON"
21+
}
22+
},
23+
{
24+
"name": "msys2-ucrt64-release",
25+
"inherits": "msys2-ucrt64-debug",
26+
"displayName": "MSYS2 UCRT64 Release (isolated)",
27+
"binaryDir": "${sourceDir}/build-ucrt64-release",
28+
"cacheVariables": {
29+
"CMAKE_BUILD_TYPE": "Release",
30+
"RUNTIME_DIRECTORY": "${sourceDir}/build-ucrt64-release/runtime"
31+
}
32+
}
33+
],
34+
"buildPresets": [
35+
{
36+
"name": "msys2-ucrt64-debug",
37+
"configurePreset": "msys2-ucrt64-debug",
38+
"jobs": 1
39+
},
40+
{
41+
"name": "msys2-ucrt64-release",
42+
"configurePreset": "msys2-ucrt64-release",
43+
"jobs": 1
44+
}
45+
],
46+
"testPresets": [
47+
{
48+
"name": "msys2-ucrt64-debug",
49+
"configurePreset": "msys2-ucrt64-debug",
50+
"output": { "outputOnFailure": true },
51+
"execution": { "jobs": 1, "noTestsAction": "error" }
52+
},
53+
{
54+
"name": "msys2-ucrt64-release",
55+
"configurePreset": "msys2-ucrt64-release",
56+
"output": { "outputOnFailure": true },
57+
"execution": { "jobs": 1, "noTestsAction": "error" }
58+
}
59+
]
60+
}

‎Mesh.cpp‎

Lines changed: 0 additions & 120 deletions
This file was deleted.

‎Mesh.h‎

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)