ISpriteBatch.cs 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Numerics;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Drawing;
  8. namespace Veldrid.Common
  9. {
  10. /// <summary>
  11. /// Represents a interface for drawing sprites in one or more optimized batches.
  12. /// </summary>
  13. public interface ISpriteBatch : IDisposable
  14. {
  15. /// <summary>
  16. /// A bool indicating whether this instance has been disposed.
  17. /// </summary>
  18. public bool IsDisposed { get; }
  19. /// <summary>
  20. /// The view matrix to use to renderer.
  21. /// </summary>
  22. public Matrix4x4 ViewMatrix { get; set; }
  23. /// <summary>
  24. /// The scissor rectangle.
  25. /// </summary>
  26. public RectangleF Scissor { get; set; }
  27. /// <summary>
  28. /// Resets the <see cref="Scissor"/> to default value.
  29. /// </summary>
  30. public void ResetScissor();
  31. /// <summary>
  32. /// Replaces the <see cref="Scissor"/> with the intersection of itself
  33. /// and the <paramref name="clip"/> rectangle.
  34. /// </summary>
  35. /// <param name="clip">The rectangle to intersects.</param>
  36. public void IntersectScissor(RectangleF clip);
  37. /// <summary>
  38. /// Begins the sprite branch.
  39. /// </summary>
  40. /// <exception cref="InvalidOperationException">Thrown if <see cref="Begin"/> is called next time without previous <see cref="End"/>.</exception>
  41. public void Begin();
  42. /// <summary>
  43. /// Flushes all batched text and sprites to the screen.
  44. /// </summary>
  45. /// <exception cref="InvalidOperationException">This command should be called after <see cref="Begin"/> and drawing commands.</exception>
  46. public void End();
  47. /// <summary>
  48. /// Submit sprite draw in the batch.
  49. /// </summary>
  50. /// <param name="texture">The source texture.</param>
  51. /// <param name="destinationRectangle">The drawing bounds on screen.</param>
  52. /// <param name="sourceRectangle">An optional region on the texture which will be rendered. If null - draws full texture.</param>
  53. /// <param name="color">Color multiplier.</param>
  54. /// <param name="rotation">The rotation of the sprite.</param>
  55. /// <param name="origin">Sprite center.</param>
  56. /// <param name="options">Options that modify the drawing.</param>
  57. /// <param name="layerDepth">A depth of the layer of this sprite.</param>
  58. public void Draw(ITexture2D texture,
  59. RectangleF destinationRectangle,
  60. RectangleF sourceRectangle,
  61. Color color,
  62. float rotation,
  63. Vector2 origin,
  64. SpriteOptions options,
  65. float layerDepth);
  66. /// <summary>
  67. /// Submit sprite draw in the batch.
  68. /// </summary>
  69. /// <param name="texture">The source texture.</param>
  70. /// <param name="position">The drawing location on screen.</param>
  71. /// <param name="sourceRectangle">An optional region on the texture which will be rendered. If null - draws full texture.</param>
  72. /// <param name="color">Color multiplier.</param>
  73. /// <param name="rotation">The rotation of the sprite.</param>
  74. /// <param name="origin">Sprite center.</param>
  75. /// <param name="scale">A scaling of this sprite.</param>
  76. /// <param name="options">Options that modify the drawing.</param>
  77. /// <param name="layerDepth">A depth of the layer of this sprite.</param>
  78. public void Draw(ITexture2D texture,
  79. PointF position,
  80. RectangleF sourceRectangle,
  81. Color color,
  82. float rotation,
  83. Vector2 origin,
  84. Vector2 scale,
  85. SpriteOptions options,
  86. float layerDepth);
  87. /// <summary>
  88. /// Submit sprite draw in the batch.
  89. /// </summary>
  90. /// <param name="texture">The source texture.</param>
  91. /// <param name="destinationRectangle">The drawing bounds on screen.</param>
  92. /// <param name="sourceRectangle">An optional region on the texture which will be rendered. If null - draws full texture.</param>
  93. /// <param name="color">Color multiplier.</param>
  94. /// <param name="rotation">The rotation of the sprite.</param>
  95. /// <param name="origin">Sprite center.</param>
  96. /// <param name="layerDepth">A depth of the layer of this sprite.</param>
  97. public void Draw(ITexture2D texture,
  98. RectangleF destinationRectangle,
  99. RectangleF sourceRectangle,
  100. Color color,
  101. float rotation,
  102. Vector2 origin,
  103. float layerDepth);
  104. /// <summary>
  105. /// Submit sprite draw in the batch.
  106. /// </summary>
  107. /// <param name="texture">The source texture.</param>
  108. /// <param name="position">The drawing location on screen.</param>
  109. /// <param name="sourceRectangle">An optional region on the texture which will be rendered. If null - draws full texture.</param>
  110. /// <param name="color">Color multiplier.</param>
  111. /// <param name="rotation">The rotation of the sprite.</param>
  112. /// <param name="origin">Sprite center.</param>
  113. /// <param name="scale">A scaling of this sprite.</param>
  114. /// <param name="layerDepth">A depth of the layer of this sprite.</param>
  115. public void Draw(ITexture2D texture,
  116. PointF position,
  117. RectangleF sourceRectangle,
  118. Color color,
  119. float rotation,
  120. Vector2 origin,
  121. Vector2 scale,
  122. float layerDepth);
  123. /// <summary>
  124. /// Submit a sprite for drawing in the current batch.
  125. /// </summary>
  126. /// <param name="texture">The source texture.</param>
  127. /// <param name="destinationRectangle">The drawing bounds on screen.</param>
  128. /// <param name="sourceRectangle">An optional region on the texture which will be rendered. If null - draws full texture.</param>
  129. /// <param name="color">Color multiplier.</param>
  130. /// <param name="rotation">A rotation of this sprite.</param>
  131. /// <param name="origin">Sprite center.</param>
  132. /// <param name="options">Options that modify the drawing.</param>
  133. /// <param name="layerDepth">A depth of the layer of this sprite.</param>
  134. public void Draw(ITexture2D texture,
  135. RectangleF destinationRectangle,
  136. RectangleF? sourceRectangle,
  137. Color color,
  138. float rotation,
  139. Vector2 origin,
  140. SpriteOptions options,
  141. float layerDepth);
  142. /// <summary>
  143. /// Submit a sprite for drawing in the current batch.
  144. /// </summary>
  145. /// <param name="texture">The source texture.</param>
  146. /// <param name="destinationRectangle">The drawing bounds on screen.</param>
  147. /// <param name="sourceRectangle">An optional region on the texture which will be rendered. If null - draws full texture.</param>
  148. /// <param name="color">Color multiplier.</param>
  149. /// <param name="rotation">A rotation of this sprite.</param>
  150. /// <param name="origin">Sprite center.</param>
  151. /// <param name="layerDepth">A depth of the layer of this sprite.</param>
  152. public void Draw(ITexture2D texture,
  153. RectangleF destinationRectangle,
  154. RectangleF? sourceRectangle,
  155. Color color,
  156. float rotation,
  157. Vector2 origin,
  158. float layerDepth);
  159. /// <summary>
  160. /// Submit sprite draw in the batch.
  161. /// </summary>
  162. /// <param name="texture">The source texture.</param>
  163. /// <param name="position">The drawing location on screen.</param>
  164. /// <param name="sourceRectangle">An optional region on the texture which will be rendered. If null - draws full texture.</param>
  165. /// <param name="color">Color multiplier.</param>
  166. /// <param name="rotation">The rotation of the sprite.</param>
  167. /// <param name="origin">Sprite center.</param>
  168. /// <param name="scale">A scaling of this sprite.</param>
  169. /// <param name="options">Options that modify the drawing.</param>
  170. /// <param name="layerDepth">A depth of the layer of this sprite.</param>
  171. public void Draw(ITexture2D texture,
  172. PointF position,
  173. RectangleF? sourceRectangle,
  174. Color color,
  175. float rotation,
  176. Vector2 origin,
  177. Vector2 scale,
  178. SpriteOptions options,
  179. float layerDepth);
  180. /// <summary>
  181. /// Submit sprite draw in the batch.
  182. /// </summary>
  183. /// <param name="texture">The source texture.</param>
  184. /// <param name="position">The drawing location on screen.</param>
  185. /// <param name="sourceRectangle">An optional region on the texture which will be rendered. If null - draws full texture.</param>
  186. /// <param name="color">Color multiplier.</param>
  187. /// <param name="rotation">The rotation of the sprite.</param>
  188. /// <param name="origin">Sprite center.</param>
  189. /// <param name="scale">A scaling of this sprite.</param>
  190. /// <param name="layerDepth">A depth of the layer of this sprite.</param>
  191. public void Draw(ITexture2D texture,
  192. PointF position,
  193. RectangleF? sourceRectangle,
  194. Color color,
  195. float rotation,
  196. Vector2 origin,
  197. Vector2 scale,
  198. float layerDepth);
  199. /// <summary>
  200. /// Submit a sprite for drawing in the current batch.
  201. /// </summary>
  202. /// <param name="texture">The source texture.</param>
  203. /// <param name="position">The drawing location on screen.</param>
  204. /// <param name="sourceRectangle">An optional region on the texture which will be rendered. If null - draws full texture.</param>
  205. /// <param name="color">Color multiplier.</param>
  206. /// <param name="rotation">A rotation of this sprite.</param>
  207. /// <param name="origin">Sprite center.</param>
  208. /// <param name="scale">A scaling of this sprite.</param>
  209. /// <param name="options">Options that modify the drawing.</param>
  210. /// <param name="layerDepth">A depth of the layer of this sprite.</param>
  211. public void Draw(ITexture2D texture,
  212. PointF position,
  213. RectangleF? sourceRectangle,
  214. Color color,
  215. float rotation,
  216. Vector2 origin,
  217. float scale,
  218. SpriteOptions options,
  219. float layerDepth);
  220. /// <summary>
  221. /// Submit a sprite for drawing in the current batch.
  222. /// </summary>
  223. /// <param name="texture">The source texture.</param>
  224. /// <param name="position">The drawing location on screen.</param>
  225. /// <param name="sourceRectangle">An optional region on the texture which will be rendered. If null - draws full texture.</param>
  226. /// <param name="color">Color multiplier.</param>
  227. /// <param name="rotation">A rotation of this sprite.</param>
  228. /// <param name="origin">Sprite center.</param>
  229. /// <param name="scale">A scaling of this sprite.</param>
  230. /// <param name="layerDepth">A depth of the layer of this sprite.</param>
  231. public void Draw(ITexture2D texture,
  232. PointF position,
  233. RectangleF? sourceRectangle,
  234. Color color,
  235. float rotation,
  236. Vector2 origin,
  237. float scale,
  238. float layerDepth);
  239. /// <summary>
  240. /// Submit a sprite for drawing in the current batch.
  241. /// </summary>
  242. /// <param name="texture">The source texture.</param>
  243. /// <param name="position">The drawing location on screen.</param>
  244. /// <param name="sourceRectangle">An optional region on the texture which will be rendered. If null - draws full texture.</param>
  245. /// <param name="color">Color multiplier.</param>
  246. /// <param name="options">Options that modify the drawing.</param>
  247. /// <param name="layerDepth">A depth of the layer of this sprite.</param>
  248. public void Draw(ITexture2D texture,
  249. PointF position,
  250. RectangleF? sourceRectangle,
  251. Color color,
  252. SpriteOptions options,
  253. float layerDepth);
  254. /// <summary>
  255. /// Submit a sprite for drawing in the current batch.
  256. /// </summary>
  257. /// <param name="texture">The source texture.</param>
  258. /// <param name="position">The drawing location on screen.</param>
  259. /// <param name="sourceRectangle">An optional region on the texture which will be rendered. If null - draws full texture.</param>
  260. /// <param name="color">Color multiplier.</param>
  261. /// <param name="layerDepth">A depth of the layer of this sprite.</param>
  262. public void Draw(ITexture2D texture,
  263. PointF position,
  264. RectangleF? sourceRectangle,
  265. Color color,
  266. float layerDepth);
  267. /// <summary>
  268. /// Submit a sprite for drawing in the current batch.
  269. /// </summary>
  270. /// <param name="texture">The source texture.</param>
  271. /// <param name="destinationRectangle">The drawing bounds on screen.</param>
  272. /// <param name="sourceRectangle">An optional region on the texture which will be rendered. If null - draws full texture.</param>
  273. /// <param name="color">Color multiplier.</param>
  274. /// <param name="options">Options that modify the drawing.</param>
  275. /// <param name="layerDepth">A depth of the layer of this sprite.</param>
  276. public void Draw(ITexture2D texture,
  277. RectangleF destinationRectangle,
  278. RectangleF? sourceRectangle,
  279. Color color,
  280. SpriteOptions options,
  281. float layerDepth);
  282. /// <summary>
  283. /// Submit a sprite for drawing in the current batch.
  284. /// </summary>
  285. /// <param name="texture">The source texture.</param>
  286. /// <param name="destinationRectangle">The drawing bounds on screen.</param>
  287. /// <param name="sourceRectangle">An optional region on the texture which will be rendered. If null - draws full texture.</param>
  288. /// <param name="color">Color multiplier.</param>
  289. /// <param name="layerDepth">A depth of the layer of this sprite.</param>
  290. public void Draw(ITexture2D texture,
  291. RectangleF destinationRectangle,
  292. RectangleF? sourceRectangle,
  293. Color color,
  294. float layerDepth);
  295. /// <summary>
  296. /// Submit a sprite for drawing in the current batch.
  297. /// </summary>
  298. /// <param name="texture">The source texture.</param>
  299. /// <param name="position">The drawing location on screen.</param>
  300. /// <param name="color">Color multiplier.</param>
  301. /// <param name="options">Options that modify the drawing.</param>
  302. /// <param name="layerDepth">A depth of the layer of this sprite.</param>
  303. public void Draw(ITexture2D texture,
  304. PointF position,
  305. Color color,
  306. SpriteOptions options,
  307. float layerDepth);
  308. /// <summary>
  309. /// Submit a sprite for drawing in the current batch.
  310. /// </summary>
  311. /// <param name="texture">The source texture.</param>
  312. /// <param name="position">The drawing location on screen.</param>
  313. /// <param name="color">Color multiplier.</param>
  314. /// <param name="layerDepth">A depth of the layer of this sprite.</param>
  315. public void Draw(ITexture2D texture,
  316. PointF position,
  317. Color color,
  318. float layerDepth);
  319. /// <summary>
  320. /// Submit a sprite for drawing in the current batch.
  321. /// </summary>
  322. /// <param name="texture">The source texture.</param>
  323. /// <param name="destinationRectangle">The drawing bounds on screen.</param>
  324. /// <param name="color">Color multiplier.</param>
  325. /// <param name="options">Options that modify the drawing.</param>
  326. /// <param name="layerDepth">A depth of the layer of this sprite.</param>
  327. public void Draw(ITexture2D texture,
  328. RectangleF destinationRectangle,
  329. Color color,
  330. SpriteOptions options,
  331. float layerDepth);
  332. /// <summary>
  333. /// Submit a sprite for drawing in the current batch.
  334. /// </summary>
  335. /// <param name="texture">The source texture.</param>
  336. /// <param name="destinationRectangle">The drawing bounds on screen.</param>
  337. /// <param name="color">Color multiplier.</param>
  338. /// <param name="layerDepth">A depth of the layer of this sprite.</param>
  339. public void Draw(ITexture2D texture,
  340. RectangleF destinationRectangle,
  341. Color color,
  342. float layerDepth);
  343. }
  344. /// <summary>
  345. /// Represents a interface for drawing sprites in one or more optimized batches.
  346. /// </summary>
  347. public interface ISpriteBatch<TTexture> : ISpriteBatch where TTexture : notnull, ITexture2D
  348. {
  349. /// <summary>
  350. /// Submit sprite draw in the batch.
  351. /// </summary>
  352. /// <param name="texture">The source texture.</param>
  353. /// <param name="destinationRectangle">The drawing bounds on screen.</param>
  354. /// <param name="sourceRectangle">An optional region on the texture which will be rendered. If null - draws full texture.</param>
  355. /// <param name="color">Color multiplier.</param>
  356. /// <param name="rotation">The rotation of the sprite.</param>
  357. /// <param name="origin">Sprite center.</param>
  358. /// <param name="options">Options that modify the drawing.</param>
  359. /// <param name="layerDepth">A depth of the layer of this sprite.</param>
  360. public void Draw(TTexture texture,
  361. RectangleF destinationRectangle,
  362. RectangleF sourceRectangle,
  363. Color color,
  364. float rotation,
  365. Vector2 origin,
  366. SpriteOptions options,
  367. float layerDepth);
  368. /// <summary>
  369. /// Submit sprite draw in the batch.
  370. /// </summary>
  371. /// <param name="texture">The source texture.</param>
  372. /// <param name="position">The drawing location on screen.</param>
  373. /// <param name="sourceRectangle">An optional region on the texture which will be rendered. If null - draws full texture.</param>
  374. /// <param name="color">Color multiplier.</param>
  375. /// <param name="rotation">The rotation of the sprite.</param>
  376. /// <param name="origin">Sprite center.</param>
  377. /// <param name="scale">A scaling of this sprite.</param>
  378. /// <param name="options">Options that modify the drawing.</param>
  379. /// <param name="layerDepth">A depth of the layer of this sprite.</param>
  380. public void Draw(TTexture texture,
  381. PointF position,
  382. RectangleF sourceRectangle,
  383. Color color,
  384. float rotation,
  385. Vector2 origin,
  386. Vector2 scale,
  387. SpriteOptions options,
  388. float layerDepth);
  389. /// <summary>
  390. /// Submit sprite draw in the batch.
  391. /// </summary>
  392. /// <param name="texture">The source texture.</param>
  393. /// <param name="destinationRectangle">The drawing bounds on screen.</param>
  394. /// <param name="sourceRectangle">An optional region on the texture which will be rendered. If null - draws full texture.</param>
  395. /// <param name="color">Color multiplier.</param>
  396. /// <param name="rotation">The rotation of the sprite.</param>
  397. /// <param name="origin">Sprite center.</param>
  398. /// <param name="layerDepth">A depth of the layer of this sprite.</param>
  399. public void Draw(TTexture texture,
  400. RectangleF destinationRectangle,
  401. RectangleF sourceRectangle,
  402. Color color,
  403. float rotation,
  404. Vector2 origin,
  405. float layerDepth);
  406. /// <summary>
  407. /// Submit sprite draw in the batch.
  408. /// </summary>
  409. /// <param name="texture">The source texture.</param>
  410. /// <param name="position">The drawing location on screen.</param>
  411. /// <param name="sourceRectangle">An optional region on the texture which will be rendered. If null - draws full texture.</param>
  412. /// <param name="color">Color multiplier.</param>
  413. /// <param name="rotation">The rotation of the sprite.</param>
  414. /// <param name="origin">Sprite center.</param>
  415. /// <param name="scale">A scaling of this sprite.</param>
  416. /// <param name="layerDepth">A depth of the layer of this sprite.</param>
  417. public void Draw(TTexture texture,
  418. PointF position,
  419. RectangleF sourceRectangle,
  420. Color color,
  421. float rotation,
  422. Vector2 origin,
  423. Vector2 scale,
  424. float layerDepth);
  425. /// <summary>
  426. /// Submit a sprite for drawing in the current batch.
  427. /// </summary>
  428. /// <param name="texture">The source texture.</param>
  429. /// <param name="destinationRectangle">The drawing bounds on screen.</param>
  430. /// <param name="sourceRectangle">An optional region on the texture which will be rendered. If null - draws full texture.</param>
  431. /// <param name="color">Color multiplier.</param>
  432. /// <param name="rotation">A rotation of this sprite.</param>
  433. /// <param name="origin">Sprite center.</param>
  434. /// <param name="options">Options that modify the drawing.</param>
  435. /// <param name="layerDepth">A depth of the layer of this sprite.</param>
  436. public void Draw(TTexture texture,
  437. RectangleF destinationRectangle,
  438. RectangleF? sourceRectangle,
  439. Color color,
  440. float rotation,
  441. Vector2 origin,
  442. SpriteOptions options,
  443. float layerDepth);
  444. /// <summary>
  445. /// Submit a sprite for drawing in the current batch.
  446. /// </summary>
  447. /// <param name="texture">The source texture.</param>
  448. /// <param name="destinationRectangle">The drawing bounds on screen.</param>
  449. /// <param name="sourceRectangle">An optional region on the texture which will be rendered. If null - draws full texture.</param>
  450. /// <param name="color">Color multiplier.</param>
  451. /// <param name="rotation">A rotation of this sprite.</param>
  452. /// <param name="origin">Sprite center.</param>
  453. /// <param name="layerDepth">A depth of the layer of this sprite.</param>
  454. public void Draw(TTexture texture,
  455. RectangleF destinationRectangle,
  456. RectangleF? sourceRectangle,
  457. Color color,
  458. float rotation,
  459. Vector2 origin,
  460. float layerDepth);
  461. /// <summary>
  462. /// Submit sprite draw in the batch.
  463. /// </summary>
  464. /// <param name="texture">The source texture.</param>
  465. /// <param name="position">The drawing location on screen.</param>
  466. /// <param name="sourceRectangle">An optional region on the texture which will be rendered. If null - draws full texture.</param>
  467. /// <param name="color">Color multiplier.</param>
  468. /// <param name="rotation">The rotation of the sprite.</param>
  469. /// <param name="origin">Sprite center.</param>
  470. /// <param name="scale">A scaling of this sprite.</param>
  471. /// <param name="options">Options that modify the drawing.</param>
  472. /// <param name="layerDepth">A depth of the layer of this sprite.</param>
  473. public void Draw(TTexture texture,
  474. PointF position,
  475. RectangleF? sourceRectangle,
  476. Color color,
  477. float rotation,
  478. Vector2 origin,
  479. Vector2 scale,
  480. SpriteOptions options,
  481. float layerDepth);
  482. /// <summary>
  483. /// Submit sprite draw in the batch.
  484. /// </summary>
  485. /// <param name="texture">The source texture.</param>
  486. /// <param name="position">The drawing location on screen.</param>
  487. /// <param name="sourceRectangle">An optional region on the texture which will be rendered. If null - draws full texture.</param>
  488. /// <param name="color">Color multiplier.</param>
  489. /// <param name="rotation">The rotation of the sprite.</param>
  490. /// <param name="origin">Sprite center.</param>
  491. /// <param name="scale">A scaling of this sprite.</param>
  492. /// <param name="layerDepth">A depth of the layer of this sprite.</param>
  493. public void Draw(TTexture texture,
  494. PointF position,
  495. RectangleF? sourceRectangle,
  496. Color color,
  497. float rotation,
  498. Vector2 origin,
  499. Vector2 scale,
  500. float layerDepth);
  501. /// <summary>
  502. /// Submit a sprite for drawing in the current batch.
  503. /// </summary>
  504. /// <param name="texture">The source texture.</param>
  505. /// <param name="position">The drawing location on screen.</param>
  506. /// <param name="sourceRectangle">An optional region on the texture which will be rendered. If null - draws full texture.</param>
  507. /// <param name="color">Color multiplier.</param>
  508. /// <param name="rotation">A rotation of this sprite.</param>
  509. /// <param name="origin">Sprite center.</param>
  510. /// <param name="scale">A scaling of this sprite.</param>
  511. /// <param name="options">Options that modify the drawing.</param>
  512. /// <param name="layerDepth">A depth of the layer of this sprite.</param>
  513. public void Draw(TTexture texture,
  514. PointF position,
  515. RectangleF? sourceRectangle,
  516. Color color,
  517. float rotation,
  518. Vector2 origin,
  519. float scale,
  520. SpriteOptions options,
  521. float layerDepth);
  522. /// <summary>
  523. /// Submit a sprite for drawing in the current batch.
  524. /// </summary>
  525. /// <param name="texture">The source texture.</param>
  526. /// <param name="position">The drawing location on screen.</param>
  527. /// <param name="sourceRectangle">An optional region on the texture which will be rendered. If null - draws full texture.</param>
  528. /// <param name="color">Color multiplier.</param>
  529. /// <param name="rotation">A rotation of this sprite.</param>
  530. /// <param name="origin">Sprite center.</param>
  531. /// <param name="scale">A scaling of this sprite.</param>
  532. /// <param name="layerDepth">A depth of the layer of this sprite.</param>
  533. public void Draw(TTexture texture,
  534. PointF position,
  535. RectangleF? sourceRectangle,
  536. Color color,
  537. float rotation,
  538. Vector2 origin,
  539. float scale,
  540. float layerDepth);
  541. /// <summary>
  542. /// Submit a sprite for drawing in the current batch.
  543. /// </summary>
  544. /// <param name="texture">The source texture.</param>
  545. /// <param name="position">The drawing location on screen.</param>
  546. /// <param name="sourceRectangle">An optional region on the texture which will be rendered. If null - draws full texture.</param>
  547. /// <param name="color">Color multiplier.</param>
  548. /// <param name="options">Options that modify the drawing.</param>
  549. /// <param name="layerDepth">A depth of the layer of this sprite.</param>
  550. public void Draw(TTexture texture,
  551. PointF position,
  552. RectangleF? sourceRectangle,
  553. Color color,
  554. SpriteOptions options,
  555. float layerDepth);
  556. /// <summary>
  557. /// Submit a sprite for drawing in the current batch.
  558. /// </summary>
  559. /// <param name="texture">The source texture.</param>
  560. /// <param name="position">The drawing location on screen.</param>
  561. /// <param name="sourceRectangle">An optional region on the texture which will be rendered. If null - draws full texture.</param>
  562. /// <param name="color">Color multiplier.</param>
  563. /// <param name="layerDepth">A depth of the layer of this sprite.</param>
  564. public void Draw(TTexture texture,
  565. PointF position,
  566. RectangleF? sourceRectangle,
  567. Color color,
  568. float layerDepth);
  569. /// <summary>
  570. /// Submit a sprite for drawing in the current batch.
  571. /// </summary>
  572. /// <param name="texture">The source texture.</param>
  573. /// <param name="destinationRectangle">The drawing bounds on screen.</param>
  574. /// <param name="sourceRectangle">An optional region on the texture which will be rendered. If null - draws full texture.</param>
  575. /// <param name="color">Color multiplier.</param>
  576. /// <param name="options">Options that modify the drawing.</param>
  577. /// <param name="layerDepth">A depth of the layer of this sprite.</param>
  578. public void Draw(TTexture texture,
  579. RectangleF destinationRectangle,
  580. RectangleF? sourceRectangle,
  581. Color color,
  582. SpriteOptions options,
  583. float layerDepth);
  584. /// <summary>
  585. /// Submit a sprite for drawing in the current batch.
  586. /// </summary>
  587. /// <param name="texture">The source texture.</param>
  588. /// <param name="destinationRectangle">The drawing bounds on screen.</param>
  589. /// <param name="sourceRectangle">An optional region on the texture which will be rendered. If null - draws full texture.</param>
  590. /// <param name="color">Color multiplier.</param>
  591. /// <param name="layerDepth">A depth of the layer of this sprite.</param>
  592. public void Draw(TTexture texture,
  593. RectangleF destinationRectangle,
  594. RectangleF? sourceRectangle,
  595. Color color,
  596. float layerDepth);
  597. /// <summary>
  598. /// Submit a sprite for drawing in the current batch.
  599. /// </summary>
  600. /// <param name="texture">The source texture.</param>
  601. /// <param name="position">The drawing location on screen.</param>
  602. /// <param name="color">Color multiplier.</param>
  603. /// <param name="options">Options that modify the drawing.</param>
  604. /// <param name="layerDepth">A depth of the layer of this sprite.</param>
  605. public void Draw(TTexture texture,
  606. PointF position,
  607. Color color,
  608. SpriteOptions options,
  609. float layerDepth);
  610. /// <summary>
  611. /// Submit a sprite for drawing in the current batch.
  612. /// </summary>
  613. /// <param name="texture">The source texture.</param>
  614. /// <param name="position">The drawing location on screen.</param>
  615. /// <param name="color">Color multiplier.</param>
  616. /// <param name="layerDepth">A depth of the layer of this sprite.</param>
  617. public void Draw(TTexture texture,
  618. PointF position,
  619. Color color,
  620. float layerDepth);
  621. /// <summary>
  622. /// Submit a sprite for drawing in the current batch.
  623. /// </summary>
  624. /// <param name="texture">The source texture.</param>
  625. /// <param name="destinationRectangle">The drawing bounds on screen.</param>
  626. /// <param name="color">Color multiplier.</param>
  627. /// <param name="options">Options that modify the drawing.</param>
  628. /// <param name="layerDepth">A depth of the layer of this sprite.</param>
  629. public void Draw(TTexture texture,
  630. RectangleF destinationRectangle,
  631. Color color,
  632. SpriteOptions options,
  633. float layerDepth);
  634. /// <summary>
  635. /// Submit a sprite for drawing in the current batch.
  636. /// </summary>
  637. /// <param name="texture">The source texture.</param>
  638. /// <param name="destinationRectangle">The drawing bounds on screen.</param>
  639. /// <param name="color">Color multiplier.</param>
  640. /// <param name="layerDepth">A depth of the layer of this sprite.</param>
  641. public void Draw(TTexture texture,
  642. RectangleF destinationRectangle,
  643. Color color,
  644. float layerDepth);
  645. }
  646. }