Texture2D.pkg 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. $#include "Graphics/Texture2D.h"
  2. enum TextureUsage{};
  3. class Texture2D : public Texture
  4. {
  5. Texture2D();
  6. ~Texture2D();
  7. bool SetSize(int width, int height, unsigned format, TextureUsage usage = TEXTURE_STATIC, int multiSample = 1, bool autoResolve = true);
  8. bool SetData(Image* image, bool useAlpha = false);
  9. tolua_outside Image* Texture2DGetImage @ GetImage() const;
  10. RenderSurface* GetRenderSurface() const;
  11. tolua_readonly tolua_property__get_set RenderSurface* renderSurface;
  12. };
  13. ${
  14. #define TOLUA_DISABLE_tolua_GraphicsLuaAPI_Texture2D_new00
  15. static int tolua_GraphicsLuaAPI_Texture2D_new00(lua_State* tolua_S)
  16. {
  17. return ToluaNewObject<Texture2D>(tolua_S);
  18. }
  19. #define TOLUA_DISABLE_tolua_GraphicsLuaAPI_Texture2D_new00_local
  20. static int tolua_GraphicsLuaAPI_Texture2D_new00_local(lua_State* tolua_S)
  21. {
  22. return ToluaNewObjectGC<Texture2D>(tolua_S);
  23. }
  24. static Image* Texture2DGetImage(const Texture2D* texture2D)
  25. {
  26. if (!texture2D)
  27. return 0;
  28. return texture2D->GetImage().Detach();
  29. }
  30. $}