| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- $#include "Texture2D.h"
- enum TextureUsage{};
- class Texture2D : public Texture
- {
- Texture2D();
- ~Texture2D();
- bool SetSize(int width, int height, unsigned format, TextureUsage usage = TEXTURE_STATIC);
- // bool SetData(SharedPtr<Image> image, bool useAlpha = false);
- tolua_outside bool Texture2DSetData @ SetData(Image* image, bool useAlpha = false);
- RenderSurface* GetRenderSurface() const;
-
- tolua_readonly tolua_property__get_set RenderSurface* renderSurface;
- };
- ${
- #define TOLUA_DISABLE_tolua_GraphicsLuaAPI_Texture2D_new00
- static int tolua_GraphicsLuaAPI_Texture2D_new00(lua_State* tolua_S)
- {
- return ToluaNewObject<Texture2D>(tolua_S);
- }
- #define TOLUA_DISABLE_tolua_GraphicsLuaAPI_Texture2D_new00_local
- static int tolua_GraphicsLuaAPI_Texture2D_new00_local(lua_State* tolua_S)
- {
- return ToluaNewObjectGC<Texture2D>(tolua_S);
- }
- static bool Texture2DSetData(Texture2D* texture, Image* image, bool useAlpha)
- {
- SharedPtr<Image> imagePtr(image);
- bool ret = texture->SetData(imagePtr, useAlpha);
- // Need to safely detach the object from the shared pointer so that the Lua script can manually
- // delete the object once done
- imagePtr.Detach();
- return ret;
- }
- $}
|