LPCGame
A Simple 2d Game Engine
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
luacimage.h
1 #ifndef LUACIMAGE_H
2 #define LUACIMAGE_H
3 
4 #include <string>
5 #include <memory>
6 #include <lua.hpp>
7 #include "luacudata.h"
8 #include "core/image.h"
9 
11 
15 namespace LuaC {
16  //The Image metatable name
17  const std::string imageMeta = "LPC.Image";
18  //The Image class/type name
19  const std::string imageClass = "Image";
21  template<>
22  const std::string UdataLib<std::shared_ptr<Image>>::mMetaTable = imageMeta;
27  class ImageLib : public UdataLib<std::shared_ptr<Image>> {
28  public:
29  //Open the Image Lua library for Lua state l
30  static int luaopen_image(lua_State *l);
31 
32  private:
34  static const struct luaL_reg luaImageLib[];
36  static int newImage(lua_State *l);
38  static int getClip(lua_State *l);
40  static int setActiveClip(lua_State *l);
42  static int clipCount(lua_State *l);
44  static int size(lua_State *l);
46  static int width(lua_State *l);
48  static int height(lua_State *l);
50  static int file(lua_State *l);
52  static int release(lua_State *l);
54  static int garbageCollection(lua_State *l);
55  };
56 }
57 
58 #endif