feat(utils): 添加二进制文件读取器 BinaryReader

refactor(assets): 将着色器路径从 "shaders" 改为 "assets/shaders"
refactor(build): 统一各平台资源目录复制逻辑为 assets 目录

style: 更新 .gitignore 忽略参考代码目录和 .pvf 文件
This commit is contained in:
2026-03-18 03:12:39 +08:00
parent 57a96a0cc5
commit a4883b433e
12 changed files with 535 additions and 67 deletions

View File

@@ -6,9 +6,11 @@
#include <frostbite2D/graphics/texture.h>
#include <glad/glad.h>
#include <frostbite2D/2d/sprite.h>
#include <frostbite2D/scene/scene.h>
#include <frostbite2D/scene/scene_manager.h>
#include <frostbite2D/2d/sprite.h>
#include <frostbite2D/utils/binary_reader.h>
using namespace frostbite2D;
@@ -36,7 +38,7 @@ int main(int argc, char **argv) {
SDL_Log("Testing colored quad...");
// 尝试加载精灵
auto sprite = Sprite::createFromFile("assets\\player.png");
auto sprite = Sprite::createFromFile("assets/player.png");
if (sprite) {
sprite->SetPosition(100, 100);
menuScene->AddActor(sprite);
@@ -45,6 +47,7 @@ int main(int argc, char **argv) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Failed to create sprite from file!");
}
app.run();
app.shutdown();