Texture3D.pkg 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. $#include "Graphics/Texture3D.h"
  2. enum TextureUsage{};
  3. class Texture3D : public Texture
  4. {
  5. Texture3D();
  6. ~Texture3D();
  7. bool SetSize(int width, int height, int depth, unsigned format, TextureUsage usage = TEXTURE_STATIC);
  8. // bool SetData(SharedPtr<Image> image, bool useAlpha = false);
  9. tolua_outside bool Texture3DSetData @ SetData(Image* image, bool useAlpha = false);
  10. };
  11. ${
  12. #define TOLUA_DISABLE_tolua_GraphicsLuaAPI_Texture3D_new00
  13. static int tolua_GraphicsLuaAPI_Texture3D_new00(lua_State* tolua_S)
  14. {
  15. return ToluaNewObject<Texture3D>(tolua_S);
  16. }
  17. #define TOLUA_DISABLE_tolua_GraphicsLuaAPI_Texture3D_new00_local
  18. static int tolua_GraphicsLuaAPI_Texture3D_new00_local(lua_State* tolua_S)
  19. {
  20. return ToluaNewObjectGC<Texture3D>(tolua_S);
  21. }
  22. static bool Texture3DSetData(Texture3D* texture, Image* image, bool useAlpha)
  23. {
  24. SharedPtr<Image> imagePtr(image);
  25. bool ret = texture->SetData(imagePtr, useAlpha);
  26. // Need to safely detach the object from the shared pointer so that the Lua script can manually
  27. // delete the object once done
  28. imagePtr.Detach();
  29. return ret;
  30. }
  31. $}