feat(utils): 添加二进制文件读取器 BinaryReader
refactor(assets): 将着色器路径从 "shaders" 改为 "assets/shaders" refactor(build): 统一各平台资源目录复制逻辑为 assets 目录 style: 更新 .gitignore 忽略参考代码目录和 .pvf 文件
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user