Graphics.cs 90 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125
  1. // WARNING - AUTOGENERATED - DO NOT EDIT
  2. //
  3. // Generated using `sharpie urho`
  4. //
  5. // Graphics.cs
  6. //
  7. // Copyright 2015 Xamarin Inc. All rights reserved.
  8. using System;
  9. using System.Runtime.InteropServices;
  10. using System.Collections.Generic;
  11. using Urho.Urho2D;
  12. using Urho.Gui;
  13. using Urho.Resources;
  14. using Urho.IO;
  15. using Urho.Navigation;
  16. using Urho.Network;
  17. namespace Urho
  18. {
  19. /// <summary>
  20. /// %Graphics subsystem. Manages the application window, rendering state and GPU resources.
  21. /// </summary>
  22. public unsafe partial class Graphics : UrhoObject
  23. {
  24. unsafe partial void OnGraphicsCreated ();
  25. [Preserve]
  26. public Graphics (IntPtr handle) : base (handle)
  27. {
  28. OnGraphicsCreated ();
  29. }
  30. [Preserve]
  31. protected Graphics (UrhoObjectFlag emptyFlag) : base (emptyFlag)
  32. {
  33. OnGraphicsCreated ();
  34. }
  35. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  36. internal static extern int Graphics_GetType (IntPtr handle);
  37. private StringHash UrhoGetType ()
  38. {
  39. Runtime.ValidateRefCounted (this);
  40. return new StringHash (Graphics_GetType (handle));
  41. }
  42. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  43. internal static extern IntPtr Graphics_GetTypeName (IntPtr handle);
  44. private string GetTypeName ()
  45. {
  46. Runtime.ValidateRefCounted (this);
  47. return Marshal.PtrToStringAnsi (Graphics_GetTypeName (handle));
  48. }
  49. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  50. internal static extern int Graphics_GetTypeStatic ();
  51. private static StringHash GetTypeStatic ()
  52. {
  53. Runtime.Validate (typeof(Graphics));
  54. return new StringHash (Graphics_GetTypeStatic ());
  55. }
  56. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  57. internal static extern IntPtr Graphics_GetTypeNameStatic ();
  58. private static string GetTypeNameStatic ()
  59. {
  60. Runtime.Validate (typeof(Graphics));
  61. return Marshal.PtrToStringAnsi (Graphics_GetTypeNameStatic ());
  62. }
  63. [Preserve]
  64. public Graphics () : this (Application.CurrentContext)
  65. {
  66. }
  67. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  68. internal static extern IntPtr Graphics_Graphics (IntPtr context);
  69. [Preserve]
  70. public Graphics (Context context) : base (UrhoObjectFlag.Empty)
  71. {
  72. Runtime.Validate (typeof(Graphics));
  73. handle = Graphics_Graphics ((object)context == null ? IntPtr.Zero : context.Handle);
  74. Runtime.RegisterObject (this);
  75. OnGraphicsCreated ();
  76. }
  77. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  78. internal static extern void Graphics_SetExternalWindow (IntPtr handle, IntPtr window);
  79. /// <summary>
  80. /// Set external window handle. Only effective before setting the initial screen mode.
  81. /// </summary>
  82. private void SetExternalWindow (IntPtr window)
  83. {
  84. Runtime.ValidateRefCounted (this);
  85. Graphics_SetExternalWindow (handle, window);
  86. }
  87. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  88. internal static extern void Graphics_SetWindowTitle (IntPtr handle, string windowTitle);
  89. /// <summary>
  90. /// Set window title.
  91. /// </summary>
  92. private void SetWindowTitle (string windowTitle)
  93. {
  94. Runtime.ValidateRefCounted (this);
  95. Graphics_SetWindowTitle (handle, windowTitle);
  96. }
  97. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  98. internal static extern void Graphics_SetWindowIcon (IntPtr handle, IntPtr windowIcon);
  99. /// <summary>
  100. /// Set window icon.
  101. /// </summary>
  102. public void SetWindowIcon (Image windowIcon)
  103. {
  104. Runtime.ValidateRefCounted (this);
  105. Graphics_SetWindowIcon (handle, (object)windowIcon == null ? IntPtr.Zero : windowIcon.Handle);
  106. }
  107. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  108. internal static extern void Graphics_SetWindowPosition (IntPtr handle, ref Urho.IntVector2 position);
  109. /// <summary>
  110. /// Set window position. Sets initial position if window is not created yet.
  111. /// </summary>
  112. public void SetWindowPosition (Urho.IntVector2 position)
  113. {
  114. Runtime.ValidateRefCounted (this);
  115. Graphics_SetWindowPosition (handle, ref position);
  116. }
  117. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  118. internal static extern void Graphics_SetWindowPosition0 (IntPtr handle, int x, int y);
  119. /// <summary>
  120. /// Set window position. Sets initial position if window is not created yet.
  121. /// </summary>
  122. public void SetWindowPosition (int x, int y)
  123. {
  124. Runtime.ValidateRefCounted (this);
  125. Graphics_SetWindowPosition0 (handle, x, y);
  126. }
  127. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  128. internal static extern bool Graphics_SetMode (IntPtr handle, int width, int height, bool fullscreen, bool borderless, bool resizable, bool highDPI, bool vsync, bool tripleBuffer, int multiSample, int monitor, int refreshRate);
  129. /// <summary>
  130. /// Set screen mode. Return true if successful.
  131. /// </summary>
  132. public bool SetMode (int width, int height, bool fullscreen, bool borderless, bool resizable, bool highDPI, bool vsync, bool tripleBuffer, int multiSample, int monitor, int refreshRate)
  133. {
  134. Runtime.ValidateRefCounted (this);
  135. return Graphics_SetMode (handle, width, height, fullscreen, borderless, resizable, highDPI, vsync, tripleBuffer, multiSample, monitor, refreshRate);
  136. }
  137. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  138. internal static extern bool Graphics_SetMode1 (IntPtr handle, int width, int height);
  139. /// <summary>
  140. /// Set screen resolution only. Return true if successful.
  141. /// </summary>
  142. public bool SetMode (int width, int height)
  143. {
  144. Runtime.ValidateRefCounted (this);
  145. return Graphics_SetMode1 (handle, width, height);
  146. }
  147. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  148. internal static extern void Graphics_SetSRGB (IntPtr handle, bool enable);
  149. /// <summary>
  150. /// Set whether the main window uses sRGB conversion on write.
  151. /// </summary>
  152. private void SetSRGB (bool enable)
  153. {
  154. Runtime.ValidateRefCounted (this);
  155. Graphics_SetSRGB (handle, enable);
  156. }
  157. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  158. internal static extern void Graphics_SetDither (IntPtr handle, bool enable);
  159. /// <summary>
  160. /// Set whether rendering output is dithered. Default true on OpenGL. No effect on Direct3D.
  161. /// </summary>
  162. private void SetDither (bool enable)
  163. {
  164. Runtime.ValidateRefCounted (this);
  165. Graphics_SetDither (handle, enable);
  166. }
  167. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  168. internal static extern void Graphics_SetFlushGPU (IntPtr handle, bool enable);
  169. /// <summary>
  170. /// Set whether to flush the GPU command buffer to prevent multiple frames being queued and uneven frame timesteps. Default off, may decrease performance if enabled. Not currently implemented on OpenGL.
  171. /// </summary>
  172. private void SetFlushGPU (bool enable)
  173. {
  174. Runtime.ValidateRefCounted (this);
  175. Graphics_SetFlushGPU (handle, enable);
  176. }
  177. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  178. internal static extern void Graphics_SetOrientations (IntPtr handle, string orientations);
  179. /// <summary>
  180. /// Set allowed screen orientations as a space-separated list of "LandscapeLeft", "LandscapeRight", "Portrait" and "PortraitUpsideDown". Affects currently only iOS platform.
  181. /// </summary>
  182. private void SetOrientations (string orientations)
  183. {
  184. Runtime.ValidateRefCounted (this);
  185. Graphics_SetOrientations (handle, orientations);
  186. }
  187. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  188. internal static extern bool Graphics_ToggleFullscreen (IntPtr handle);
  189. /// <summary>
  190. /// Toggle between full screen and windowed mode. Return true if successful.
  191. /// </summary>
  192. public bool ToggleFullscreen ()
  193. {
  194. Runtime.ValidateRefCounted (this);
  195. return Graphics_ToggleFullscreen (handle);
  196. }
  197. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  198. internal static extern void Graphics_Close (IntPtr handle);
  199. /// <summary>
  200. /// Close the window.
  201. /// </summary>
  202. public void Close ()
  203. {
  204. Runtime.ValidateRefCounted (this);
  205. Graphics_Close (handle);
  206. }
  207. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  208. internal static extern bool Graphics_TakeScreenShot (IntPtr handle, IntPtr destImage);
  209. /// <summary>
  210. /// Take a screenshot. Return true if successful.
  211. /// </summary>
  212. public bool TakeScreenShot (Image destImage)
  213. {
  214. Runtime.ValidateRefCounted (this);
  215. return Graphics_TakeScreenShot (handle, (object)destImage == null ? IntPtr.Zero : destImage.Handle);
  216. }
  217. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  218. internal static extern bool Graphics_BeginFrame (IntPtr handle);
  219. /// <summary>
  220. /// Begin frame rendering. Return true if device available and can render.
  221. /// </summary>
  222. public bool BeginFrame ()
  223. {
  224. Runtime.ValidateRefCounted (this);
  225. return Graphics_BeginFrame (handle);
  226. }
  227. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  228. internal static extern void Graphics_EndFrame (IntPtr handle);
  229. /// <summary>
  230. /// End frame rendering and swap buffers.
  231. /// </summary>
  232. public void EndFrame ()
  233. {
  234. Runtime.ValidateRefCounted (this);
  235. Graphics_EndFrame (handle);
  236. }
  237. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  238. internal static extern void Graphics_Clear (IntPtr handle, uint flags, ref Urho.Color color, float depth, uint stencil);
  239. /// <summary>
  240. /// Clear any or all of rendertarget, depth buffer and stencil buffer.
  241. /// </summary>
  242. public void Clear (uint flags, Urho.Color color = default(Urho.Color), float depth = 1f, uint stencil = 0)
  243. {
  244. Runtime.ValidateRefCounted (this);
  245. Graphics_Clear (handle, flags, ref color, depth, stencil);
  246. }
  247. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  248. internal static extern bool Graphics_ResolveToTexture (IntPtr handle, IntPtr destination, ref Urho.IntRect viewport);
  249. /// <summary>
  250. /// Resolve multisampled backbuffer to a texture rendertarget. The texture's size should match the viewport size.
  251. /// </summary>
  252. public bool ResolveToTexture (Texture2D destination, Urho.IntRect viewport)
  253. {
  254. Runtime.ValidateRefCounted (this);
  255. return Graphics_ResolveToTexture (handle, (object)destination == null ? IntPtr.Zero : destination.Handle, ref viewport);
  256. }
  257. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  258. internal static extern bool Graphics_ResolveToTexture2 (IntPtr handle, IntPtr texture);
  259. /// <summary>
  260. /// Resolve a multisampled texture on itself.
  261. /// </summary>
  262. public bool ResolveToTexture (Texture2D texture)
  263. {
  264. Runtime.ValidateRefCounted (this);
  265. return Graphics_ResolveToTexture2 (handle, (object)texture == null ? IntPtr.Zero : texture.Handle);
  266. }
  267. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  268. internal static extern bool Graphics_ResolveToTexture3 (IntPtr handle, IntPtr texture);
  269. /// <summary>
  270. /// Resolve a multisampled cube texture on itself.
  271. /// </summary>
  272. public bool ResolveToTexture (TextureCube texture)
  273. {
  274. Runtime.ValidateRefCounted (this);
  275. return Graphics_ResolveToTexture3 (handle, (object)texture == null ? IntPtr.Zero : texture.Handle);
  276. }
  277. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  278. internal static extern void Graphics_Draw (IntPtr handle, PrimitiveType type, uint vertexStart, uint vertexCount);
  279. /// <summary>
  280. /// Draw non-indexed geometry.
  281. /// </summary>
  282. public void Draw (PrimitiveType type, uint vertexStart, uint vertexCount)
  283. {
  284. Runtime.ValidateRefCounted (this);
  285. Graphics_Draw (handle, type, vertexStart, vertexCount);
  286. }
  287. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  288. internal static extern void Graphics_Draw4 (IntPtr handle, PrimitiveType type, uint indexStart, uint indexCount, uint minVertex, uint vertexCount);
  289. /// <summary>
  290. /// Draw indexed geometry.
  291. /// </summary>
  292. public void Draw (PrimitiveType type, uint indexStart, uint indexCount, uint minVertex, uint vertexCount)
  293. {
  294. Runtime.ValidateRefCounted (this);
  295. Graphics_Draw4 (handle, type, indexStart, indexCount, minVertex, vertexCount);
  296. }
  297. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  298. internal static extern void Graphics_Draw5 (IntPtr handle, PrimitiveType type, uint indexStart, uint indexCount, uint baseVertexIndex, uint minVertex, uint vertexCount);
  299. /// <summary>
  300. /// Draw indexed geometry with vertex index offset.
  301. /// </summary>
  302. public void Draw (PrimitiveType type, uint indexStart, uint indexCount, uint baseVertexIndex, uint minVertex, uint vertexCount)
  303. {
  304. Runtime.ValidateRefCounted (this);
  305. Graphics_Draw5 (handle, type, indexStart, indexCount, baseVertexIndex, minVertex, vertexCount);
  306. }
  307. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  308. internal static extern void Graphics_DrawInstanced (IntPtr handle, PrimitiveType type, uint indexStart, uint indexCount, uint minVertex, uint vertexCount, uint instanceCount);
  309. /// <summary>
  310. /// Draw indexed, instanced geometry. An instancing vertex buffer must be set.
  311. /// </summary>
  312. public void DrawInstanced (PrimitiveType type, uint indexStart, uint indexCount, uint minVertex, uint vertexCount, uint instanceCount)
  313. {
  314. Runtime.ValidateRefCounted (this);
  315. Graphics_DrawInstanced (handle, type, indexStart, indexCount, minVertex, vertexCount, instanceCount);
  316. }
  317. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  318. internal static extern void Graphics_DrawInstanced6 (IntPtr handle, PrimitiveType type, uint indexStart, uint indexCount, uint baseVertexIndex, uint minVertex, uint vertexCount, uint instanceCount);
  319. /// <summary>
  320. /// Draw indexed, instanced geometry with vertex index offset.
  321. /// </summary>
  322. public void DrawInstanced (PrimitiveType type, uint indexStart, uint indexCount, uint baseVertexIndex, uint minVertex, uint vertexCount, uint instanceCount)
  323. {
  324. Runtime.ValidateRefCounted (this);
  325. Graphics_DrawInstanced6 (handle, type, indexStart, indexCount, baseVertexIndex, minVertex, vertexCount, instanceCount);
  326. }
  327. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  328. internal static extern void Graphics_SetVertexBuffer (IntPtr handle, IntPtr buffer);
  329. /// <summary>
  330. /// Set vertex buffer.
  331. /// </summary>
  332. public void SetVertexBuffer (VertexBuffer buffer)
  333. {
  334. Runtime.ValidateRefCounted (this);
  335. Graphics_SetVertexBuffer (handle, (object)buffer == null ? IntPtr.Zero : buffer.Handle);
  336. }
  337. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  338. internal static extern void Graphics_SetIndexBuffer (IntPtr handle, IntPtr buffer);
  339. /// <summary>
  340. /// Set index buffer.
  341. /// </summary>
  342. private void SetIndexBuffer (IndexBuffer buffer)
  343. {
  344. Runtime.ValidateRefCounted (this);
  345. Graphics_SetIndexBuffer (handle, (object)buffer == null ? IntPtr.Zero : buffer.Handle);
  346. }
  347. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  348. internal static extern void Graphics_SetShaders (IntPtr handle, IntPtr vs, IntPtr ps);
  349. /// <summary>
  350. /// Set shaders.
  351. /// </summary>
  352. public void SetShaders (ShaderVariation vs, ShaderVariation ps)
  353. {
  354. Runtime.ValidateRefCounted (this);
  355. Graphics_SetShaders (handle, (object)vs == null ? IntPtr.Zero : vs.Handle, (object)ps == null ? IntPtr.Zero : ps.Handle);
  356. }
  357. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  358. internal static extern void Graphics_SetShaderParameter (IntPtr handle, int param, float* data, uint count);
  359. /// <summary>
  360. /// Set shader float constants.
  361. /// </summary>
  362. public void SetShaderParameter (StringHash param, float* data, uint count)
  363. {
  364. Runtime.ValidateRefCounted (this);
  365. Graphics_SetShaderParameter (handle, param.Code, data, count);
  366. }
  367. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  368. internal static extern void Graphics_SetShaderParameter7 (IntPtr handle, int param, float value);
  369. /// <summary>
  370. /// Set shader float constant.
  371. /// </summary>
  372. public void SetShaderParameter (StringHash param, float value)
  373. {
  374. Runtime.ValidateRefCounted (this);
  375. Graphics_SetShaderParameter7 (handle, param.Code, value);
  376. }
  377. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  378. internal static extern void Graphics_SetShaderParameter8 (IntPtr handle, int param, int value);
  379. /// <summary>
  380. /// Set shader integer constant.
  381. /// </summary>
  382. public void SetShaderParameter (StringHash param, int value)
  383. {
  384. Runtime.ValidateRefCounted (this);
  385. Graphics_SetShaderParameter8 (handle, param.Code, value);
  386. }
  387. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  388. internal static extern void Graphics_SetShaderParameter9 (IntPtr handle, int param, bool value);
  389. /// <summary>
  390. /// Set shader boolean constant.
  391. /// </summary>
  392. public void SetShaderParameter (StringHash param, bool value)
  393. {
  394. Runtime.ValidateRefCounted (this);
  395. Graphics_SetShaderParameter9 (handle, param.Code, value);
  396. }
  397. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  398. internal static extern void Graphics_SetShaderParameter10 (IntPtr handle, int param, ref Urho.Color color);
  399. /// <summary>
  400. /// Set shader color constant.
  401. /// </summary>
  402. public void SetShaderParameter (StringHash param, Urho.Color color)
  403. {
  404. Runtime.ValidateRefCounted (this);
  405. Graphics_SetShaderParameter10 (handle, param.Code, ref color);
  406. }
  407. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  408. internal static extern void Graphics_SetShaderParameter11 (IntPtr handle, int param, ref Urho.Vector2 vector);
  409. /// <summary>
  410. /// Set shader 2D vector constant.
  411. /// </summary>
  412. public void SetShaderParameter (StringHash param, Urho.Vector2 vector)
  413. {
  414. Runtime.ValidateRefCounted (this);
  415. Graphics_SetShaderParameter11 (handle, param.Code, ref vector);
  416. }
  417. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  418. internal static extern void Graphics_SetShaderParameter12 (IntPtr handle, int param, ref Urho.Vector3 vector);
  419. /// <summary>
  420. /// Set shader 3D vector constant.
  421. /// </summary>
  422. public void SetShaderParameter (StringHash param, Urho.Vector3 vector)
  423. {
  424. Runtime.ValidateRefCounted (this);
  425. Graphics_SetShaderParameter12 (handle, param.Code, ref vector);
  426. }
  427. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  428. internal static extern void Graphics_SetShaderParameter13 (IntPtr handle, int param, ref Urho.Matrix4 matrix);
  429. /// <summary>
  430. /// Set shader 4x4 matrix constant.
  431. /// </summary>
  432. public void SetShaderParameter (StringHash param, Urho.Matrix4 matrix)
  433. {
  434. Runtime.ValidateRefCounted (this);
  435. Graphics_SetShaderParameter13 (handle, param.Code, ref matrix);
  436. }
  437. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  438. internal static extern void Graphics_SetShaderParameter14 (IntPtr handle, int param, ref Urho.Vector4 vector);
  439. /// <summary>
  440. /// Set shader 4D vector constant.
  441. /// </summary>
  442. public void SetShaderParameter (StringHash param, Urho.Vector4 vector)
  443. {
  444. Runtime.ValidateRefCounted (this);
  445. Graphics_SetShaderParameter14 (handle, param.Code, ref vector);
  446. }
  447. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  448. internal static extern void Graphics_SetShaderParameter15 (IntPtr handle, int param, ref Urho.Matrix3x4 matrix);
  449. /// <summary>
  450. /// Set shader 3x4 matrix constant.
  451. /// </summary>
  452. public void SetShaderParameter (StringHash param, Urho.Matrix3x4 matrix)
  453. {
  454. Runtime.ValidateRefCounted (this);
  455. Graphics_SetShaderParameter15 (handle, param.Code, ref matrix);
  456. }
  457. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  458. internal static extern bool Graphics_NeedParameterUpdate (IntPtr handle, ShaderParameterGroup group, void* source);
  459. /// <summary>
  460. /// Check whether a shader parameter group needs update. Does not actually check whether parameters exist in the shaders.
  461. /// </summary>
  462. public bool NeedParameterUpdate (ShaderParameterGroup group, void* source)
  463. {
  464. Runtime.ValidateRefCounted (this);
  465. return Graphics_NeedParameterUpdate (handle, group, source);
  466. }
  467. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  468. internal static extern bool Graphics_HasShaderParameter (IntPtr handle, int param);
  469. /// <summary>
  470. /// Check whether a shader parameter exists on the currently set shaders.
  471. /// </summary>
  472. public bool HasShaderParameter (StringHash param)
  473. {
  474. Runtime.ValidateRefCounted (this);
  475. return Graphics_HasShaderParameter (handle, param.Code);
  476. }
  477. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  478. internal static extern bool Graphics_HasTextureUnit (IntPtr handle, TextureUnit unit);
  479. /// <summary>
  480. /// Check whether the current vertex or pixel shader uses a texture unit.
  481. /// </summary>
  482. public bool HasTextureUnit (TextureUnit unit)
  483. {
  484. Runtime.ValidateRefCounted (this);
  485. return Graphics_HasTextureUnit (handle, unit);
  486. }
  487. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  488. internal static extern void Graphics_ClearParameterSource (IntPtr handle, ShaderParameterGroup group);
  489. /// <summary>
  490. /// Clear remembered shader parameter source group.
  491. /// </summary>
  492. public void ClearParameterSource (ShaderParameterGroup group)
  493. {
  494. Runtime.ValidateRefCounted (this);
  495. Graphics_ClearParameterSource (handle, group);
  496. }
  497. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  498. internal static extern void Graphics_ClearParameterSources (IntPtr handle);
  499. /// <summary>
  500. /// Clear remembered shader parameter sources.
  501. /// </summary>
  502. public void ClearParameterSources ()
  503. {
  504. Runtime.ValidateRefCounted (this);
  505. Graphics_ClearParameterSources (handle);
  506. }
  507. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  508. internal static extern void Graphics_ClearTransformSources (IntPtr handle);
  509. /// <summary>
  510. /// Clear remembered transform shader parameter sources.
  511. /// </summary>
  512. public void ClearTransformSources ()
  513. {
  514. Runtime.ValidateRefCounted (this);
  515. Graphics_ClearTransformSources (handle);
  516. }
  517. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  518. internal static extern void Graphics_SetTexture (IntPtr handle, uint index, IntPtr texture);
  519. /// <summary>
  520. /// Set texture.
  521. /// </summary>
  522. public void SetTexture (uint index, Texture texture)
  523. {
  524. Runtime.ValidateRefCounted (this);
  525. Graphics_SetTexture (handle, index, (object)texture == null ? IntPtr.Zero : texture.Handle);
  526. }
  527. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  528. internal static extern void Graphics_SetTextureParametersDirty (IntPtr handle);
  529. /// <summary>
  530. /// Dirty texture parameters of all textures (when global settings change.)
  531. /// </summary>
  532. public void SetTextureParametersDirty ()
  533. {
  534. Runtime.ValidateRefCounted (this);
  535. Graphics_SetTextureParametersDirty (handle);
  536. }
  537. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  538. internal static extern void Graphics_SetDefaultTextureFilterMode (IntPtr handle, TextureFilterMode mode);
  539. /// <summary>
  540. /// Set default texture filtering mode. Called by Renderer before rendering.
  541. /// </summary>
  542. private void SetDefaultTextureFilterMode (TextureFilterMode mode)
  543. {
  544. Runtime.ValidateRefCounted (this);
  545. Graphics_SetDefaultTextureFilterMode (handle, mode);
  546. }
  547. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  548. internal static extern void Graphics_SetDefaultTextureAnisotropy (IntPtr handle, uint level);
  549. /// <summary>
  550. /// Set default texture anisotropy level. Called by Renderer before rendering.
  551. /// </summary>
  552. private void SetDefaultTextureAnisotropy (uint level)
  553. {
  554. Runtime.ValidateRefCounted (this);
  555. Graphics_SetDefaultTextureAnisotropy (handle, level);
  556. }
  557. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  558. internal static extern void Graphics_ResetRenderTargets (IntPtr handle);
  559. /// <summary>
  560. /// Reset all rendertargets, depth-stencil surface and viewport.
  561. /// </summary>
  562. public void ResetRenderTargets ()
  563. {
  564. Runtime.ValidateRefCounted (this);
  565. Graphics_ResetRenderTargets (handle);
  566. }
  567. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  568. internal static extern void Graphics_ResetRenderTarget (IntPtr handle, uint index);
  569. /// <summary>
  570. /// Reset specific rendertarget.
  571. /// </summary>
  572. public void ResetRenderTarget (uint index)
  573. {
  574. Runtime.ValidateRefCounted (this);
  575. Graphics_ResetRenderTarget (handle, index);
  576. }
  577. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  578. internal static extern void Graphics_ResetDepthStencil (IntPtr handle);
  579. /// <summary>
  580. /// Reset depth-stencil surface.
  581. /// </summary>
  582. public void ResetDepthStencil ()
  583. {
  584. Runtime.ValidateRefCounted (this);
  585. Graphics_ResetDepthStencil (handle);
  586. }
  587. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  588. internal static extern void Graphics_SetRenderTarget (IntPtr handle, uint index, IntPtr renderTarget);
  589. /// <summary>
  590. /// Set rendertarget.
  591. /// </summary>
  592. public void SetRenderTarget (uint index, RenderSurface renderTarget)
  593. {
  594. Runtime.ValidateRefCounted (this);
  595. Graphics_SetRenderTarget (handle, index, (object)renderTarget == null ? IntPtr.Zero : renderTarget.Handle);
  596. }
  597. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  598. internal static extern void Graphics_SetRenderTarget16 (IntPtr handle, uint index, IntPtr texture);
  599. /// <summary>
  600. /// Set rendertarget.
  601. /// </summary>
  602. public void SetRenderTarget (uint index, Texture2D texture)
  603. {
  604. Runtime.ValidateRefCounted (this);
  605. Graphics_SetRenderTarget16 (handle, index, (object)texture == null ? IntPtr.Zero : texture.Handle);
  606. }
  607. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  608. internal static extern void Graphics_SetDepthStencil (IntPtr handle, IntPtr depthStencil);
  609. /// <summary>
  610. /// Set depth-stencil surface.
  611. /// </summary>
  612. private void SetDepthStencil (RenderSurface depthStencil)
  613. {
  614. Runtime.ValidateRefCounted (this);
  615. Graphics_SetDepthStencil (handle, (object)depthStencil == null ? IntPtr.Zero : depthStencil.Handle);
  616. }
  617. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  618. internal static extern void Graphics_SetDepthStencil17 (IntPtr handle, IntPtr texture);
  619. /// <summary>
  620. /// Set depth-stencil surface.
  621. /// </summary>
  622. public void SetDepthStencil (Texture2D texture)
  623. {
  624. Runtime.ValidateRefCounted (this);
  625. Graphics_SetDepthStencil17 (handle, (object)texture == null ? IntPtr.Zero : texture.Handle);
  626. }
  627. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  628. internal static extern void Graphics_SetViewport (IntPtr handle, ref Urho.IntRect rect);
  629. /// <summary>
  630. /// Set viewport.
  631. /// </summary>
  632. public void SetViewport (Urho.IntRect rect)
  633. {
  634. Runtime.ValidateRefCounted (this);
  635. Graphics_SetViewport (handle, ref rect);
  636. }
  637. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  638. internal static extern void Graphics_SetBlendMode (IntPtr handle, BlendMode mode, bool alphaToCoverage);
  639. /// <summary>
  640. /// Set blending and alpha-to-coverage modes. Alpha-to-coverage is not supported on Direct3D9.
  641. /// </summary>
  642. public void SetBlendMode (BlendMode mode, bool alphaToCoverage = false)
  643. {
  644. Runtime.ValidateRefCounted (this);
  645. Graphics_SetBlendMode (handle, mode, alphaToCoverage);
  646. }
  647. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  648. internal static extern void Graphics_SetColorWrite (IntPtr handle, bool enable);
  649. /// <summary>
  650. /// Set color write on/off.
  651. /// </summary>
  652. private void SetColorWrite (bool enable)
  653. {
  654. Runtime.ValidateRefCounted (this);
  655. Graphics_SetColorWrite (handle, enable);
  656. }
  657. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  658. internal static extern void Graphics_SetCullMode (IntPtr handle, CullMode mode);
  659. /// <summary>
  660. /// Set hardware culling mode.
  661. /// </summary>
  662. private void SetCullMode (CullMode mode)
  663. {
  664. Runtime.ValidateRefCounted (this);
  665. Graphics_SetCullMode (handle, mode);
  666. }
  667. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  668. internal static extern void Graphics_SetDepthBias (IntPtr handle, float constantBias, float slopeScaledBias);
  669. /// <summary>
  670. /// Set depth bias.
  671. /// </summary>
  672. public void SetDepthBias (float constantBias, float slopeScaledBias)
  673. {
  674. Runtime.ValidateRefCounted (this);
  675. Graphics_SetDepthBias (handle, constantBias, slopeScaledBias);
  676. }
  677. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  678. internal static extern void Graphics_SetDepthTest (IntPtr handle, CompareMode mode);
  679. /// <summary>
  680. /// Set depth compare.
  681. /// </summary>
  682. private void SetDepthTest (CompareMode mode)
  683. {
  684. Runtime.ValidateRefCounted (this);
  685. Graphics_SetDepthTest (handle, mode);
  686. }
  687. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  688. internal static extern void Graphics_SetDepthWrite (IntPtr handle, bool enable);
  689. /// <summary>
  690. /// Set depth write on/off.
  691. /// </summary>
  692. private void SetDepthWrite (bool enable)
  693. {
  694. Runtime.ValidateRefCounted (this);
  695. Graphics_SetDepthWrite (handle, enable);
  696. }
  697. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  698. internal static extern void Graphics_SetFillMode (IntPtr handle, FillMode mode);
  699. /// <summary>
  700. /// Set polygon fill mode.
  701. /// </summary>
  702. private void SetFillMode (FillMode mode)
  703. {
  704. Runtime.ValidateRefCounted (this);
  705. Graphics_SetFillMode (handle, mode);
  706. }
  707. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  708. internal static extern void Graphics_SetStereo (IntPtr handle, bool stereo);
  709. /// <summary>
  710. /// Set stereo mode
  711. /// </summary>
  712. public void SetStereo (bool stereo)
  713. {
  714. Runtime.ValidateRefCounted (this);
  715. Graphics_SetStereo (handle, stereo);
  716. }
  717. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  718. internal static extern void Graphics_SetLineAntiAlias (IntPtr handle, bool enable);
  719. /// <summary>
  720. /// Set line antialiasing on/off.
  721. /// </summary>
  722. private void SetLineAntiAlias (bool enable)
  723. {
  724. Runtime.ValidateRefCounted (this);
  725. Graphics_SetLineAntiAlias (handle, enable);
  726. }
  727. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  728. internal static extern void Graphics_SetScissorTest (IntPtr handle, bool enable, ref Urho.IntRect rect);
  729. /// <summary>
  730. /// Set scissor test.
  731. /// </summary>
  732. public void SetScissorTest (bool enable, Urho.IntRect rect)
  733. {
  734. Runtime.ValidateRefCounted (this);
  735. Graphics_SetScissorTest (handle, enable, ref rect);
  736. }
  737. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  738. internal static extern void Graphics_SetStencilTest (IntPtr handle, bool enable, CompareMode mode, StencilOp pass, StencilOp fail, StencilOp zFail, uint stencilRef, uint compareMask, uint writeMask);
  739. /// <summary>
  740. /// Set stencil test.
  741. /// </summary>
  742. public void SetStencilTest (bool enable, CompareMode mode = CompareMode.Always, StencilOp pass = StencilOp.Keep, StencilOp fail = StencilOp.Keep, StencilOp zFail = StencilOp.Keep, uint stencilRef = 0, uint compareMask = uint.MaxValue, uint writeMask = uint.MaxValue)
  743. {
  744. Runtime.ValidateRefCounted (this);
  745. Graphics_SetStencilTest (handle, enable, mode, pass, fail, zFail, stencilRef, compareMask, writeMask);
  746. }
  747. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  748. internal static extern void Graphics_SetClipPlane (IntPtr handle, bool enable, ref Urho.Plane clipPlane, ref Urho.Matrix3x4 view, ref Urho.Matrix4 projection);
  749. /// <summary>
  750. /// Set a custom clipping plane. The plane is specified in world space, but is dependent on the view and projection matrices.
  751. /// </summary>
  752. public void SetClipPlane (bool enable, Urho.Plane clipPlane, Urho.Matrix3x4 view, Urho.Matrix4 projection)
  753. {
  754. Runtime.ValidateRefCounted (this);
  755. Graphics_SetClipPlane (handle, enable, ref clipPlane, ref view, ref projection);
  756. }
  757. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  758. internal static extern void Graphics_BeginDumpShaders (IntPtr handle, string fileName);
  759. /// <summary>
  760. /// Begin dumping shader variation names to an XML file for precaching.
  761. /// </summary>
  762. public void BeginDumpShaders (string fileName)
  763. {
  764. Runtime.ValidateRefCounted (this);
  765. Graphics_BeginDumpShaders (handle, fileName);
  766. }
  767. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  768. internal static extern void Graphics_EndDumpShaders (IntPtr handle);
  769. /// <summary>
  770. /// End dumping shader variations names.
  771. /// </summary>
  772. public void EndDumpShaders ()
  773. {
  774. Runtime.ValidateRefCounted (this);
  775. Graphics_EndDumpShaders (handle);
  776. }
  777. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  778. internal static extern void Graphics_PrecacheShaders_File (IntPtr handle, IntPtr source);
  779. /// <summary>
  780. /// Precache shader variations from an XML file generated with BeginDumpShaders().
  781. /// </summary>
  782. public void PrecacheShaders (File source)
  783. {
  784. Runtime.ValidateRefCounted (this);
  785. Graphics_PrecacheShaders_File (handle, (object)source == null ? IntPtr.Zero : source.Handle);
  786. }
  787. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  788. internal static extern void Graphics_PrecacheShaders_MemoryBuffer (IntPtr handle, IntPtr source);
  789. /// <summary>
  790. /// Precache shader variations from an XML file generated with BeginDumpShaders().
  791. /// </summary>
  792. public void PrecacheShaders (MemoryBuffer source)
  793. {
  794. Runtime.ValidateRefCounted (this);
  795. Graphics_PrecacheShaders_MemoryBuffer (handle, (object)source == null ? IntPtr.Zero : source.Handle);
  796. }
  797. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  798. internal static extern void Graphics_SetShaderCacheDir (IntPtr handle, string path);
  799. /// <summary>
  800. /// Set shader cache directory, Direct3D only. This can either be an absolute path or a path within the resource system.
  801. /// </summary>
  802. private void SetShaderCacheDir (string path)
  803. {
  804. Runtime.ValidateRefCounted (this);
  805. Graphics_SetShaderCacheDir (handle, path);
  806. }
  807. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  808. internal static extern bool Graphics_IsInitialized (IntPtr handle);
  809. /// <summary>
  810. /// Return whether rendering initialized.
  811. /// </summary>
  812. private bool IsInitialized ()
  813. {
  814. Runtime.ValidateRefCounted (this);
  815. return Graphics_IsInitialized (handle);
  816. }
  817. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  818. internal static extern GraphicsImpl* Graphics_GetImpl (IntPtr handle);
  819. /// <summary>
  820. /// Return graphics implementation, which holds the actual API-specific resources.
  821. /// </summary>
  822. private GraphicsImpl* GetImpl ()
  823. {
  824. Runtime.ValidateRefCounted (this);
  825. return Graphics_GetImpl (handle);
  826. }
  827. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  828. internal static extern IntPtr Graphics_GetExternalWindow (IntPtr handle);
  829. /// <summary>
  830. /// Return OS-specific external window handle. Null if not in use.
  831. /// </summary>
  832. private IntPtr GetExternalWindow ()
  833. {
  834. Runtime.ValidateRefCounted (this);
  835. return Graphics_GetExternalWindow (handle);
  836. }
  837. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  838. internal static extern IntPtr Graphics_GetWindowTitle (IntPtr handle);
  839. /// <summary>
  840. /// Return window title.
  841. /// </summary>
  842. private string GetWindowTitle ()
  843. {
  844. Runtime.ValidateRefCounted (this);
  845. return Marshal.PtrToStringAnsi (Graphics_GetWindowTitle (handle));
  846. }
  847. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  848. internal static extern IntPtr Graphics_GetApiName (IntPtr handle);
  849. /// <summary>
  850. /// Return graphics API name.
  851. /// </summary>
  852. private string GetApiName ()
  853. {
  854. Runtime.ValidateRefCounted (this);
  855. return Marshal.PtrToStringAnsi (Graphics_GetApiName (handle));
  856. }
  857. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  858. internal static extern Urho.IntVector2 Graphics_GetWindowPosition (IntPtr handle);
  859. /// <summary>
  860. /// Return window position.
  861. /// </summary>
  862. private Urho.IntVector2 GetWindowPosition ()
  863. {
  864. Runtime.ValidateRefCounted (this);
  865. return Graphics_GetWindowPosition (handle);
  866. }
  867. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  868. internal static extern int Graphics_GetWidth (IntPtr handle);
  869. /// <summary>
  870. /// Return window width in pixels.
  871. /// </summary>
  872. private int GetWidth ()
  873. {
  874. Runtime.ValidateRefCounted (this);
  875. return Graphics_GetWidth (handle);
  876. }
  877. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  878. internal static extern int Graphics_GetHeight (IntPtr handle);
  879. /// <summary>
  880. /// Return window height in pixels.
  881. /// </summary>
  882. private int GetHeight ()
  883. {
  884. Runtime.ValidateRefCounted (this);
  885. return Graphics_GetHeight (handle);
  886. }
  887. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  888. internal static extern int Graphics_GetMultiSample (IntPtr handle);
  889. /// <summary>
  890. /// Return multisample mode (1 = no multisampling.)
  891. /// </summary>
  892. private int GetMultiSample ()
  893. {
  894. Runtime.ValidateRefCounted (this);
  895. return Graphics_GetMultiSample (handle);
  896. }
  897. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  898. internal static extern Urho.IntVector2 Graphics_GetSize (IntPtr handle);
  899. /// <summary>
  900. /// Return window size in pixels.
  901. /// </summary>
  902. private Urho.IntVector2 GetSize ()
  903. {
  904. Runtime.ValidateRefCounted (this);
  905. return Graphics_GetSize (handle);
  906. }
  907. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  908. internal static extern bool Graphics_GetFullscreen (IntPtr handle);
  909. /// <summary>
  910. /// Return whether window is fullscreen.
  911. /// </summary>
  912. private bool GetFullscreen ()
  913. {
  914. Runtime.ValidateRefCounted (this);
  915. return Graphics_GetFullscreen (handle);
  916. }
  917. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  918. internal static extern bool Graphics_GetBorderless (IntPtr handle);
  919. /// <summary>
  920. /// Return whether window is borderless.
  921. /// </summary>
  922. private bool GetBorderless ()
  923. {
  924. Runtime.ValidateRefCounted (this);
  925. return Graphics_GetBorderless (handle);
  926. }
  927. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  928. internal static extern bool Graphics_GetResizable (IntPtr handle);
  929. /// <summary>
  930. /// Return whether window is resizable.
  931. /// </summary>
  932. private bool GetResizable ()
  933. {
  934. Runtime.ValidateRefCounted (this);
  935. return Graphics_GetResizable (handle);
  936. }
  937. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  938. internal static extern bool Graphics_GetHighDPI (IntPtr handle);
  939. /// <summary>
  940. /// Return whether window is high DPI.
  941. /// </summary>
  942. private bool GetHighDPI ()
  943. {
  944. Runtime.ValidateRefCounted (this);
  945. return Graphics_GetHighDPI (handle);
  946. }
  947. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  948. internal static extern bool Graphics_GetVSync (IntPtr handle);
  949. /// <summary>
  950. /// Return whether vertical sync is on.
  951. /// </summary>
  952. private bool GetVSync ()
  953. {
  954. Runtime.ValidateRefCounted (this);
  955. return Graphics_GetVSync (handle);
  956. }
  957. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  958. internal static extern int Graphics_GetRefreshRate (IntPtr handle);
  959. /// <summary>
  960. /// Return refresh rate when using vsync in fullscreen
  961. /// </summary>
  962. private int GetRefreshRate ()
  963. {
  964. Runtime.ValidateRefCounted (this);
  965. return Graphics_GetRefreshRate (handle);
  966. }
  967. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  968. internal static extern int Graphics_GetMonitor (IntPtr handle);
  969. /// <summary>
  970. /// Return the current monitor index. Effective on in fullscreen
  971. /// </summary>
  972. private int GetMonitor ()
  973. {
  974. Runtime.ValidateRefCounted (this);
  975. return Graphics_GetMonitor (handle);
  976. }
  977. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  978. internal static extern bool Graphics_GetTripleBuffer (IntPtr handle);
  979. /// <summary>
  980. /// Return whether triple buffering is enabled.
  981. /// </summary>
  982. private bool GetTripleBuffer ()
  983. {
  984. Runtime.ValidateRefCounted (this);
  985. return Graphics_GetTripleBuffer (handle);
  986. }
  987. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  988. internal static extern bool Graphics_GetSRGB (IntPtr handle);
  989. /// <summary>
  990. /// Return whether the main window is using sRGB conversion on write.
  991. /// </summary>
  992. private bool GetSRGB ()
  993. {
  994. Runtime.ValidateRefCounted (this);
  995. return Graphics_GetSRGB (handle);
  996. }
  997. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  998. internal static extern bool Graphics_GetDither (IntPtr handle);
  999. /// <summary>
  1000. /// Return whether rendering output is dithered.
  1001. /// </summary>
  1002. private bool GetDither ()
  1003. {
  1004. Runtime.ValidateRefCounted (this);
  1005. return Graphics_GetDither (handle);
  1006. }
  1007. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1008. internal static extern bool Graphics_GetFlushGPU (IntPtr handle);
  1009. /// <summary>
  1010. /// Return whether the GPU command buffer is flushed each frame.
  1011. /// </summary>
  1012. private bool GetFlushGPU ()
  1013. {
  1014. Runtime.ValidateRefCounted (this);
  1015. return Graphics_GetFlushGPU (handle);
  1016. }
  1017. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1018. internal static extern IntPtr Graphics_GetOrientations (IntPtr handle);
  1019. /// <summary>
  1020. /// Return allowed screen orientations.
  1021. /// </summary>
  1022. private string GetOrientations ()
  1023. {
  1024. Runtime.ValidateRefCounted (this);
  1025. return Marshal.PtrToStringAnsi (Graphics_GetOrientations (handle));
  1026. }
  1027. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1028. internal static extern bool Graphics_IsDeviceLost (IntPtr handle);
  1029. /// <summary>
  1030. /// Return whether graphics context is lost and can not render or load GPU resources.
  1031. /// </summary>
  1032. private bool IsDeviceLost ()
  1033. {
  1034. Runtime.ValidateRefCounted (this);
  1035. return Graphics_IsDeviceLost (handle);
  1036. }
  1037. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1038. internal static extern uint Graphics_GetNumPrimitives (IntPtr handle);
  1039. /// <summary>
  1040. /// Return number of primitives drawn this frame.
  1041. /// </summary>
  1042. private uint GetNumPrimitives ()
  1043. {
  1044. Runtime.ValidateRefCounted (this);
  1045. return Graphics_GetNumPrimitives (handle);
  1046. }
  1047. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1048. internal static extern uint Graphics_GetNumBatches (IntPtr handle);
  1049. /// <summary>
  1050. /// Return number of batches drawn this frame.
  1051. /// </summary>
  1052. private uint GetNumBatches ()
  1053. {
  1054. Runtime.ValidateRefCounted (this);
  1055. return Graphics_GetNumBatches (handle);
  1056. }
  1057. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1058. internal static extern uint Graphics_GetDummyColorFormat (IntPtr handle);
  1059. /// <summary>
  1060. /// Return dummy color texture format for shadow maps. Is "NULL" (consume no video memory) if supported.
  1061. /// </summary>
  1062. private uint GetDummyColorFormat ()
  1063. {
  1064. Runtime.ValidateRefCounted (this);
  1065. return Graphics_GetDummyColorFormat (handle);
  1066. }
  1067. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1068. internal static extern uint Graphics_GetShadowMapFormat (IntPtr handle);
  1069. /// <summary>
  1070. /// Return shadow map depth texture format, or 0 if not supported.
  1071. /// </summary>
  1072. private uint GetShadowMapFormat ()
  1073. {
  1074. Runtime.ValidateRefCounted (this);
  1075. return Graphics_GetShadowMapFormat (handle);
  1076. }
  1077. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1078. internal static extern uint Graphics_GetHiresShadowMapFormat (IntPtr handle);
  1079. /// <summary>
  1080. /// Return 24-bit shadow map depth texture format, or 0 if not supported.
  1081. /// </summary>
  1082. private uint GetHiresShadowMapFormat ()
  1083. {
  1084. Runtime.ValidateRefCounted (this);
  1085. return Graphics_GetHiresShadowMapFormat (handle);
  1086. }
  1087. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1088. internal static extern bool Graphics_GetInstancingSupport (IntPtr handle);
  1089. /// <summary>
  1090. /// Return whether hardware instancing is supported.
  1091. /// </summary>
  1092. private bool GetInstancingSupport ()
  1093. {
  1094. Runtime.ValidateRefCounted (this);
  1095. return Graphics_GetInstancingSupport (handle);
  1096. }
  1097. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1098. internal static extern bool Graphics_GetLightPrepassSupport (IntPtr handle);
  1099. /// <summary>
  1100. /// Return whether light pre-pass rendering is supported.
  1101. /// </summary>
  1102. private bool GetLightPrepassSupport ()
  1103. {
  1104. Runtime.ValidateRefCounted (this);
  1105. return Graphics_GetLightPrepassSupport (handle);
  1106. }
  1107. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1108. internal static extern bool Graphics_GetDeferredSupport (IntPtr handle);
  1109. /// <summary>
  1110. /// Return whether deferred rendering is supported.
  1111. /// </summary>
  1112. private bool GetDeferredSupport ()
  1113. {
  1114. Runtime.ValidateRefCounted (this);
  1115. return Graphics_GetDeferredSupport (handle);
  1116. }
  1117. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1118. internal static extern bool Graphics_GetHardwareShadowSupport (IntPtr handle);
  1119. /// <summary>
  1120. /// Return whether shadow map depth compare is done in hardware.
  1121. /// </summary>
  1122. private bool GetHardwareShadowSupport ()
  1123. {
  1124. Runtime.ValidateRefCounted (this);
  1125. return Graphics_GetHardwareShadowSupport (handle);
  1126. }
  1127. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1128. internal static extern bool Graphics_GetReadableDepthSupport (IntPtr handle);
  1129. /// <summary>
  1130. /// Return whether a readable hardware depth format is available.
  1131. /// </summary>
  1132. private bool GetReadableDepthSupport ()
  1133. {
  1134. Runtime.ValidateRefCounted (this);
  1135. return Graphics_GetReadableDepthSupport (handle);
  1136. }
  1137. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1138. internal static extern bool Graphics_GetSRGBSupport (IntPtr handle);
  1139. /// <summary>
  1140. /// Return whether sRGB conversion on texture sampling is supported.
  1141. /// </summary>
  1142. private bool GetSRGBSupport ()
  1143. {
  1144. Runtime.ValidateRefCounted (this);
  1145. return Graphics_GetSRGBSupport (handle);
  1146. }
  1147. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1148. internal static extern bool Graphics_GetSRGBWriteSupport (IntPtr handle);
  1149. /// <summary>
  1150. /// Return whether sRGB conversion on rendertarget writing is supported.
  1151. /// </summary>
  1152. private bool GetSRGBWriteSupport ()
  1153. {
  1154. Runtime.ValidateRefCounted (this);
  1155. return Graphics_GetSRGBWriteSupport (handle);
  1156. }
  1157. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1158. internal static extern Urho.IntVector2 Graphics_GetDesktopResolution (IntPtr handle, int monitor);
  1159. /// <summary>
  1160. /// Return the desktop resolution.
  1161. /// </summary>
  1162. public Urho.IntVector2 GetDesktopResolution (int monitor)
  1163. {
  1164. Runtime.ValidateRefCounted (this);
  1165. return Graphics_GetDesktopResolution (handle, monitor);
  1166. }
  1167. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1168. internal static extern int Graphics_GetMonitorCount (IntPtr handle);
  1169. /// <summary>
  1170. /// Return the number of currently connected monitors.
  1171. /// </summary>
  1172. private int GetMonitorCount ()
  1173. {
  1174. Runtime.ValidateRefCounted (this);
  1175. return Graphics_GetMonitorCount (handle);
  1176. }
  1177. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1178. internal static extern int Graphics_GetCurrentMonitor (IntPtr handle);
  1179. /// <summary>
  1180. /// Returns the index of the display containing the center of the window on success or a negative error code on failure.
  1181. /// </summary>
  1182. private int GetCurrentMonitor ()
  1183. {
  1184. Runtime.ValidateRefCounted (this);
  1185. return Graphics_GetCurrentMonitor (handle);
  1186. }
  1187. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1188. internal static extern bool Graphics_GetMaximized (IntPtr handle);
  1189. /// <summary>
  1190. /// Returns true if window is maximized or runs in full screen mode.
  1191. /// </summary>
  1192. private bool GetMaximized ()
  1193. {
  1194. Runtime.ValidateRefCounted (this);
  1195. return Graphics_GetMaximized (handle);
  1196. }
  1197. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1198. internal static extern Vector3 Graphics_GetDisplayDPI (IntPtr handle, int monitor);
  1199. /// <summary>
  1200. /// Return display dpi information: (hdpi, vdpi, ddpi). On failure returns zero vector.
  1201. /// </summary>
  1202. public Vector3 GetDisplayDPI (int monitor = 0)
  1203. {
  1204. Runtime.ValidateRefCounted (this);
  1205. return Graphics_GetDisplayDPI (handle, monitor);
  1206. }
  1207. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1208. internal static extern uint Graphics_GetFormat (IntPtr handle, CompressedFormat format);
  1209. /// <summary>
  1210. /// Return hardware format for a compressed image format, or 0 if unsupported.
  1211. /// </summary>
  1212. public uint GetFormat (CompressedFormat format)
  1213. {
  1214. Runtime.ValidateRefCounted (this);
  1215. return Graphics_GetFormat (handle, format);
  1216. }
  1217. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1218. internal static extern IntPtr Graphics_GetShader (IntPtr handle, ShaderType type, string name, string defines);
  1219. /// <summary>
  1220. /// Return a shader variation by name and defines.
  1221. /// </summary>
  1222. public ShaderVariation GetShader (ShaderType type, string name, string defines = "")
  1223. {
  1224. Runtime.ValidateRefCounted (this);
  1225. return Runtime.LookupRefCounted<ShaderVariation> (Graphics_GetShader (handle, type, name, defines));
  1226. }
  1227. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1228. internal static extern IntPtr Graphics_GetVertexBuffer (IntPtr handle, uint index);
  1229. /// <summary>
  1230. /// Return current vertex buffer by index.
  1231. /// </summary>
  1232. public VertexBuffer GetVertexBuffer (uint index)
  1233. {
  1234. Runtime.ValidateRefCounted (this);
  1235. return Runtime.LookupObject<VertexBuffer> (Graphics_GetVertexBuffer (handle, index));
  1236. }
  1237. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1238. internal static extern IntPtr Graphics_GetIndexBuffer (IntPtr handle);
  1239. /// <summary>
  1240. /// Return current index buffer.
  1241. /// </summary>
  1242. private IndexBuffer GetIndexBuffer ()
  1243. {
  1244. Runtime.ValidateRefCounted (this);
  1245. return Runtime.LookupObject<IndexBuffer> (Graphics_GetIndexBuffer (handle));
  1246. }
  1247. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1248. internal static extern IntPtr Graphics_GetVertexShader (IntPtr handle);
  1249. /// <summary>
  1250. /// Return current vertex shader.
  1251. /// </summary>
  1252. private ShaderVariation GetVertexShader ()
  1253. {
  1254. Runtime.ValidateRefCounted (this);
  1255. return Runtime.LookupRefCounted<ShaderVariation> (Graphics_GetVertexShader (handle));
  1256. }
  1257. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1258. internal static extern IntPtr Graphics_GetPixelShader (IntPtr handle);
  1259. /// <summary>
  1260. /// Return current pixel shader.
  1261. /// </summary>
  1262. private ShaderVariation GetPixelShader ()
  1263. {
  1264. Runtime.ValidateRefCounted (this);
  1265. return Runtime.LookupRefCounted<ShaderVariation> (Graphics_GetPixelShader (handle));
  1266. }
  1267. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1268. internal static extern TextureUnit Graphics_GetTextureUnit (IntPtr handle, string name);
  1269. /// <summary>
  1270. /// Return texture unit index by name.
  1271. /// </summary>
  1272. public TextureUnit GetTextureUnit (string name)
  1273. {
  1274. Runtime.ValidateRefCounted (this);
  1275. return Graphics_GetTextureUnit (handle, name);
  1276. }
  1277. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1278. internal static extern IntPtr Graphics_GetTextureUnitName (IntPtr handle, TextureUnit unit);
  1279. /// <summary>
  1280. /// Return texture unit name by index.
  1281. /// </summary>
  1282. public string GetTextureUnitName (TextureUnit unit)
  1283. {
  1284. Runtime.ValidateRefCounted (this);
  1285. return Marshal.PtrToStringAnsi (Graphics_GetTextureUnitName (handle, unit));
  1286. }
  1287. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1288. internal static extern IntPtr Graphics_GetTexture (IntPtr handle, uint index);
  1289. /// <summary>
  1290. /// Return current texture by texture unit index.
  1291. /// </summary>
  1292. public Texture GetTexture (uint index)
  1293. {
  1294. Runtime.ValidateRefCounted (this);
  1295. return Runtime.LookupObject<Texture> (Graphics_GetTexture (handle, index));
  1296. }
  1297. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1298. internal static extern TextureFilterMode Graphics_GetDefaultTextureFilterMode (IntPtr handle);
  1299. /// <summary>
  1300. /// Return default texture filtering mode.
  1301. /// </summary>
  1302. private TextureFilterMode GetDefaultTextureFilterMode ()
  1303. {
  1304. Runtime.ValidateRefCounted (this);
  1305. return Graphics_GetDefaultTextureFilterMode (handle);
  1306. }
  1307. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1308. internal static extern uint Graphics_GetDefaultTextureAnisotropy (IntPtr handle);
  1309. /// <summary>
  1310. /// Return default texture max. anisotropy level.
  1311. /// </summary>
  1312. private uint GetDefaultTextureAnisotropy ()
  1313. {
  1314. Runtime.ValidateRefCounted (this);
  1315. return Graphics_GetDefaultTextureAnisotropy (handle);
  1316. }
  1317. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1318. internal static extern IntPtr Graphics_GetRenderTarget (IntPtr handle, uint index);
  1319. /// <summary>
  1320. /// Return current rendertarget by index.
  1321. /// </summary>
  1322. public RenderSurface GetRenderTarget (uint index)
  1323. {
  1324. Runtime.ValidateRefCounted (this);
  1325. return Runtime.LookupRefCounted<RenderSurface> (Graphics_GetRenderTarget (handle, index));
  1326. }
  1327. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1328. internal static extern IntPtr Graphics_GetDepthStencil (IntPtr handle);
  1329. /// <summary>
  1330. /// Return current depth-stencil surface.
  1331. /// </summary>
  1332. private RenderSurface GetDepthStencil ()
  1333. {
  1334. Runtime.ValidateRefCounted (this);
  1335. return Runtime.LookupRefCounted<RenderSurface> (Graphics_GetDepthStencil (handle));
  1336. }
  1337. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1338. internal static extern IntRect Graphics_GetViewport (IntPtr handle);
  1339. /// <summary>
  1340. /// Return the viewport coordinates.
  1341. /// </summary>
  1342. private IntRect GetViewport ()
  1343. {
  1344. Runtime.ValidateRefCounted (this);
  1345. return Graphics_GetViewport (handle);
  1346. }
  1347. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1348. internal static extern BlendMode Graphics_GetBlendMode (IntPtr handle);
  1349. /// <summary>
  1350. /// Return blending mode.
  1351. /// </summary>
  1352. private BlendMode GetBlendMode ()
  1353. {
  1354. Runtime.ValidateRefCounted (this);
  1355. return Graphics_GetBlendMode (handle);
  1356. }
  1357. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1358. internal static extern bool Graphics_GetAlphaToCoverage (IntPtr handle);
  1359. /// <summary>
  1360. /// Return whether alpha-to-coverage is enabled.
  1361. /// </summary>
  1362. private bool GetAlphaToCoverage ()
  1363. {
  1364. Runtime.ValidateRefCounted (this);
  1365. return Graphics_GetAlphaToCoverage (handle);
  1366. }
  1367. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1368. internal static extern bool Graphics_GetColorWrite (IntPtr handle);
  1369. /// <summary>
  1370. /// Return whether color write is enabled.
  1371. /// </summary>
  1372. private bool GetColorWrite ()
  1373. {
  1374. Runtime.ValidateRefCounted (this);
  1375. return Graphics_GetColorWrite (handle);
  1376. }
  1377. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1378. internal static extern CullMode Graphics_GetCullMode (IntPtr handle);
  1379. /// <summary>
  1380. /// Return hardware culling mode.
  1381. /// </summary>
  1382. private CullMode GetCullMode ()
  1383. {
  1384. Runtime.ValidateRefCounted (this);
  1385. return Graphics_GetCullMode (handle);
  1386. }
  1387. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1388. internal static extern float Graphics_GetDepthConstantBias (IntPtr handle);
  1389. /// <summary>
  1390. /// Return depth constant bias.
  1391. /// </summary>
  1392. private float GetDepthConstantBias ()
  1393. {
  1394. Runtime.ValidateRefCounted (this);
  1395. return Graphics_GetDepthConstantBias (handle);
  1396. }
  1397. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1398. internal static extern float Graphics_GetDepthSlopeScaledBias (IntPtr handle);
  1399. /// <summary>
  1400. /// Return depth slope scaled bias.
  1401. /// </summary>
  1402. private float GetDepthSlopeScaledBias ()
  1403. {
  1404. Runtime.ValidateRefCounted (this);
  1405. return Graphics_GetDepthSlopeScaledBias (handle);
  1406. }
  1407. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1408. internal static extern CompareMode Graphics_GetDepthTest (IntPtr handle);
  1409. /// <summary>
  1410. /// Return depth compare mode.
  1411. /// </summary>
  1412. private CompareMode GetDepthTest ()
  1413. {
  1414. Runtime.ValidateRefCounted (this);
  1415. return Graphics_GetDepthTest (handle);
  1416. }
  1417. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1418. internal static extern bool Graphics_GetDepthWrite (IntPtr handle);
  1419. /// <summary>
  1420. /// Return whether depth write is enabled.
  1421. /// </summary>
  1422. private bool GetDepthWrite ()
  1423. {
  1424. Runtime.ValidateRefCounted (this);
  1425. return Graphics_GetDepthWrite (handle);
  1426. }
  1427. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1428. internal static extern FillMode Graphics_GetFillMode (IntPtr handle);
  1429. /// <summary>
  1430. /// Return polygon fill mode.
  1431. /// </summary>
  1432. private FillMode GetFillMode ()
  1433. {
  1434. Runtime.ValidateRefCounted (this);
  1435. return Graphics_GetFillMode (handle);
  1436. }
  1437. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1438. internal static extern bool Graphics_GetLineAntiAlias (IntPtr handle);
  1439. /// <summary>
  1440. /// Return whether line antialiasing is enabled.
  1441. /// </summary>
  1442. private bool GetLineAntiAlias ()
  1443. {
  1444. Runtime.ValidateRefCounted (this);
  1445. return Graphics_GetLineAntiAlias (handle);
  1446. }
  1447. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1448. internal static extern bool Graphics_GetStencilTest (IntPtr handle);
  1449. /// <summary>
  1450. /// Return whether stencil test is enabled.
  1451. /// </summary>
  1452. private bool GetStencilTest ()
  1453. {
  1454. Runtime.ValidateRefCounted (this);
  1455. return Graphics_GetStencilTest (handle);
  1456. }
  1457. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1458. internal static extern bool Graphics_GetScissorTest (IntPtr handle);
  1459. /// <summary>
  1460. /// Return whether scissor test is enabled.
  1461. /// </summary>
  1462. private bool GetScissorTest ()
  1463. {
  1464. Runtime.ValidateRefCounted (this);
  1465. return Graphics_GetScissorTest (handle);
  1466. }
  1467. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1468. internal static extern Urho.IntRect Graphics_GetScissorRect (IntPtr handle);
  1469. /// <summary>
  1470. /// Return scissor rectangle coordinates.
  1471. /// </summary>
  1472. private Urho.IntRect GetScissorRect ()
  1473. {
  1474. Runtime.ValidateRefCounted (this);
  1475. return Graphics_GetScissorRect (handle);
  1476. }
  1477. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1478. internal static extern CompareMode Graphics_GetStencilTestMode (IntPtr handle);
  1479. /// <summary>
  1480. /// Return stencil compare mode.
  1481. /// </summary>
  1482. private CompareMode GetStencilTestMode ()
  1483. {
  1484. Runtime.ValidateRefCounted (this);
  1485. return Graphics_GetStencilTestMode (handle);
  1486. }
  1487. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1488. internal static extern StencilOp Graphics_GetStencilPass (IntPtr handle);
  1489. /// <summary>
  1490. /// Return stencil operation to do if stencil test passes.
  1491. /// </summary>
  1492. private StencilOp GetStencilPass ()
  1493. {
  1494. Runtime.ValidateRefCounted (this);
  1495. return Graphics_GetStencilPass (handle);
  1496. }
  1497. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1498. internal static extern StencilOp Graphics_GetStencilFail (IntPtr handle);
  1499. /// <summary>
  1500. /// Return stencil operation to do if stencil test fails.
  1501. /// </summary>
  1502. private StencilOp GetStencilFail ()
  1503. {
  1504. Runtime.ValidateRefCounted (this);
  1505. return Graphics_GetStencilFail (handle);
  1506. }
  1507. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1508. internal static extern StencilOp Graphics_GetStencilZFail (IntPtr handle);
  1509. /// <summary>
  1510. /// Return stencil operation to do if depth compare fails.
  1511. /// </summary>
  1512. private StencilOp GetStencilZFail ()
  1513. {
  1514. Runtime.ValidateRefCounted (this);
  1515. return Graphics_GetStencilZFail (handle);
  1516. }
  1517. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1518. internal static extern uint Graphics_GetStencilRef (IntPtr handle);
  1519. /// <summary>
  1520. /// Return stencil reference value.
  1521. /// </summary>
  1522. private uint GetStencilRef ()
  1523. {
  1524. Runtime.ValidateRefCounted (this);
  1525. return Graphics_GetStencilRef (handle);
  1526. }
  1527. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1528. internal static extern uint Graphics_GetStencilCompareMask (IntPtr handle);
  1529. /// <summary>
  1530. /// Return stencil compare bitmask.
  1531. /// </summary>
  1532. private uint GetStencilCompareMask ()
  1533. {
  1534. Runtime.ValidateRefCounted (this);
  1535. return Graphics_GetStencilCompareMask (handle);
  1536. }
  1537. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1538. internal static extern uint Graphics_GetStencilWriteMask (IntPtr handle);
  1539. /// <summary>
  1540. /// Return stencil write bitmask.
  1541. /// </summary>
  1542. private uint GetStencilWriteMask ()
  1543. {
  1544. Runtime.ValidateRefCounted (this);
  1545. return Graphics_GetStencilWriteMask (handle);
  1546. }
  1547. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1548. internal static extern bool Graphics_GetUseClipPlane (IntPtr handle);
  1549. /// <summary>
  1550. /// Return whether a custom clipping plane is in use.
  1551. /// </summary>
  1552. private bool GetUseClipPlane ()
  1553. {
  1554. Runtime.ValidateRefCounted (this);
  1555. return Graphics_GetUseClipPlane (handle);
  1556. }
  1557. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1558. internal static extern IntPtr Graphics_GetShaderCacheDir (IntPtr handle);
  1559. /// <summary>
  1560. /// Return shader cache directory, Direct3D only.
  1561. /// </summary>
  1562. private string GetShaderCacheDir ()
  1563. {
  1564. Runtime.ValidateRefCounted (this);
  1565. return Marshal.PtrToStringAnsi (Graphics_GetShaderCacheDir (handle));
  1566. }
  1567. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1568. internal static extern Urho.IntVector2 Graphics_GetRenderTargetDimensions (IntPtr handle);
  1569. /// <summary>
  1570. /// Return current rendertarget width and height.
  1571. /// </summary>
  1572. private Urho.IntVector2 GetRenderTargetDimensions ()
  1573. {
  1574. Runtime.ValidateRefCounted (this);
  1575. return Graphics_GetRenderTargetDimensions (handle);
  1576. }
  1577. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1578. internal static extern void Graphics_OnWindowResized (IntPtr handle);
  1579. /// <summary>
  1580. /// Window was resized through user interaction. Called by Input subsystem.
  1581. /// </summary>
  1582. public void OnWindowResized ()
  1583. {
  1584. Runtime.ValidateRefCounted (this);
  1585. Graphics_OnWindowResized (handle);
  1586. }
  1587. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1588. internal static extern void Graphics_OnWindowMoved (IntPtr handle);
  1589. /// <summary>
  1590. /// Window was moved through user interaction. Called by Input subsystem.
  1591. /// </summary>
  1592. public void OnWindowMoved ()
  1593. {
  1594. Runtime.ValidateRefCounted (this);
  1595. Graphics_OnWindowMoved (handle);
  1596. }
  1597. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1598. internal static extern void Graphics_Maximize (IntPtr handle);
  1599. /// <summary>
  1600. /// Maximize the window.
  1601. /// </summary>
  1602. public void Maximize ()
  1603. {
  1604. Runtime.ValidateRefCounted (this);
  1605. Graphics_Maximize (handle);
  1606. }
  1607. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1608. internal static extern void Graphics_Minimize (IntPtr handle);
  1609. /// <summary>
  1610. /// Minimize the window.
  1611. /// </summary>
  1612. public void Minimize ()
  1613. {
  1614. Runtime.ValidateRefCounted (this);
  1615. Graphics_Minimize (handle);
  1616. }
  1617. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1618. internal static extern void Graphics_Raise (IntPtr handle);
  1619. /// <summary>
  1620. /// Raises window if it was minimized.
  1621. /// </summary>
  1622. public void Raise ()
  1623. {
  1624. Runtime.ValidateRefCounted (this);
  1625. Graphics_Raise (handle);
  1626. }
  1627. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1628. internal static extern void Graphics_AddGPUObject (IntPtr handle, IntPtr @object);
  1629. /// <summary>
  1630. /// Add a GPU object to keep track of. Called by GPUObject.
  1631. /// </summary>
  1632. public void AddGPUObject (IntPtr @object)
  1633. {
  1634. Runtime.ValidateRefCounted (this);
  1635. Graphics_AddGPUObject (handle, @object);
  1636. }
  1637. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1638. internal static extern void Graphics_RemoveGPUObject (IntPtr handle, IntPtr @object);
  1639. /// <summary>
  1640. /// Remove a GPU object. Called by GPUObject.
  1641. /// </summary>
  1642. public void RemoveGPUObject (IntPtr @object)
  1643. {
  1644. Runtime.ValidateRefCounted (this);
  1645. Graphics_RemoveGPUObject (handle, @object);
  1646. }
  1647. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1648. internal static extern IntPtr Graphics_ReserveScratchBuffer (IntPtr handle, uint size);
  1649. /// <summary>
  1650. /// Reserve a CPU-side scratch buffer.
  1651. /// </summary>
  1652. public IntPtr ReserveScratchBuffer (uint size)
  1653. {
  1654. Runtime.ValidateRefCounted (this);
  1655. return Graphics_ReserveScratchBuffer (handle, size);
  1656. }
  1657. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1658. internal static extern void Graphics_FreeScratchBuffer (IntPtr handle, IntPtr buffer);
  1659. /// <summary>
  1660. /// Free a CPU-side scratch buffer.
  1661. /// </summary>
  1662. public void FreeScratchBuffer (IntPtr buffer)
  1663. {
  1664. Runtime.ValidateRefCounted (this);
  1665. Graphics_FreeScratchBuffer (handle, buffer);
  1666. }
  1667. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1668. internal static extern void Graphics_CleanupScratchBuffers (IntPtr handle);
  1669. /// <summary>
  1670. /// Clean up too large scratch buffers.
  1671. /// </summary>
  1672. public void CleanupScratchBuffers ()
  1673. {
  1674. Runtime.ValidateRefCounted (this);
  1675. Graphics_CleanupScratchBuffers (handle);
  1676. }
  1677. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1678. internal static extern uint Graphics_GetAlphaFormat ();
  1679. /// <summary>
  1680. /// Return the API-specific alpha texture format.
  1681. /// </summary>
  1682. private static uint GetAlphaFormat ()
  1683. {
  1684. Runtime.Validate (typeof(Graphics));
  1685. return Graphics_GetAlphaFormat ();
  1686. }
  1687. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1688. internal static extern uint Graphics_GetLuminanceFormat ();
  1689. /// <summary>
  1690. /// Return the API-specific luminance texture format.
  1691. /// </summary>
  1692. private static uint GetLuminanceFormat ()
  1693. {
  1694. Runtime.Validate (typeof(Graphics));
  1695. return Graphics_GetLuminanceFormat ();
  1696. }
  1697. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1698. internal static extern uint Graphics_GetLuminanceAlphaFormat ();
  1699. /// <summary>
  1700. /// Return the API-specific luminance alpha texture format.
  1701. /// </summary>
  1702. private static uint GetLuminanceAlphaFormat ()
  1703. {
  1704. Runtime.Validate (typeof(Graphics));
  1705. return Graphics_GetLuminanceAlphaFormat ();
  1706. }
  1707. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1708. internal static extern uint Graphics_GetRGBFormat ();
  1709. /// <summary>
  1710. /// Return the API-specific RGB texture format.
  1711. /// </summary>
  1712. private static uint GetRGBFormat ()
  1713. {
  1714. Runtime.Validate (typeof(Graphics));
  1715. return Graphics_GetRGBFormat ();
  1716. }
  1717. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1718. internal static extern uint Graphics_GetRGBAFormat ();
  1719. /// <summary>
  1720. /// Return the API-specific RGBA texture format.
  1721. /// </summary>
  1722. private static uint GetRGBAFormat ()
  1723. {
  1724. Runtime.Validate (typeof(Graphics));
  1725. return Graphics_GetRGBAFormat ();
  1726. }
  1727. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1728. internal static extern uint Graphics_GetRGBA16Format ();
  1729. /// <summary>
  1730. /// Return the API-specific RGBA 16-bit texture format.
  1731. /// </summary>
  1732. private static uint GetRGBA16Format ()
  1733. {
  1734. Runtime.Validate (typeof(Graphics));
  1735. return Graphics_GetRGBA16Format ();
  1736. }
  1737. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1738. internal static extern uint Graphics_GetRGBAFloat16Format ();
  1739. /// <summary>
  1740. /// Return the API-specific RGBA 16-bit float texture format.
  1741. /// </summary>
  1742. private static uint GetRGBAFloat16Format ()
  1743. {
  1744. Runtime.Validate (typeof(Graphics));
  1745. return Graphics_GetRGBAFloat16Format ();
  1746. }
  1747. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1748. internal static extern uint Graphics_GetRGBAFloat32Format ();
  1749. /// <summary>
  1750. /// Return the API-specific RGBA 32-bit float texture format.
  1751. /// </summary>
  1752. private static uint GetRGBAFloat32Format ()
  1753. {
  1754. Runtime.Validate (typeof(Graphics));
  1755. return Graphics_GetRGBAFloat32Format ();
  1756. }
  1757. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1758. internal static extern uint Graphics_GetRG16Format ();
  1759. /// <summary>
  1760. /// Return the API-specific RG 16-bit texture format.
  1761. /// </summary>
  1762. private static uint GetRG16Format ()
  1763. {
  1764. Runtime.Validate (typeof(Graphics));
  1765. return Graphics_GetRG16Format ();
  1766. }
  1767. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1768. internal static extern uint Graphics_GetRGFloat16Format ();
  1769. /// <summary>
  1770. /// Return the API-specific RG 16-bit float texture format.
  1771. /// </summary>
  1772. private static uint GetRGFloat16Format ()
  1773. {
  1774. Runtime.Validate (typeof(Graphics));
  1775. return Graphics_GetRGFloat16Format ();
  1776. }
  1777. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1778. internal static extern uint Graphics_GetRGFloat32Format ();
  1779. /// <summary>
  1780. /// Return the API-specific RG 32-bit float texture format.
  1781. /// </summary>
  1782. private static uint GetRGFloat32Format ()
  1783. {
  1784. Runtime.Validate (typeof(Graphics));
  1785. return Graphics_GetRGFloat32Format ();
  1786. }
  1787. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1788. internal static extern uint Graphics_GetFloat16Format ();
  1789. /// <summary>
  1790. /// Return the API-specific single channel 16-bit float texture format.
  1791. /// </summary>
  1792. private static uint GetFloat16Format ()
  1793. {
  1794. Runtime.Validate (typeof(Graphics));
  1795. return Graphics_GetFloat16Format ();
  1796. }
  1797. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1798. internal static extern uint Graphics_GetFloat32Format ();
  1799. /// <summary>
  1800. /// Return the API-specific single channel 32-bit float texture format.
  1801. /// </summary>
  1802. private static uint GetFloat32Format ()
  1803. {
  1804. Runtime.Validate (typeof(Graphics));
  1805. return Graphics_GetFloat32Format ();
  1806. }
  1807. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1808. internal static extern uint Graphics_GetLinearDepthFormat ();
  1809. /// <summary>
  1810. /// Return the API-specific linear depth texture format.
  1811. /// </summary>
  1812. private static uint GetLinearDepthFormat ()
  1813. {
  1814. Runtime.Validate (typeof(Graphics));
  1815. return Graphics_GetLinearDepthFormat ();
  1816. }
  1817. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1818. internal static extern uint Graphics_GetDepthStencilFormat ();
  1819. /// <summary>
  1820. /// Return the API-specific hardware depth-stencil texture format.
  1821. /// </summary>
  1822. private static uint GetDepthStencilFormat ()
  1823. {
  1824. Runtime.Validate (typeof(Graphics));
  1825. return Graphics_GetDepthStencilFormat ();
  1826. }
  1827. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1828. internal static extern uint Graphics_GetReadableDepthFormat ();
  1829. /// <summary>
  1830. /// Return the API-specific readable hardware depth format, or 0 if not supported.
  1831. /// </summary>
  1832. private static uint GetReadableDepthFormat ()
  1833. {
  1834. Runtime.Validate (typeof(Graphics));
  1835. return Graphics_GetReadableDepthFormat ();
  1836. }
  1837. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1838. internal static extern uint Graphics_GetFormat18 (string formatName);
  1839. /// <summary>
  1840. /// Return the API-specific texture format from a textual description, for example "rgb".
  1841. /// </summary>
  1842. public static uint GetFormat (string formatName)
  1843. {
  1844. Runtime.Validate (typeof(Graphics));
  1845. return Graphics_GetFormat18 (formatName);
  1846. }
  1847. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1848. internal static extern Urho.Vector2 Graphics_GetPixelUVOffset ();
  1849. /// <summary>
  1850. /// Return UV offset required for pixel perfect rendering.
  1851. /// </summary>
  1852. private static Urho.Vector2 GetPixelUVOffset ()
  1853. {
  1854. Runtime.Validate (typeof(Graphics));
  1855. return Graphics_GetPixelUVOffset ();
  1856. }
  1857. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  1858. internal static extern uint Graphics_GetMaxBones ();
  1859. /// <summary>
  1860. /// Return maximum number of supported bones for skinning.
  1861. /// </summary>
  1862. private static uint GetMaxBones ()
  1863. {
  1864. Runtime.Validate (typeof(Graphics));
  1865. return Graphics_GetMaxBones ();
  1866. }
  1867. public override StringHash Type {
  1868. get {
  1869. return UrhoGetType ();
  1870. }
  1871. }
  1872. public override string TypeName {
  1873. get {
  1874. return GetTypeName ();
  1875. }
  1876. }
  1877. [Preserve]
  1878. public static StringHash TypeStatic {
  1879. get {
  1880. return GetTypeStatic ();
  1881. }
  1882. }
  1883. public static string TypeNameStatic {
  1884. get {
  1885. return GetTypeNameStatic ();
  1886. }
  1887. }
  1888. /// <summary>
  1889. /// Return OS-specific external window handle. Null if not in use.
  1890. /// Or
  1891. /// Set external window handle. Only effective before setting the initial screen mode.
  1892. /// </summary>
  1893. public IntPtr ExternalWindow {
  1894. get {
  1895. return GetExternalWindow ();
  1896. }
  1897. set {
  1898. SetExternalWindow (value);
  1899. }
  1900. }
  1901. /// <summary>
  1902. /// Return window title.
  1903. /// Or
  1904. /// Set window title.
  1905. /// </summary>
  1906. public string WindowTitle {
  1907. get {
  1908. return GetWindowTitle ();
  1909. }
  1910. set {
  1911. SetWindowTitle (value);
  1912. }
  1913. }
  1914. /// <summary>
  1915. /// Return window position.
  1916. /// </summary>
  1917. public Urho.IntVector2 WindowPosition {
  1918. get {
  1919. return GetWindowPosition ();
  1920. }
  1921. }
  1922. /// <summary>
  1923. /// Return whether the main window is using sRGB conversion on write.
  1924. /// Or
  1925. /// Set whether the main window uses sRGB conversion on write.
  1926. /// </summary>
  1927. public bool SRGB {
  1928. get {
  1929. return GetSRGB ();
  1930. }
  1931. set {
  1932. SetSRGB (value);
  1933. }
  1934. }
  1935. /// <summary>
  1936. /// Return whether rendering output is dithered.
  1937. /// Or
  1938. /// Set whether rendering output is dithered. Default true on OpenGL. No effect on Direct3D.
  1939. /// </summary>
  1940. public bool Dither {
  1941. get {
  1942. return GetDither ();
  1943. }
  1944. set {
  1945. SetDither (value);
  1946. }
  1947. }
  1948. /// <summary>
  1949. /// Return whether the GPU command buffer is flushed each frame.
  1950. /// Or
  1951. /// Set whether to flush the GPU command buffer to prevent multiple frames being queued and uneven frame timesteps. Default off, may decrease performance if enabled. Not currently implemented on OpenGL.
  1952. /// </summary>
  1953. public bool FlushGPU {
  1954. get {
  1955. return GetFlushGPU ();
  1956. }
  1957. set {
  1958. SetFlushGPU (value);
  1959. }
  1960. }
  1961. /// <summary>
  1962. /// Return allowed screen orientations.
  1963. /// Or
  1964. /// Set allowed screen orientations as a space-separated list of "LandscapeLeft", "LandscapeRight", "Portrait" and "PortraitUpsideDown". Affects currently only iOS platform.
  1965. /// </summary>
  1966. public string Orientations {
  1967. get {
  1968. return GetOrientations ();
  1969. }
  1970. set {
  1971. SetOrientations (value);
  1972. }
  1973. }
  1974. /// <summary>
  1975. /// Return current index buffer.
  1976. /// Or
  1977. /// Set index buffer.
  1978. /// </summary>
  1979. public IndexBuffer IndexBuffer {
  1980. get {
  1981. return GetIndexBuffer ();
  1982. }
  1983. set {
  1984. SetIndexBuffer (value);
  1985. }
  1986. }
  1987. /// <summary>
  1988. /// Return default texture filtering mode.
  1989. /// Or
  1990. /// Set default texture filtering mode. Called by Renderer before rendering.
  1991. /// </summary>
  1992. public TextureFilterMode DefaultTextureFilterMode {
  1993. get {
  1994. return GetDefaultTextureFilterMode ();
  1995. }
  1996. set {
  1997. SetDefaultTextureFilterMode (value);
  1998. }
  1999. }
  2000. /// <summary>
  2001. /// Return default texture max. anisotropy level.
  2002. /// Or
  2003. /// Set default texture anisotropy level. Called by Renderer before rendering.
  2004. /// </summary>
  2005. public uint DefaultTextureAnisotropy {
  2006. get {
  2007. return GetDefaultTextureAnisotropy ();
  2008. }
  2009. set {
  2010. SetDefaultTextureAnisotropy (value);
  2011. }
  2012. }
  2013. /// <summary>
  2014. /// Return current depth-stencil surface.
  2015. /// Or
  2016. /// Set depth-stencil surface.
  2017. /// </summary>
  2018. public RenderSurface DepthStencil {
  2019. get {
  2020. return GetDepthStencil ();
  2021. }
  2022. set {
  2023. SetDepthStencil (value);
  2024. }
  2025. }
  2026. /// <summary>
  2027. /// Return the viewport coordinates.
  2028. /// </summary>
  2029. public IntRect Viewport {
  2030. get {
  2031. return GetViewport ();
  2032. }
  2033. }
  2034. /// <summary>
  2035. /// Return whether color write is enabled.
  2036. /// Or
  2037. /// Set color write on/off.
  2038. /// </summary>
  2039. public bool ColorWrite {
  2040. get {
  2041. return GetColorWrite ();
  2042. }
  2043. set {
  2044. SetColorWrite (value);
  2045. }
  2046. }
  2047. /// <summary>
  2048. /// Return hardware culling mode.
  2049. /// Or
  2050. /// Set hardware culling mode.
  2051. /// </summary>
  2052. public CullMode CullMode {
  2053. get {
  2054. return GetCullMode ();
  2055. }
  2056. set {
  2057. SetCullMode (value);
  2058. }
  2059. }
  2060. /// <summary>
  2061. /// Return depth compare mode.
  2062. /// Or
  2063. /// Set depth compare.
  2064. /// </summary>
  2065. public CompareMode DepthTest {
  2066. get {
  2067. return GetDepthTest ();
  2068. }
  2069. set {
  2070. SetDepthTest (value);
  2071. }
  2072. }
  2073. /// <summary>
  2074. /// Return whether depth write is enabled.
  2075. /// Or
  2076. /// Set depth write on/off.
  2077. /// </summary>
  2078. public bool DepthWrite {
  2079. get {
  2080. return GetDepthWrite ();
  2081. }
  2082. set {
  2083. SetDepthWrite (value);
  2084. }
  2085. }
  2086. /// <summary>
  2087. /// Return polygon fill mode.
  2088. /// Or
  2089. /// Set polygon fill mode.
  2090. /// </summary>
  2091. public FillMode FillMode {
  2092. get {
  2093. return GetFillMode ();
  2094. }
  2095. set {
  2096. SetFillMode (value);
  2097. }
  2098. }
  2099. /// <summary>
  2100. /// Return whether line antialiasing is enabled.
  2101. /// Or
  2102. /// Set line antialiasing on/off.
  2103. /// </summary>
  2104. public bool LineAntiAlias {
  2105. get {
  2106. return GetLineAntiAlias ();
  2107. }
  2108. set {
  2109. SetLineAntiAlias (value);
  2110. }
  2111. }
  2112. /// <summary>
  2113. /// Return shader cache directory, Direct3D only.
  2114. /// Or
  2115. /// Set shader cache directory, Direct3D only. This can either be an absolute path or a path within the resource system.
  2116. /// </summary>
  2117. public string ShaderCacheDir {
  2118. get {
  2119. return GetShaderCacheDir ();
  2120. }
  2121. set {
  2122. SetShaderCacheDir (value);
  2123. }
  2124. }
  2125. /// <summary>
  2126. /// Return whether rendering initialized.
  2127. /// </summary>
  2128. public bool Initialized {
  2129. get {
  2130. return IsInitialized ();
  2131. }
  2132. }
  2133. /// <summary>
  2134. /// Return graphics implementation, which holds the actual API-specific resources.
  2135. /// </summary>
  2136. public GraphicsImpl* Impl {
  2137. get {
  2138. return GetImpl ();
  2139. }
  2140. }
  2141. /// <summary>
  2142. /// Return graphics API name.
  2143. /// </summary>
  2144. public string ApiName {
  2145. get {
  2146. return GetApiName ();
  2147. }
  2148. }
  2149. /// <summary>
  2150. /// Return window width in pixels.
  2151. /// </summary>
  2152. public int Width {
  2153. get {
  2154. return GetWidth ();
  2155. }
  2156. }
  2157. /// <summary>
  2158. /// Return window height in pixels.
  2159. /// </summary>
  2160. public int Height {
  2161. get {
  2162. return GetHeight ();
  2163. }
  2164. }
  2165. /// <summary>
  2166. /// Return multisample mode (1 = no multisampling.)
  2167. /// </summary>
  2168. public int MultiSample {
  2169. get {
  2170. return GetMultiSample ();
  2171. }
  2172. }
  2173. /// <summary>
  2174. /// Return window size in pixels.
  2175. /// </summary>
  2176. public Urho.IntVector2 Size {
  2177. get {
  2178. return GetSize ();
  2179. }
  2180. }
  2181. /// <summary>
  2182. /// Return whether window is fullscreen.
  2183. /// </summary>
  2184. public bool Fullscreen {
  2185. get {
  2186. return GetFullscreen ();
  2187. }
  2188. }
  2189. /// <summary>
  2190. /// Return whether window is borderless.
  2191. /// </summary>
  2192. public bool Borderless {
  2193. get {
  2194. return GetBorderless ();
  2195. }
  2196. }
  2197. /// <summary>
  2198. /// Return whether window is resizable.
  2199. /// </summary>
  2200. public bool Resizable {
  2201. get {
  2202. return GetResizable ();
  2203. }
  2204. }
  2205. /// <summary>
  2206. /// Return whether window is high DPI.
  2207. /// </summary>
  2208. public bool HighDPI {
  2209. get {
  2210. return GetHighDPI ();
  2211. }
  2212. }
  2213. /// <summary>
  2214. /// Return whether vertical sync is on.
  2215. /// </summary>
  2216. public bool VSync {
  2217. get {
  2218. return GetVSync ();
  2219. }
  2220. }
  2221. /// <summary>
  2222. /// Return refresh rate when using vsync in fullscreen
  2223. /// </summary>
  2224. public int RefreshRate {
  2225. get {
  2226. return GetRefreshRate ();
  2227. }
  2228. }
  2229. /// <summary>
  2230. /// Return the current monitor index. Effective on in fullscreen
  2231. /// </summary>
  2232. public int Monitor {
  2233. get {
  2234. return GetMonitor ();
  2235. }
  2236. }
  2237. /// <summary>
  2238. /// Return whether triple buffering is enabled.
  2239. /// </summary>
  2240. public bool TripleBuffer {
  2241. get {
  2242. return GetTripleBuffer ();
  2243. }
  2244. }
  2245. /// <summary>
  2246. /// Return whether graphics context is lost and can not render or load GPU resources.
  2247. /// </summary>
  2248. public bool DeviceLost {
  2249. get {
  2250. return IsDeviceLost ();
  2251. }
  2252. }
  2253. /// <summary>
  2254. /// Return number of primitives drawn this frame.
  2255. /// </summary>
  2256. public uint NumPrimitives {
  2257. get {
  2258. return GetNumPrimitives ();
  2259. }
  2260. }
  2261. /// <summary>
  2262. /// Return number of batches drawn this frame.
  2263. /// </summary>
  2264. public uint NumBatches {
  2265. get {
  2266. return GetNumBatches ();
  2267. }
  2268. }
  2269. /// <summary>
  2270. /// Return dummy color texture format for shadow maps. Is "NULL" (consume no video memory) if supported.
  2271. /// </summary>
  2272. public uint DummyColorFormat {
  2273. get {
  2274. return GetDummyColorFormat ();
  2275. }
  2276. }
  2277. /// <summary>
  2278. /// Return shadow map depth texture format, or 0 if not supported.
  2279. /// </summary>
  2280. public uint ShadowMapFormat {
  2281. get {
  2282. return GetShadowMapFormat ();
  2283. }
  2284. }
  2285. /// <summary>
  2286. /// Return 24-bit shadow map depth texture format, or 0 if not supported.
  2287. /// </summary>
  2288. public uint HiresShadowMapFormat {
  2289. get {
  2290. return GetHiresShadowMapFormat ();
  2291. }
  2292. }
  2293. /// <summary>
  2294. /// Return whether hardware instancing is supported.
  2295. /// </summary>
  2296. public bool InstancingSupport {
  2297. get {
  2298. return GetInstancingSupport ();
  2299. }
  2300. }
  2301. /// <summary>
  2302. /// Return whether light pre-pass rendering is supported.
  2303. /// </summary>
  2304. public bool LightPrepassSupport {
  2305. get {
  2306. return GetLightPrepassSupport ();
  2307. }
  2308. }
  2309. /// <summary>
  2310. /// Return whether deferred rendering is supported.
  2311. /// </summary>
  2312. public bool DeferredSupport {
  2313. get {
  2314. return GetDeferredSupport ();
  2315. }
  2316. }
  2317. /// <summary>
  2318. /// Return whether shadow map depth compare is done in hardware.
  2319. /// </summary>
  2320. public bool HardwareShadowSupport {
  2321. get {
  2322. return GetHardwareShadowSupport ();
  2323. }
  2324. }
  2325. /// <summary>
  2326. /// Return whether a readable hardware depth format is available.
  2327. /// </summary>
  2328. public bool ReadableDepthSupport {
  2329. get {
  2330. return GetReadableDepthSupport ();
  2331. }
  2332. }
  2333. /// <summary>
  2334. /// Return whether sRGB conversion on texture sampling is supported.
  2335. /// </summary>
  2336. public bool SRGBSupport {
  2337. get {
  2338. return GetSRGBSupport ();
  2339. }
  2340. }
  2341. /// <summary>
  2342. /// Return whether sRGB conversion on rendertarget writing is supported.
  2343. /// </summary>
  2344. public bool SRGBWriteSupport {
  2345. get {
  2346. return GetSRGBWriteSupport ();
  2347. }
  2348. }
  2349. /// <summary>
  2350. /// Return the number of currently connected monitors.
  2351. /// </summary>
  2352. public int MonitorCount {
  2353. get {
  2354. return GetMonitorCount ();
  2355. }
  2356. }
  2357. /// <summary>
  2358. /// Returns the index of the display containing the center of the window on success or a negative error code on failure.
  2359. /// </summary>
  2360. public int CurrentMonitor {
  2361. get {
  2362. return GetCurrentMonitor ();
  2363. }
  2364. }
  2365. /// <summary>
  2366. /// Returns true if window is maximized or runs in full screen mode.
  2367. /// </summary>
  2368. public bool Maximized {
  2369. get {
  2370. return GetMaximized ();
  2371. }
  2372. }
  2373. /// <summary>
  2374. /// Return current vertex shader.
  2375. /// </summary>
  2376. public ShaderVariation VertexShader {
  2377. get {
  2378. return GetVertexShader ();
  2379. }
  2380. }
  2381. /// <summary>
  2382. /// Return current pixel shader.
  2383. /// </summary>
  2384. public ShaderVariation PixelShader {
  2385. get {
  2386. return GetPixelShader ();
  2387. }
  2388. }
  2389. /// <summary>
  2390. /// Return blending mode.
  2391. /// </summary>
  2392. public BlendMode BlendMode {
  2393. get {
  2394. return GetBlendMode ();
  2395. }
  2396. }
  2397. /// <summary>
  2398. /// Return whether alpha-to-coverage is enabled.
  2399. /// </summary>
  2400. public bool AlphaToCoverage {
  2401. get {
  2402. return GetAlphaToCoverage ();
  2403. }
  2404. }
  2405. /// <summary>
  2406. /// Return depth constant bias.
  2407. /// </summary>
  2408. public float DepthConstantBias {
  2409. get {
  2410. return GetDepthConstantBias ();
  2411. }
  2412. }
  2413. /// <summary>
  2414. /// Return depth slope scaled bias.
  2415. /// </summary>
  2416. public float DepthSlopeScaledBias {
  2417. get {
  2418. return GetDepthSlopeScaledBias ();
  2419. }
  2420. }
  2421. /// <summary>
  2422. /// Return whether stencil test is enabled.
  2423. /// </summary>
  2424. public bool StencilTest {
  2425. get {
  2426. return GetStencilTest ();
  2427. }
  2428. }
  2429. /// <summary>
  2430. /// Return whether scissor test is enabled.
  2431. /// </summary>
  2432. public bool ScissorTest {
  2433. get {
  2434. return GetScissorTest ();
  2435. }
  2436. }
  2437. /// <summary>
  2438. /// Return scissor rectangle coordinates.
  2439. /// </summary>
  2440. public Urho.IntRect ScissorRect {
  2441. get {
  2442. return GetScissorRect ();
  2443. }
  2444. }
  2445. /// <summary>
  2446. /// Return stencil compare mode.
  2447. /// </summary>
  2448. public CompareMode StencilTestMode {
  2449. get {
  2450. return GetStencilTestMode ();
  2451. }
  2452. }
  2453. /// <summary>
  2454. /// Return stencil operation to do if stencil test passes.
  2455. /// </summary>
  2456. public StencilOp StencilPass {
  2457. get {
  2458. return GetStencilPass ();
  2459. }
  2460. }
  2461. /// <summary>
  2462. /// Return stencil operation to do if stencil test fails.
  2463. /// </summary>
  2464. public StencilOp StencilFail {
  2465. get {
  2466. return GetStencilFail ();
  2467. }
  2468. }
  2469. /// <summary>
  2470. /// Return stencil operation to do if depth compare fails.
  2471. /// </summary>
  2472. public StencilOp StencilZFail {
  2473. get {
  2474. return GetStencilZFail ();
  2475. }
  2476. }
  2477. /// <summary>
  2478. /// Return stencil reference value.
  2479. /// </summary>
  2480. public uint StencilRef {
  2481. get {
  2482. return GetStencilRef ();
  2483. }
  2484. }
  2485. /// <summary>
  2486. /// Return stencil compare bitmask.
  2487. /// </summary>
  2488. public uint StencilCompareMask {
  2489. get {
  2490. return GetStencilCompareMask ();
  2491. }
  2492. }
  2493. /// <summary>
  2494. /// Return stencil write bitmask.
  2495. /// </summary>
  2496. public uint StencilWriteMask {
  2497. get {
  2498. return GetStencilWriteMask ();
  2499. }
  2500. }
  2501. /// <summary>
  2502. /// Return whether a custom clipping plane is in use.
  2503. /// </summary>
  2504. public bool UseClipPlane {
  2505. get {
  2506. return GetUseClipPlane ();
  2507. }
  2508. }
  2509. /// <summary>
  2510. /// Return current rendertarget width and height.
  2511. /// </summary>
  2512. public Urho.IntVector2 RenderTargetDimensions {
  2513. get {
  2514. return GetRenderTargetDimensions ();
  2515. }
  2516. }
  2517. /// <summary>
  2518. /// Return the API-specific alpha texture format.
  2519. /// </summary>
  2520. public static uint AlphaFormat {
  2521. get {
  2522. return GetAlphaFormat ();
  2523. }
  2524. }
  2525. /// <summary>
  2526. /// Return the API-specific luminance texture format.
  2527. /// </summary>
  2528. public static uint LuminanceFormat {
  2529. get {
  2530. return GetLuminanceFormat ();
  2531. }
  2532. }
  2533. /// <summary>
  2534. /// Return the API-specific luminance alpha texture format.
  2535. /// </summary>
  2536. public static uint LuminanceAlphaFormat {
  2537. get {
  2538. return GetLuminanceAlphaFormat ();
  2539. }
  2540. }
  2541. /// <summary>
  2542. /// Return the API-specific RGB texture format.
  2543. /// </summary>
  2544. public static uint RGBFormat {
  2545. get {
  2546. return GetRGBFormat ();
  2547. }
  2548. }
  2549. /// <summary>
  2550. /// Return the API-specific RGBA texture format.
  2551. /// </summary>
  2552. public static uint RGBAFormat {
  2553. get {
  2554. return GetRGBAFormat ();
  2555. }
  2556. }
  2557. /// <summary>
  2558. /// Return the API-specific RGBA 16-bit texture format.
  2559. /// </summary>
  2560. public static uint RGBA16Format {
  2561. get {
  2562. return GetRGBA16Format ();
  2563. }
  2564. }
  2565. /// <summary>
  2566. /// Return the API-specific RGBA 16-bit float texture format.
  2567. /// </summary>
  2568. public static uint RGBAFloat16Format {
  2569. get {
  2570. return GetRGBAFloat16Format ();
  2571. }
  2572. }
  2573. /// <summary>
  2574. /// Return the API-specific RGBA 32-bit float texture format.
  2575. /// </summary>
  2576. public static uint RGBAFloat32Format {
  2577. get {
  2578. return GetRGBAFloat32Format ();
  2579. }
  2580. }
  2581. /// <summary>
  2582. /// Return the API-specific RG 16-bit texture format.
  2583. /// </summary>
  2584. public static uint RG16Format {
  2585. get {
  2586. return GetRG16Format ();
  2587. }
  2588. }
  2589. /// <summary>
  2590. /// Return the API-specific RG 16-bit float texture format.
  2591. /// </summary>
  2592. public static uint RGFloat16Format {
  2593. get {
  2594. return GetRGFloat16Format ();
  2595. }
  2596. }
  2597. /// <summary>
  2598. /// Return the API-specific RG 32-bit float texture format.
  2599. /// </summary>
  2600. public static uint RGFloat32Format {
  2601. get {
  2602. return GetRGFloat32Format ();
  2603. }
  2604. }
  2605. /// <summary>
  2606. /// Return the API-specific single channel 16-bit float texture format.
  2607. /// </summary>
  2608. public static uint Float16Format {
  2609. get {
  2610. return GetFloat16Format ();
  2611. }
  2612. }
  2613. /// <summary>
  2614. /// Return the API-specific single channel 32-bit float texture format.
  2615. /// </summary>
  2616. public static uint Float32Format {
  2617. get {
  2618. return GetFloat32Format ();
  2619. }
  2620. }
  2621. /// <summary>
  2622. /// Return the API-specific linear depth texture format.
  2623. /// </summary>
  2624. public static uint LinearDepthFormat {
  2625. get {
  2626. return GetLinearDepthFormat ();
  2627. }
  2628. }
  2629. /// <summary>
  2630. /// Return the API-specific hardware depth-stencil texture format.
  2631. /// </summary>
  2632. public static uint DepthStencilFormat {
  2633. get {
  2634. return GetDepthStencilFormat ();
  2635. }
  2636. }
  2637. /// <summary>
  2638. /// Return the API-specific readable hardware depth format, or 0 if not supported.
  2639. /// </summary>
  2640. public static uint ReadableDepthFormat {
  2641. get {
  2642. return GetReadableDepthFormat ();
  2643. }
  2644. }
  2645. /// <summary>
  2646. /// Return UV offset required for pixel perfect rendering.
  2647. /// </summary>
  2648. public static Urho.Vector2 PixelUVOffset {
  2649. get {
  2650. return GetPixelUVOffset ();
  2651. }
  2652. }
  2653. /// <summary>
  2654. /// Return maximum number of supported bones for skinning.
  2655. /// </summary>
  2656. public static uint MaxBones {
  2657. get {
  2658. return GetMaxBones ();
  2659. }
  2660. }
  2661. }
  2662. }