mirror of
https://github.com/zhenyan121/SporeBG-Conid.git
synced 2026-04-10 06:14:08 +08:00
Use GameScene to control render
This commit is contained in:
@@ -1,21 +1,26 @@
|
||||
#pragma once
|
||||
#include "Scene.h"
|
||||
#include "scenes/gameplay/GameScene.h"
|
||||
#include <SDL3/SDL.h>
|
||||
#include <string>
|
||||
#include <stack>
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
class SceneManager {
|
||||
public:
|
||||
SceneManager();
|
||||
SceneManager(SDL_Renderer* renderer);
|
||||
~SceneManager();
|
||||
|
||||
void PushScene(const std::string& sceneName, std::unique_ptr<Scene> scene);
|
||||
void PopScene();
|
||||
void ChangeScene(const std::string& sceneName, std::unique_ptr<Scene> scene);
|
||||
|
||||
// void PopScene();
|
||||
//void ChangeScene(const std::string& sceneName, std::unique_ptr<Scene> scene);
|
||||
void handleClickCurrent(std::pair<float, float> clickon);
|
||||
void updateCurrent();
|
||||
void renderCurrent();
|
||||
|
||||
|
||||
private:
|
||||
std::unique_ptr<Scene> m_scene;
|
||||
// 用栈的形式来存储场景
|
||||
std::stack<std::unique_ptr<Scene>> m_scenes;
|
||||
std::unordered_map<std::string, std::unique_ptr<Scene>> m_sceneCache;
|
||||
|
||||
Reference in New Issue
Block a user