mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
28 lines
434 B
C++
28 lines
434 B
C++
#pragma once
|
|
|
|
#include <string_view>
|
|
#include <string>
|
|
#include <memory>
|
|
|
|
#include "ext/sol/forward.hpp"
|
|
|
|
struct lua_State;
|
|
|
|
class LuaContext {
|
|
public:
|
|
void Init();
|
|
void Shutdown();
|
|
void Load(const char *code);
|
|
|
|
// For the console.
|
|
void Execute(std::string_view cmd, std::string *output);
|
|
|
|
private:
|
|
std::unique_ptr<sol::state> lua_;
|
|
|
|
// Naming it L is a common convention.
|
|
lua_State *L = nullptr;
|
|
};
|
|
|
|
extern LuaContext g_lua;
|