Infinite Dev Log

引言

Infinite 引擎的开发过程记录和总结。

BLENDING

Shader Library

添加 Shader Library 并规范 Shader 的创建过程。

过程中出现的主要问题是纹理路径中间加了多余的空格导致读取失败,断言止于 Bind() 函数。

Camera Controllers

构建正交相机控制类,整理沙盒代码。

过程中出现的主要问题是忘记更新事件,补上 OnUpdate() 方法即可。旋转速度还是过快,但平移速度正常,不知道时间步出了什么问题。

ExampleLayer()
: Layer("Example"), m_CameraController(1280.0f / 720.0f, true){}

启用旋转后使用 QE

Resizing

继续完善窗口大小调整的裁剪事件,修复 Resize 行为。

之前的引擎会在窗口大小改变后固定渲染的区域,并不会随着窗口大小的改变而改变,如图所示:

RenderCommandRenderer 等加入 Resize 事件改变视口后后最大化可以正常显示:

在 git 提交时出现问题:

fatal: unable to access [repo adress]: schannel: failed to receive handshake, SSL/TLS connection failed.

解决方案:

git config --global http.sslBackend "openssl"

Preparing for 2D Rendering

Starting our 2D Renderer

2D Renderer Transform

2D Renderer Textures

Single Shader 2D Renderer

Code maintenance

- Convert smart pointers to Hazel wrappers: (Create)Scope and (Create)Ref
- Removing all DLL traces (removing all INFINITE_API macros)
- Fixing include statements:
-> All includes relative to `Infinite/src`
-> All external includes use `<>` instead of `""`
- Use default (de)constructor instead of an empty one
- Removed the dedicated (duplicate) `BIND_EVENT_FN` in application
- Removed obsolete logging messages in glfw
- Removed obsolete YAML keys in PR template
- Call Renderer2D::Shutdown() to free memory from allocated Renderer2DStorage
- Removed traces of OpenGL in the main Renderer and in Sandbox/ExampleLayer

只声明 LayerStack 的构造函数没有实现,报错 LINK2019 无法解析的外部符号。

LayerStack() = default;

Improving 2D Rendering API

{
IFN_PROFILE_SCOPE("Renderer Draw");
Infinite::Renderer2D::BeginScene(m_CameraController.GetCamera());
+ Infinite::Renderer2D::DrawRotatedQuad({ -1.0f, 0.0f }, { 0.8f, 0.8f }, glm::radians(-45.0f),{ 0.8f, 0.2f, 0.3f, 1.0f });
Infinite::Renderer2D::DrawQuad({ 0.5f, -0.5f }, { 0.5f, 0.75f }, { 0.2f, 0.3f, 0.8f, 1.0f });
+ Infinite::Renderer2D::DrawRotatedQuad({ 0.0f, 0.0f, -0.1f }, { 10.0f, 10.0f }, glm::radians(45.0f), m_CheckerboardTexture, 10.0f);
Infinite::Renderer2D::EndScene();
}