Kiritow
bc189b4951
分离各SDL类的包装代码. 事件分发处理全部转移至Lua Init层. C层只提供获取事件的方法. 这样有助于提高性能,以及今后Coroutine scheduler的添加.
29 lines
429 B
C++
29 lines
429 B
C++
#pragma once
|
|
#include "LuaVM.h"
|
|
#include "SDL2/include/SDL_mixer.h"
|
|
#include <memory>
|
|
|
|
class Chunk
|
|
{
|
|
public:
|
|
std::shared_ptr<Mix_Chunk> chunk;
|
|
|
|
Chunk(Mix_Chunk* c);
|
|
|
|
static int setVolume(lua_State* L);
|
|
|
|
static int close(lua_State* L);
|
|
static int create(lua_State* L);
|
|
};
|
|
|
|
class Music
|
|
{
|
|
public:
|
|
std::shared_ptr<Mix_Music> music;
|
|
|
|
Music(Mix_Music* m);
|
|
|
|
static int close(lua_State* L);
|
|
static int create(lua_State* L);
|
|
};
|