Viewport.pkg 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. $#include "Viewport.h"
  2. class Viewport
  3. {
  4. Viewport();
  5. Viewport(Scene* scene, Camera* camera, RenderPath* renderPath = 0);
  6. Viewport(Scene* scene, Camera* camera, const IntRect& rect, RenderPath* renderPath = 0);
  7. ~Viewport();
  8. void SetScene(Scene* scene);
  9. void SetCamera(Camera* camera);
  10. void SetRect(const IntRect& rect);
  11. void SetRenderPath(RenderPath* path);
  12. void SetRenderPath(XMLFile* file);
  13. Scene* GetScene() const;
  14. Camera* GetCamera() const;
  15. const IntRect& GetRect() const;
  16. RenderPath* GetRenderPath() const;
  17. tolua_property__get_set Scene* scene;
  18. tolua_property__get_set Camera* camera;
  19. tolua_property__get_set IntRect& rect;
  20. tolua_property__get_set RenderPath* renderPath;
  21. };
  22. ${
  23. #define TOLUA_DISABLE_tolua_GraphicsLuaAPI_Viewport_new00
  24. static int tolua_GraphicsLuaAPI_Viewport_new00(lua_State* tolua_S)
  25. {
  26. return ToluaNewObject<Viewport>(tolua_S);
  27. }
  28. #define TOLUA_DISABLE_tolua_GraphicsLuaAPI_Viewport_new00_local
  29. static int tolua_GraphicsLuaAPI_Viewport_new00_local(lua_State* tolua_S)
  30. {
  31. return ToluaNewObjectGC<Viewport>(tolua_S);
  32. }
  33. /* method: new of class Viewport */
  34. #define TOLUA_DISABLE_tolua_GraphicsLuaAPI_Viewport_new01
  35. static int tolua_GraphicsLuaAPI_Viewport_new01(lua_State* tolua_S)
  36. {
  37. tolua_Error tolua_err;
  38. if (
  39. !tolua_isusertable(tolua_S,1,"Viewport",0,&tolua_err) ||
  40. !tolua_isusertype(tolua_S,2,"Scene",0,&tolua_err) ||
  41. !tolua_isusertype(tolua_S,3,"Camera",0,&tolua_err) ||
  42. !tolua_isusertype(tolua_S,4,"RenderPath",1,&tolua_err) ||
  43. !tolua_isnoobj(tolua_S,5,&tolua_err)
  44. )
  45. goto tolua_lerror;
  46. else
  47. {
  48. Scene* scene = ((Scene*) tolua_tousertype(tolua_S,2,0));
  49. Camera* camera = ((Camera*) tolua_tousertype(tolua_S,3,0));
  50. RenderPath* renderPath = ((RenderPath*) tolua_tousertype(tolua_S,4,0));
  51. {
  52. Viewport* tolua_ret = (Viewport*) Mtolua_new((Viewport)(GetContext(tolua_S),scene,camera,renderPath));
  53. tolua_pushusertype(tolua_S,(void*)tolua_ret,"Viewport");
  54. }
  55. }
  56. return 1;
  57. tolua_lerror:
  58. return tolua_GraphicsLuaAPI_Viewport_new00(tolua_S);
  59. }
  60. /* method: new_local of class Viewport */
  61. #define TOLUA_DISABLE_tolua_GraphicsLuaAPI_Viewport_new01_local
  62. static int tolua_GraphicsLuaAPI_Viewport_new01_local(lua_State* tolua_S)
  63. {
  64. tolua_Error tolua_err;
  65. if (
  66. !tolua_isusertable(tolua_S,1,"Viewport",0,&tolua_err) ||
  67. !tolua_isusertype(tolua_S,2,"Scene",0,&tolua_err) ||
  68. !tolua_isusertype(tolua_S,3,"Camera",0,&tolua_err) ||
  69. !tolua_isusertype(tolua_S,4,"RenderPath",1,&tolua_err) ||
  70. !tolua_isnoobj(tolua_S,5,&tolua_err)
  71. )
  72. goto tolua_lerror;
  73. else
  74. {
  75. Scene* scene = ((Scene*) tolua_tousertype(tolua_S,2,0));
  76. Camera* camera = ((Camera*) tolua_tousertype(tolua_S,3,0));
  77. RenderPath* renderPath = ((RenderPath*) tolua_tousertype(tolua_S,4,0));
  78. {
  79. Viewport* tolua_ret = (Viewport*) Mtolua_new((Viewport)(GetContext(tolua_S),scene,camera,renderPath));
  80. tolua_pushusertype(tolua_S,(void*)tolua_ret,"Viewport");
  81. tolua_register_gc(tolua_S,lua_gettop(tolua_S));
  82. }
  83. }
  84. return 1;
  85. tolua_lerror:
  86. return tolua_GraphicsLuaAPI_Viewport_new00_local(tolua_S);
  87. }
  88. /* method: new of class Viewport */
  89. #define TOLUA_DISABLE_tolua_GraphicsLuaAPI_Viewport_new02
  90. static int tolua_GraphicsLuaAPI_Viewport_new02(lua_State* tolua_S)
  91. {
  92. tolua_Error tolua_err;
  93. if (
  94. !tolua_isusertable(tolua_S,1,"Viewport",0,&tolua_err) ||
  95. !tolua_isusertype(tolua_S,2,"Scene",0,&tolua_err) ||
  96. !tolua_isusertype(tolua_S,3,"Camera",0,&tolua_err) ||
  97. (tolua_isvaluenil(tolua_S,4,&tolua_err) || !tolua_isusertype(tolua_S,4,"const IntRect",0,&tolua_err)) ||
  98. !tolua_isusertype(tolua_S,5,"RenderPath",1,&tolua_err) ||
  99. !tolua_isnoobj(tolua_S,6,&tolua_err)
  100. )
  101. goto tolua_lerror;
  102. else
  103. {
  104. Scene* scene = ((Scene*) tolua_tousertype(tolua_S,2,0));
  105. Camera* camera = ((Camera*) tolua_tousertype(tolua_S,3,0));
  106. const IntRect* rect = ((const IntRect*) tolua_tousertype(tolua_S,4,0));
  107. RenderPath* renderPath = ((RenderPath*) tolua_tousertype(tolua_S,5,0));
  108. {
  109. Viewport* tolua_ret = (Viewport*) Mtolua_new((Viewport)(GetContext(tolua_S),scene,camera,*rect,renderPath));
  110. tolua_pushusertype(tolua_S,(void*)tolua_ret,"Viewport");
  111. }
  112. }
  113. return 1;
  114. tolua_lerror:
  115. return tolua_GraphicsLuaAPI_Viewport_new01(tolua_S);
  116. }
  117. /* method: new_local of class Viewport */
  118. #define TOLUA_DISABLE_tolua_GraphicsLuaAPI_Viewport_new02_local
  119. static int tolua_GraphicsLuaAPI_Viewport_new02_local(lua_State* tolua_S)
  120. {
  121. tolua_Error tolua_err;
  122. if (
  123. !tolua_isusertable(tolua_S,1,"Viewport",0,&tolua_err) ||
  124. !tolua_isusertype(tolua_S,2,"Scene",0,&tolua_err) ||
  125. !tolua_isusertype(tolua_S,3,"Camera",0,&tolua_err) ||
  126. (tolua_isvaluenil(tolua_S,4,&tolua_err) || !tolua_isusertype(tolua_S,4,"const IntRect",0,&tolua_err)) ||
  127. !tolua_isusertype(tolua_S,5,"RenderPath",1,&tolua_err) ||
  128. !tolua_isnoobj(tolua_S,6,&tolua_err)
  129. )
  130. goto tolua_lerror;
  131. else
  132. {
  133. Scene* scene = ((Scene*) tolua_tousertype(tolua_S,2,0));
  134. Camera* camera = ((Camera*) tolua_tousertype(tolua_S,3,0));
  135. const IntRect* rect = ((const IntRect*) tolua_tousertype(tolua_S,4,0));
  136. RenderPath* renderPath = ((RenderPath*) tolua_tousertype(tolua_S,5,0));
  137. {
  138. Viewport* tolua_ret = (Viewport*) Mtolua_new((Viewport)(GetContext(tolua_S),scene,camera,*rect,renderPath));
  139. tolua_pushusertype(tolua_S,(void*)tolua_ret,"Viewport");
  140. tolua_register_gc(tolua_S,lua_gettop(tolua_S));
  141. }
  142. }
  143. return 1;
  144. tolua_lerror:
  145. return tolua_GraphicsLuaAPI_Viewport_new01_local(tolua_S);
  146. }
  147. $}