feat(渲染): 添加Sprite类并实现基础渲染功能

添加Sprite类用于2D精灵渲染,支持纹理、着色器、颜色、翻转等属性
在Application中增加批处理渲染逻辑
在示例游戏中添加测试精灵
This commit is contained in:
2026-03-17 16:01:22 +08:00
parent b35ecb197f
commit f0298504ac
5 changed files with 260 additions and 0 deletions

BIN
Game/assets/player.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

View File

@@ -8,6 +8,7 @@
#include <frostbite2D/scene/scene.h>
#include <frostbite2D/scene/scene_manager.h>
#include <frostbite2D/2d/sprite.h>
using namespace frostbite2D;
@@ -28,6 +29,13 @@ int main(int argc, char **argv) {
SDL_Log("Starting main loop...");
auto menuScene = MakePtr<Scene>();
SceneManager::get().PushScene(menuScene);
auto sprite = Sprite::createFromFile("assets\\player.png");
sprite->SetPosition(100, 100);
menuScene->AddActor(sprite);
app.run();
app.shutdown();