visual_server_wrap_mt.h 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057
  1. /*************************************************************************/
  2. /* visual_server_wrap_mt.h */
  3. /*************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* http://www.godotengine.org */
  7. /*************************************************************************/
  8. /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
  9. /* */
  10. /* Permission is hereby granted, free of charge, to any person obtaining */
  11. /* a copy of this software and associated documentation files (the */
  12. /* "Software"), to deal in the Software without restriction, including */
  13. /* without limitation the rights to use, copy, modify, merge, publish, */
  14. /* distribute, sublicense, and/or sell copies of the Software, and to */
  15. /* permit persons to whom the Software is furnished to do so, subject to */
  16. /* the following conditions: */
  17. /* */
  18. /* The above copyright notice and this permission notice shall be */
  19. /* included in all copies or substantial portions of the Software. */
  20. /* */
  21. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  22. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  23. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
  24. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  25. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  26. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  27. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  28. /*************************************************************************/
  29. #ifndef VISUAL_SERVER_WRAP_MT_H
  30. #define VISUAL_SERVER_WRAP_MT_H
  31. #include "servers/visual_server.h"
  32. #include "command_queue_mt.h"
  33. #include "os/thread.h"
  34. /**
  35. @author Juan Linietsky <[email protected]>
  36. */
  37. class VisualServerWrapMT : public VisualServer {
  38. // the real visual server
  39. mutable VisualServer *visual_server;
  40. mutable CommandQueueMT command_queue;
  41. static void _thread_callback(void *_instance);
  42. void thread_loop();
  43. Thread::ID server_thread;
  44. volatile bool exit;
  45. Thread *thread;
  46. volatile bool draw_thread_up;
  47. bool create_thread;
  48. Mutex *draw_mutex;
  49. int draw_pending;
  50. void thread_draw();
  51. void thread_flush();
  52. void thread_exit();
  53. public:
  54. #define FUNC0R(m_r,m_func)\
  55. virtual m_r m_func() { \
  56. if (Thread::get_caller_ID()!=server_thread) {\
  57. m_r ret;\
  58. command_queue.push_and_ret( visual_server, &VisualServer::m_func,&ret);\
  59. return ret;\
  60. } else {\
  61. return visual_server->m_func();\
  62. }\
  63. }
  64. #define FUNC0RC(m_r,m_func)\
  65. virtual m_r m_func() const { \
  66. if (Thread::get_caller_ID()!=server_thread) {\
  67. m_r ret;\
  68. command_queue.push_and_ret( visual_server, &VisualServer::m_func,&ret);\
  69. return ret;\
  70. } else {\
  71. return visual_server->m_func();\
  72. }\
  73. }
  74. #define FUNC0(m_func)\
  75. virtual void m_func() { \
  76. if (Thread::get_caller_ID()!=server_thread) {\
  77. command_queue.push( visual_server, &VisualServer::m_func);\
  78. } else {\
  79. visual_server->m_func();\
  80. }\
  81. }
  82. #define FUNC0C(m_func)\
  83. virtual void m_func() const { \
  84. if (Thread::get_caller_ID()!=server_thread) {\
  85. command_queue.push( visual_server, &VisualServer::m_func);\
  86. } else {\
  87. visual_server->m_func();\
  88. }\
  89. }
  90. #define FUNC0S(m_func)\
  91. virtual void m_func() { \
  92. if (Thread::get_caller_ID()!=server_thread) {\
  93. command_queue.push_and_sync( visual_server, &VisualServer::m_func);\
  94. } else {\
  95. visual_server->m_func();\
  96. }\
  97. }
  98. #define FUNC0SC(m_func)\
  99. virtual void m_func() const { \
  100. if (Thread::get_caller_ID()!=server_thread) {\
  101. command_queue.push_and_sync( visual_server, &VisualServer::m_func);\
  102. } else {\
  103. visual_server->m_func();\
  104. }\
  105. }
  106. ///////////////////////////////////////////////
  107. #define FUNC1R(m_r,m_func,m_arg1)\
  108. virtual m_r m_func(m_arg1 p1) { \
  109. if (Thread::get_caller_ID()!=server_thread) {\
  110. m_r ret;\
  111. command_queue.push_and_ret( visual_server, &VisualServer::m_func,p1,&ret);\
  112. return ret;\
  113. } else {\
  114. return visual_server->m_func(p1);\
  115. }\
  116. }
  117. #define FUNC1RC(m_r,m_func,m_arg1)\
  118. virtual m_r m_func(m_arg1 p1) const { \
  119. if (Thread::get_caller_ID()!=server_thread) {\
  120. m_r ret;\
  121. command_queue.push_and_ret( visual_server, &VisualServer::m_func,p1,&ret);\
  122. return ret;\
  123. } else {\
  124. return visual_server->m_func(p1);\
  125. }\
  126. }
  127. #define FUNC1S(m_func,m_arg1)\
  128. virtual void m_func(m_arg1 p1) { \
  129. if (Thread::get_caller_ID()!=server_thread) {\
  130. command_queue.push_and_sync( visual_server, &VisualServer::m_func,p1);\
  131. } else {\
  132. visual_server->m_func(p1);\
  133. }\
  134. }
  135. #define FUNC1SC(m_func,m_arg1)\
  136. virtual void m_func(m_arg1 p1) const { \
  137. if (Thread::get_caller_ID()!=server_thread) {\
  138. command_queue.push_and_sync( visual_server, &VisualServer::m_func,p1);\
  139. } else {\
  140. visual_server->m_func(p1);\
  141. }\
  142. }
  143. #define FUNC1(m_func,m_arg1)\
  144. virtual void m_func(m_arg1 p1) { \
  145. if (Thread::get_caller_ID()!=server_thread) {\
  146. command_queue.push( visual_server, &VisualServer::m_func,p1);\
  147. } else {\
  148. visual_server->m_func(p1);\
  149. }\
  150. }
  151. #define FUNC1C(m_func,m_arg1)\
  152. virtual void m_func(m_arg1 p1) const { \
  153. if (Thread::get_caller_ID()!=server_thread) {\
  154. command_queue.push( visual_server, &VisualServer::m_func,p1);\
  155. } else {\
  156. visual_server->m_func(p1);\
  157. }\
  158. }
  159. #define FUNC2R(m_r,m_func,m_arg1, m_arg2)\
  160. virtual m_r m_func(m_arg1 p1, m_arg2 p2) { \
  161. if (Thread::get_caller_ID()!=server_thread) {\
  162. m_r ret;\
  163. command_queue.push_and_ret( visual_server, &VisualServer::m_func,p1, p2,&ret);\
  164. return ret;\
  165. } else {\
  166. return visual_server->m_func(p1, p2);\
  167. }\
  168. }
  169. #define FUNC2RC(m_r,m_func,m_arg1, m_arg2)\
  170. virtual m_r m_func(m_arg1 p1, m_arg2 p2) const { \
  171. if (Thread::get_caller_ID()!=server_thread) {\
  172. m_r ret;\
  173. command_queue.push_and_ret( visual_server, &VisualServer::m_func,p1, p2,&ret);\
  174. return ret;\
  175. } else {\
  176. return visual_server->m_func(p1, p2);\
  177. }\
  178. }
  179. #define FUNC2S(m_func,m_arg1, m_arg2)\
  180. virtual void m_func(m_arg1 p1, m_arg2 p2) { \
  181. if (Thread::get_caller_ID()!=server_thread) {\
  182. command_queue.push_and_sync( visual_server, &VisualServer::m_func,p1, p2);\
  183. } else {\
  184. visual_server->m_func(p1, p2);\
  185. }\
  186. }
  187. #define FUNC2SC(m_func,m_arg1, m_arg2)\
  188. virtual void m_func(m_arg1 p1, m_arg2 p2) const { \
  189. if (Thread::get_caller_ID()!=server_thread) {\
  190. command_queue.push_and_sync( visual_server, &VisualServer::m_func,p1, p2);\
  191. } else {\
  192. visual_server->m_func(p1, p2);\
  193. }\
  194. }
  195. #define FUNC2(m_func,m_arg1, m_arg2)\
  196. virtual void m_func(m_arg1 p1, m_arg2 p2) { \
  197. if (Thread::get_caller_ID()!=server_thread) {\
  198. command_queue.push( visual_server, &VisualServer::m_func,p1, p2);\
  199. } else {\
  200. visual_server->m_func(p1, p2);\
  201. }\
  202. }
  203. #define FUNC2C(m_func,m_arg1, m_arg2)\
  204. virtual void m_func(m_arg1 p1, m_arg2 p2) const { \
  205. if (Thread::get_caller_ID()!=server_thread) {\
  206. command_queue.push( visual_server, &VisualServer::m_func,p1, p2);\
  207. } else {\
  208. visual_server->m_func(p1, p2);\
  209. }\
  210. }
  211. #define FUNC3R(m_r,m_func,m_arg1, m_arg2, m_arg3)\
  212. virtual m_r m_func(m_arg1 p1, m_arg2 p2, m_arg3 p3) { \
  213. if (Thread::get_caller_ID()!=server_thread) {\
  214. m_r ret;\
  215. command_queue.push_and_ret( visual_server, &VisualServer::m_func,p1, p2, p3,&ret);\
  216. return ret;\
  217. } else {\
  218. return visual_server->m_func(p1, p2, p3);\
  219. }\
  220. }
  221. #define FUNC3RC(m_r,m_func,m_arg1, m_arg2, m_arg3)\
  222. virtual m_r m_func(m_arg1 p1, m_arg2 p2, m_arg3 p3) const { \
  223. if (Thread::get_caller_ID()!=server_thread) {\
  224. m_r ret;\
  225. command_queue.push_and_ret( visual_server, &VisualServer::m_func,p1, p2, p3,&ret);\
  226. return ret;\
  227. } else {\
  228. return visual_server->m_func(p1, p2, p3);\
  229. }\
  230. }
  231. #define FUNC3S(m_func,m_arg1, m_arg2, m_arg3)\
  232. virtual void m_func(m_arg1 p1, m_arg2 p2, m_arg3 p3) { \
  233. if (Thread::get_caller_ID()!=server_thread) {\
  234. command_queue.push_and_sync( visual_server, &VisualServer::m_func,p1, p2, p3);\
  235. } else {\
  236. visual_server->m_func(p1, p2, p3);\
  237. }\
  238. }
  239. #define FUNC3SC(m_func,m_arg1, m_arg2, m_arg3)\
  240. virtual void m_func(m_arg1 p1, m_arg2 p2, m_arg3 p3) const { \
  241. if (Thread::get_caller_ID()!=server_thread) {\
  242. command_queue.push_and_sync( visual_server, &VisualServer::m_func,p1, p2, p3);\
  243. } else {\
  244. visual_server->m_func(p1, p2, p3);\
  245. }\
  246. }
  247. #define FUNC3(m_func,m_arg1, m_arg2, m_arg3)\
  248. virtual void m_func(m_arg1 p1, m_arg2 p2, m_arg3 p3) { \
  249. if (Thread::get_caller_ID()!=server_thread) {\
  250. command_queue.push( visual_server, &VisualServer::m_func,p1, p2, p3);\
  251. } else {\
  252. visual_server->m_func(p1, p2, p3);\
  253. }\
  254. }
  255. #define FUNC3C(m_func,m_arg1, m_arg2, m_arg3)\
  256. virtual void m_func(m_arg1 p1, m_arg2 p2, m_arg3 p3) const { \
  257. if (Thread::get_caller_ID()!=server_thread) {\
  258. command_queue.push( visual_server, &VisualServer::m_func,p1, p2, p3);\
  259. } else {\
  260. visual_server->m_func(p1, p2, p3);\
  261. }\
  262. }
  263. #define FUNC4R(m_r,m_func,m_arg1, m_arg2, m_arg3, m_arg4)\
  264. virtual m_r m_func(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4) { \
  265. if (Thread::get_caller_ID()!=server_thread) {\
  266. m_r ret;\
  267. command_queue.push_and_ret( visual_server, &VisualServer::m_func,p1, p2, p3, p4,&ret);\
  268. return ret;\
  269. } else {\
  270. return visual_server->m_func(p1, p2, p3, p4);\
  271. }\
  272. }
  273. #define FUNC4RC(m_r,m_func,m_arg1, m_arg2, m_arg3, m_arg4)\
  274. virtual m_r m_func(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4) const { \
  275. if (Thread::get_caller_ID()!=server_thread) {\
  276. m_r ret;\
  277. command_queue.push_and_ret( visual_server, &VisualServer::m_func,p1, p2, p3, p4,&ret);\
  278. return ret;\
  279. } else {\
  280. return visual_server->m_func(p1, p2, p3, p4);\
  281. }\
  282. }
  283. #define FUNC4S(m_func,m_arg1, m_arg2, m_arg3, m_arg4)\
  284. virtual void m_func(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4) { \
  285. if (Thread::get_caller_ID()!=server_thread) {\
  286. command_queue.push_and_sync( visual_server, &VisualServer::m_func,p1, p2, p3, p4);\
  287. } else {\
  288. visual_server->m_func(p1, p2, p3, p4);\
  289. }\
  290. }
  291. #define FUNC4SC(m_func,m_arg1, m_arg2, m_arg3, m_arg4)\
  292. virtual void m_func(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4) const { \
  293. if (Thread::get_caller_ID()!=server_thread) {\
  294. command_queue.push_and_sync( visual_server, &VisualServer::m_func,p1, p2, p3, p4);\
  295. } else {\
  296. visual_server->m_func(p1, p2, p3, p4);\
  297. }\
  298. }
  299. #define FUNC4(m_func,m_arg1, m_arg2, m_arg3, m_arg4)\
  300. virtual void m_func(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4) { \
  301. if (Thread::get_caller_ID()!=server_thread) {\
  302. command_queue.push( visual_server, &VisualServer::m_func,p1, p2, p3, p4);\
  303. } else {\
  304. visual_server->m_func(p1, p2, p3, p4);\
  305. }\
  306. }
  307. #define FUNC4C(m_func,m_arg1, m_arg2, m_arg3, m_arg4)\
  308. virtual void m_func(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4) const { \
  309. if (Thread::get_caller_ID()!=server_thread) {\
  310. command_queue.push( visual_server, &VisualServer::m_func,p1, p2, p3, p4);\
  311. } else {\
  312. visual_server->m_func(p1, p2, p3, p4);\
  313. }\
  314. }
  315. #define FUNC5R(m_r,m_func,m_arg1, m_arg2, m_arg3, m_arg4, m_arg5)\
  316. virtual m_r m_func(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5) { \
  317. if (Thread::get_caller_ID()!=server_thread) {\
  318. m_r ret;\
  319. command_queue.push_and_ret( visual_server, &VisualServer::m_func,p1, p2, p3, p4, p5,&ret);\
  320. return ret;\
  321. } else {\
  322. return visual_server->m_func(p1, p2, p3, p4, p5);\
  323. }\
  324. }
  325. #define FUNC5RC(m_r,m_func,m_arg1, m_arg2, m_arg3, m_arg4, m_arg5)\
  326. virtual m_r m_func(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5) const { \
  327. if (Thread::get_caller_ID()!=server_thread) {\
  328. m_r ret;\
  329. command_queue.push_and_ret( visual_server, &VisualServer::m_func,p1, p2, p3, p4, p5,&ret);\
  330. return ret;\
  331. } else {\
  332. return visual_server->m_func(p1, p2, p3, p4, p5);\
  333. }\
  334. }
  335. #define FUNC5S(m_func,m_arg1, m_arg2, m_arg3, m_arg4, m_arg5)\
  336. virtual void m_func(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5) { \
  337. if (Thread::get_caller_ID()!=server_thread) {\
  338. command_queue.push_and_sync( visual_server, &VisualServer::m_func,p1, p2, p3, p4, p5);\
  339. } else {\
  340. visual_server->m_func(p1, p2, p3, p4, p5);\
  341. }\
  342. }
  343. #define FUNC5SC(m_func,m_arg1, m_arg2, m_arg3, m_arg4, m_arg5)\
  344. virtual void m_func(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5) const { \
  345. if (Thread::get_caller_ID()!=server_thread) {\
  346. command_queue.push_and_sync( visual_server, &VisualServer::m_func,p1, p2, p3, p4, p5);\
  347. } else {\
  348. visual_server->m_func(p1, p2, p3, p4, p5);\
  349. }\
  350. }
  351. #define FUNC5(m_func,m_arg1, m_arg2, m_arg3, m_arg4, m_arg5)\
  352. virtual void m_func(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5) { \
  353. if (Thread::get_caller_ID()!=server_thread) {\
  354. command_queue.push( visual_server, &VisualServer::m_func,p1, p2, p3, p4, p5);\
  355. } else {\
  356. visual_server->m_func(p1, p2, p3, p4, p5);\
  357. }\
  358. }
  359. #define FUNC5C(m_func,m_arg1, m_arg2, m_arg3, m_arg4, m_arg5)\
  360. virtual void m_func(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5) const { \
  361. if (Thread::get_caller_ID()!=server_thread) {\
  362. command_queue.push( visual_server, &VisualServer::m_func,p1, p2, p3, p4, p5);\
  363. } else {\
  364. visual_server->m_func(p1, p2, p3, p4, p5);\
  365. }\
  366. }
  367. #define FUNC6R(m_r,m_func,m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6)\
  368. virtual m_r m_func(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6) { \
  369. if (Thread::get_caller_ID()!=server_thread) {\
  370. m_r ret;\
  371. command_queue.push_and_ret( visual_server, &VisualServer::m_func,p1, p2, p3, p4, p5, p6,&ret);\
  372. return ret;\
  373. } else {\
  374. return visual_server->m_func(p1, p2, p3, p4, p5, p6);\
  375. }\
  376. }
  377. #define FUNC6RC(m_r,m_func,m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6)\
  378. virtual m_r m_func(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6) const { \
  379. if (Thread::get_caller_ID()!=server_thread) {\
  380. m_r ret;\
  381. command_queue.push_and_ret( visual_server, &VisualServer::m_func,p1, p2, p3, p4, p5, p6,&ret);\
  382. return ret;\
  383. } else {\
  384. return visual_server->m_func(p1, p2, p3, p4, p5, p6);\
  385. }\
  386. }
  387. #define FUNC6S(m_func,m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6)\
  388. virtual void m_func(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6) { \
  389. if (Thread::get_caller_ID()!=server_thread) {\
  390. command_queue.push_and_sync( visual_server, &VisualServer::m_func,p1, p2, p3, p4, p5, p6);\
  391. } else {\
  392. visual_server->m_func(p1, p2, p3, p4, p5, p6);\
  393. }\
  394. }
  395. #define FUNC6SC(m_func,m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6)\
  396. virtual void m_func(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6) const { \
  397. if (Thread::get_caller_ID()!=server_thread) {\
  398. command_queue.push_and_sync( visual_server, &VisualServer::m_func,p1, p2, p3, p4, p5, p6);\
  399. } else {\
  400. visual_server->m_func(p1, p2, p3, p4, p5, p6);\
  401. }\
  402. }
  403. #define FUNC6(m_func,m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6)\
  404. virtual void m_func(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6) { \
  405. if (Thread::get_caller_ID()!=server_thread) {\
  406. command_queue.push( visual_server, &VisualServer::m_func,p1, p2, p3, p4, p5, p6);\
  407. } else {\
  408. visual_server->m_func(p1, p2, p3, p4, p5, p6);\
  409. }\
  410. }
  411. #define FUNC6C(m_func,m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6)\
  412. virtual void m_func(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6) const { \
  413. if (Thread::get_caller_ID()!=server_thread) {\
  414. command_queue.push( visual_server, &VisualServer::m_func,p1, p2, p3, p4, p5, p6);\
  415. } else {\
  416. visual_server->m_func(p1, p2, p3, p4, p5, p6);\
  417. }\
  418. }
  419. #define FUNC7R(m_r,m_func,m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6, m_arg7)\
  420. virtual m_r m_func(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6, m_arg7 p7) { \
  421. if (Thread::get_caller_ID()!=server_thread) {\
  422. m_r ret;\
  423. command_queue.push_and_ret( visual_server, &VisualServer::m_func,p1, p2, p3, p4, p5, p6, p7,&ret);\
  424. return ret;\
  425. } else {\
  426. return visual_server->m_func(p1, p2, p3, p4, p5, p6, p7);\
  427. }\
  428. }
  429. #define FUNC7RC(m_r,m_func,m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6, m_arg7)\
  430. virtual m_r m_func(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6, m_arg7 p7) const { \
  431. if (Thread::get_caller_ID()!=server_thread) {\
  432. m_r ret;\
  433. command_queue.push_and_ret( visual_server, &VisualServer::m_func,p1, p2, p3, p4, p5, p6, p7,&ret);\
  434. return ret;\
  435. } else {\
  436. return visual_server->m_func(p1, p2, p3, p4, p5, p6, p7);\
  437. }\
  438. }
  439. #define FUNC7S(m_func,m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6, m_arg7)\
  440. virtual void m_func(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6, m_arg7 p7) { \
  441. if (Thread::get_caller_ID()!=server_thread) {\
  442. command_queue.push_and_sync( visual_server, &VisualServer::m_func,p1, p2, p3, p4, p5, p6, p7);\
  443. } else {\
  444. visual_server->m_func(p1, p2, p3, p4, p5, p6, p7);\
  445. }\
  446. }
  447. #define FUNC7SC(m_func,m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6, m_arg7)\
  448. virtual void m_func(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6, m_arg7 p7) const { \
  449. if (Thread::get_caller_ID()!=server_thread) {\
  450. command_queue.push_and_sync( visual_server, &VisualServer::m_func,p1, p2, p3, p4, p5, p6, p7);\
  451. } else {\
  452. visual_server->m_func(p1, p2, p3, p4, p5, p6, p7);\
  453. }\
  454. }
  455. #define FUNC7(m_func,m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6, m_arg7)\
  456. virtual void m_func(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6, m_arg7 p7) { \
  457. if (Thread::get_caller_ID()!=server_thread) {\
  458. command_queue.push( visual_server, &VisualServer::m_func,p1, p2, p3, p4, p5, p6, p7);\
  459. } else {\
  460. visual_server->m_func(p1, p2, p3, p4, p5, p6, p7);\
  461. }\
  462. }
  463. #define FUNC7C(m_func,m_arg1, m_arg2, m_arg3, m_arg4, m_arg5, m_arg6, m_arg7)\
  464. virtual void m_func(m_arg1 p1, m_arg2 p2, m_arg3 p3, m_arg4 p4, m_arg5 p5, m_arg6 p6, m_arg7 p7) const { \
  465. if (Thread::get_caller_ID()!=server_thread) {\
  466. command_queue.push( visual_server, &VisualServer::m_func,p1, p2, p3, p4, p5, p6, p7);\
  467. } else {\
  468. visual_server->m_func(p1, p2, p3, p4, p5, p6, p7);\
  469. }\
  470. }
  471. FUNC0R(RID,texture_create);
  472. FUNC5(texture_allocate,RID,int,int,Image::Format,uint32_t);
  473. FUNC3(texture_set_data,RID,const Image&,CubeMapSide);
  474. FUNC2RC(Image,texture_get_data,RID,CubeMapSide);
  475. FUNC2(texture_set_flags,RID,uint32_t);
  476. FUNC1RC(Image::Format,texture_get_format,RID);
  477. FUNC1RC(uint32_t,texture_get_flags,RID);
  478. FUNC1RC(uint32_t,texture_get_width,RID);
  479. FUNC1RC(uint32_t,texture_get_height,RID);
  480. FUNC3(texture_set_size_override,RID,int,int);
  481. FUNC1RC(bool,texture_can_stream,RID);
  482. FUNC3C(texture_set_reload_hook,RID,ObjectID,const StringName&);
  483. /* SHADER API */
  484. FUNC1R(RID,shader_create,ShaderMode);
  485. FUNC2(shader_set_mode,RID,ShaderMode);
  486. FUNC1RC(ShaderMode,shader_get_mode,RID);
  487. FUNC5(shader_set_code,RID,const String&,const String&,int,int);
  488. FUNC1RC(String,shader_get_vertex_code,RID);
  489. FUNC1RC(String,shader_get_fragment_code,RID);
  490. FUNC2SC(shader_get_param_list,RID,List<PropertyInfo>*);
  491. /*virtual void shader_get_param_list(RID p_shader, List<PropertyInfo> *p_param_list) {
  492. if (Thread::get_caller_ID()!=server_thread) {
  493. command_queue.push_and_sync( visual_server, &VisualServer::shader_get_param_list,p_shader,p_param_list);
  494. } else {
  495. visual_server->m_func(p1, p2, p3, p4, p5);
  496. }
  497. }*/
  498. // virtual void shader_get_param_list(RID p_shader, List<PropertyInfo> *p_param_list);
  499. /* COMMON MATERIAL API */
  500. FUNC0R(RID,material_create);
  501. FUNC2(material_set_shader,RID,RID);
  502. FUNC1RC(RID,material_get_shader,RID);
  503. FUNC3(material_set_param,RID,const StringName&,const Variant&);
  504. FUNC2RC(Variant,material_get_param,RID,const StringName&);
  505. FUNC3(material_set_flag,RID,MaterialFlag,bool);
  506. FUNC2RC(bool,material_get_flag,RID,MaterialFlag);
  507. FUNC3(material_set_hint,RID,MaterialHint,bool);
  508. FUNC2RC(bool,material_get_hint,RID,MaterialHint);
  509. FUNC2(material_set_shade_model,RID,MaterialShadeModel);
  510. FUNC1RC(MaterialShadeModel,material_get_shade_model,RID);
  511. FUNC2(material_set_blend_mode,RID,MaterialBlendMode);
  512. FUNC1RC(MaterialBlendMode,material_get_blend_mode,RID);
  513. FUNC2(material_set_line_width,RID,float);
  514. FUNC1RC(float,material_get_line_width,RID);
  515. /* FIXED MATERIAL */
  516. FUNC0R(RID,fixed_material_create);
  517. FUNC3(fixed_material_set_flag,RID, FixedMaterialFlags , bool );
  518. FUNC2RC(bool, fixed_material_get_flag,RID, FixedMaterialFlags);
  519. FUNC3(fixed_material_set_param,RID, FixedMaterialParam, const Variant& );
  520. FUNC2RC(Variant, fixed_material_get_param,RID ,FixedMaterialParam);
  521. FUNC3(fixed_material_set_texture,RID ,FixedMaterialParam, RID );
  522. FUNC2RC(RID, fixed_material_get_texture,RID,FixedMaterialParam);
  523. FUNC2(fixed_material_set_detail_blend_mode,RID ,MaterialBlendMode );
  524. FUNC1RC(MaterialBlendMode, fixed_material_get_detail_blend_mode,RID);
  525. FUNC3(fixed_material_set_texcoord_mode,RID,FixedMaterialParam, FixedMaterialTexCoordMode );
  526. FUNC2RC(FixedMaterialTexCoordMode, fixed_material_get_texcoord_mode,RID,FixedMaterialParam);
  527. FUNC2(fixed_material_set_uv_transform,RID,const Transform&);
  528. FUNC1RC(Transform, fixed_material_get_uv_transform,RID);
  529. FUNC2(fixed_material_set_point_size,RID ,float);
  530. FUNC1RC(float,fixed_material_get_point_size,RID);
  531. /* SURFACE API */
  532. FUNC0R(RID,mesh_create);
  533. FUNC2(mesh_set_morph_target_count,RID,int);
  534. FUNC1RC(int,mesh_get_morph_target_count,RID);
  535. FUNC2(mesh_set_morph_target_mode,RID,MorphTargetMode);
  536. FUNC1RC(MorphTargetMode,mesh_get_morph_target_mode,RID);
  537. FUNC2(mesh_add_custom_surface,RID,const Variant&); //this is used by each platform in a different way
  538. FUNC5(mesh_add_surface,RID,PrimitiveType,const Array&,const Array&,bool);
  539. FUNC2RC(Array,mesh_get_surface_arrays,RID,int);
  540. FUNC2RC(Array,mesh_get_surface_morph_arrays,RID,int);
  541. FUNC4(mesh_surface_set_material,RID, int, RID,bool);
  542. FUNC2RC(RID,mesh_surface_get_material,RID, int);
  543. FUNC2RC(int,mesh_surface_get_array_len,RID, int);
  544. FUNC2RC(int,mesh_surface_get_array_index_len,RID, int);
  545. FUNC2RC(uint32_t,mesh_surface_get_format,RID, int);
  546. FUNC2RC(PrimitiveType,mesh_surface_get_primitive_type,RID, int);
  547. FUNC2(mesh_remove_surface,RID,int);
  548. FUNC1RC(int,mesh_get_surface_count,RID);
  549. /* MULTIMESH API */
  550. FUNC0R(RID,multimesh_create);
  551. FUNC2(multimesh_set_instance_count,RID,int);
  552. FUNC1RC(int,multimesh_get_instance_count,RID);
  553. FUNC2(multimesh_set_mesh,RID,RID);
  554. FUNC2(multimesh_set_aabb,RID,const AABB&);
  555. FUNC3(multimesh_instance_set_transform,RID,int,const Transform&);
  556. FUNC3(multimesh_instance_set_color,RID,int,const Color&);
  557. FUNC1RC(RID,multimesh_get_mesh,RID);
  558. FUNC2RC(AABB,multimesh_get_aabb,RID,const AABB&);
  559. FUNC2RC(Transform,multimesh_instance_get_transform,RID,int);
  560. FUNC2RC(Color,multimesh_instance_get_color,RID,int);
  561. FUNC2(multimesh_set_visible_instances,RID,int);
  562. FUNC1RC(int,multimesh_get_visible_instances,RID);
  563. /* PARTICLES API */
  564. FUNC0R(RID,particles_create);
  565. FUNC2(particles_set_amount,RID, int );
  566. FUNC1RC(int,particles_get_amount,RID);
  567. FUNC2(particles_set_emitting,RID, bool );
  568. FUNC1RC(bool,particles_is_emitting,RID);
  569. FUNC2(particles_set_visibility_aabb,RID, const AABB&);
  570. FUNC1RC(AABB,particles_get_visibility_aabb,RID);
  571. FUNC2(particles_set_emission_half_extents,RID, const Vector3&);
  572. FUNC1RC(Vector3,particles_get_emission_half_extents,RID);
  573. FUNC2(particles_set_emission_base_velocity,RID, const Vector3&);
  574. FUNC1RC(Vector3,particles_get_emission_base_velocity,RID);
  575. FUNC2(particles_set_emission_points,RID, const DVector<Vector3>& );
  576. FUNC1RC(DVector<Vector3>,particles_get_emission_points,RID);
  577. FUNC2(particles_set_gravity_normal,RID, const Vector3& );
  578. FUNC1RC(Vector3,particles_get_gravity_normal,RID);
  579. FUNC3(particles_set_variable,RID, ParticleVariable ,float);
  580. FUNC2RC(float,particles_get_variable,RID, ParticleVariable );
  581. FUNC3(particles_set_randomness,RID, ParticleVariable ,float);
  582. FUNC2RC(float,particles_get_randomness,RID, ParticleVariable );
  583. FUNC3(particles_set_color_phase_pos,RID, int , float);
  584. FUNC2RC(float,particles_get_color_phase_pos,RID, int );
  585. FUNC2(particles_set_color_phases,RID, int );
  586. FUNC1RC(int,particles_get_color_phases,RID);
  587. FUNC3(particles_set_color_phase_color,RID, int , const Color& );
  588. FUNC2RC(Color,particles_get_color_phase_color,RID, int );
  589. FUNC2(particles_set_attractors,RID, int);
  590. FUNC1RC(int,particles_get_attractors,RID);
  591. FUNC3(particles_set_attractor_pos,RID, int, const Vector3&);
  592. FUNC2RC(Vector3,particles_get_attractor_pos,RID,int);
  593. FUNC3(particles_set_attractor_strength,RID, int, float);
  594. FUNC2RC(float,particles_get_attractor_strength,RID,int);
  595. FUNC3(particles_set_material,RID, RID,bool);
  596. FUNC1RC(RID,particles_get_material,RID);
  597. FUNC2(particles_set_height_from_velocity,RID, bool);
  598. FUNC1RC(bool,particles_has_height_from_velocity,RID);
  599. FUNC2(particles_set_use_local_coordinates,RID, bool);
  600. FUNC1RC(bool,particles_is_using_local_coordinates,RID);
  601. /* Light API */
  602. FUNC1R(RID,light_create,LightType);
  603. FUNC1RC(LightType,light_get_type,RID);
  604. FUNC3(light_set_color,RID,LightColor , const Color& );
  605. FUNC2RC(Color,light_get_color,RID,LightColor );
  606. FUNC2(light_set_shadow,RID,bool );
  607. FUNC1RC(bool,light_has_shadow,RID);
  608. FUNC2(light_set_volumetric,RID,bool );
  609. FUNC1RC(bool,light_is_volumetric,RID);
  610. FUNC2(light_set_projector,RID,RID );
  611. FUNC1RC(RID,light_get_projector,RID);
  612. FUNC3(light_set_param,RID, LightParam , float );
  613. FUNC2RC(float,light_get_param,RID, LightParam );
  614. FUNC2(light_set_operator,RID,LightOp);
  615. FUNC1RC(LightOp,light_get_operator,RID);
  616. FUNC2(light_omni_set_shadow_mode,RID,LightOmniShadowMode);
  617. FUNC1RC(LightOmniShadowMode,light_omni_get_shadow_mode,RID);
  618. FUNC2(light_directional_set_shadow_mode,RID,LightDirectionalShadowMode);
  619. FUNC1RC(LightDirectionalShadowMode,light_directional_get_shadow_mode,RID);
  620. FUNC3(light_directional_set_shadow_param,RID,LightDirectionalShadowParam, float );
  621. FUNC2RC(float,light_directional_get_shadow_param,RID,LightDirectionalShadowParam );
  622. /* SKELETON API */
  623. FUNC0R(RID,skeleton_create);
  624. FUNC2(skeleton_resize,RID,int );
  625. FUNC1RC(int,skeleton_get_bone_count,RID) ;
  626. FUNC3(skeleton_bone_set_transform,RID,int, const Transform&);
  627. FUNC2R(Transform,skeleton_bone_get_transform,RID,int );
  628. /* ROOM API */
  629. FUNC0R(RID,room_create);
  630. FUNC2(room_set_bounds,RID, const BSP_Tree&);
  631. FUNC1RC(BSP_Tree,room_get_bounds,RID);
  632. /* PORTAL API */
  633. FUNC0R(RID,portal_create);
  634. FUNC2(portal_set_shape,RID,const Vector<Point2>&);
  635. FUNC1RC(Vector<Point2>,portal_get_shape,RID);
  636. FUNC2(portal_set_enabled,RID, bool);
  637. FUNC1RC(bool,portal_is_enabled,RID);
  638. FUNC2(portal_set_disable_distance,RID, float);
  639. FUNC1RC(float,portal_get_disable_distance,RID);
  640. FUNC2(portal_set_disabled_color,RID, const Color&);
  641. FUNC1RC(Color,portal_get_disabled_color,RID);
  642. FUNC2(portal_set_connect_range,RID, float);
  643. FUNC1RC(float,portal_get_connect_range,RID);
  644. /* CAMERA API */
  645. FUNC0R(RID,camera_create);
  646. FUNC4(camera_set_perspective,RID,float , float , float );
  647. FUNC4(camera_set_orthogonal,RID,float, float , float );
  648. FUNC2(camera_set_transform,RID,const Transform& );
  649. FUNC2(camera_set_visible_layers,RID,uint32_t);
  650. FUNC1RC(uint32_t,camera_get_visible_layers,RID);
  651. FUNC2(camera_set_environment,RID,RID);
  652. FUNC1RC(RID,camera_get_environment,RID);
  653. FUNC2(camera_set_use_vertical_aspect,RID,bool);
  654. FUNC2RC(bool,camera_is_using_vertical_aspect,RID,bool);
  655. /* VIEWPORT API */
  656. FUNC0R(RID,viewport_create);
  657. FUNC2(viewport_attach_to_screen,RID,int );
  658. FUNC1(viewport_detach,RID);
  659. FUNC2(viewport_set_as_render_target,RID,bool);
  660. FUNC2(viewport_set_render_target_update_mode,RID,RenderTargetUpdateMode);
  661. FUNC1RC(RenderTargetUpdateMode,viewport_get_render_target_update_mode,RID);
  662. FUNC1RC(RID,viewport_get_render_target_texture,RID);
  663. FUNC1(viewport_queue_screen_capture,RID);
  664. FUNC1RC(Image,viewport_get_screen_capture,RID);
  665. FUNC2(viewport_set_rect,RID,const ViewportRect&);
  666. FUNC1RC(ViewportRect,viewport_get_rect,RID);
  667. FUNC2(viewport_set_hide_scenario,RID,bool );
  668. FUNC2(viewport_set_hide_canvas,RID,bool );
  669. FUNC2(viewport_attach_camera,RID,RID );
  670. FUNC2(viewport_set_scenario,RID,RID );
  671. FUNC1RC(RID,viewport_get_attached_camera,RID);
  672. FUNC1RC(RID,viewport_get_scenario,RID );
  673. FUNC2(viewport_attach_canvas,RID,RID);
  674. FUNC2(viewport_remove_canvas,RID,RID);
  675. FUNC3(viewport_set_canvas_transform,RID,RID,const Matrix32&);
  676. FUNC2RC(Matrix32,viewport_get_canvas_transform,RID,RID);
  677. FUNC2(viewport_set_global_canvas_transform,RID,const Matrix32&);
  678. FUNC1RC(Matrix32,viewport_get_global_canvas_transform,RID);
  679. FUNC3(viewport_set_canvas_layer,RID,RID ,int);
  680. FUNC2(viewport_set_transparent_background,RID,bool);
  681. FUNC1RC(bool,viewport_has_transparent_background,RID);
  682. /* ENVIRONMENT API */
  683. FUNC0R(RID,environment_create);
  684. FUNC2(environment_set_background,RID,EnvironmentBG);
  685. FUNC1RC(EnvironmentBG,environment_get_background,RID);
  686. FUNC3(environment_set_background_param,RID,EnvironmentBGParam, const Variant&);
  687. FUNC2RC(Variant,environment_get_background_param,RID,EnvironmentBGParam );
  688. FUNC3(environment_set_enable_fx,RID,EnvironmentFx,bool);
  689. FUNC2RC(bool,environment_is_fx_enabled,RID,EnvironmentFx);
  690. FUNC3(environment_fx_set_param,RID,EnvironmentFxParam,const Variant&);
  691. FUNC2RC(Variant,environment_fx_get_param,RID,EnvironmentFxParam);
  692. /* SCENARIO API */
  693. FUNC0R(RID,scenario_create);
  694. FUNC2(scenario_set_debug,RID,ScenarioDebugMode);
  695. FUNC2(scenario_set_environment,RID, RID);
  696. FUNC2RC(RID,scenario_get_environment,RID, RID);
  697. /* INSTANCING API */
  698. FUNC0R(RID,instance_create);
  699. FUNC2(instance_set_base,RID, RID);
  700. FUNC1RC(RID,instance_get_base,RID);
  701. FUNC2(instance_set_scenario,RID, RID);
  702. FUNC1RC(RID,instance_get_scenario,RID);
  703. FUNC2(instance_set_layer_mask,RID, uint32_t);
  704. FUNC1RC(uint32_t,instance_get_layer_mask,RID);
  705. FUNC1RC(AABB,instance_get_base_aabb,RID);
  706. FUNC2(instance_attach_object_instance_ID,RID,uint32_t);
  707. FUNC1RC(uint32_t,instance_get_object_instance_ID,RID);
  708. FUNC2(instance_attach_skeleton,RID,RID);
  709. FUNC1RC(RID,instance_get_skeleton,RID);
  710. FUNC3(instance_set_morph_target_weight,RID,int, float);
  711. FUNC2RC(float,instance_get_morph_target_weight,RID,int);
  712. FUNC2(instance_set_transform,RID, const Transform&);
  713. FUNC1RC(Transform,instance_get_transform,RID);
  714. FUNC2(instance_set_exterior,RID, bool );
  715. FUNC1RC(bool,instance_is_exterior,RID);
  716. FUNC2(instance_set_room,RID, RID );
  717. FUNC1RC(RID,instance_get_room,RID ) ;
  718. FUNC2(instance_set_extra_visibility_margin,RID, real_t );
  719. FUNC1RC(real_t,instance_get_extra_visibility_margin,RID );
  720. FUNC2RC(Vector<RID>,instances_cull_aabb,const AABB& , RID );
  721. FUNC3RC(Vector<RID>,instances_cull_ray,const Vector3& ,const Vector3&, RID );
  722. FUNC2RC(Vector<RID>,instances_cull_convex,const Vector<Plane>& , RID );
  723. FUNC3(instance_geometry_set_flag,RID,InstanceFlags ,bool );
  724. FUNC2RC(bool,instance_geometry_get_flag,RID,InstanceFlags );
  725. FUNC2(instance_geometry_set_material_override,RID, RID );
  726. FUNC1RC(RID,instance_geometry_get_material_override,RID);
  727. FUNC3(instance_geometry_set_draw_range,RID,float ,float);
  728. FUNC1RC(float,instance_geometry_get_draw_range_max,RID);
  729. FUNC1RC(float,instance_geometry_get_draw_range_min,RID);
  730. /* CANVAS (2D) */
  731. FUNC0R(RID,canvas_create);
  732. FUNC3(canvas_set_item_mirroring,RID,RID,const Point2&);
  733. FUNC2RC(Point2,canvas_get_item_mirroring,RID,RID);
  734. FUNC0R(RID,canvas_item_create);
  735. FUNC2(canvas_item_set_parent,RID,RID );
  736. FUNC1RC(RID,canvas_item_get_parent,RID);
  737. FUNC2(canvas_item_set_visible,RID,bool );
  738. FUNC1RC(bool,canvas_item_is_visible,RID);
  739. FUNC2(canvas_item_set_blend_mode,RID,MaterialBlendMode );
  740. //FUNC(canvas_item_set_rect,RID, const Rect2& p_rect);
  741. FUNC2(canvas_item_set_transform,RID, const Matrix32& );
  742. FUNC2(canvas_item_set_clip,RID, bool );
  743. FUNC3(canvas_item_set_custom_rect,RID, bool ,const Rect2&);
  744. FUNC2(canvas_item_set_opacity,RID, float );
  745. FUNC2RC(float,canvas_item_get_opacity,RID, float );
  746. FUNC2(canvas_item_set_on_top,RID, bool );
  747. FUNC1RC(bool,canvas_item_is_on_top,RID);
  748. FUNC2(canvas_item_set_self_opacity,RID, float );
  749. FUNC2RC(float,canvas_item_get_self_opacity,RID, float );
  750. FUNC2(canvas_item_attach_viewport,RID, RID );
  751. FUNC5(canvas_item_add_line,RID, const Point2& , const Point2& ,const Color& ,float );
  752. FUNC3(canvas_item_add_rect,RID, const Rect2& , const Color& );
  753. FUNC4(canvas_item_add_circle,RID, const Point2& , float ,const Color& );
  754. FUNC5(canvas_item_add_texture_rect,RID, const Rect2& , RID ,bool ,const Color& );
  755. FUNC5(canvas_item_add_texture_rect_region,RID, const Rect2& , RID ,const Rect2& ,const Color& );
  756. FUNC7(canvas_item_add_style_box,RID, const Rect2& , RID ,const Vector2& ,const Vector2&, bool ,const Color& );
  757. FUNC6(canvas_item_add_primitive,RID, const Vector<Point2>& , const Vector<Color>& ,const Vector<Point2>& , RID ,float );
  758. FUNC5(canvas_item_add_polygon,RID, const Vector<Point2>& , const Vector<Color>& ,const Vector<Point2>& , RID );
  759. FUNC7(canvas_item_add_triangle_array,RID, const Vector<int>& , const Vector<Point2>& , const Vector<Color>& ,const Vector<Point2>& , RID , int );
  760. FUNC7(canvas_item_add_triangle_array_ptr,RID, int , const int* , const Point2* , const Color* ,const Point2* , RID );
  761. FUNC2(canvas_item_add_set_transform,RID,const Matrix32& );
  762. FUNC2(canvas_item_add_set_blend_mode,RID, MaterialBlendMode );
  763. FUNC2(canvas_item_add_clip_ignore,RID, bool );
  764. FUNC1(canvas_item_clear,RID);
  765. FUNC1(canvas_item_raise,RID);
  766. /* CURSOR */
  767. FUNC2(cursor_set_rotation,float , int ); // radians
  768. FUNC3(cursor_set_texture,RID , const Point2 &, int );
  769. FUNC2(cursor_set_visible,bool , int );
  770. FUNC2(cursor_set_pos,const Point2& , int );
  771. /* BLACK BARS */
  772. FUNC4(black_bars_set_margins,int , int , int , int );
  773. /* FREE */
  774. FUNC1(free,RID);
  775. /* CUSTOM SHADE MODEL */
  776. FUNC2(custom_shade_model_set_shader,int , RID );
  777. FUNC1RC(RID,custom_shade_model_get_shader,int );
  778. FUNC2(custom_shade_model_set_name,int , const String& );
  779. FUNC1RC(String,custom_shade_model_get_name,int );
  780. FUNC2(custom_shade_model_set_param_info,int , const List<PropertyInfo>& );
  781. FUNC2SC(custom_shade_model_get_param_info,int , List<PropertyInfo>* );
  782. /* EVENT QUEUING */
  783. virtual void init();
  784. virtual void finish();
  785. virtual void draw();
  786. virtual void flush();
  787. FUNC0RC(bool,has_changed);
  788. /* RENDER INFO */
  789. FUNC1R(int,get_render_info,RenderInfo );
  790. FUNC1RC(bool,has_feature,Features );
  791. FUNC2(set_boot_image,const Image& , const Color& );
  792. FUNC1(set_default_clear_color,const Color& );
  793. FUNC0R(RID,get_test_cube );
  794. VisualServerWrapMT(VisualServer* p_contained,bool p_create_thread);
  795. ~VisualServerWrapMT();
  796. };
  797. #endif