LearnOpenTK 项目教程

LearnOpenTK 项目教程

LearnOpenTKA port of learnopengl.com's tutorials to OpenTK and C#.项目地址:https://gitcode.com/gh_mirrors/le/LearnOpenTK

1. 项目的目录结构及介绍

LearnOpenTK 项目的目录结构如下:

LearnOpenTK/
├── Chapter1/
│   ├── Chapter1.csproj
│   ├── Program.cs
│   └── ...
├── Chapter2/
│   ├── Chapter2.csproj
│   ├── Program.cs
│   └── ...
├── Common/
│   ├── Common.csproj
│   ├── Shader.cs
│   └── ...
├── .gitattributes
├── .gitignore
├── LICENSE
├── LearnOpenTK.sln
└── README.md

目录介绍:

  • Chapter1/Chapter2/:包含各个章节的示例代码和项目文件。
  • Common/:包含项目中使用的通用代码,如着色器管理等。
  • .gitattributes.gitignore:Git 配置文件。
  • LICENSE:项目许可证文件。
  • LearnOpenTK.sln:Visual Studio 解决方案文件。
  • README.md:项目说明文件。

2. 项目的启动文件介绍

每个章节目录(如 Chapter1/)中包含一个 Program.cs 文件,这是该章节的启动文件。例如,Chapter1/Program.cs 的内容如下:

using System;
using OpenTK.Graphics.OpenGL4;
using OpenTK.Mathematics;
using OpenTK.Windowing.Desktop;

namespace LearnOpenTK.Chapter1
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var nativeWindowSettings = new NativeWindowSettings()
            {
                Size = new Vector2i(800, 600),
                Title = "LearnOpenTK - Chapter 1"
            };

            using (var window = new Window(GameWindowSettings.Default, nativeWindowSettings))
            {
                window.Run();
            }
        }
    }
}

启动文件介绍:

  • Program.cs:定义了程序的入口点 Main 方法,创建并运行一个窗口。
  • NativeWindowSettings:配置窗口的大小和标题。
  • Window:继承自 GameWindow,负责窗口的生命周期管理。

3. 项目的配置文件介绍

.gitattributes

* text=auto
*.cs text eol=crlf

.gitignore

# Visual Studio Code
.vscode/

# Visual Studio
bin/
obj/
*.suo
*.user
*.sln.docstates

# Miscellaneous
*.log
*.cache
*.dll
*.pdb

LICENSE

CC-BY-4.0 license

LearnOpenTK.sln

这是 Visual Studio 解决方案文件,包含了项目的所有项目文件和配置。

README.md

# LearnOpenTK

A port of learnopengl.com's tutorials to OpenTK and C#.

For a more comprehensive written tutorial, go to the Learn section of OpenTK.net site.

These tutorials serve as a complement to the website tutorial and contains working samples of the different chapters.

## About

A port of learnopengl.com's tutorials to OpenTK and C#.

## Resources

- [LearnOpenGL](https://learnopengl.com)
- [OpenTK](https://opentk.net)

## License

CC-BY-4.0 license

配置文件介绍:

  • .gitattributes:定义了 Git 对文件的处理方式。
  • .gitignore:指定 Git 忽略的文件和目录。
  • LICENSE:项目许可证,采用 CC-BY-4.0 许可证。
  • LearnOpenTK.sln:Visual Studio 解决方案文件。
  • README.md:项目说明文件,包含项目介绍、资源链接和许可证信息。

LearnOpenTKA port of learnopengl.com's tutorials to OpenTK and C#.项目地址:https://gitcode.com/gh_mirrors/le/LearnOpenTK

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

时昕海Minerva

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值