Files
SDL3CPlusPlus/src/script/scene_manager.hpp
johndoe6345789 e9b944680c feat: Enhance ScriptEngine with Shader and Scene Management
- Added ShaderManager to handle shader paths loading from Lua.
- Integrated SceneManager for managing scene objects within ScriptEngine.
- Updated ScriptEngine to utilize ShaderManager and SceneManager.
- Refactored audio command handling to use AudioManager.
- Improved error handling and Lua integration for shader and scene loading.
- Cleaned up code structure and dependencies in script_engine.hpp.
2026-01-04 00:05:05 +00:00

38 lines
894 B
C++

#pragma once
#include <lua.hpp>
#include <lauxlib.h>
#include "script/lua_helpers.hpp"
#include "core/vertex.hpp"
#include <array>
#include <filesystem>
#include <string>
#include <vector>
namespace sdl3cpp::script {
class SceneManager {
public:
struct SceneObject {
std::vector<core::Vertex> vertices;
std::vector<uint16_t> indices;
int computeModelMatrixRef = LUA_REFNIL;
std::string shaderKey = "default";
};
explicit SceneManager(lua_State* L);
std::vector<SceneObject> LoadSceneObjects();
std::array<float, 16> ComputeModelMatrix(int functionRef, float time);
std::array<float, 16> GetViewProjectionMatrix(float aspect);
private:
lua_State* L_;
std::vector<core::Vertex> ReadVertexArray(int index);
std::vector<uint16_t> ReadIndexArray(int index);
std::string GetLuaError();
};
} // namespace sdl3cpp::script