Kiritow
bc189b4951
分离各SDL类的包装代码. 事件分发处理全部转移至Lua Init层. C层只提供获取事件的方法. 这样有助于提高性能,以及今后Coroutine scheduler的添加.
20 lines
394 B
C++
20 lines
394 B
C++
#pragma once
|
|
#include "LuaVM.h"
|
|
#include "SDL2/include/SDL.h"
|
|
#include <memory>
|
|
|
|
|
|
class Texture
|
|
{
|
|
public:
|
|
std::shared_ptr<SDL_Renderer> rnd;
|
|
std::shared_ptr<SDL_Texture> text;
|
|
int w;
|
|
int h;
|
|
|
|
Texture(const std::shared_ptr<SDL_Renderer>& exrnd, SDL_Texture* t);
|
|
|
|
static int close(lua_State* L);
|
|
static int create(lua_State* L, const std::shared_ptr<SDL_Renderer>& rnd, SDL_Texture* t);
|
|
};
|