Add Music fluctuations project and Chinese plan docs

This commit is contained in:
2026-03-21 15:55:54 +08:00
parent 629455df07
commit a172d75e36
462 changed files with 382904 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
#递归将本文件夹下所有cpp放到FUNCS中
file(GLOB_RECURSE GAME ./ *.cpp)
#将FUNCS中所有cpp编译为funcs这个lib库
add_library(game ${GAME} )

View File

@@ -0,0 +1,57 @@
#include"Game.h"
Game::Game(Context& p_context) :
m_context(p_context)
{
}
Game::~Game() {}
void Game::Update(float p_deltaTime)
{
/*Scene-Update*/
if (m_context.m_sceneManager.m_currentScene)
{
m_context.m_sceneManager.m_currentScene->Update(p_deltaTime);
}
/*Network-Update*/
/*Render-Update*/
m_context.m_renderer.RenderUI();
/*Audio-Update*/
m_context.m_audioManager.Update(p_deltaTime);
m_context.m_audioEngine.Update(p_deltaTime);
}
void Game::PreUpdate()
{
m_context.m_window.peekMessage();
m_context.m_window.Update();
m_context.m_gpu.clear();
}
void Game::PostUpdate()
{
m_context.m_window.swapBuffer();
}
void Game::OnEnter()
{
StartScene* m_startScene = new StartScene();
m_context.m_sceneManager.RegisterScene("start_scene", m_startScene);
m_startScene->m_context = &m_context;
m_context.m_sceneManager.ChangeScene(m_startScene);
/*Audio-Init*/
m_context.m_audioEngine.InitAudioEngine();
}
void Game::OnExit()
{
/*Audio-Exit*/
m_context.m_audioEngine.ExitAudioEngine();
}

View File

@@ -0,0 +1,17 @@
#pragma once
#include"../context/Context.h"
#include"../scene/StartScene/StartScene.h"
class Game
{
public:
Game(Context& p_context);
~Game();
void Update(float p_deltaTime);
void PreUpdate();
void PostUpdate();
void OnEnter();
void OnExit();
private:
Context& m_context;
};