Renderer.cpp 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. // Copyright (C) 2014, Panagiotis Christopoulos Charitos.
  2. // All rights reserved.
  3. // Code licensed under the BSD License.
  4. // http://www.anki3d.org/LICENSE
  5. // WARNING: The file is auto generated.
  6. #include "anki/script/LuaBinder.h"
  7. #include "anki/Renderer.h"
  8. namespace anki {
  9. //==============================================================================
  10. // Dbg =
  11. //==============================================================================
  12. //==============================================================================
  13. static const char* classnameDbg = "Dbg";
  14. //==============================================================================
  15. /// Pre-wrap method Dbg::getEnabled.
  16. static inline int pwrapDbggetEnabled(lua_State* l)
  17. {
  18. UserData* ud;
  19. (void)ud;
  20. void* voidp;
  21. (void)voidp;
  22. Error err = ErrorCode::NONE;
  23. (void)err;
  24. LuaBinder::checkArgsCount(l, 1);
  25. // Get "this" as "self"
  26. voidp = luaL_checkudata(l, 1, classnameDbg);
  27. ud = reinterpret_cast<UserData*>(voidp);
  28. Dbg* self = reinterpret_cast<Dbg*>(ud->m_data);
  29. ANKI_ASSERT(self != nullptr);
  30. // Call the method
  31. Bool ret = self->getEnabled();
  32. // Push return value
  33. lua_pushboolean(l, ret);
  34. return 1;
  35. }
  36. //==============================================================================
  37. /// Wrap method Dbg::getEnabled.
  38. static int wrapDbggetEnabled(lua_State* l)
  39. {
  40. int res = pwrapDbggetEnabled(l);
  41. if(res >= 0) return res;
  42. lua_error(l);
  43. return 0;
  44. }
  45. //==============================================================================
  46. /// Pre-wrap method Dbg::setEnabled.
  47. static inline int pwrapDbgsetEnabled(lua_State* l)
  48. {
  49. UserData* ud;
  50. (void)ud;
  51. void* voidp;
  52. (void)voidp;
  53. Error err = ErrorCode::NONE;
  54. (void)err;
  55. LuaBinder::checkArgsCount(l, 2);
  56. // Get "this" as "self"
  57. voidp = luaL_checkudata(l, 1, classnameDbg);
  58. ud = reinterpret_cast<UserData*>(voidp);
  59. Dbg* self = reinterpret_cast<Dbg*>(ud->m_data);
  60. ANKI_ASSERT(self != nullptr);
  61. // Pop arguments
  62. Bool arg0;
  63. if(LuaBinder::checkNumber(l, 2, arg0)) return -1;
  64. // Call the method
  65. self->setEnabled(arg0);
  66. return 0;
  67. }
  68. //==============================================================================
  69. /// Wrap method Dbg::setEnabled.
  70. static int wrapDbgsetEnabled(lua_State* l)
  71. {
  72. int res = pwrapDbgsetEnabled(l);
  73. if(res >= 0) return res;
  74. lua_error(l);
  75. return 0;
  76. }
  77. //==============================================================================
  78. /// Wrap class Dbg.
  79. static inline void wrapDbg(lua_State* l)
  80. {
  81. LuaBinder::createClass(l, classnameDbg);
  82. LuaBinder::pushLuaCFuncMethod(l, "getEnabled", wrapDbggetEnabled);
  83. LuaBinder::pushLuaCFuncMethod(l, "setEnabled", wrapDbgsetEnabled);
  84. lua_settop(l, 0);
  85. }
  86. //==============================================================================
  87. /// Wrap the module.
  88. void wrapModuleRenderer(lua_State* l)
  89. {
  90. wrapDbg(l);
  91. }
  92. } // end namespace anki