nvapi.pas 145 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024
  1. (*****************************************************************************
  2. |* *|
  3. |* Copyright 2005-2008 NVIDIA Corporation. All rights reserved. *|
  4. |* *|
  5. |* NOTICE TO USER: *|
  6. |* *|
  7. |* This source code is subject to NVIDIA ownership rights under U.S. *|
  8. |* and international Copyright laws. Users and possessors of this *|
  9. |* source code are hereby granted a nonexclusive, royalty-free *|
  10. |* license to use this code in individual and commercial software. *|
  11. |* *|
  12. |* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE *|
  13. |* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR *|
  14. |* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH *|
  15. |* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF *|
  16. |* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR *|
  17. |* PURPOSE. IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, *|
  18. |* INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES *|
  19. |* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN *|
  20. |* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *|
  21. |* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE *|
  22. |* CODE. *|
  23. |* *|
  24. |* U.S. Government End Users. This source code is a "commercial item" *|
  25. |* as that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting *|
  26. |* of "commercial computer software" and "commercial computer software *|
  27. |* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) *|
  28. |* and is provided to the U.S. Government only as a commercial end item. *|
  29. |* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through *|
  30. |* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the *|
  31. |* source code with only those rights set forth herein. *|
  32. |* *|
  33. |* Any use of this source code in individual and commercial software must *|
  34. |* include, in the user documentation and internal comments to the code, *|
  35. |* the above Disclaimer and U.S. Government End Users Notice. *|
  36. |* *|
  37. |* *|
  38. *****************************************************************************)
  39. { Header translation by (2008) Andreas Hausladen (Andreas DOTT Hausladen ATT gmx DOTT de) }
  40. { Header update }
  41. { * added stereoscopic API }
  42. { * changed NVHandle usage }
  43. { * ported for FPC }
  44. { by (2010) Dmitry Boyarintsev (skalogryz DOTT lists ATT gail DOTT com) }
  45. ///////////////////////////////////////////////////////////////////////////////
  46. //
  47. // Date: Aug 24, 2008
  48. // File: nvapi.h
  49. //
  50. // NvAPI provides an interface to NVIDIA devices. This file contains the
  51. // interface constants, structure definitions and function prototypes.
  52. //
  53. // Target Profile: developer
  54. // Target OS-Arch: windows
  55. //
  56. ///////////////////////////////////////////////////////////////////////////////
  57. {$IFNDEF FPC_DOTTEDUNITS}
  58. unit nvapi;
  59. {$ENDIF FPC_DOTTEDUNITS}
  60. {$ifndef FPC}
  61. {$A8,B-,C+,D+,E-,F-,G+,H+,I+,J-,K-,L+,M-,N-,O+,P+,Q-,R-,S-,T-,U-,V+,W-,X+,Y+,Z1}
  62. {$minenumsize 4}
  63. {$else}
  64. {$mode delphi}
  65. {$packenum 4}
  66. {$packrecords c}
  67. {$NOTES OFF}
  68. {$endif}
  69. interface
  70. {$IFDEF FPC_DOTTEDUNITS}
  71. uses
  72. WinApi.Windows;
  73. {$ELSE FPC_DOTTEDUNITS}
  74. uses
  75. Windows;
  76. {$ENDIF FPC_DOTTEDUNITS}
  77. // ====================================================
  78. // Universal NvAPI Definitions
  79. // ====================================================
  80. { 64-bit types for compilers that support them, plus some obsolete variants }
  81. type
  82. {$IF declared(UInt64)}
  83. NvU64 = UInt64; { 0 to 18446744073709551615 }
  84. {$ELSE}
  85. NvU64 = Int64; { 0 to 18446744073709551615 }
  86. {$IFEND}
  87. // mac os 32-bit still needs this
  88. NvS32 = Longint; { -2147483648 to 2147483647 }
  89. NvU32 = LongWord;
  90. NvU16 = Word;
  91. NvU8 = Byte;
  92. PNvU8 = ^NvU8;
  93. // NVAPI Handles - These handles are retrieved from various calls and passed in to others in NvAPI
  94. // These are meant to be opaque types. Do not assume they correspond to indices, HDCs,
  95. // display indexes or anything else.
  96. //
  97. // Most handles remain valid until a display re-configuration (display mode set) or GPU
  98. // reconfiguration (going into or out of SLI modes) occurs. If NVAPI_HANDLE_INVALIDATED
  99. // is received by an app, it should discard all handles, and re-enumerate them.
  100. //
  101. {$ifndef FPC}
  102. NvHandle = LongWord;
  103. {$else}
  104. NvHandle = PtrUInt;
  105. {$endif}
  106. // Display Device driven by NVIDIA GPU(s) (an attached display)
  107. NvDisplayHandle = NvHandle;
  108. // Unattached Display Device driven by NVIDIA GPU(s)
  109. NvUnAttachedDisplayHandle = NvHandle;
  110. // One or more physical GPUs acting in concert (SLI)
  111. NvLogicalGpuHandle = NvHandle;
  112. // A single physical GPU
  113. NvPhysicalGpuHandle = NvHandle;
  114. // A handle to an event registration instance
  115. NvEventHandle = NvHandle;
  116. const
  117. NVAPI_DEFAULT_HANDLE = 0;
  118. NVAPI_GENERIC_STRING_MAX = 4096;
  119. NVAPI_LONG_STRING_MAX = 256;
  120. NVAPI_SHORT_STRING_MAX = 64;
  121. type
  122. NvSBox = record
  123. sX: NvS32;
  124. sY: NvS32;
  125. sWidth: NvS32;
  126. sHeight: NvS32;
  127. end;
  128. const
  129. NVAPI_MAX_PHYSICAL_GPUS = 64;
  130. NVAPI_MAX_LOGICAL_GPUS = 64;
  131. NVAPI_MAX_AVAILABLE_GPU_TOPOLOGIES = 256;
  132. NVAPI_MAX_GPU_TOPOLOGIES = NVAPI_MAX_PHYSICAL_GPUS;
  133. NVAPI_MAX_GPU_PER_TOPOLOGY = 8;
  134. NVAPI_MAX_DISPLAY_HEADS = 2;
  135. NVAPI_MAX_DISPLAYS = NVAPI_MAX_PHYSICAL_GPUS * NVAPI_MAX_DISPLAY_HEADS;
  136. NV_MAX_HEADS = 4; // Maximum heads, each with NVAPI_DESKTOP_RES resolution
  137. NV_MAX_VID_STREAMS = 4; // Maximum input video streams, each with a NVAPI_VIDEO_SRC_INFO
  138. NV_MAX_VID_PROFILES = 4; // Maximum output video profiles supported
  139. type
  140. NvAPI_String = array[0..NVAPI_GENERIC_STRING_MAX - 1] of AnsiChar;
  141. NvAPI_LongString = array[0..NVAPI_LONG_STRING_MAX - 1] of AnsiChar;
  142. NvAPI_ShortString = array[0..NVAPI_SHORT_STRING_MAX - 1] of AnsiChar;
  143. type
  144. TNvPhysicalGpuHandleArray = array[0..NVAPI_MAX_PHYSICAL_GPUS - 1] of NvPhysicalGpuHandle;
  145. TNvLogicalGpuHandleArray = array[0..NVAPI_MAX_LOGICAL_GPUS - 1] of NvLogicalGpuHandle;
  146. // =========================================================================================
  147. // NvAPI Version Definition
  148. // Maintain per structure specific version define using the MAKE_NVAPI_VERSION macro.
  149. // Usage: #define NV_GENLOCK_STATUS_VER MAKE_NVAPI_VERSION(NV_GENLOCK_STATUS, 1)
  150. // =========================================================================================
  151. //#define MAKE_NVAPI_VERSION(typeName,ver) (NvU32)(sizeof(typeName) | ((ver)<<16))
  152. //#define GET_NVAPI_VERSION(ver) (NvU32)((ver)>>16)
  153. //#define GET_NVAPI_SIZE(ver) (NvU32)((ver) & 0xffff)
  154. {$ifndef FPC}
  155. {$IF CompilerVersion >= 18.0} {$define USEINLINE} {$ifend}
  156. {$else}
  157. {$define USEINLINE}
  158. {$endif}
  159. function GetNvAPIVersion(Ver: NvU32): NvU32; {$ifdef USEINLINE} inline; {$endif}
  160. function GetNvAPISize(Ver: NvU32): NvU32; {$ifdef USEINLINE} inline; {$endif}
  161. // ====================================================
  162. // NvAPI Status Values
  163. // All NvAPI functions return one of these codes.
  164. // ====================================================
  165. type
  166. NvAPI_Status = (
  167. NVAPI_OK = 0, // Success
  168. NVAPI_ERROR = -1, // Generic error
  169. NVAPI_LIBRARY_NOT_FOUND = -2, // nvapi.dll can not be loaded
  170. NVAPI_NO_IMPLEMENTATION = -3, // not implemented in current driver installation
  171. NVAPI_API_NOT_INTIALIZED = -4, // NvAPI_Initialize has not been called (successfully)
  172. NVAPI_INVALID_ARGUMENT = -5, // invalid argument
  173. NVAPI_NVIDIA_DEVICE_NOT_FOUND = -6, // no NVIDIA display driver was found
  174. NVAPI_END_ENUMERATION = -7, // no more to enum
  175. NVAPI_INVALID_HANDLE = -8, // invalid handle
  176. NVAPI_INCOMPATIBLE_STRUCT_VERSION = -9, // an argument's structure version is not supported
  177. NVAPI_HANDLE_INVALIDATED = -10, // handle is no longer valid (likely due to GPU or display re-configuration)
  178. NVAPI_OPENGL_CONTEXT_NOT_CURRENT = -11, // no NVIDIA OpenGL context is current (but needs to be)
  179. NVAPI_NO_GL_EXPERT = -12, // OpenGL Expert is not supported by the current drivers
  180. NVAPI_INSTRUMENTATION_DISABLED = -13, // OpenGL Expert is supported, but driver instrumentation is currently disabled
  181. NVAPI_EXPECTED_LOGICAL_GPU_HANDLE = -100, // expected a logical GPU handle for one or more parameters
  182. NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE = -101, // expected a physical GPU handle for one or more parameters
  183. NVAPI_EXPECTED_DISPLAY_HANDLE = -102, // expected an NV display handle for one or more parameters
  184. NVAPI_INVALID_COMBINATION = -103, // used in some commands to indicate that the combination of parameters is not valid
  185. NVAPI_NOT_SUPPORTED = -104, // Requested feature not supported in the selected GPU
  186. NVAPI_PORTID_NOT_FOUND = -105, // NO port ID found for I2C transaction
  187. NVAPI_EXPECTED_UNATTACHED_DISPLAY_HANDLE = -106, // expected an unattached display handle as one of the input param
  188. NVAPI_INVALID_PERF_LEVEL = -107, // invalid perf level
  189. NVAPI_DEVICE_BUSY = -108, // device is busy, request not fulfilled
  190. NVAPI_NV_PERSIST_FILE_NOT_FOUND = -109, // NV persist file is not found
  191. NVAPI_PERSIST_DATA_NOT_FOUND = -110, // NV persist data is not found
  192. NVAPI_EXPECTED_TV_DISPLAY = -111, // expected TV output display
  193. NVAPI_EXPECTED_TV_DISPLAY_ON_DCONNECTOR = -112, // expected TV output on D Connector - HDTV_EIAJ4120.
  194. NVAPI_NO_ACTIVE_SLI_TOPOLOGY = -113, // SLI is not active on this device
  195. NVAPI_SLI_RENDERING_MODE_NOTALLOWED = -114, // setup of SLI rendering mode is not possible right now
  196. NVAPI_EXPECTED_DIGITAL_FLAT_PANEL = -115, // expected digital flat panel
  197. NVAPI_ARGUMENT_EXCEED_MAX_SIZE = -116, // argument exceeds expected size
  198. NVAPI_DEVICE_SWITCHING_NOT_ALLOWED = -117, // inhibit ON due to one of the flags in NV_GPU_DISPLAY_CHANGE_INHIBIT or SLI Active
  199. NVAPI_TESTING_CLOCKS_NOT_SUPPORTED = -118, // testing clocks not supported
  200. NVAPI_UNKNOWN_UNDERSCAN_CONFIG = -119, // the specified underscan config is from an unknown source (e.g. INF)
  201. NVAPI_TIMEOUT_RECONFIGURING_GPU_TOPO = -120, // timeout while reconfiguring GPUs
  202. NVAPI_DATA_NOT_FOUND = -121, // Requested data was not found
  203. NVAPI_EXPECTED_ANALOG_DISPLAY = -122, // expected analog display
  204. NVAPI_NO_VIDLINK = -123, // No SLI video bridge present
  205. NVAPI_REQUIRES_REBOOT = -124, // NVAPI requires reboot for its settings to take effect
  206. NVAPI_INVALID_HYBRID_MODE = -125, // the function is not supported with the current hybrid mode.
  207. NVAPI_MIXED_TARGET_TYPES = -126, // The target types are not all the same
  208. NVAPI_SYSWOW64_NOT_SUPPORTED = -127, // the function is not supported from 32-bit on a 64-bit system
  209. NVAPI_IMPLICIT_SET_GPU_TOPOLOGY_CHANGE_NOT_ALLOWED = -128, //there is any implicit GPU topo active. Use NVAPI_SetHybridMode to change topology.
  210. NVAPI_REQUEST_USER_TO_CLOSE_NON_MIGRATABLE_APPS = -129, //Prompt the user to close all non-migratable apps.
  211. NVAPI_OUT_OF_MEMORY = -130, // Could not allocate sufficient memory to complete the call
  212. NVAPI_WAS_STILL_DRAWING = -131, // The previous operation that is transferring information to or from this surface is incomplete
  213. NVAPI_FILE_NOT_FOUND = -132, // The file was not found
  214. NVAPI_TOO_MANY_UNIQUE_STATE_OBJECTS = -133, // There are too many unique instances of a particular type of state object
  215. NVAPI_INVALID_CALL = -134, // The method call is invalid. For example, a method's parameter may not be a valid pointer
  216. NVAPI_D3D10_1_LIBRARY_NOT_FOUND = -135, // d3d10_1.dll can not be loaded
  217. NVAPI_FUNCTION_NOT_FOUND = -136 // Couldn't find the function in loaded dll library
  218. );
  219. ///////////////////////////////////////////////////////////////////////////////
  220. //
  221. // FUNCTION NAME: NvAPI_Initialize
  222. //
  223. // DESCRIPTION: Initializes NVAPI library. This must be called before any
  224. // other NvAPI_ function.
  225. //
  226. // SUPPORTED OS: Mac OS X, Windows XP and higher
  227. //
  228. // RETURN STATUS: NVAPI_ERROR Something is wrong during the initialization process (generic error)
  229. // NVAPI_LIBRARYNOTFOUND Can not load nvapi.dll
  230. // NVAPI_OK Initialized
  231. //
  232. ///////////////////////////////////////////////////////////////////////////////
  233. function NvAPI_Initialize(): NvAPI_Status; cdecl;
  234. ///////////////////////////////////////////////////////////////////////////////
  235. //
  236. // FUNCTION NAME: NvAPI_GetErrorMessage
  237. //
  238. // DESCRIPTION: converts an NvAPI error code into a null terminated string
  239. //
  240. // SUPPORTED OS: Mac OS X, Windows XP and higher
  241. //
  242. // RETURN STATUS: null terminated string (always, never NULL)
  243. //
  244. ///////////////////////////////////////////////////////////////////////////////
  245. var
  246. NvAPI_GetErrorMessage: function(nr: NvAPI_Status; var szDesc: NvAPI_ShortString): NvAPI_Status; cdecl;
  247. ///////////////////////////////////////////////////////////////////////////////
  248. //
  249. // FUNCTION NAME: NvAPI_GetInterfaceVersionString
  250. //
  251. // DESCRIPTION: Returns a string describing the version of the NvAPI library.
  252. // Contents of the string are human readable. Do not assume a fixed
  253. // format.
  254. //
  255. // SUPPORTED OS: Mac OS X, Windows XP and higher
  256. //
  257. // RETURN STATUS: User readable string giving info on NvAPI's version
  258. //
  259. ///////////////////////////////////////////////////////////////////////////////
  260. var
  261. NvAPI_GetInterfaceVersionString: function(var szDesc: NvAPI_ShortString): NvAPI_Status; cdecl;
  262. ///////////////////////////////////////////////////////////////////////////////
  263. //
  264. // FUNCTION NAME: NvAPI_GetDisplayDriverVersion
  265. //
  266. // DESCRIPTION: Returns a struct that describes aspects of the display driver
  267. // build.
  268. //
  269. // SUPPORTED OS: Mac OS X, Windows XP and higher
  270. //
  271. // RETURN STATUS: NVAPI_ERROR or NVAPI_OK
  272. //
  273. ///////////////////////////////////////////////////////////////////////////////
  274. type
  275. NV_DISPLAY_DRIVER_VERSION = record
  276. version: NvU32; // Structure version
  277. drvVersion: NvU32;
  278. bldChangeListNum: NvU32;
  279. szBuildBranchString: NvAPI_ShortString;
  280. szAdapterString: NvAPI_ShortString;
  281. end;
  282. TNvDisplayDriverVersion = NV_DISPLAY_DRIVER_VERSION;
  283. PNvDisplayDriverVersion = ^TNvDisplayDriverVersion;
  284. const
  285. //#define NV_DISPLAY_DRIVER_VERSION_VER MAKE_NVAPI_VERSION(NV_DISPLAY_DRIVER_VERSION,1)
  286. NV_DISPLAY_DRIVER_VERSION_VER = NvU32(SizeOf(NV_DISPLAY_DRIVER_VERSION) or (1 shl 16));
  287. var
  288. NvAPI_GetDisplayDriverVersion: function(hNvDisplay: NvDisplayHandle; pVersion: PNvDisplayDriverVersion): NvAPI_Status; cdecl;
  289. ///////////////////////////////////////////////////////////////////////////////
  290. //
  291. // FUNCTION NAME: NvAPI_EnumNvidiaDisplayHandle
  292. //
  293. // DESCRIPTION: Returns the handle of the NVIDIA display specified by the enum
  294. // index (thisEnum). The client should keep enumerating until it
  295. // returns NVAPI_END_ENUMERATION.
  296. //
  297. // Note: Display handles can get invalidated on a modeset, so the calling applications need to
  298. // renum the handles after every modeset.
  299. //
  300. // SUPPORTED OS: Windows XP and higher
  301. //
  302. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: either the handle pointer is NULL or enum index too big
  303. // NVAPI_OK: return a valid NvDisplayHandle based on the enum index
  304. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA device found in the system
  305. // NVAPI_END_ENUMERATION: no more display device to enumerate.
  306. //
  307. ///////////////////////////////////////////////////////////////////////////////
  308. var
  309. NvAPI_EnumNvidiaDisplayHandle: function(thisEnum: NvU32; var NvDispHandle: NvDisplayHandle): NvAPI_Status; cdecl;
  310. ///////////////////////////////////////////////////////////////////////////////
  311. //
  312. // FUNCTION NAME: NvAPI_EnumNvidiaUnAttachedDisplayHandle
  313. //
  314. // DESCRIPTION: Returns the handle of the NVIDIA UnAttached display specified by the enum
  315. // index (thisEnum). The client should keep enumerating till it
  316. // return error.
  317. //
  318. // Note: Display handles can get invalidated on a modeset, so the calling applications need to
  319. // renum the handles after every modeset.
  320. //
  321. // SUPPORTED OS: Windows XP and higher
  322. //
  323. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: either the handle pointer is NULL or enum index too big
  324. // NVAPI_OK: return a valid NvDisplayHandle based on the enum index
  325. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA device found in the system
  326. // NVAPI_END_ENUMERATION: no more display device to enumerate.
  327. //
  328. ///////////////////////////////////////////////////////////////////////////////
  329. var
  330. NvAPI_EnumNvidiaUnAttachedDisplayHandle: function(thisEnum: NvU32; var NvUnAttachedDispHandle: NvUnAttachedDisplayHandle): NvAPI_Status; cdecl;
  331. ///////////////////////////////////////////////////////////////////////////////
  332. //
  333. // FUNCTION NAME: NvAPI_EnumPhysicalGPUs
  334. //
  335. // DESCRIPTION: Returns an array of physical GPU handles.
  336. //
  337. // Each handle represents a physical GPU present in the system.
  338. // That GPU may be part of a SLI configuration, or not be visible to the OS directly.
  339. //
  340. // At least 1 GPU must be present in the system and running an NV display driver.
  341. //
  342. // The array nvGPUHandle will be filled with physical GPU handle values. The returned
  343. // gpuCount determines how many entries in the array are valid.
  344. //
  345. // Note: In drivers older than 105.00, all physical GPU handles get invalidated on a modeset. So the calling applications
  346. // need to renum the handles after every modeset.
  347. // With drivers 105.00 and up all physical GPU handles are constant.
  348. // Physical GPU handles are constant as long as the GPUs are not physically moved and the SBIOS VGA order is unchanged.
  349. //
  350. // SUPPORTED OS: Mac OS X, Windows XP and higher
  351. //
  352. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: nvGPUHandle or pGpuCount is NULL
  353. // NVAPI_OK: one or more handles were returned
  354. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  355. //
  356. ///////////////////////////////////////////////////////////////////////////////
  357. var
  358. NvAPI_EnumPhysicalGPUs: function(var nvGPUHandle: TNvPhysicalGpuHandleArray; var pGpuCount: NvU32): NvAPI_Status; cdecl;
  359. ///////////////////////////////////////////////////////////////////////////////
  360. //
  361. // FUNCTION NAME: NvAPI_EnumLogicalGPUs
  362. //
  363. // DESCRIPTION: Returns an array of logical GPU handles.
  364. //
  365. // Each handle represents one or more GPUs acting in concert as a single graphics device.
  366. //
  367. // At least 1 GPU must be present in the system and running an NV display driver.
  368. //
  369. // The array nvGPUHandle will be filled with logical GPU handle values. The returned
  370. // gpuCount determines how many entries in the array are valid.
  371. //
  372. // Note: All logical GPUs handles get invalidated on a GPU topology change, so the calling application is required to
  373. // renum the logical GPU handles to get latest physical handle mapping after every GPU topology change activated
  374. // by a call to NvAPI_SetGpuTopologies.
  375. //
  376. // To detect if SLI rendering is enabled please use NvAPI_D3D_GetCurrentSLIState
  377. //
  378. // SUPPORTED OS: Mac OS X, Windows XP and higher
  379. //
  380. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: nvGPUHandle or pGpuCount is NULL
  381. // NVAPI_OK: one or more handles were returned
  382. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  383. //
  384. ///////////////////////////////////////////////////////////////////////////////
  385. var
  386. NvAPI_EnumLogicalGPUs: function(var nvGPUHandle: TNvLogicalGpuHandleArray; var pGpuCount: NvU32): NvAPI_Status; cdecl;
  387. ///////////////////////////////////////////////////////////////////////////////
  388. //
  389. // FUNCTION NAME: NvAPI_GetPhysicalGPUsFromDisplay
  390. //
  391. // DESCRIPTION: Returns an array of physical GPU handles associated with the specified display.
  392. //
  393. // At least 1 GPU must be present in the system and running an NV display driver.
  394. //
  395. // The array nvGPUHandle will be filled with physical GPU handle values. The returned
  396. // gpuCount determines how many entries in the array are valid.
  397. //
  398. // If the display corresponds to more than one physical GPU, the first GPU returned
  399. // is the one with the attached active output.
  400. //
  401. // SUPPORTED OS: Windows XP and higher
  402. //
  403. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hNvDisp is not valid; nvGPUHandle or pGpuCount is NULL
  404. // NVAPI_OK: one or more handles were returned
  405. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  406. //
  407. ///////////////////////////////////////////////////////////////////////////////
  408. var
  409. NvAPI_GetPhysicalGPUsFromDisplay: function(hNvDisp: NvDisplayHandle; var nvGPUHandle: TNvPhysicalGpuHandleArray; var pGpuCount: NvU32): NvAPI_Status; cdecl;
  410. ///////////////////////////////////////////////////////////////////////////////
  411. //
  412. // FUNCTION NAME: NvAPI_GetPhysicalGPUFromUnAttachedDisplay
  413. //
  414. // DESCRIPTION: Returns a physical GPU handle associated with the specified unattached display.
  415. //
  416. // At least 1 GPU must be present in the system and running an NV display driver.
  417. //
  418. // SUPPORTED OS: Windows XP and higher
  419. //
  420. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hNvUnAttachedDisp is not valid or pPhysicalGpu is NULL.
  421. // NVAPI_OK: one or more handles were returned
  422. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  423. //
  424. ///////////////////////////////////////////////////////////////////////////////
  425. var
  426. NvAPI_GetPhysicalGPUFromUnAttachedDisplay: function(hNvUnAttachedDisp: NvUnAttachedDisplayHandle; var PhysicalGpu: NvPhysicalGpuHandle): NvAPI_Status; cdecl;
  427. ///////////////////////////////////////////////////////////////////////////////
  428. //
  429. // FUNCTION NAME: NvAPI_CreateDisplayFromUnAttachedDisplay
  430. //
  431. // DESCRIPTION: The unattached display handle is converted to a active attached display handle.
  432. //
  433. // At least 1 GPU must be present in the system and running an NV display driver.
  434. //
  435. // SUPPORTED OS: Windows XP and higher
  436. //
  437. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hNvUnAttachedDisp is not valid or pNvDisplay is NULL.
  438. // NVAPI_OK: one or more handles were returned
  439. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  440. //
  441. ///////////////////////////////////////////////////////////////////////////////
  442. var
  443. NvAPI_CreateDisplayFromUnAttachedDisplay: function(hNvUnAttachedDisp: NvUnAttachedDisplayHandle; var NvDisplay: NvDisplayHandle): NvAPI_Status; cdecl;
  444. ///////////////////////////////////////////////////////////////////////////////
  445. //
  446. // FUNCTION NAME: NvAPI_GetLogicalGPUFromDisplay
  447. //
  448. // DESCRIPTION: Returns the logical GPU handle associated with the specified display.
  449. //
  450. // At least 1 GPU must be present in the system and running an NV display driver.
  451. //
  452. // SUPPORTED OS: Windows XP and higher
  453. //
  454. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hNvDisp is not valid; pLogicalGPU is NULL
  455. // NVAPI_OK: one or more handles were returned
  456. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  457. //
  458. ///////////////////////////////////////////////////////////////////////////////
  459. var
  460. NvAPI_GetLogicalGPUFromDisplay: function(hNvDisp: NvDisplayHandle; var LogicalGPU: NvLogicalGpuHandle): NvAPI_Status; cdecl;
  461. ///////////////////////////////////////////////////////////////////////////////
  462. //
  463. // FUNCTION NAME: NvAPI_GetLogicalGPUFromPhysicalGPU
  464. //
  465. // DESCRIPTION: Returns the logical GPU handle associated with specified physical GPU handle.
  466. //
  467. // At least 1 GPU must be present in the system and running an NV display driver.
  468. //
  469. // SUPPORTED OS: Mac OS X, Windows XP and higher
  470. //
  471. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGPU is not valid; pLogicalGPU is NULL
  472. // NVAPI_OK: one or more handles were returned
  473. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  474. //
  475. ///////////////////////////////////////////////////////////////////////////////
  476. var
  477. NvAPI_GetLogicalGPUFromPhysicalGPU: function(hPhysicalGPU: NvPhysicalGpuHandle; var LogicalGPU: NvLogicalGpuHandle): NvAPI_Status; cdecl;
  478. ///////////////////////////////////////////////////////////////////////////////
  479. //
  480. // FUNCTION NAME: NvAPI_GetPhysicalGPUsFromLogicalGPU
  481. //
  482. // DESCRIPTION: Returns the physical GPU handles associated with the specified logical GPU handle.
  483. //
  484. // At least 1 GPU must be present in the system and running an NV display driver.
  485. //
  486. // The array hPhysicalGPU will be filled with physical GPU handle values. The returned
  487. // gpuCount determines how many entries in the array are valid.
  488. //
  489. // SUPPORTED OS: Mac OS X, Windows XP and higher
  490. //
  491. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hLogicalGPU is not valid; hPhysicalGPU is NULL
  492. // NVAPI_OK: one or more handles were returned
  493. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  494. // NVAPI_EXPECTED_LOGICAL_GPU_HANDLE: hLogicalGPU was not a logical GPU handle
  495. //
  496. ///////////////////////////////////////////////////////////////////////////////
  497. var
  498. NvAPI_GetPhysicalGPUsFromLogicalGPU: function(hLogicalGPU: NvLogicalGpuHandle; var hPhysicalGPU: TNvPhysicalGpuHandleArray; var pGpuCount: NvU32): NvAPI_Status; cdecl;
  499. ///////////////////////////////////////////////////////////////////////////////
  500. //
  501. // FUNCTION NAME: NvAPI_GetAssociatedNvidiaDisplayHandle
  502. //
  503. // DESCRIPTION: Returns the handle of the NVIDIA display that is associated
  504. // with the display name given. Eg: "\\DISPLAY1"
  505. //
  506. // SUPPORTED OS: Windows XP and higher
  507. //
  508. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: either argument is NULL
  509. // NVAPI_OK: *pNvDispHandle is now valid
  510. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA device maps to that display name
  511. //
  512. ///////////////////////////////////////////////////////////////////////////////
  513. var
  514. NvAPI_GetAssociatedNvidiaDisplayHandle: function(const szDisplayName: PAnsiChar; var NvDispHandle: NvDisplayHandle): NvAPI_Status; cdecl;
  515. ///////////////////////////////////////////////////////////////////////////////
  516. //
  517. // FUNCTION NAME: NvAPI_GetAssociatedNvidiaDisplayName
  518. //
  519. // DESCRIPTION: Returns the display name given. Eg: "\\DISPLAY1" using the NVIDIA display handle
  520. //
  521. // SUPPORTED OS: Windows XP and higher
  522. //
  523. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: either argument is NULL
  524. // NVAPI_OK: *pNvDispHandle is now valid
  525. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA device maps to that display name
  526. //
  527. ///////////////////////////////////////////////////////////////////////////////
  528. var
  529. NvAPI_GetAssociatedNvidiaDisplayName: function(NvDispHandle: NvDisplayHandle; var szDisplayName: NvAPI_ShortString): NvAPI_Status; cdecl;
  530. ///////////////////////////////////////////////////////////////////////////////
  531. //
  532. // FUNCTION NAME: NvAPI_GetUnAttachedAssociatedDisplayName
  533. //
  534. // DESCRIPTION: Returns the display name given. Eg: "\\DISPLAY1" using the NVIDIA unattached display handle
  535. //
  536. // SUPPORTED OS: Windows XP and higher
  537. //
  538. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: either argument is NULL
  539. // NVAPI_OK: *pNvDispHandle is now valid
  540. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA device maps to that display name
  541. //
  542. ///////////////////////////////////////////////////////////////////////////////
  543. var
  544. NvAPI_GetUnAttachedAssociatedDisplayName: function(hNvUnAttachedDisp: NvUnAttachedDisplayHandle; var szDisplayName: NvAPI_ShortString): NvAPI_Status; cdecl;
  545. ///////////////////////////////////////////////////////////////////////////////
  546. //
  547. // FUNCTION NAME: NvAPI_EnableHWCursor
  548. //
  549. // DESCRIPTION: Enable hardware cursor support
  550. //
  551. // SUPPORTED OS: Windows XP
  552. //
  553. // RETURN STATUS: NVAPI_ERROR or NVAPI_OK
  554. //
  555. ///////////////////////////////////////////////////////////////////////////////
  556. var
  557. NvAPI_EnableHWCursor: function(hNvDisplay: NvDisplayHandle): NvAPI_Status; cdecl;
  558. ///////////////////////////////////////////////////////////////////////////////
  559. //
  560. // FUNCTION NAME: NvAPI_DisableHWCursor
  561. //
  562. // DESCRIPTION: Disable hardware cursor support
  563. //
  564. // SUPPORTED OS: Windows XP and higher
  565. //
  566. // RETURN STATUS: NVAPI_ERROR or NVAPI_OK
  567. //
  568. ///////////////////////////////////////////////////////////////////////////////
  569. var
  570. NvAPI_DisableHWCursor: function(hNvDisplay: NvDisplayHandle): NvAPI_Status; cdecl;
  571. ///////////////////////////////////////////////////////////////////////////////
  572. //
  573. // FUNCTION NAME: NvAPI_GetVBlankCounter
  574. //
  575. // DESCRIPTION: get vblank counter
  576. //
  577. // SUPPORTED OS: Windows XP and higher
  578. //
  579. // RETURN STATUS: NVAPI_ERROR or NVAPI_OK
  580. //
  581. ///////////////////////////////////////////////////////////////////////////////
  582. var
  583. NvAPI_GetVBlankCounter: function(hNvDisplay: NvDisplayHandle; var pCounter: NvU32): NvAPI_Status; cdecl;
  584. ///////////////////////////////////////////////////////////////////////////////
  585. // FUNCTION NAME: NvAPI_SetRefreshRateOverride
  586. // DESCRIPTION: Override the refresh rate on the given display/outputsMask.
  587. // The new refresh rate can be applied right away in this API call or deferred to happen with the
  588. // next OS modeset. The override is only good for one modeset (doesn't matter it's deferred or immediate).
  589. //
  590. // SUPPORTED OS: Windows XP
  591. //
  592. //
  593. // INPUT: hNvDisplay - the NVIDIA display handle. It can be NVAPI_DEFAULT_HANDLE or a handle
  594. // enumerated from NvAPI_EnumNVidiaDisplayHandle().
  595. //
  596. // outputsMask - a set of bits that identify all target outputs which are associated with the NVIDIA
  597. // display handle to apply the refresh rate override. Note when SLI is enabled, the
  598. // outputsMask only applies to the GPU that is driving the display output.
  599. //
  600. // refreshRate - the override value. "0.0" means cancel the override.
  601. //
  602. //
  603. // bSetDeferred - "0": apply the refresh rate override immediately in this API call.
  604. // "1": apply refresh rate at the next OS modeset.
  605. //
  606. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hNvDisplay or outputsMask is invalid
  607. // NVAPI_OK: the refresh rate override is correct set
  608. // NVAPI_ERROR: the operation failed
  609. //
  610. ///////////////////////////////////////////////////////////////////////////////
  611. var
  612. NvAPI_SetRefreshRateOverride: function(hNvDisplay: NvDisplayHandle; outputMask: NvU32; refreshRate: Double; bSetDeferred: NvU32): NvAPI_Status; cdecl;
  613. ///////////////////////////////////////////////////////////////////////////////
  614. //
  615. // FUNCTION NAME: NvAPI_GetAssociatedDisplayOutputId
  616. //
  617. // DESCRIPTION: Gets the active outputId associated with the display handle.
  618. //
  619. // SUPPORTED OS: Windows XP and higher
  620. //
  621. // PARAMETERS: hNvDisplay(IN) - NVIDIA Display selection. It can be NVAPI_DEFAULT_HANDLE or a handle enumerated from NvAPI_EnumNVidiaDisplayHandle().
  622. // outputId(OUT) - The active display output id associated with the selected display handle hNvDisplay.
  623. // The outputid will have only one bit set. In case of clone or span this will indicate the display
  624. // outputId of the primary display that the GPU is driving.
  625. // RETURN STATUS: NVAPI_OK: call successful.
  626. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found.
  627. // NVAPI_EXPECTED_DISPLAY_HANDLE: hNvDisplay is not a valid display handle.
  628. //
  629. ///////////////////////////////////////////////////////////////////////////////
  630. var
  631. NvAPI_GetAssociatedDisplayOutputId: function(hNvDisplay: NvDisplayHandle; var pOutputId: NvU32): NvAPI_Status; cdecl;
  632. ///////////////////////////////////////////////////////////////////////////////
  633. // FUNCTION NAME: NvAPI_GetDisplayPortInfo
  634. //
  635. // DESCRIPTION: This API returns the current DP related into on the specified device(monitor)
  636. //
  637. // SUPPORTED OS: Windows XP and higher
  638. //
  639. // PARAMETERS: hNvDisplay(IN) - NVIDIA Display selection. It can be NVAPI_DEFAULT_HANDLE or a handle enumerated from NvAPI_EnumNVidiaDisplayHandle().
  640. // outputId(IN) - The display output id. If it's "0" then the default outputId from NvAPI_GetAssociatedDisplayOutputId() will be used.
  641. // pInfo(OUT) - The display port info
  642. //
  643. // RETURN STATUS:
  644. // NVAPI_OK - completed request
  645. // NVAPI_ERROR - miscellaneous error occurred
  646. // NVAPI_INVALID_ARGUMENT: Invalid input parameter.
  647. //
  648. ///////////////////////////////////////////////////////////////////////////////
  649. type
  650. NV_DP_LINK_RATE = (
  651. NV_DP_1_62GBPS = 6,
  652. NV_DP_2_70GBPS = $A
  653. );
  654. NV_DP_LANE_COUNT = (
  655. NV_DP_1_LANE = 1,
  656. NV_DP_2_LANE = 2,
  657. NV_DP_4_LANE = 4
  658. );
  659. NV_DP_COLOR_FORMAT = (
  660. NV_DP_COLOR_FORMAT_RGB = 0,
  661. NV_DP_COLOR_FORMAT_YCbCr422,
  662. NV_DP_COLOR_FORMAT_YCbCr444
  663. );
  664. NV_DP_COLORIMETRY = (
  665. NV_DP_COLORIMETRY_RGB = 0,
  666. NV_DP_COLORIMETRY_YCbCr_ITU601,
  667. NV_DP_COLORIMETRY_YCbCr_ITU709
  668. );
  669. NV_DP_DYNAMIC_RANGE = (
  670. NV_DP_DYNAMIC_RANGE_VESA = 0,
  671. NV_DP_DYNAMIC_RANGE_CEA
  672. );
  673. NV_DP_BPC = (
  674. NV_DP_BPC_DEFAULT = 0,
  675. NV_DP_BPC_6,
  676. NV_DP_BPC_8,
  677. NV_DP_BPC_10,
  678. NV_DP_BPC_12,
  679. NV_DP_BPC_16
  680. );
  681. TTNvDisplayPortInfoFlags = (
  682. isDp, isInternalDp, isColorCtrlSupported, is6BPCSupported, is8BPCSupported, is10BPCSupported,
  683. is12BPCSupported, is16BPCSupported
  684. );
  685. NV_DISPLAY_PORT_INFO = record
  686. version: NvU32; // structure version
  687. dpcd_ver: NvU32; // the DPCD version of the monitor
  688. maxLinkRate: NV_DP_LINK_RATE; // the max supported link rate
  689. maxLaneCount: NV_DP_LANE_COUNT; // the max supported lane count
  690. curLinkRate: NV_DP_LINK_RATE; // the current link rate
  691. curLaneCount: NV_DP_LANE_COUNT; // the current lane count
  692. colorFormat: NV_DP_COLOR_FORMAT; // the current color format
  693. dynamicRange: NV_DP_DYNAMIC_RANGE; // the dynamic range
  694. colorimetry: NV_DP_COLORIMETRY; // ignored in RGB space
  695. bpc: NV_DP_BPC; // the current bit-per-component;
  696. Flags: TTNvDisplayPortInfoFlags;
  697. {isDp: NvU32 : 1; // if the monitor is driven by display port
  698. isInternalDp: NvU32 : 1; // if the monitor is driven by NV Dp transmitter
  699. isColorCtrlSupported: NvU32 : 1; // if the color format change is supported
  700. is6BPCSupported: NvU32 : 1; // if 6 bpc is supported
  701. is8BPCSupported: NvU32 : 1; // if 8 bpc is supported
  702. is10BPCSupported: NvU32 : 1; // if 10 bpc is supported
  703. is12BPCSupported: NvU32 : 1; // if 12 bpc is supported
  704. is16BPCSupported: NvU32 : 1; // if 16 bpc is supported}
  705. end;
  706. TNvDisplayPortInfo = NV_DISPLAY_PORT_INFO;
  707. const
  708. //#define NV_DISPLAY_PORT_INFO_VER MAKE_NVAPI_VERSION(NV_DISPLAY_PORT_INFO,1)
  709. NV_DISPLAY_PORT_INFO_VER = NvU32(SizeOf(NV_DISPLAY_PORT_INFO) or (1 shl 16));
  710. var
  711. NvAPI_GetDisplayPortInfo: function(hNvDisplay: NvDisplayHandle; outputId: NvU32; var pInfo: TNvDisplayPortInfo): NvAPI_Status; cdecl;
  712. ///////////////////////////////////////////////////////////////////////////////
  713. // FUNCTION NAME: NvAPI_SetDisplayPort
  714. //
  715. // DESCRIPTION: This API is used to setup DP related configurations.
  716. //
  717. // SUPPORTED OS: Windows XP and higher
  718. //
  719. // PARAMETERS: hNvDisplay(IN) - NVIDIA display handle. It can be NVAPI_DEFAULT_HANDLE or a handle enumerated from NvAPI_EnumNVidiaDisplayHandle().
  720. // outputId(IN) - This display output ID, when it's "0" it means the default outputId generated from the return of NvAPI_GetAssociatedDisplayOutputId().
  721. // pCfg(IN) - The display port config structure. If pCfg is NULL, it means to use the driver's default value to setup.
  722. //
  723. // RETURN STATUS:
  724. // NVAPI_OK - completed request
  725. // NVAPI_ERROR - miscellaneous error occurred
  726. // NVAPI_INVALID_ARGUMENT: Invalid input parameter.
  727. ///////////////////////////////////////////////////////////////////////////////
  728. type
  729. TNvDisplayPortConfigFlags = (isHPD, isSetDeferred, isChromaLpfOff, isDitherOff);
  730. NV_DISPLAY_PORT_CONFIG = record
  731. version: NvU32; // structure version - 2 is latest
  732. linkRate: NV_DP_LINK_RATE; // the link rate
  733. laneCount: NV_DP_LANE_COUNT; // the lane count
  734. colorFormat: NV_DP_COLOR_FORMAT; // the color format to set
  735. dynamicRange: NV_DP_DYNAMIC_RANGE; // the dynamic range
  736. colorimetry: NV_DP_COLORIMETRY; // ignored in RGB space
  737. bpc: NV_DP_BPC; // the current bit-per-component;
  738. Flags: TNvDisplayPortConfigFlags;
  739. {isHPD: NvU32 : 1; // if CPL is making this call due to HPD
  740. isSetDeferred: NvU32 : 1; // requires an OS modeset to finalize the setup if set
  741. isChromaLpfOff: NvU32 : 1; // force the chroma low_pass_filter to be off
  742. isDitherOff: NvU32 : 1; // force to turn off dither}
  743. end;
  744. TNvDisplayPortConfig = NV_DISPLAY_PORT_CONFIG;
  745. const
  746. //#define NV_DISPLAY_PORT_CONFIG_VER MAKE_NVAPI_VERSION(NV_DISPLAY_PORT_CONFIG,2)
  747. //#define NV_DISPLAY_PORT_CONFIG_VER_1 MAKE_NVAPI_VERSION(NV_DISPLAY_PORT_CONFIG,1)
  748. //#define NV_DISPLAY_PORT_CONFIG_VER_2 MAKE_NVAPI_VERSION(NV_DISPLAY_PORT_CONFIG,2)
  749. NV_DISPLAY_PORT_CONFIG_VER = NvU32(SizeOf(NV_DISPLAY_PORT_CONFIG) or (2 shl 16));
  750. NV_DISPLAY_PORT_CONFIG_VER_1 = NvU32(SizeOf(NV_DISPLAY_PORT_CONFIG) or (1 shl 16));
  751. NV_DISPLAY_PORT_CONFIG_VER_2 = NvU32(SizeOf(NV_DISPLAY_PORT_CONFIG) or (2 shl 16));
  752. var
  753. NvAPI_SetDisplayPort: function(hNvDisplay: NvDisplayHandle; outputId: NvU32; var pCfg: TNvDisplayPortConfig): NvAPI_Status; cdecl;
  754. ///////////////////////////////////////////////////////////////////////////////
  755. // FUNCTION NAME: NvAPI_GetHDMISupportInfo
  756. //
  757. // DESCRIPTION: This API returns the current infoframe data on the specified device(monitor)
  758. //
  759. // SUPPORTED OS: Windows Vista and higher
  760. //
  761. // PARAMETERS: hNvDisplay(IN) - NVIDIA Display selection. It can be NVAPI_DEFAULT_HANDLE or a handle enumerated from NvAPI_EnumNVidiaDisplayHandle().
  762. // outputId(IN) - The display output id. If it's "0" then the default outputId from NvAPI_GetAssociatedDisplayOutputId() will be used.
  763. // pInfo(OUT) - The monitor and GPU's HDMI support info
  764. //
  765. // RETURN STATUS:
  766. // NVAPI_OK - completed request
  767. // NVAPI_ERROR - miscellaneous error occurred
  768. // NVAPI_INVALID_ARGUMENT: Invalid input parameter.
  769. //
  770. ///////////////////////////////////////////////////////////////////////////////
  771. type
  772. TNvHDMISupportInfoFlags = (
  773. isGpuHDMICapable, isMonUnderscanCapable, isMonBasicAudioCapable, isMonYCbCr444Capable,
  774. isMonYCbCr422Capable, isMonxvYCC601Capable, isMonxvYCC709Capable, isMonHDMI
  775. );
  776. NV_HDMI_SUPPORT_INFO = record
  777. version: NvU32; // structure version
  778. flags: TNvHDMISupportInfoFlags;
  779. {isGpuHDMICapable: NvU32 : 1; // if the GPU can handle HDMI
  780. isMonUnderscanCapable: NvU32 : 1; // if the monitor supports underscan
  781. isMonBasicAudioCapable: NvU32 : 1; // if the monitor supports basic audio
  782. isMonYCbCr444Capable: NvU32 : 1; // if YCbCr 4:4:4 is supported
  783. isMonYCbCr422Capable: NvU32 : 1; // if YCbCr 4:2:2 is supported
  784. isMonxvYCC601Capable: NvU32 : 1; // if xvYCC 601 is supported
  785. isMonxvYCC709Capable: NvU32 : 1; // if xvYCC 709 is supported
  786. isMonHDMI: NvU32 : 1; // if the monitor is HDMI (with IEEE's HDMI registry ID)}
  787. EDID861ExtRev: NvU32; // the revision number of the EDID 861 extension
  788. end;
  789. TNvHDMISupportInfo = NV_HDMI_SUPPORT_INFO;
  790. const
  791. //#define NV_HDMI_SUPPORT_INFO_VER MAKE_NVAPI_VERSION(NV_HDMI_SUPPORT_INFO,1)
  792. NV_HDMI_SUPPORT_INFO_VER = NvU32(SizeOf(NV_HDMI_SUPPORT_INFO) or (1 shl 16));
  793. var
  794. NvAPI_GetHDMISupportInfo: function(hNvDisplay: NvDisplayHandle; outputId: NvU32; var pInfo: TNvHDMISupportInfo): NvAPI_Status; cdecl;
  795. ///////////////////////////////////////////////////////////////////////////////
  796. //
  797. // FUNCTION NAME: NvAPI_GPU_GetAllOutputs
  798. //
  799. // DESCRIPTION: Returns set of all GPU-output identifiers as a bitmask.
  800. //
  801. // SUPPORTED OS: Windows XP and higher
  802. //
  803. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu or pOutputsMask is NULL
  804. // NVAPI_OK: *pOutputsMask contains a set of GPU-output identifiers
  805. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  806. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  807. //
  808. ///////////////////////////////////////////////////////////////////////////////
  809. var
  810. NvAPI_GPU_GetAllOutputs: function(hPhysicalGpu: NvPhysicalGpuHandle; var pOutputsMask: NvU32): NvAPI_Status; cdecl;
  811. ///////////////////////////////////////////////////////////////////////////////
  812. //
  813. // FUNCTION NAME: NvAPI_GPU_GetConnectedOutputs
  814. //
  815. // DESCRIPTION: Same as NvAPI_GPU_GetAllOutputs but returns only the set of GPU-output
  816. // identifiers that are connected to display devices.
  817. //
  818. // SUPPORTED OS: Windows XP and higher
  819. //
  820. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu or pOutputsMask is NULL
  821. // NVAPI_OK: *pOutputsMask contains a set of GPU-output identifiers
  822. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  823. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  824. //
  825. ///////////////////////////////////////////////////////////////////////////////
  826. var
  827. NvAPI_GPU_GetConnectedOutputs: function(hPhysicalGpu: NvPhysicalGpuHandle; var pOutputsMask: NvU32): NvAPI_Status; cdecl;
  828. ///////////////////////////////////////////////////////////////////////////////
  829. //
  830. // FUNCTION NAME: NvAPI_GPU_GetConnectedSLIOutputs
  831. //
  832. // DESCRIPTION: Same as NvAPI_GPU_GetConnectedOutputs but returns only the set of GPU-output
  833. // identifiers that can be selected in an SLI configuration. With SLI disabled
  834. // this function matches NvAPI_GPU_GetConnectedOutputs
  835. //
  836. // SUPPORTED OS: Windows XP and higher
  837. //
  838. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu or pOutputsMask is NULL
  839. // NVAPI_OK: *pOutputsMask contains a set of GPU-output identifiers
  840. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  841. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  842. //
  843. ///////////////////////////////////////////////////////////////////////////////
  844. var
  845. NvAPI_GPU_GetConnectedSLIOutputs: function(hPhysicalGpu: NvPhysicalGpuHandle; var pOutputsMask: NvU32): NvAPI_Status; cdecl;
  846. ///////////////////////////////////////////////////////////////////////////////
  847. //
  848. // FUNCTION NAME: NvAPI_GPU_GetConnectedOutputsWithLidState
  849. //
  850. // DESCRIPTION: Similar to NvAPI_GPU_GetConnectedOutputs this API returns the connected display identifiers that are connected
  851. // as a output mask but unlike NvAPI_GPU_GetConnectedOutputs this API "always" reflects the Lid State in the output mask.
  852. // Thus if you expect the LID close state to be available in the connection mask use this API.
  853. // If LID is closed then this API will remove the LID panel from the connected display identifiers.
  854. // If LID is open then this API will reflect the LID panel in the connected display identifiers.
  855. // Note:This API should be used on laptop systems and on systems where LID state is required in the connection output mask.
  856. // On desktop systems the returned identifiers will match NvAPI_GPU_GetConnectedOutputs.
  857. //
  858. // SUPPORTED OS: Windows XP and higher
  859. //
  860. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu or pOutputsMask is NULL
  861. // NVAPI_OK: *pOutputsMask contains a set of GPU-output identifiers
  862. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  863. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  864. //
  865. ///////////////////////////////////////////////////////////////////////////////
  866. var
  867. NvAPI_GPU_GetConnectedOutputsWithLidState: function(hPhysicalGpu: NvPhysicalGpuHandle; var pOutputsMask: NvU32): NvAPI_Status; cdecl;
  868. ///////////////////////////////////////////////////////////////////////////////
  869. //
  870. // FUNCTION NAME: NvAPI_GPU_GetConnectedSLIOutputsWithLidState
  871. //
  872. // DESCRIPTION: Same as NvAPI_GPU_GetConnectedOutputsWithLidState but returns only the set of GPU-output
  873. // identifiers that can be selected in an SLI configuration. With SLI disabled
  874. // this function matches NvAPI_GPU_GetConnectedOutputsWithLidState
  875. //
  876. // SUPPORTED OS: Windows XP and higher
  877. //
  878. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu or pOutputsMask is NULL
  879. // NVAPI_OK: *pOutputsMask contains a set of GPU-output identifiers
  880. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  881. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  882. //
  883. ///////////////////////////////////////////////////////////////////////////////
  884. var
  885. NvAPI_GPU_GetConnectedSLIOutputsWithLidState: function(hPhysicalGpu: NvPhysicalGpuHandle; var pOutputsMask: NvU32): NvAPI_Status; cdecl;
  886. ///////////////////////////////////////////////////////////////////////////////
  887. //
  888. // FUNCTION NAME: NvAPI_GPU_GetSystemType
  889. //
  890. // DESCRIPTION: Returns information to identify if the GPU type is for a laptop system or a desktop system.
  891. //
  892. // SUPPORTED OS: Windows XP and higher
  893. //
  894. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu or pOutputsMask is NULL
  895. // NVAPI_OK: *pSystemType contains the GPU system type
  896. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  897. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  898. //
  899. ///////////////////////////////////////////////////////////////////////////////
  900. type
  901. NV_SYSTEM_TYPE = (
  902. NV_SYSTEM_TYPE_UNKNOWN = 0,
  903. NV_SYSTEM_TYPE_LAPTOP = 1,
  904. NV_SYSTEM_TYPE_DESKTOP = 2
  905. );
  906. var
  907. NvAPI_GPU_GetSystemType: function(hPhysicalGpu: NvPhysicalGpuHandle; var pSystemType: NV_SYSTEM_TYPE): NvAPI_Status; cdecl;
  908. ///////////////////////////////////////////////////////////////////////////////
  909. //
  910. // FUNCTION NAME: NvAPI_GPU_GetActiveOutputs
  911. //
  912. // DESCRIPTION: Same as NvAPI_GPU_GetAllOutputs but returns only the set of GPU-output
  913. // identifiers that are actively driving display devices.
  914. //
  915. // SUPPORTED OS: Windows XP and higher
  916. //
  917. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu or pOutputsMask is NULL
  918. // NVAPI_OK: *pOutputsMask contains a set of GPU-output identifiers
  919. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  920. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  921. //
  922. ///////////////////////////////////////////////////////////////////////////////
  923. var
  924. NvAPI_GPU_GetActiveOutputs: function(hPhysicalGpu: NvPhysicalGpuHandle; var pOutputsMask: NvU32): NvAPI_Status; cdecl;
  925. ///////////////////////////////////////////////////////////////////////////////
  926. //
  927. // FUNCTION NAME: NvAPI_GPU_GetEDID
  928. //
  929. // DESCRIPTION: Returns the EDID data for the specified GPU handle and connection bit mask.
  930. // displayOutputId should have exactly 1 bit set to indicate a single display.
  931. //
  932. // SUPPORTED OS: Windows XP and higher
  933. //
  934. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: pEDID is NULL; displayOutputId has 0 or > 1 bits set.
  935. // NVAPI_OK: *pEDID contains valid data.
  936. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found.
  937. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle.
  938. // NVAPI_DATA_NOT_FOUND: requested display does not contain an EDID
  939. //
  940. ///////////////////////////////////////////////////////////////////////////////
  941. const
  942. NV_EDID_V1_DATA_SIZE = 256;
  943. NV_EDID_DATA_SIZE = NV_EDID_V1_DATA_SIZE;
  944. type
  945. NV_EDID = record
  946. version: NvU32; //structure version
  947. EDID_Data: array[0..NV_EDID_DATA_SIZE - 1] of NvU8;
  948. sizeofEDID: NvU32;
  949. end;
  950. TNvEDID = NV_EDID;
  951. const
  952. //#define NV_EDID_VER MAKE_NVAPI_VERSION(NV_EDID,2)
  953. NV_EDID_VER = NvU32(SizeOf(NV_EDID) or (2 shl 16));
  954. var
  955. NvAPI_GPU_GetEDID: function(hPhysicalGpu: NvPhysicalGpuHandle; displayOutputId: NvU32; var pEDID: TNvEDID): NvAPI_Status; cdecl;
  956. ///////////////////////////////////////////////////////////////////////////////
  957. //
  958. // FUNCTION NAME: NvAPI_GPU_GetOutputType
  959. //
  960. // DESCRIPTION: Give a physical GPU handle and a single outputId (exactly 1 bit set), this API
  961. // returns the output type.
  962. //
  963. // SUPPORTED OS: Windows XP and higher
  964. //
  965. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu, outputId or pOutputsMask is NULL; or outputId has > 1 bit set
  966. // NVAPI_OK: *pOutputType contains a NvGpuOutputType value
  967. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  968. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  969. //
  970. ///////////////////////////////////////////////////////////////////////////////
  971. type
  972. _NV_GPU_OUTPUT_TYPE = (
  973. NVAPI_GPU_OUTPUT_UNKNOWN = 0,
  974. NVAPI_GPU_OUTPUT_CRT = 1, // CRT display device
  975. NVAPI_GPU_OUTPUT_DFP = 2, // Digital Flat Panel display device
  976. NVAPI_GPU_OUTPUT_TV = 3 // TV display device
  977. );
  978. NV_GPU_OUTPUT_TYPE = _NV_GPU_OUTPUT_TYPE;
  979. var
  980. NvAPI_GPU_GetOutputType: function(hPhysicalGpu: NvPhysicalGpuHandle; outputId: NvU32; var pOutputType: NV_GPU_OUTPUT_TYPE): NvAPI_Status; cdecl;
  981. ///////////////////////////////////////////////////////////////////////////////
  982. //
  983. // FUNCTION NAME: NvAPI_GPU_ValidateOutputCombination
  984. //
  985. // DESCRIPTION: This call is used to determine if a set of GPU outputs can be active
  986. // simultaneously. While a GPU may have <n> outputs, they can not typically
  987. // all be active at the same time due to internal resource sharing.
  988. //
  989. // Given a physical GPU handle and a mask of candidate outputs, this call
  990. // will return NVAPI_OK if all of the specified outputs can be driven
  991. // simultaneously. It will return NVAPI_INVALID_COMBINATION if they cannot.
  992. //
  993. // Use NvAPI_GPU_GetAllOutputs() to determine which outputs are candidates.
  994. //
  995. // SUPPORTED OS: Windows XP and higher
  996. //
  997. // RETURN STATUS: NVAPI_OK: combination of outputs in outputsMask are valid (can be active simultaneously)
  998. // NVAPI_INVALID_COMBINATION: combination of outputs in outputsMask are NOT valid
  999. // NVAPI_INVALID_ARGUMENT: hPhysicalGpu or outputsMask does not have at least 2 bits set
  1000. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  1001. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  1002. //
  1003. ///////////////////////////////////////////////////////////////////////////////
  1004. var
  1005. NvAPI_GPU_ValidateOutputCombination: function(hPhysicalGpu: NvPhysicalGpuHandle; outputsMask: NvU32): NvAPI_Status; cdecl;
  1006. type
  1007. _NV_GPU_CONNECTOR_TYPE = (
  1008. NVAPI_GPU_CONNECTOR_VGA_15_PIN = $00000000,
  1009. NVAPI_GPU_CONNECTOR_TV_COMPOSITE = $00000010,
  1010. NVAPI_GPU_CONNECTOR_TV_SVIDEO = $00000011,
  1011. NVAPI_GPU_CONNECTOR_TV_HDTV_COMPONENT = $00000013,
  1012. NVAPI_GPU_CONNECTOR_TV_SCART = $00000014,
  1013. NVAPI_GPU_CONNECTOR_TV_COMPOSITE_SCART_ON_EIAJ4120 = $00000016,
  1014. NVAPI_GPU_CONNECTOR_TV_HDTV_EIAJ4120 = $00000017,
  1015. NVAPI_GPU_CONNECTOR_PC_POD_HDTV_YPRPB = $00000018,
  1016. NVAPI_GPU_CONNECTOR_PC_POD_SVIDEO = $00000019,
  1017. NVAPI_GPU_CONNECTOR_PC_POD_COMPOSITE = $0000001A,
  1018. NVAPI_GPU_CONNECTOR_DVI_I_TV_SVIDEO = $00000020,
  1019. NVAPI_GPU_CONNECTOR_DVI_I_TV_COMPOSITE = $00000021,
  1020. NVAPI_GPU_CONNECTOR_DVI_I = $00000030,
  1021. NVAPI_GPU_CONNECTOR_DVI_D = $00000031,
  1022. NVAPI_GPU_CONNECTOR_ADC = $00000032,
  1023. NVAPI_GPU_CONNECTOR_LFH_DVI_I_1 = $00000038,
  1024. NVAPI_GPU_CONNECTOR_LFH_DVI_I_2 = $00000039,
  1025. NVAPI_GPU_CONNECTOR_SPWG = $00000040,
  1026. NVAPI_GPU_CONNECTOR_OEM = $00000041,
  1027. NVAPI_GPU_CONNECTOR_DISPLAYPORT_EXTERNAL = $00000046,
  1028. NVAPI_GPU_CONNECTOR_DISPLAYPORT_INTERNAL = $00000047,
  1029. NVAPI_GPU_CONNECTOR_HDMI_A = $00000061,
  1030. NVAPI_GPU_CONNECTOR_UNKNOWN = Integer($FFFFFFFF)
  1031. );
  1032. NV_GPU_CONNECTOR_TYPE = _NV_GPU_CONNECTOR_TYPE;
  1033. ///////////////////////////////////////////////////////////////////////////////
  1034. //
  1035. // FUNCTION NAME: NvAPI_GPU_GetFullName
  1036. //
  1037. // DESCRIPTION: Retrieves the full GPU name as an ascii string. Eg: "Quadro FX 1400"
  1038. //
  1039. // SUPPORTED OS: Mac OS X, Windows XP and higher
  1040. //
  1041. // RETURN STATUS: NVAPI_ERROR or NVAPI_OK
  1042. //
  1043. ///////////////////////////////////////////////////////////////////////////////
  1044. var
  1045. NvAPI_GPU_GetFullName: function(hPhysicalGpu: NvPhysicalGpuHandle; var szName: NvAPI_ShortString): NvAPI_Status; cdecl;
  1046. ///////////////////////////////////////////////////////////////////////////////
  1047. //
  1048. // FUNCTION NAME: NvAPI_GPU_GetPCIIdentifiers
  1049. //
  1050. // DESCRIPTION: Returns the PCI identifiers associated with this GPU.
  1051. // DeviceId - the internal PCI device identifier for the GPU.
  1052. // SubSystemId - the internal PCI subsystem identifier for the GPU.
  1053. // RevisionId - the internal PCI device-specific revision identifier for the GPU.
  1054. // ExtDeviceId - the external PCI device identifier for the GPU.
  1055. //
  1056. // SUPPORTED OS: Mac OS X, Windows XP and higher
  1057. //
  1058. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu or an argument is NULL
  1059. // NVAPI_OK: arguments are populated with PCI identifiers
  1060. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  1061. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  1062. //
  1063. ///////////////////////////////////////////////////////////////////////////////
  1064. var
  1065. NvAPI_GPU_GetPCIIdentifiers: function(hPhysicalGpu: NvPhysicalGpuHandle; var pDeviceId, pSubSystemId, pRevisionId, pExtDeviceId: NvU32): NvAPI_Status; cdecl;
  1066. type
  1067. _NV_GPU_TYPE = (
  1068. NV_SYSTEM_TYPE_GPU_UNKNOWN = 0,
  1069. NV_SYSTEM_TYPE_IGPU = 1, //integrated
  1070. NV_SYSTEM_TYPE_DGPU = 2 //discrete
  1071. );
  1072. NV_GPU_TYPE = _NV_GPU_TYPE;
  1073. ///////////////////////////////////////////////////////////////////////////////
  1074. //
  1075. // FUNCTION NAME: NvAPI_GPU_GetGPUType
  1076. //
  1077. // DESCRIPTION: Returns information to identify the GPU type
  1078. //
  1079. // SUPPORTED OS: Mac OS X, Windows XP and higher
  1080. //
  1081. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu
  1082. // NVAPI_OK: *pGpuType contains the GPU type
  1083. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  1084. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  1085. //
  1086. ///////////////////////////////////////////////////////////////////////////////
  1087. var
  1088. NvAPI_GPU_GetGPUType: function(hPhysicalGpu: NvPhysicalGpuHandle; var pGpuType: NV_GPU_TYPE): NvAPI_Status; cdecl;
  1089. type
  1090. _NV_GPU_BUS_TYPE = (
  1091. NVAPI_GPU_BUS_TYPE_UNDEFINED = 0,
  1092. NVAPI_GPU_BUS_TYPE_PCI = 1,
  1093. NVAPI_GPU_BUS_TYPE_AGP = 2,
  1094. NVAPI_GPU_BUS_TYPE_PCI_EXPRESS = 3,
  1095. NVAPI_GPU_BUS_TYPE_FPCI = 4
  1096. );
  1097. NV_GPU_BUS_TYPE = _NV_GPU_BUS_TYPE;
  1098. ///////////////////////////////////////////////////////////////////////////////
  1099. //
  1100. // FUNCTION NAME: NvAPI_GPU_GetBusType
  1101. //
  1102. // DESCRIPTION: Returns the type of bus associated with this GPU.
  1103. //
  1104. // SUPPORTED OS: Mac OS X, Windows XP and higher
  1105. //
  1106. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu or pBusType is NULL
  1107. // NVAPI_OK: *pBusType contains bus identifier
  1108. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  1109. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  1110. //
  1111. ///////////////////////////////////////////////////////////////////////////////
  1112. var
  1113. NvAPI_GPU_GetBusType: function(hPhysicalGpu: NvPhysicalGpuHandle; var pBusType: NV_GPU_BUS_TYPE): NvAPI_Status; cdecl;
  1114. ///////////////////////////////////////////////////////////////////////////////
  1115. //
  1116. // FUNCTION NAME: NvAPI_GPU_GetBusId
  1117. //
  1118. // DESCRIPTION: Returns the ID of bus associated with this GPU.
  1119. //
  1120. // SUPPORTED OS: Mac OS X, Windows XP and higher
  1121. //
  1122. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu or pBusId is NULL
  1123. // NVAPI_OK: *pBusId contains bus id
  1124. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  1125. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  1126. //
  1127. ///////////////////////////////////////////////////////////////////////////////
  1128. var
  1129. NvAPI_GPU_GetBusId: function(hPhysicalGpu: NvPhysicalGpuHandle; var pBusId: NvU32): NvAPI_Status; cdecl;
  1130. ///////////////////////////////////////////////////////////////////////////////
  1131. //
  1132. // FUNCTION NAME: NvAPI_GPU_GetBusSlotId
  1133. //
  1134. // DESCRIPTION: Returns the ID of bus-slot associated with this GPU.
  1135. //
  1136. // SUPPORTED OS: Mac OS X, Windows XP and higher
  1137. //
  1138. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu or pBusSlotId is NULL
  1139. // NVAPI_OK: *pBusSlotId contains bus-slot id
  1140. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  1141. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  1142. //
  1143. ///////////////////////////////////////////////////////////////////////////////
  1144. var
  1145. NvAPI_GPU_GetBusSlotId: function(hPhysicalGpu: NvPhysicalGpuHandle; var pBusSlotId: NvU32): NvAPI_Status; cdecl;
  1146. ///////////////////////////////////////////////////////////////////////////////
  1147. //
  1148. // FUNCTION NAME: NvAPI_GPU_GetIRQ
  1149. //
  1150. // DESCRIPTION: Returns the interrupt number associated with this GPU.
  1151. //
  1152. // SUPPORTED OS: Mac OS X, Windows XP and higher
  1153. //
  1154. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu or pIRQ is NULL
  1155. // NVAPI_OK: *pIRQ contains interrupt number
  1156. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  1157. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  1158. //
  1159. ///////////////////////////////////////////////////////////////////////////////
  1160. var
  1161. NvAPI_GPU_GetIRQ: function(hPhysicalGpu: NvPhysicalGpuHandle; var pIRQ: NvU32): NvAPI_Status; cdecl;
  1162. ///////////////////////////////////////////////////////////////////////////////
  1163. //
  1164. // FUNCTION NAME: NvAPI_GPU_GetVbiosRevision
  1165. //
  1166. // DESCRIPTION: Returns the revision of the video bios associated with this GPU.
  1167. //
  1168. // SUPPORTED OS: Mac OS X, Windows XP and higher
  1169. //
  1170. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu or pBiosRevision is NULL
  1171. // NVAPI_OK: *pBiosRevision contains revision number
  1172. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  1173. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  1174. //
  1175. ///////////////////////////////////////////////////////////////////////////////
  1176. var
  1177. NvAPI_GPU_GetVbiosRevision: function(hPhysicalGpu: NvPhysicalGpuHandle; var pBiosRevision: NvU32): NvAPI_Status; cdecl;
  1178. ///////////////////////////////////////////////////////////////////////////////
  1179. //
  1180. // FUNCTION NAME: NvAPI_GPU_GetVbiosOEMRevision
  1181. //
  1182. // DESCRIPTION: Returns the OEM revision of the video bios associated with this GPU.
  1183. //
  1184. // SUPPORTED OS: Mac OS X, Windows XP and higher
  1185. //
  1186. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu or pBiosRevision is NULL
  1187. // NVAPI_OK: *pBiosRevision contains revision number
  1188. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  1189. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  1190. //
  1191. ///////////////////////////////////////////////////////////////////////////////
  1192. var
  1193. NvAPI_GPU_GetVbiosOEMRevision: function(hPhysicalGpu: NvPhysicalGpuHandle; var pBiosRevision: NvU32): NvAPI_Status; cdecl;
  1194. ///////////////////////////////////////////////////////////////////////////////
  1195. //
  1196. // FUNCTION NAME: NvAPI_GPU_GetVbiosVersionString
  1197. //
  1198. // DESCRIPTION: Returns the full bios version string in the form of xx.xx.xx.xx.yy where
  1199. // the xx numbers come from NvAPI_GPU_GetVbiosRevision and yy comes from
  1200. // NvAPI_GPU_GetVbiosOEMRevision.
  1201. //
  1202. // SUPPORTED OS: Mac OS X, Windows XP and higher
  1203. //
  1204. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: hPhysicalGpu is NULL
  1205. // NVAPI_OK: szBiosRevision contains version string
  1206. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  1207. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  1208. //
  1209. ///////////////////////////////////////////////////////////////////////////////
  1210. var
  1211. NvAPI_GPU_GetVbiosVersionString: function(hPhysicalGpu: NvPhysicalGpuHandle; var szBiosRevision: NvAPI_ShortString): NvAPI_Status; cdecl;
  1212. ///////////////////////////////////////////////////////////////////////////////
  1213. //
  1214. // FUNCTION NAME: NvAPI_GPU_GetAGPAperture
  1215. //
  1216. // DESCRIPTION: Returns AGP aperture in megabytes
  1217. //
  1218. // SUPPORTED OS: Mac OS X, Windows XP and higher
  1219. //
  1220. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: pSize is NULL
  1221. // NVAPI_OK: call successful
  1222. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  1223. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  1224. //
  1225. ///////////////////////////////////////////////////////////////////////////////
  1226. var
  1227. NvAPI_GPU_GetAGPAperture: function(hPhysicalGpu: NvPhysicalGpuHandle; pSize: NvU32): NvAPI_Status; cdecl;
  1228. ///////////////////////////////////////////////////////////////////////////////
  1229. //
  1230. // FUNCTION NAME: NvAPI_GPU_GetCurrentAGPRate
  1231. //
  1232. // DESCRIPTION: Returns the current AGP Rate (1 = 1x, 2=2x etc, 0 = AGP not present)
  1233. //
  1234. // SUPPORTED OS: Mac OS X, Windows XP and higher
  1235. //
  1236. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: pRate is NULL
  1237. // NVAPI_OK: call successful
  1238. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  1239. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  1240. //
  1241. ///////////////////////////////////////////////////////////////////////////////
  1242. var
  1243. NvAPI_GPU_GetCurrentAGPRate: function(hPhysicalGpu: NvPhysicalGpuHandle; var pRate: NvU32): NvAPI_Status; cdecl;
  1244. ///////////////////////////////////////////////////////////////////////////////
  1245. //
  1246. // FUNCTION NAME: NvAPI_GPU_GetCurrentPCIEDownstreamWidth
  1247. //
  1248. // DESCRIPTION: Returns the number of PCIE lanes being used for the PCIE interface
  1249. // downstream from the GPU.
  1250. //
  1251. // On systems that do not support PCIE, the maxspeed for the root link
  1252. // will be zero.
  1253. //
  1254. // SUPPORTED OS: Mac OS X, Windows XP and higher
  1255. //
  1256. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: pWidth is NULL
  1257. // NVAPI_OK: call successful
  1258. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  1259. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  1260. //
  1261. ///////////////////////////////////////////////////////////////////////////////
  1262. var
  1263. NvAPI_GPU_GetCurrentPCIEDownstreamWidth: function(hPhysicalGpu: NvPhysicalGpuHandle; var pWidth: NvU32): NvAPI_Status; cdecl;
  1264. ///////////////////////////////////////////////////////////////////////////////
  1265. //
  1266. // FUNCTION NAME: NvAPI_GPU_GetPhysicalFrameBufferSize
  1267. //
  1268. // DESCRIPTION: Returns the physical size of framebuffer in Kb. This does NOT include any
  1269. // system RAM that may be dedicated for use by the GPU.
  1270. //
  1271. // SUPPORTED OS: Mac OS X, Windows XP and higher
  1272. //
  1273. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: pSize is NULL
  1274. // NVAPI_OK: call successful
  1275. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  1276. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  1277. //
  1278. ///////////////////////////////////////////////////////////////////////////////
  1279. var
  1280. NvAPI_GPU_GetPhysicalFrameBufferSize: function(hPhysicalGpu: NvPhysicalGpuHandle; var pSize: NvU32): NvAPI_Status; cdecl;
  1281. ///////////////////////////////////////////////////////////////////////////////
  1282. //
  1283. // FUNCTION NAME: NvAPI_GPU_GetVirtualFrameBufferSize
  1284. //
  1285. // DESCRIPTION: Returns the virtual size of framebuffer in Kb. This includes the physical RAM plus any
  1286. // system RAM that has been dedicated for use by the GPU.
  1287. //
  1288. // SUPPORTED OS: Mac OS X, Windows XP and higher
  1289. //
  1290. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: pSize is NULL
  1291. // NVAPI_OK: call successful
  1292. // NVAPI_NVIDIA_DEVICE_NOT_FOUND: no NVIDIA GPU driving a display was found
  1293. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE: hPhysicalGpu was not a physical GPU handle
  1294. //
  1295. ///////////////////////////////////////////////////////////////////////////////
  1296. var
  1297. NvAPI_GPU_GetVirtualFrameBufferSize: function(hPhysicalGpu: NvPhysicalGpuHandle; var pSize: NvU32): NvAPI_Status; cdecl;
  1298. ///////////////////////////////////////////////////////////////////////////////////
  1299. // Thermal API
  1300. // Provides ability to get temperature levels from the various thermal sensors associated with the GPU
  1301. const
  1302. NVAPI_MAX_THERMAL_SENSORS_PER_GPU = 3;
  1303. type
  1304. NV_THERMAL_TARGET = (
  1305. NVAPI_THERMAL_TARGET_NONE = 0,
  1306. NVAPI_THERMAL_TARGET_GPU = 1,
  1307. NVAPI_THERMAL_TARGET_MEMORY = 2,
  1308. NVAPI_THERMAL_TARGET_POWER_SUPPLY = 4,
  1309. NVAPI_THERMAL_TARGET_BOARD = 8,
  1310. NVAPI_THERMAL_TARGET_ALL = 15,
  1311. NVAPI_THERMAL_TARGET_UNKNOWN = -1
  1312. );
  1313. NV_THERMAL_CONTROLLER = (
  1314. NVAPI_THERMAL_CONTROLLER_NONE = 0,
  1315. NVAPI_THERMAL_CONTROLLER_GPU_INTERNAL,
  1316. NVAPI_THERMAL_CONTROLLER_ADM1032,
  1317. NVAPI_THERMAL_CONTROLLER_MAX6649,
  1318. NVAPI_THERMAL_CONTROLLER_MAX1617,
  1319. NVAPI_THERMAL_CONTROLLER_LM99,
  1320. NVAPI_THERMAL_CONTROLLER_LM89,
  1321. NVAPI_THERMAL_CONTROLLER_LM64,
  1322. NVAPI_THERMAL_CONTROLLER_ADT7473,
  1323. NVAPI_THERMAL_CONTROLLER_SBMAX6649,
  1324. NVAPI_THERMAL_CONTROLLER_VBIOSEVT,
  1325. NVAPI_THERMAL_CONTROLLER_OS,
  1326. NVAPI_THERMAL_CONTROLLER_UNKNOWN = -1
  1327. );
  1328. NV_GPU_THERMAL_SETTINGS = record
  1329. version: NvU32; //structure version
  1330. count: NvU32; //number of associated thermal sensors with the selected GPU
  1331. sensor: array[0..NVAPI_MAX_THERMAL_SENSORS_PER_GPU - 1] of
  1332. record
  1333. controller: NV_THERMAL_CONTROLLER; //internal, ADM1032, MAX6649...
  1334. defaultMinTemp: NvU32; //the min default temperature value of the thermal sensor in degrees centigrade
  1335. defaultMaxTemp: NvU32; //the max default temperature value of the thermal sensor in degrees centigrade
  1336. currentTemp: NvU32; //the current temperature value of the thermal sensor in degrees centigrade
  1337. target: NV_THERMAL_TARGET; //thermal senor targeted @ GPU, memory, chipset, powersupply, canoas...
  1338. end;
  1339. end;
  1340. TNvGPUThermalSettings = NV_GPU_THERMAL_SETTINGS;
  1341. PNvGPUThermalSettings = ^TNvGPUThermalSettings;
  1342. const
  1343. //#define NV_GPU_THERMAL_SETTINGS_VER MAKE_NVAPI_VERSION(NV_GPU_THERMAL_SETTINGS,1)
  1344. NV_GPU_THERMAL_SETTINGS_VER = NvU32(SizeOf(NV_GPU_THERMAL_SETTINGS) or (1 shl 16));
  1345. ///////////////////////////////////////////////////////////////////////////////
  1346. //
  1347. // FUNCTION NAME: NvAPI_GPU_GetThermalSettings
  1348. //
  1349. // DESCRIPTION: Retrieves the thermal information of all thermal sensors or specific thermal sensor associated with the selected GPU.
  1350. // Thermal sensors are indexed 0 to NVAPI_MAX_THERMAL_SENSORS_PER_GPU-1.
  1351. // To retrieve specific thermal sensor info set the sensorIndex to the required thermal sensor index.
  1352. // To retrieve info for all sensors set sensorIndex to NVAPI_THERMAL_TARGET_ALL.
  1353. //
  1354. // SUPPORTED OS: Mac OS X, Windows XP and higher
  1355. //
  1356. // PARAMETERS : hPhysicalGPU(IN) - GPU selection.
  1357. // sensorIndex(IN) - Explicit thermal sensor index selection.
  1358. // pThermalSettings(OUT) - Array of thermal settings.
  1359. //
  1360. // RETURN STATUS:
  1361. // NVAPI_OK - completed request
  1362. // NVAPI_ERROR - miscellaneous error occurred
  1363. // NVAPI_INVALID_ARGUMENT - pThermalInfo is NULL
  1364. // NVAPI_HANDLE_INVALIDATED - handle passed has been invalidated (see user guide)
  1365. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE - handle passed is not a physical GPU handle
  1366. // NVAPI_INCOMPATIBLE_STRUCT_VERSION - the version of the INFO struct is not supported
  1367. //
  1368. ///////////////////////////////////////////////////////////////////////////////
  1369. var
  1370. NvAPI_GPU_GetThermalSettings: function(hPhysicalGpu: NvPhysicalGpuHandle; sensorIndex: NvU32; pThermalSettings: PNvGPUThermalSettings): NvAPI_Status; cdecl;
  1371. ////////////////////////////////////////////////////////////////////////////////
  1372. //NvAPI_TVOutput Information
  1373. type
  1374. _NV_DISPLAY_TV_FORMAT = (
  1375. NV_DISPLAY_TV_FORMAT_NONE = 0,
  1376. NV_DISPLAY_TV_FORMAT_SD_NTSCM = $00000001,
  1377. NV_DISPLAY_TV_FORMAT_SD_NTSCJ = $00000002,
  1378. NV_DISPLAY_TV_FORMAT_SD_PALM = $00000004,
  1379. NV_DISPLAY_TV_FORMAT_SD_PALBDGH = $00000008,
  1380. NV_DISPLAY_TV_FORMAT_SD_PALN = $00000010,
  1381. NV_DISPLAY_TV_FORMAT_SD_PALNC = $00000020,
  1382. NV_DISPLAY_TV_FORMAT_SD_576i = $00000100,
  1383. NV_DISPLAY_TV_FORMAT_SD_480i = $00000200,
  1384. NV_DISPLAY_TV_FORMAT_ED_480p = $00000400,
  1385. NV_DISPLAY_TV_FORMAT_ED_576p = $00000800,
  1386. NV_DISPLAY_TV_FORMAT_HD_720p = $00001000,
  1387. NV_DISPLAY_TV_FORMAT_HD_1080i = $00002000,
  1388. NV_DISPLAY_TV_FORMAT_HD_1080p = $00004000,
  1389. NV_DISPLAY_TV_FORMAT_HD_720p50 = $00008000,
  1390. NV_DISPLAY_TV_FORMAT_HD_1080p24 = $00010000,
  1391. NV_DISPLAY_TV_FORMAT_HD_1080i50 = $00020000,
  1392. NV_DISPLAY_TV_FORMAT_HD_1080p50 = $00040000
  1393. );
  1394. NV_DISPLAY_TV_FORMAT = _NV_DISPLAY_TV_FORMAT;
  1395. ///////////////////////////////////////////////////////////////////////////////////
  1396. // I2C API
  1397. // Provides ability to read or write data using I2C protocol.
  1398. // These APIs allow I2C access only to DDC monitors
  1399. const
  1400. NVAPI_MAX_SIZEOF_I2C_DATA_BUFFER = 256;
  1401. NVAPI_NO_PORTID_FOUND = 5;
  1402. NVAPI_DISPLAY_DEVICE_MASK_MAX = 24;
  1403. type
  1404. NV_I2C_INFO = record
  1405. version: NvU32; //structure version
  1406. displayMask: NvU32; //the Display Mask of the concerned display
  1407. bIsDDCPort: NvU8; //Flag indicating DDC port or a communication port
  1408. i2cDevAddress: NvU8; //the I2C target device address
  1409. pbI2cRegAddress: PNvU8; //the I2C target register address
  1410. regAddrSize: NvU32; //the size in bytes of target register address
  1411. pbData: PNvU8; //The buffer of data which is to be read/written
  1412. cbSize: NvU32; //The size of Data buffer to be read.
  1413. i2cSpeed: NvU32; //The speed at which the transaction is be made(between 28kbps to 40kbps)
  1414. end;
  1415. TNvI2CInfo = NV_I2C_INFO;
  1416. const
  1417. //#define NV_I2C_INFO_VER MAKE_NVAPI_VERSION(NV_I2C_INFO,1)
  1418. NV_I2C_INFO_VER = NvU32(SizeOf(NV_I2C_INFO) or (1 shl 16));
  1419. {***********************************************************************************}
  1420. ///////////////////////////////////////////////////////////////////////////////
  1421. //
  1422. // FUNCTION NAME: NvAPI_I2CRead
  1423. //
  1424. // DESCRIPTION: Read data buffer from I2C port
  1425. //
  1426. // SUPPORTED OS: Mac OS X, Windows XP and higher
  1427. //
  1428. // PARAMETERS: hPhysicalGPU(IN) - GPU selection.
  1429. // NV_I2C_INFO *pI2cInfo -The I2c data input structure
  1430. //
  1431. // RETURN STATUS:
  1432. // NVAPI_OK - completed request
  1433. // NVAPI_ERROR - miscellaneous error occurred
  1434. // NVAPI_HANDLE_INVALIDATED - handle passed has been invalidated (see user guide)
  1435. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE - handle passed is not a physical GPU handle
  1436. // NVAPI_INCOMPATIBLE_STRUCT_VERSION - structure version is not supported
  1437. //
  1438. ///////////////////////////////////////////////////////////////////////////////
  1439. var
  1440. NvAPI_I2CRead: function(hPhysicalGpu: NvPhysicalGpuHandle; var pI2cInfo: TNvI2CInfo): NvAPI_Status; cdecl;
  1441. ///////////////////////////////////////////////////////////////////////////////
  1442. //
  1443. // FUNCTION NAME: NvAPI_I2CWrite
  1444. //
  1445. // DESCRIPTION: Writes data buffer to I2C port
  1446. //
  1447. // SUPPORTED OS: Mac OS X, Windows XP and higher
  1448. //
  1449. // PARAMETERS: hPhysicalGPU(IN) - GPU selection.
  1450. // NV_I2C_INFO *pI2cInfo -The I2c data input structure
  1451. //
  1452. // RETURN STATUS:
  1453. // NVAPI_OK - completed request
  1454. // NVAPI_ERROR - miscellaneous error occurred
  1455. // NVAPI_HANDLE_INVALIDATED - handle passed has been invalidated (see user guide)
  1456. // NVAPI_EXPECTED_PHYSICAL_GPU_HANDLE - handle passed is not a physical GPU handle
  1457. // NVAPI_INCOMPATIBLE_STRUCT_VERSION - structure version is not supported
  1458. //
  1459. ///////////////////////////////////////////////////////////////////////////////
  1460. var
  1461. NvAPI_I2CWrite: function(hPhysicalGpu: NvPhysicalGpuHandle; var pI2cInfo: TNvI2CInfo): NvAPI_Status; cdecl;
  1462. type
  1463. NV_CHIPSET_INFO = record
  1464. version: NvU32; //structure version
  1465. vendorId: NvU32; //vendorId
  1466. deviceId: NvU32; //deviceId
  1467. szVendorName: NvAPI_ShortString; //vendor Name
  1468. szChipsetName: NvAPI_ShortString; //device Name
  1469. flags: NvU32; //Chipset info flags - obsolete
  1470. subSysVendorId: NvU32; //subsystem vendorId
  1471. subSysDeviceId: NvU32; //subsystem deviceId
  1472. szSubSysVendorName: NvAPI_ShortString;//subsystem vendor Name
  1473. end;
  1474. TNvChipsetInfo = NV_CHIPSET_INFO;
  1475. const
  1476. //#define NV_CHIPSET_INFO_VER MAKE_NVAPI_VERSION(NV_CHIPSET_INFO,3)
  1477. NV_CHIPSET_INFO_VER = NvU32(SizeOf(NV_CHIPSET_INFO) or (3 shl 16));
  1478. {type
  1479. NV_CHIPSET_INFO_FLAGS = (
  1480. NV_CHIPSET_INFO_HYBRID = $00000001
  1481. );}
  1482. const
  1483. NV_CHIPSET_INFO_HYBRID = $00000001;
  1484. type
  1485. NV_CHIPSET_INFO_v2 = record
  1486. version: NvU32; //structure version
  1487. vendorId: NvU32; //vendorId
  1488. deviceId: NvU32; //deviceId
  1489. szVendorName: NvAPI_ShortString; //vendor Name
  1490. szChipsetName: NvAPI_ShortString; //device Name
  1491. flags: NvU32; //Chipset info flags
  1492. end;
  1493. TNvChipsetInfoV2 = NV_CHIPSET_INFO_v2;
  1494. const
  1495. //#define NV_CHIPSET_INFO_VER_2 MAKE_NVAPI_VERSION(NV_CHIPSET_INFO_v2,2)
  1496. NV_CHIPSET_INFO_VER_2 = NvU32(SizeOf(NV_CHIPSET_INFO_v2) or (2 shl 16));
  1497. type
  1498. NV_CHIPSET_INFO_v1 = record
  1499. version: NvU32; //structure version
  1500. vendorId: NvU32; //vendorId
  1501. deviceId: NvU32; //deviceId
  1502. szVendorName: NvAPI_ShortString; //vendor Name
  1503. szChipsetName: NvAPI_ShortString; //device Name
  1504. end;
  1505. TNvChipsetInfoV1 = NV_CHIPSET_INFO_v1;
  1506. const
  1507. //#define NV_CHIPSET_INFO_VER_1 MAKE_NVAPI_VERSION(NV_CHIPSET_INFO_v1,1)
  1508. NV_CHIPSET_INFO_VER_1 = NvU32(SizeOf(NV_CHIPSET_INFO_v1) or (1 shl 16));
  1509. ///////////////////////////////////////////////////////////////////////////////
  1510. //
  1511. // FUNCTION NAME: NvAPI_SYS_GetChipSetInfo
  1512. //
  1513. // DESCRIPTION: Returns information about the System's ChipSet
  1514. //
  1515. // SUPPORTED OS: Mac OS X, Windows XP and higher
  1516. //
  1517. // RETURN STATUS: NVAPI_INVALID_ARGUMENT: pChipSetInfo is NULL
  1518. // NVAPI_OK: *pChipSetInfo is now set
  1519. // NVAPI_INCOMPATIBLE_STRUCT_VERSION - NV_CHIPSET_INFO version not compatible with driver
  1520. //
  1521. ///////////////////////////////////////////////////////////////////////////////
  1522. function NvAPI_SYS_GetChipSetInfo(var pChipSetInfo: TNvChipsetInfo): NvAPI_Status; cdecl; overload;
  1523. function NvAPI_SYS_GetChipSetInfo(var pChipSetInfo: TNvChipsetInfoV2): NvAPI_Status; cdecl; overload;
  1524. function NvAPI_SYS_GetChipSetInfo(var pChipSetInfo: TNvChipsetInfoV1): NvAPI_Status; cdecl; overload;
  1525. type
  1526. NV_LID_DOCK_PARAMS = record
  1527. version: NvU32; // Structure version, constructed from macro below
  1528. currentLidState: NvU32;
  1529. currentDockState: NvU32;
  1530. currentLidPolicy: NvU32;
  1531. currentDockPolicy: NvU32;
  1532. forcedLidMechanismPresent: NvU32;
  1533. forcedDockMechanismPresent: NvU32;
  1534. end;
  1535. TNvLIDDockParams = NV_LID_DOCK_PARAMS;
  1536. const
  1537. //#define NV_LID_DOCK_PARAMS_VER MAKE_NVAPI_VERSION(NV_LID_DOCK_PARAMS,1)
  1538. NV_LID_DOCK_PARAMS_VER = NvU32(SizeOf(NV_LID_DOCK_PARAMS) or (1 shl 16));
  1539. ///////////////////////////////////////////////////////////////////////////////
  1540. //
  1541. // FUNCTION NAME: NvAPI_GetLidDockInfo
  1542. //
  1543. // DESCRIPTION: Returns current lid and dock information.
  1544. //
  1545. // SUPPORTED OS: Mac OS X, Windows XP and higher
  1546. //
  1547. // RETURN STATUS: NVAPI_OK: now *pLidAndDock contains the returned lid and dock information.
  1548. // NVAPI_ERROR:If any way call is not success.
  1549. // NVAPI_NOT_SUPPORTED:If any way call is not success.
  1550. // NVAPI_HANDLE_INVALIDATED:If nvapi escape result handle is invalid.
  1551. // NVAPI_API_NOT_INTIALIZED:If NVAPI is not initialized.
  1552. //
  1553. ///////////////////////////////////////////////////////////////////////////////
  1554. var
  1555. NvAPI_SYS_GetLidAndDockInfo: function(var pLidAndDock: TNvLIDDockParams): NvAPI_Status; cdecl;
  1556. ///////////////////////////////////////////////////////////////////////////////
  1557. //
  1558. // FUNCTION NAME: NvAPI_OGL_ExpertModeSet[Get]
  1559. //
  1560. // DESCRIPTION: Configure OpenGL Expert Mode, an API usage feedback and
  1561. // advice reporting mechanism. The effects of this call are
  1562. // applied only to the current context, and are reset to the
  1563. // defaults when the context is destroyed.
  1564. //
  1565. // Note: This feature is valid at runtime only when GLExpert
  1566. // functionality has been built into the OpenGL driver
  1567. // installed on the system. All Windows Vista OpenGL
  1568. // drivers provided by NVIDIA have this instrumentation
  1569. // included by default. Windows XP, however, requires a
  1570. // special display driver available with the NVIDIA
  1571. // PerfSDK found at developer.nvidia.com.
  1572. //
  1573. // Note: These functions are valid only for the current OpenGL
  1574. // context. Calling these functions prior to creating a
  1575. // context and calling MakeCurrent with it will result
  1576. // in errors and undefined behavior.
  1577. //
  1578. // PARAMETERS: expertDetailMask Mask made up of NVAPI_OGLEXPERT_DETAIL bits,
  1579. // this parameter specifies the detail level in
  1580. // the feedback stream.
  1581. //
  1582. // expertReportMask Mask made up of NVAPI_OGLEXPERT_REPORT bits,
  1583. // this parameter specifies the areas of
  1584. // functional interest.
  1585. //
  1586. // expertOutputMask Mask made up of NVAPI_OGLEXPERT_OUTPUT bits,
  1587. // this parameter specifies the feedback output
  1588. // location.
  1589. //
  1590. // expertCallback Used in conjunction with OUTPUT_TO_CALLBACK,
  1591. // this is a simple callback function the user
  1592. // may use to obtain the feedback stream. The
  1593. // function will be called once per fully
  1594. // qualified feedback stream entry.
  1595. //
  1596. // RETURN STATUS: NVAPI_API_NOT_INTIALIZED : NVAPI not initialized
  1597. // NVAPI_NVIDIA_DEVICE_NOT_FOUND : no NVIDIA GPU found
  1598. // NVAPI_OPENGL_CONTEXT_NOT_CURRENT : no NVIDIA OpenGL context
  1599. // which supports GLExpert
  1600. // has been made current
  1601. // NVAPI_ERROR : OpenGL driver failed to load properly
  1602. // NVAPI_OK : success
  1603. //
  1604. ///////////////////////////////////////////////////////////////////////////////
  1605. const
  1606. NVAPI_OGLEXPERT_DETAIL_NONE = $00000000;
  1607. NVAPI_OGLEXPERT_DETAIL_ERROR = $00000001;
  1608. NVAPI_OGLEXPERT_DETAIL_SWFALLBACK = $00000002;
  1609. NVAPI_OGLEXPERT_DETAIL_BASIC_INFO = $00000004;
  1610. NVAPI_OGLEXPERT_DETAIL_DETAILED_INFO = $00000008;
  1611. NVAPI_OGLEXPERT_DETAIL_PERFORMANCE_WARNING = $00000010;
  1612. NVAPI_OGLEXPERT_DETAIL_QUALITY_WARNING = $00000020;
  1613. NVAPI_OGLEXPERT_DETAIL_USAGE_WARNING = $00000040;
  1614. NVAPI_OGLEXPERT_DETAIL_ALL = $FFFFFFFF;
  1615. NVAPI_OGLEXPERT_REPORT_NONE = $00000000;
  1616. NVAPI_OGLEXPERT_REPORT_ERROR = $00000001;
  1617. NVAPI_OGLEXPERT_REPORT_SWFALLBACK = $00000002;
  1618. NVAPI_OGLEXPERT_REPORT_PIPELINE_VERTEX = $00000004;
  1619. NVAPI_OGLEXPERT_REPORT_PIPELINE_GEOMETRY = $00000008;
  1620. NVAPI_OGLEXPERT_REPORT_PIPELINE_XFB = $00000010;
  1621. NVAPI_OGLEXPERT_REPORT_PIPELINE_RASTER = $00000020;
  1622. NVAPI_OGLEXPERT_REPORT_PIPELINE_FRAGMENT = $00000040;
  1623. NVAPI_OGLEXPERT_REPORT_PIPELINE_ROP = $00000080;
  1624. NVAPI_OGLEXPERT_REPORT_PIPELINE_FRAMEBUFFER = $00000100;
  1625. NVAPI_OGLEXPERT_REPORT_PIPELINE_PIXEL = $00000200;
  1626. NVAPI_OGLEXPERT_REPORT_PIPELINE_TEXTURE = $00000400;
  1627. NVAPI_OGLEXPERT_REPORT_OBJECT_BUFFEROBJECT = $00000800;
  1628. NVAPI_OGLEXPERT_REPORT_OBJECT_TEXTURE = $00001000;
  1629. NVAPI_OGLEXPERT_REPORT_OBJECT_PROGRAM = $00002000;
  1630. NVAPI_OGLEXPERT_REPORT_OBJECT_FBO = $00004000;
  1631. NVAPI_OGLEXPERT_REPORT_FEATURE_SLI = $00008000;
  1632. NVAPI_OGLEXPERT_REPORT_ALL = $FFFFFFFF;
  1633. NVAPI_OGLEXPERT_OUTPUT_TO_NONE = $00000000;
  1634. NVAPI_OGLEXPERT_OUTPUT_TO_CONSOLE = $00000001;
  1635. NVAPI_OGLEXPERT_OUTPUT_TO_DEBUGGER = $00000004;
  1636. NVAPI_OGLEXPERT_OUTPUT_TO_CALLBACK = $00000008;
  1637. NVAPI_OGLEXPERT_OUTPUT_TO_ALL = $FFFFFFFF;
  1638. ///////////////////////////////////////////////////////////////////////////////
  1639. //
  1640. // FUNCTION TYPE: NVAPI_OGLEXPERT_CALLBACK
  1641. //
  1642. // DESCRIPTION: Used in conjunction with OUTPUT_TO_CALLBACK, this is a simple
  1643. // callback function the user may use to obtain the feedback
  1644. // stream. The function will be called once per fully qualified
  1645. // feedback stream entry.
  1646. //
  1647. // PARAMETERS: categoryId Contains the bit from the NVAPI_OGLEXPERT_REPORT
  1648. // mask that corresponds to the current message
  1649. // messageId Unique Id for the current message
  1650. // detailLevel Contains the bit from the NVAPI_OGLEXPERT_DETAIL
  1651. // mask that corresponds to the current message
  1652. // objectId Unique Id of the object that corresponds to the
  1653. // current message
  1654. // messageStr Text string from the current message
  1655. //
  1656. ///////////////////////////////////////////////////////////////////////////////
  1657. type
  1658. //typedef void (* NVAPI_OGLEXPERT_CALLBACK) (unsigned int categoryId, unsigned int messageId, unsigned int detailLevel, int objectId, const AnsiChar *messageStr): NvAPI_Status; cdecl;
  1659. NVAPI_OGLEXPERT_CALLBACK = procedure (categoryId, messageId, detailLevel: Cardinal; objectId: Integer; const messageStr: PAnsiChar); cdecl;
  1660. // SUPPORTED OS: Windows XP and higher
  1661. var
  1662. NvAPI_OGL_ExpertModeSet: function(expertDetailLevel: NvU32;
  1663. expertReportMask: NvU32;
  1664. expertOutputMask: NvU32;
  1665. expertCallback: NVAPI_OGLEXPERT_CALLBACK): NvAPI_Status; cdecl;
  1666. // SUPPORTED OS: Windows XP and higher
  1667. var
  1668. NvAPI_OGL_ExpertModeGet: function(var pExpertDetailLevel: NvU32;
  1669. var pExpertReportMask: NvU32;
  1670. var pExpertOutputMask;
  1671. var pExpertCallback: NVAPI_OGLEXPERT_CALLBACK): NvAPI_Status; cdecl;
  1672. ///////////////////////////////////////////////////////////////////////////////
  1673. //
  1674. // FUNCTION NAME: NvAPI_OGL_ExpertModeDefaultsSet[Get]
  1675. //
  1676. // DESCRIPTION: Configure OpenGL Expert Mode global defaults. These settings
  1677. // apply to any OpenGL application which starts up after these
  1678. // values are applied (i.e. these settings *do not* apply to
  1679. // currently running applications).
  1680. //
  1681. // PARAMETERS: expertDetailLevel Value which specifies the detail level in
  1682. // the feedback stream. This is a mask made up
  1683. // of NVAPI_OGLEXPERT_LEVEL bits.
  1684. //
  1685. // expertReportMask Mask made up of NVAPI_OGLEXPERT_REPORT bits,
  1686. // this parameter specifies the areas of
  1687. // functional interest.
  1688. //
  1689. // expertOutputMask Mask made up of NVAPI_OGLEXPERT_OUTPUT bits,
  1690. // this parameter specifies the feedback output
  1691. // location. Note that using OUTPUT_TO_CALLBACK
  1692. // here is meaningless and has no effect, but
  1693. // using it will not cause an error.
  1694. //
  1695. // RETURN STATUS: NVAPI_ERROR or NVAPI_OK
  1696. //
  1697. ///////////////////////////////////////////////////////////////////////////////
  1698. // SUPPORTED OS: Windows XP and higher
  1699. var
  1700. NvAPI_OGL_ExpertModeDefaultsSet: function(expertDetailLevel: NvU32;
  1701. expertReportMask: NvU32;
  1702. expertOutputMask: NvU32): NvAPI_Status; cdecl;
  1703. // SUPPORTED OS: Windows XP and higher
  1704. var
  1705. NvAPI_OGL_ExpertModeDefaultsGet: function(var pExpertDetailLevel: NvU32;
  1706. var pExpertReportMask: NvU32;
  1707. var pExpertOutputMask: NvU32): NvAPI_Status; cdecl;
  1708. const
  1709. NVAPI_MAX_VIEW_TARGET = 2;
  1710. type
  1711. _NV_TARGET_VIEW_MODE = (
  1712. NV_VIEW_MODE_STANDARD = 0,
  1713. NV_VIEW_MODE_CLONE = 1,
  1714. NV_VIEW_MODE_HSPAN = 2,
  1715. NV_VIEW_MODE_VSPAN = 3,
  1716. NV_VIEW_MODE_DUALVIEW = 4,
  1717. NV_VIEW_MODE_MULTIVIEW = 5
  1718. );
  1719. NV_TARGET_VIEW_MODE = _NV_TARGET_VIEW_MODE;
  1720. TNvTargetViewMode = NV_TARGET_VIEW_MODE;
  1721. PNvTargetViewMode = ^TNvTargetViewMode;
  1722. // Following definitions are used in NvAPI_SetViewEx.
  1723. // Scaling modes
  1724. _NV_SCALING = (
  1725. NV_SCALING_DEFAULT = 0, // No change
  1726. NV_SCALING_MONITOR_SCALING = 1,
  1727. NV_SCALING_ADAPTER_SCALING = 2,
  1728. NV_SCALING_CENTERED = 3,
  1729. NV_SCALING_ASPECT_SCALING = 5,
  1730. NV_SCALING_CUSTOMIZED = 255 // For future use
  1731. );
  1732. NV_SCALING = _NV_SCALING;
  1733. // Rotate modes
  1734. _NV_ROTATE = (
  1735. NV_ROTATE_0 = 0,
  1736. NV_ROTATE_90 = 1,
  1737. NV_ROTATE_180 = 2,
  1738. NV_ROTATE_270 = 3
  1739. );
  1740. NV_ROTATE = _NV_ROTATE;
  1741. // Color formats
  1742. _NV_FORMAT = (
  1743. NV_FORMAT_UNKNOWN = 0, // unknown. Driver will choose one as following value.
  1744. NV_FORMAT_P8 = 41, // for 8bpp mode
  1745. NV_FORMAT_R5G6B5 = 23, // for 16bpp mode
  1746. NV_FORMAT_A8R8G8B8 = 21, // for 32bpp mode
  1747. NV_FORMAT_A16B16G16R16F = 113 // for 64bpp(floating point) mode.
  1748. );
  1749. NV_FORMAT = _NV_FORMAT;
  1750. // TV standard
  1751. ///////////////////////////////////////////////////////////////////////////////
  1752. // FUNCTION NAME: NvAPI_SetView
  1753. //
  1754. // DESCRIPTION: This API lets caller to modify target display arrangement for selected source display handle in any of the nview modes.
  1755. // It also allows to modify or extend the source display in dualview mode.
  1756. //
  1757. // SUPPORTED OS: Windows Vista and higher
  1758. //
  1759. // PARAMETERS: hNvDisplay(IN) - NVIDIA Display selection. NVAPI_DEFAULT_HANDLE not allowed, it has to be a handle enumerated with NvAPI_EnumNVidiaDisplayHandle().
  1760. // pTargetInfo(IN) - Pointer to array of NV_VIEW_TARGET_INFO, specifying device properties in this view.
  1761. // The first device entry in the array is the physical primary.
  1762. // The device entry with the lowest source id is the desktop primary.
  1763. // targetCount(IN) - Count of target devices specified in pTargetInfo.
  1764. // targetView(IN) - Target view selected from NV_TARGET_VIEW_MODE.
  1765. //
  1766. // RETURN STATUS:
  1767. // NVAPI_OK - completed request
  1768. // NVAPI_ERROR - miscellaneous error occurred
  1769. // NVAPI_INVALID_ARGUMENT: Invalid input parameter.
  1770. //
  1771. ///////////////////////////////////////////////////////////////////////////////
  1772. type
  1773. TNvViewTargetInfoFlags = (bPrimary, bInterlaced, bGDIPrimary);
  1774. NV_VIEW_TARGET_INFO = record
  1775. version: NvU32; // (IN) structure version
  1776. count: NvU32; // (IN) target count
  1777. target: array[0..NVAPI_MAX_VIEW_TARGET - 1] of
  1778. record
  1779. deviceMask: NvU32; // (IN/OUT) device mask
  1780. sourceId: NvU32; // (IN/OUT) source id
  1781. Flags: TNvViewTargetInfoFlags;
  1782. {bPrimary: NvU32 :1; // (OUT) Indicates if this is the GPU's primary view target. This is not the desktop GDI primary.
  1783. // NvAPI_SetView automatically selects the first target in NV_VIEW_TARGET_INFO index 0 as the GPU's primary view.
  1784. bInterlaced: NvU32 :1;// (IN/OUT) Indicates if the timing being used on this monitor is interlaced
  1785. bGDIPrimary: NvU32 :1;// (IN/OUT) Indicates if this is the desktop GDI primary.}
  1786. end;
  1787. end;
  1788. TNvViewTargetInfo = NV_VIEW_TARGET_INFO;
  1789. PNvViewTargetInfo = ^TNvViewTargetInfo;
  1790. const
  1791. //#define NV_VIEW_TARGET_INFO_VER MAKE_NVAPI_VERSION(NV_VIEW_TARGET_INFO,2)
  1792. NV_VIEW_TARGET_INFO_VER = NvU32(SizeOf(NV_VIEW_TARGET_INFO) or (2 shl 16));
  1793. var
  1794. NvAPI_SetView: function(hNvDisplay: NvDisplayHandle; pTargetInfo: PNvViewTargetInfo; targetView: TNvTargetViewMode): NvAPI_Status; cdecl;
  1795. ///////////////////////////////////////////////////////////////////////////////
  1796. // FUNCTION NAME: NvAPI_GetView
  1797. //
  1798. // DESCRIPTION: This API lets caller retrieve the target display arrangement for selected source display handle.
  1799. //
  1800. // SUPPORTED OS: Windows Vista and higher
  1801. //
  1802. // PARAMETERS: hNvDisplay(IN) - NVIDIA Display selection. NVAPI_DEFAULT_HANDLE not allowed, it has to be a handle enumerated with NvAPI_EnumNVidiaDisplayHandle().
  1803. // pTargetInfo(OUT) - User allocated storage to retrieve an array of NV_VIEW_TARGET_INFO. Can be NULL to retrieve the targetCount.
  1804. // targetMaskCount(IN/OUT) - Count of target device mask specified in pTargetMask.
  1805. // targetView(OUT) - Target view selected from NV_TARGET_VIEW_MODE.
  1806. //
  1807. // RETURN STATUS:
  1808. // NVAPI_OK - completed request
  1809. // NVAPI_ERROR - miscellaneous error occurred
  1810. // NVAPI_INVALID_ARGUMENT: Invalid input parameter.
  1811. //
  1812. ///////////////////////////////////////////////////////////////////////////////
  1813. var
  1814. NvAPI_GetView: function(hNvDisplay: NvDisplayHandle; pTargets: PNvViewTargetInfo; var pTargetMaskCount: NvU32; var pTargetView: TNvTargetViewMode): NvAPI_Status; cdecl;
  1815. ///////////////////////////////////////////////////////////////////////////////
  1816. // FUNCTION NAME: NvAPI_SetViewEx
  1817. //
  1818. // DESCRIPTION: This API lets caller to modify the display arrangement for selected source display handle in any of the nview modes.
  1819. // It also allows to modify or extend the source display in dualview mode.
  1820. //
  1821. // SUPPORTED OS: Windows Vista and higher
  1822. //
  1823. // PARAMETERS: hNvDisplay(IN) - NVIDIA Display selection. NVAPI_DEFAULT_HANDLE not allowed, it has to be a handle enumerated with NvAPI_EnumNVidiaDisplayHandle().
  1824. // pPathInfo(IN) - Pointer to array of NV_VIEW_PATH_INFO, specifying device properties in this view.
  1825. // The first device entry in the array is the physical primary.
  1826. // The device entry with the lowest source id is the desktop primary.
  1827. // pathCount(IN) - Count of paths specified in pPathInfo.
  1828. // displayView(IN)- Display view selected from NV_TARGET_VIEW_MODE.
  1829. //
  1830. // RETURN STATUS:
  1831. // NVAPI_OK - completed request
  1832. // NVAPI_ERROR - miscellaneous error occurred
  1833. // NVAPI_INVALID_ARGUMENT: Invalid input parameter.
  1834. //
  1835. ///////////////////////////////////////////////////////////////////////////////
  1836. const
  1837. NVAPI_MAX_DISPLAY_PATH = NVAPI_MAX_VIEW_TARGET;
  1838. type
  1839. NV_DISPLAY_PATH_INFO = record
  1840. version: NvU32; // (IN) structure version
  1841. count: NvU32; // (IN) path count
  1842. path: array[0..NVAPI_MAX_DISPLAY_PATH - 1] of
  1843. record
  1844. deviceMask: NvU32; // (IN) device mask
  1845. sourceId: NvU32; // (IN) source id
  1846. bPrimary: LongBool;
  1847. {bPrimary: NvU32; :1; // (IN/OUT) Indicates if this is the GPU's primary view target. This is not the desktop GDI primary.
  1848. // NvAPI_SetViewEx automatically selects the first target in NV_DISPLAY_PATH_INFO index 0 as the GPU's primary view.}
  1849. connector: NV_GPU_CONNECTOR_TYPE; // (IN) Specify connector type. For TV only.
  1850. // source mode information
  1851. width: NvU32; // (IN) width of the mode
  1852. height: NvU32; // (IN) height of the mode
  1853. depth: NvU32; // (IN) depth of the mode
  1854. colorFormat: NV_FORMAT; // color format if needs to specify. Not used now.
  1855. //rotation setting of the mode
  1856. rotation: NV_ROTATE; // (IN) rotation setting.
  1857. // the scaling mode
  1858. scaling: NV_SCALING; // (IN) scaling setting
  1859. // Timing info
  1860. refreshRate: NvU32; // (IN) refresh rate of the mode
  1861. interlaced: LongBool;
  1862. {interlaced: NvU32 :1; // (IN) interlaced mode flag}
  1863. tvFormat: NV_DISPLAY_TV_FORMAT; // (IN) to choose the last TV format set this value to NV_DISPLAY_TV_FORMAT_NONE
  1864. // Windows desktop position
  1865. posx: NvU32; // (IN/OUT) x offset of this display on the Windows desktop
  1866. posy: NvU32; // (IN/OUT) y offset of this display on the Windows desktop
  1867. bGDIPrimary: LongBool;
  1868. {bGDIPrimary: NvU32; :1; // (IN/OUT) Indicates if this is the desktop GDI primary.}
  1869. end;
  1870. end;
  1871. TNvDisplayPathInfo = NV_DISPLAY_PATH_INFO;
  1872. PNvDisplayPathInfo = ^TNvDisplayPathInfo;
  1873. const
  1874. //#define NV_DISPLAY_PATH_INFO_VER MAKE_NVAPI_VERSION(NV_DISPLAY_PATH_INFO,2)
  1875. NV_DISPLAY_PATH_INFO_VER = NvU32(SizeOf(NV_DISPLAY_PATH_INFO) or (2 shl 16));
  1876. var
  1877. NvAPI_SetViewEx: function(hNvDisplay: NvDisplayHandle; pPathInfo: PNvDisplayPathInfo; displayView: TNvTargetViewMode): NvAPI_Status; cdecl;
  1878. ///////////////////////////////////////////////////////////////////////////////
  1879. // FUNCTION NAME: NvAPI_GetViewEx
  1880. //
  1881. // DESCRIPTION: This API lets caller retrieve the target display arrangement for selected source display handle.
  1882. //
  1883. // SUPPORTED OS: Windows Vista and higher
  1884. //
  1885. // PARAMETERS: hNvDisplay(IN) - NVIDIA Display selection. NVAPI_DEFAULT_HANDLE not allowed, it has to be a handle enumerated with NvAPI_EnumNVidiaDisplayHandle().
  1886. // pPathInfo(IN/OUT) - count field should be set to NVAPI_MAX_DISPLAY_PATH. Can be NULL to retrieve just the pathCount.
  1887. // pPathCount(IN/OUT) - Number of elements in array pPathInfo->path.
  1888. // pTargetViewMode(OUT)- Display view selected from NV_TARGET_VIEW_MODE.
  1889. //
  1890. // RETURN STATUS:
  1891. // NVAPI_OK - completed request
  1892. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized
  1893. // NVAPI_ERROR - miscellaneous error occurred
  1894. // NVAPI_INVALID_ARGUMENT - Invalid input parameter.
  1895. // NVAPI_EXPECTED_DISPLAY_HANDLE - hNvDisplay is not a valid display handle.
  1896. //
  1897. ///////////////////////////////////////////////////////////////////////////////
  1898. var
  1899. NvAPI_GetViewEx: function(hNvDisplay: NvDisplayHandle; pPathInfo: PNvDisplayPathInfo; var pPathCount: NvU32; var pTargetViewMode: TNvTargetViewMode): NvAPI_Status; cdecl;
  1900. ///////////////////////////////////////////////////////////////////////////////
  1901. // FUNCTION NAME: NvAPI_GetSupportedViews
  1902. //
  1903. // DESCRIPTION: This API lets caller enumerate all the supported NVIDIA display views - nview and dualview modes.
  1904. //
  1905. // SUPPORTED OS: Windows XP and higher
  1906. //
  1907. // PARAMETERS: hNvDisplay(IN) - NVIDIA Display selection. It can be NVAPI_DEFAULT_HANDLE or a handle enumerated from NvAPI_EnumNVidiaDisplayHandle().
  1908. // pTargetViews(OUT) - Array of supported views. Can be NULL to retrieve the pViewCount first.
  1909. // pViewCount(IN/OUT) - Count of supported views.
  1910. //
  1911. // RETURN STATUS:
  1912. // NVAPI_OK - completed request
  1913. // NVAPI_ERROR - miscellaneous error occurred
  1914. // NVAPI_INVALID_ARGUMENT: Invalid input parameter.
  1915. //
  1916. ///////////////////////////////////////////////////////////////////////////////
  1917. var
  1918. NvAPI_GetSupportedViews: function(hNvDisplay: NvDisplayHandle; pTargetViews: PNvTargetViewMode; var pViewCount: NvU32): NvAPI_Status; cdecl;
  1919. type
  1920. NV_STEREO_REGISTRY_PROFILE_TYPE = Integer;
  1921. const
  1922. NVAPI_STEREO_DEFAULT_REGISTRY_PROFILE = 0; // Default registry configuration profile.
  1923. NVAPI_STEREO_DX9_REGISTRY_PROFILE = 1; // Separate registry configuration profile for DX9 executable.
  1924. NVAPI_STEREO_DX10_REGISTRY_PROFILE = 2; // Separate registry configuration profile for DX10 executable.
  1925. ///////////////////////////////////////////////////////////////////////////////
  1926. //
  1927. // FUNCTION NAME: NvAPI_Stereo_CreateConfigurationProfileRegistryKey
  1928. //
  1929. // SUPPORTED OS: Windows Vista and higher
  1930. //
  1931. // DESCRIPTION: Creates new configuration registry key for current application.
  1932. //
  1933. // If there was no configuration profile prior to the function call,
  1934. // tries to create brand new configuration profile registry key
  1935. // for a given application and fill it with default values.
  1936. // If an application already had a configuration profile registry key, does nothing.
  1937. // Name of the key is automatically determined as the name of the executable that calls this function.
  1938. // Because of this, application executable should have distinct and unique name.
  1939. // If the application is using only one version of DirectX, than the default profile type will be appropriate.
  1940. // If the application is using more than one version of DirectX from same executable,
  1941. // it should use appropriate profile type for each configuration profile.
  1942. //
  1943. // PARAMETERS: registryProfileType(IN) - Type of profile that application wants to create.
  1944. // Should be one of the symbolic constants defined in NV_STEREO_REGISTRY_PROFILE_TYPE.
  1945. // Any other value will cause function to do nothing and return NV_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED.
  1946. //
  1947. // HOW TO USE: When there is a need for an application to have default stereo parameter values,
  1948. // use this function to create a key where they will be stored.
  1949. //
  1950. // RETURN STATUS:
  1951. // NVAPI_OK - Key exists in the registry.
  1952. // NVAPI_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED - This profile type is not supported.
  1953. // NVAPI_STEREO_REGISTRY_ACCESS_FAILED - Access to registry failed.
  1954. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  1955. // NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  1956. // NVAPI_ERROR - Something is wrong (generic error).
  1957. //
  1958. ///////////////////////////////////////////////////////////////////////////////
  1959. var
  1960. NvAPI_Stereo_CreateConfigurationProfileRegistryKey : function (registryProfileType: NV_STEREO_REGISTRY_PROFILE_TYPE): NvAPI_Status; cdecl;
  1961. ///////////////////////////////////////////////////////////////////////////////
  1962. //
  1963. // FUNCTION NAME: NvAPI_Stereo_DeleteConfigurationProfileRegistryKey
  1964. //
  1965. // SUPPORTED OS: Windows Vista and higher
  1966. //
  1967. // DESCRIPTION: Removes configuration registry key for current application.
  1968. //
  1969. // If an application already had a configuration profile prior to the function call,
  1970. // this function will try to remove application's configuration profile registry key from the registry.
  1971. // If there was no configuration profile registry key prior to the function call,
  1972. // the function will do nothing and will not report an error.
  1973. //
  1974. // PARAMETERS: registryProfileType(IN) - Type of profile that application wants to delete.
  1975. // Should be one of the symbolic constants defined in NV_STEREO_REGISTRY_PROFILE_TYPE.
  1976. // Any other value will cause function to do nothing and return NV_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED.
  1977. //
  1978. // RETURN STATUS:
  1979. // NVAPI_OK - Key does not exist in the registry any more.
  1980. // NVAPI_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED - This profile type is not supported.
  1981. // NVAPI_STEREO_REGISTRY_ACCESS_FAILED - Access to registry failed.
  1982. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  1983. // NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  1984. // NVAPI_ERROR - Something is wrong (generic error).
  1985. //
  1986. ///////////////////////////////////////////////////////////////////////////////
  1987. var
  1988. NvAPI_Stereo_DeleteConfigurationProfileRegistryKey : function (registryProfileType: NV_STEREO_REGISTRY_PROFILE_TYPE): NvAPI_Status; cdecl;
  1989. ///////////////////////////////////////////////////////////////////////////////
  1990. //
  1991. // FUNCTION NAME: NvAPI_Stereo_SetConfigurationProfileValue
  1992. //
  1993. // PARAMETERS: registryProfileType(IN) - Type of profile that application wants to access.
  1994. // Should be one of the symbolic constants defined in NV_STEREO_REGISTRY_PROFILE_TYPE.
  1995. // Any other value will cause function to do nothing and return NV_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED.
  1996. // valueRegistryID(IN) - ID of the value that is being set.
  1997. // Should be one of the symbolic constants defined in NV_STEREO_REGISTRY_PROFILE_TYPE.
  1998. // Any other value will cause function to do nothing and return NVAPI_STEREO_REGISTRY_VALUE_NOT_SUPPORTED.
  1999. // pValue(IN) - Address of the value that is being set.
  2000. // Should be either address of a DWORD or of a float,
  2001. // dependent on the type of the stereo parameter whose value is being set.
  2002. // The API will then cast that address to DWORD*
  2003. // and write whatever is in those 4 bytes as a DWORD to the registry.
  2004. //
  2005. // SUPPORTED OS: Windows Vista and higher
  2006. //
  2007. // DESCRIPTION: Sets given parameter value under the application's registry key.
  2008. //
  2009. // If the value does not exist under the application's registry key,
  2010. // the value will be created under the key.
  2011. //
  2012. // RETURN STATUS:
  2013. // NVAPI_OK - Value is written to registry.
  2014. // NVAPI_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED - This profile type is not supported.
  2015. // NVAPI_STEREO_REGISTRY_VALUE_NOT_SUPPORTED - This value is not supported.
  2016. // NVAPI_STEREO_REGISTRY_ACCESS_FAILED - Access to registry failed.
  2017. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  2018. // NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  2019. // NVAPI_ERROR - Something is wrong (generic error).
  2020. //
  2021. ///////////////////////////////////////////////////////////////////////////////
  2022. type
  2023. NV_STEREO_REGISTRY_ID = Integer;
  2024. const
  2025. NVAPI_CONVERGENCE_ID = 0; // Symbolic constant for convergence registry ID.
  2026. NVAPI_FRUSTUM_ADJUST_MODE_ID = 1; // Symbolic constant for frustum adjust mode registry ID.
  2027. var
  2028. NvAPI_Stereo_SetConfigurationProfileValue : function (
  2029. registryProfileType: NV_STEREO_REGISTRY_PROFILE_TYPE;
  2030. valueRegistryID: NV_STEREO_REGISTRY_ID; Value : Pointer): NvAPI_Status; cdecl;
  2031. ///////////////////////////////////////////////////////////////////////////////
  2032. //
  2033. // FUNCTION NAME: NvAPI_Stereo_DeleteConfigurationProfileValue
  2034. //
  2035. // PARAMETERS: registryProfileType(IN) - Type of profile that application wants to access.
  2036. // Should be one of the symbolic constants defined in NV_STEREO_REGISTRY_PROFILE_TYPE.
  2037. // Any other value will cause function to do nothing and return NV_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED.
  2038. // valueRegistryID(IN) - ID of the value that is being deleted.
  2039. // Should be one of the symbolic constants defined in NV_STEREO_REGISTRY_PROFILE_TYPE.
  2040. // Any other value will cause function to do nothing and return NVAPI_STEREO_REGISTRY_VALUE_NOT_SUPPORTED.
  2041. //
  2042. // SUPPORTED OS: Windows Vista and higher
  2043. //
  2044. // DESCRIPTION: Removes given value from application's configuration profile registry key.
  2045. //
  2046. // If there is no such value, the function will do nothing and will not report an error.
  2047. //
  2048. // RETURN STATUS:
  2049. // NVAPI_OK - Value does not exist in registry any more.
  2050. // NVAPI_STEREO_REGISTRY_PROFILE_TYPE_NOT_SUPPORTED - This profile type is not supported.
  2051. // NVAPI_STEREO_REGISTRY_VALUE_NOT_SUPPORTED - This value is not supported.
  2052. // NVAPI_STEREO_REGISTRY_ACCESS_FAILED - Access to registry failed.
  2053. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  2054. // NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  2055. // NVAPI_ERROR - Something is wrong (generic error).
  2056. //
  2057. ///////////////////////////////////////////////////////////////////////////////
  2058. var
  2059. NvAPI_Stereo_DeleteConfigurationProfileValue : function (
  2060. registryProfileType : NV_STEREO_REGISTRY_PROFILE_TYPE;
  2061. valueRegistryID : NV_STEREO_REGISTRY_ID): NvAPI_Status; cdecl;
  2062. {///////////////////////////////////////////////////////////////////////////// }
  2063. { }
  2064. { FUNCTION NAME: NvAPI_Stereo_Enable }
  2065. { }
  2066. { SUPPORTED OS: Windows Vista and higher }
  2067. { }
  2068. { DESCRIPTION: Enables stereo mode in the registry. }
  2069. { Call to this function affects entire system. }
  2070. { Calls to functions that require stereo enabled with stereo disabled will have no effect, }
  2071. { and will return apropriate error code. }
  2072. { }
  2073. { RETURN STATUS: }
  2074. { NVAPI_OK - Stereo is now enabled. }
  2075. { NVAPI_API_NOT_INTIALIZED - NVAPI not initialized. }
  2076. { NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized. }
  2077. { NVAPI_ERROR - Something is wrong (generic error). }
  2078. { }
  2079. {///////////////////////////////////////////////////////////////////////////// }
  2080. var
  2081. NvAPI_Stereo_Enable : function : NVapi_status; cdecl;
  2082. {///////////////////////////////////////////////////////////////////////////// }
  2083. { }
  2084. { FUNCTION NAME: NvAPI_Stereo_Disable }
  2085. { }
  2086. { SUPPORTED OS: Windows Vista and higher }
  2087. { }
  2088. { DESCRIPTION: Disables stereo mode in the registry. }
  2089. { Call to this function affects entire system. }
  2090. { Calls to functions that require stereo enabled with stereo disabled will have no effect, }
  2091. { and will return apropriate error code. }
  2092. { }
  2093. { RETURN STATUS: }
  2094. { NVAPI_OK - Stereo is now disabled. }
  2095. { NVAPI_API_NOT_INTIALIZED - NVAPI not initialized. }
  2096. { NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized. }
  2097. { NVAPI_ERROR - Something is wrong (generic error). }
  2098. { }
  2099. {///////////////////////////////////////////////////////////////////////////// }
  2100. var
  2101. NvAPI_Stereo_Disable : function : NVapi_status; cdecl;
  2102. {///////////////////////////////////////////////////////////////////////////// }
  2103. { }
  2104. { FUNCTION NAME: NvAPI_Stereo_IsEnabled }
  2105. { }
  2106. { PARAMETERS: pIsStereoEnabled(OUT) - Address where result of the inquiry will be placed. }
  2107. { }
  2108. { SUPPORTED OS: Windows Vista and higher }
  2109. { }
  2110. { DESCRIPTION: Checks if stereo mode is enabled in the registry. }
  2111. { }
  2112. { RETURN STATUS: }
  2113. { NVAPI_OK - Check was sucessfully completed and result reflects current state of stereo availability. }
  2114. { NVAPI_API_NOT_INTIALIZED - NVAPI not initialized. }
  2115. { NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized. }
  2116. { NVAPI_ERROR - Something is wrong (generic error). }
  2117. { }
  2118. {///////////////////////////////////////////////////////////////////////////// }
  2119. var
  2120. NvAPI_Stereo_IsEnabled : function (var IsStereoEnabled: NvU8): NvAPI_Status; cdecl;
  2121. ///////////////////////////////////////////////////////////////////////////////
  2122. //
  2123. // FUNCTION NAME: NvAPI_Stereo_CreateHandleFromIUnknown
  2124. //
  2125. // PARAMETERS: pDevice(IN) - Pointer to IUnknown interface that IDirect3DDevice9* in DX9, ID3D10Device*.
  2126. // pStereoHandle(OUT) - Pointer to newly created stereo handle.
  2127. //
  2128. // SUPPORTED OS: Windows Vista and higher
  2129. //
  2130. // DESCRIPTION: Creates stereo handle, that is used in subsequent calls related to given device interface.
  2131. // This must be called before any other NvAPI_Stereo_ function for that handle.
  2132. // Multiple devices can be used at one time using multiple calls to this function (one per each device).
  2133. //
  2134. // HOW TO USE: After the Direct3D device is created, create stereo handle.
  2135. // On call success:
  2136. // Use all other NvAPI_Stereo_ functions that have stereo handle as first parameter.
  2137. // After the device interface correspondent to the stereo handle is destroyed,
  2138. // application should call NvAPI_DestroyStereoHandle for that stereo handle.
  2139. //
  2140. // RETURN STATUS:
  2141. // NVAPI_OK - Stereo handle is created for given device interface.
  2142. // NVAPI_INVALID_ARGUMENT - Provided device interface is invalid.
  2143. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  2144. // NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  2145. // NVAPI_ERROR - Something is wrong (generic error).
  2146. //
  2147. ///////////////////////////////////////////////////////////////////////////////
  2148. type
  2149. StereoHandle = Pointer;
  2150. var
  2151. NvAPI_Stereo_CreateHandleFromIUnknown : function (pDevice: IUnknown; var Handle: StereoHandle): NvAPI_Status; cdecl;
  2152. ///////////////////////////////////////////////////////////////////////////////
  2153. //
  2154. // FUNCTION NAME: NvAPI_Stereo_DestroyHandle
  2155. //
  2156. // PARAMETERS: stereoHandle(IN) - Stereo handle that is to be destroyed.
  2157. //
  2158. // SUPPORTED OS: Windows Vista and higher
  2159. //
  2160. // DESCRIPTION: Destroys stereo handle created with one of NvAPI_Stereo_CreateHandleFrom functions.
  2161. // This should be called after device corresponding to the handle has been destroyed.
  2162. //
  2163. // RETURN STATUS:
  2164. // NVAPI_OK - Stereo handle is destroyed.
  2165. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  2166. // NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  2167. // NVAPI_ERROR - Something is wrong (generic error).
  2168. //
  2169. ///////////////////////////////////////////////////////////////////////////////
  2170. var
  2171. NvAPI_Stereo_DestroyHandle : function (Handle: StereoHandle): NvAPI_Status; cdecl;
  2172. ///////////////////////////////////////////////////////////////////////////////
  2173. //
  2174. // FUNCTION NAME: NvAPI_Stereo_Activate
  2175. //
  2176. // PARAMETERS: stereoHandle(IN) - Stereo handle correspondent to device interface.
  2177. //
  2178. // SUPPORTED OS: Windows Vista and higher
  2179. //
  2180. // DESCRIPTION: Activates stereo for device interface correspondent to given stereo handle.
  2181. // Activating stereo will be possible only if stereo was enabled previously in the registry.
  2182. // Calls to all functions that require stereo activated
  2183. // with stereo deactivated will have no effect and will return appropriate error code.
  2184. //
  2185. // HOW TO USE: After the stereo handle for device interface is created via successfull call to appropriate NvAPI_Stereo_CreateHandleFrom function.
  2186. //
  2187. // RETURN STATUS:
  2188. // NVAPI_OK - Stereo is turned on.
  2189. // NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again.
  2190. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  2191. // NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  2192. // NVAPI_ERROR - Something is wrong (generic error).
  2193. //
  2194. ///////////////////////////////////////////////////////////////////////////////
  2195. var
  2196. NvAPI_Stereo_Activate : function (Handle: StereoHandle): NvAPI_Status; cdecl;
  2197. ///////////////////////////////////////////////////////////////////////////////
  2198. //
  2199. // FUNCTION NAME: NvAPI_Stereo_Deactivate
  2200. //
  2201. // PARAMETERS: stereoHandle(IN) - Stereo handle correspondent to device interface.
  2202. //
  2203. // SUPPORTED OS: Windows Vista and higher
  2204. //
  2205. // DESCRIPTION: Deactivates stereo for given device interface.
  2206. // Calls to all functions that require stereo activated
  2207. // with stereo deactivated will have no effect and will return appropriate error code.
  2208. //
  2209. // HOW TO USE: After the stereo handle for device interface is created via successfull call to appropriate NvAPI_Stereo_CreateHandleFrom function.
  2210. //
  2211. // RETURN STATUS:
  2212. // NVAPI_OK - Stereo is turned off.
  2213. // NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again.
  2214. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  2215. // NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  2216. // NVAPI_ERROR - Something is wrong (generic error).
  2217. //
  2218. ///////////////////////////////////////////////////////////////////////////////
  2219. var
  2220. NvAPI_Stereo_Deactivate : function (Handle: StereoHandle): NvAPI_Status; cdecl;
  2221. ///////////////////////////////////////////////////////////////////////////////
  2222. //
  2223. // FUNCTION NAME: NvAPI_Stereo_IsActivated
  2224. //
  2225. // PARAMETERS: stereoHandle(IN) - Stereo handle correspondent to device interface.
  2226. // pIsStereoOn(IN) - Address where result of the inquiry will be placed.
  2227. //
  2228. // SUPPORTED OS: Windows Vista and higher
  2229. //
  2230. // DESCRIPTION: Checks if stereo is activated for given device interface.
  2231. //
  2232. // HOW TO USE: After the stereo handle for device interface is created via successfull call to appropriate NvAPI_Stereo_CreateHandleFrom function.
  2233. //
  2234. // RETURN STATUS:
  2235. // NVAPI_OK - Check was sucessfully completed and result reflects current state of stereo (on/off).
  2236. // NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again.
  2237. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  2238. // NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  2239. // NVAPI_ERROR - Something is wrong (generic error).
  2240. //
  2241. ///////////////////////////////////////////////////////////////////////////////
  2242. var
  2243. NvAPI_Stereo_IsActivated : function (Handle: StereoHandle; var IsStereoOn: NvU8): NvAPI_Status; cdecl;
  2244. ///////////////////////////////////////////////////////////////////////////////
  2245. //
  2246. // FUNCTION NAME: NvAPI_Stereo_GetSeparation
  2247. //
  2248. // PARAMETERS: stereoHandle(IN) - Stereo handle correspondent to device interface.
  2249. // pSeparationPercentage(OUT) - Address of @c float type variable to store current separation percentage in.
  2250. //
  2251. // SUPPORTED OS: Windows Vista and higher
  2252. //
  2253. // DESCRIPTION: Gets current separation value (in percents).
  2254. //
  2255. // HOW TO USE: After the stereo handle for device interface is created via successfull call to appropriate NvAPI_Stereo_CreateHandleFrom function.
  2256. //
  2257. // RETURN STATUS:
  2258. // NVAPI_OK - Retrieval of separation percentage was successfull.
  2259. // NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again.
  2260. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  2261. // NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  2262. // NVAPI_ERROR - Something is wrong (generic error).
  2263. //
  2264. ///////////////////////////////////////////////////////////////////////////////
  2265. var
  2266. NvAPI_Stereo_GetSeparation : function (Handle: StereoHandle; var SeparationPercentage: Single): NvAPI_Status; cdecl;
  2267. ///////////////////////////////////////////////////////////////////////////////
  2268. //
  2269. // FUNCTION NAME: NvAPI_Stereo_SetSeparation
  2270. //
  2271. // PARAMETERS: stereoHandle(IN) - Stereo handle correspondent to device interface.
  2272. // newSeparationPercentage(IN) - New value for separation percentage.
  2273. //
  2274. // SUPPORTED OS: Windows Vista and higher
  2275. //
  2276. // DESCRIPTION: Sets separation to given percentage.
  2277. //
  2278. // HOW TO USE: After the stereo handle for device interface is created via successfull call to appropriate NvAPI_Stereo_CreateHandleFrom function.
  2279. //
  2280. // RETURN STATUS:
  2281. // NVAPI_OK - Setting of separation percentage was successfull.
  2282. // NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again.
  2283. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  2284. // NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  2285. // NVAPI_STEREO_PARAMETER_OUT_OF_RANGE - Given separation percentage is out of [0..100] range.
  2286. // NVAPI_ERROR - Something is wrong (generic error).
  2287. //
  2288. ///////////////////////////////////////////////////////////////////////////////
  2289. var
  2290. NvAPI_Stereo_SetSeparation : function (Handle: StereoHandle; newSeparationPercentage: Single): NvAPI_Status; cdecl;
  2291. ///////////////////////////////////////////////////////////////////////////////
  2292. //
  2293. // FUNCTION NAME: NvAPI_Stereo_DecreaseSeparation
  2294. //
  2295. // PARAMETERS: stereoHandle(IN) - Stereo handle correspondent to device interface.
  2296. //
  2297. // SUPPORTED OS: Windows Vista and higher
  2298. //
  2299. // DESCRIPTION: Decreases separation for given device interface (same like Ctrl+F3 hotkey).
  2300. //
  2301. // HOW TO USE: After the stereo handle for device interface is created via successfull call to appropriate NvAPI_Stereo_CreateHandleFrom function.
  2302. //
  2303. // RETURN STATUS:
  2304. // NVAPI_OK - Decrease of separation percentage was successfull.
  2305. // NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again.
  2306. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  2307. // NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  2308. // NVAPI_ERROR - Something is wrong (generic error).
  2309. //
  2310. ///////////////////////////////////////////////////////////////////////////////
  2311. var
  2312. NvAPI_Stereo_DecreaseSeparation : function (Handle: StereoHandle): NvAPI_Status; cdecl;
  2313. ///////////////////////////////////////////////////////////////////////////////
  2314. //
  2315. // FUNCTION NAME: NvAPI_Stereo_IncreaseSeparation
  2316. //
  2317. // PARAMETERS: stereoHandle(IN) - Stereo handle correspondent to device interface.
  2318. //
  2319. // SUPPORTED OS: Windows Vista and higher
  2320. //
  2321. // DESCRIPTION: Increases separation for given device interface (same like Ctrl+F4 hotkey).
  2322. //
  2323. // HOW TO USE: After the stereo handle for device interface is created via successfull call to appropriate NvAPI_Stereo_CreateHandleFrom function.
  2324. //
  2325. // RETURN STATUS:
  2326. // NVAPI_OK - Increase of separation percentage was successfull.
  2327. // NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again.
  2328. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  2329. // NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  2330. // NVAPI_ERROR - Something is wrong (generic error).
  2331. //
  2332. ///////////////////////////////////////////////////////////////////////////////
  2333. var
  2334. NvAPI_Stereo_IncreaseSeparation : function (Handle: StereoHandle): NvAPI_Status; cdecl;
  2335. ///////////////////////////////////////////////////////////////////////////////
  2336. //
  2337. // FUNCTION NAME: NvAPI_Stereo_GetConvergence
  2338. //
  2339. // PARAMETERS: stereoHandle(IN) - Stereo handle correspondent to device interface.
  2340. // pConvergence(OUT) - Address of @c float type variable to store current convergence value in.
  2341. //
  2342. // SUPPORTED OS: Windows Vista and higher
  2343. //
  2344. // DESCRIPTION: Gets current convergence value.
  2345. //
  2346. // HOW TO USE: After the stereo handle for device interface is created via successfull call to appropriate NvAPI_Stereo_CreateHandleFrom function.
  2347. //
  2348. // RETURN STATUS:
  2349. // NVAPI_OK - Retrieval of convergence value was successfull.
  2350. // NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again.
  2351. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  2352. // NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  2353. // NVAPI_ERROR - Something is wrong (generic error).
  2354. //
  2355. ///////////////////////////////////////////////////////////////////////////////
  2356. var
  2357. NvAPI_Stereo_GetConvergence : function (Handle: StereoHandle; var pConvergence: Single): NvAPI_Status; cdecl;
  2358. ///////////////////////////////////////////////////////////////////////////////
  2359. //
  2360. // FUNCTION NAME: NvAPI_Stereo_SetConvergence
  2361. //
  2362. // PARAMETERS: stereoHandle(IN) - Stereo handle correspondent to device interface.
  2363. // newConvergencePercentage(IN) - New value for convergence.
  2364. //
  2365. // SUPPORTED OS: Windows Vista and higher
  2366. //
  2367. // DESCRIPTION: Sets convergence to given value.
  2368. //
  2369. // HOW TO USE: After the stereo handle for device interface is created via successfull call to appropriate NvAPI_Stereo_CreateHandleFrom function.
  2370. //
  2371. // RETURN STATUS:
  2372. // NVAPI_OK - Setting of convergence value was successfull.
  2373. // NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again.
  2374. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  2375. // NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  2376. // NVAPI_ERROR - Something is wrong (generic error).
  2377. //
  2378. ///////////////////////////////////////////////////////////////////////////////
  2379. var
  2380. NvAPI_Stereo_SetConvergence : function (Handle: StereoHandle; newConvergencePercentage: Single): NvAPI_Status; cdecl;
  2381. ///////////////////////////////////////////////////////////////////////////////
  2382. //
  2383. // FUNCTION NAME: NvAPI_Stereo_DecreaseConvergence
  2384. //
  2385. // PARAMETERS: stereoHandle(IN) - Stereo handle correspondent to device interface.
  2386. //
  2387. // SUPPORTED OS: Windows Vista and higher
  2388. //
  2389. // DESCRIPTION: Decreases convergence for given device interface (same like Ctrl+F5 hotkey).
  2390. //
  2391. // HOW TO USE: After the stereo handle for device interface is created via successfull call to appropriate NvAPI_Stereo_CreateHandleFrom function.
  2392. //
  2393. // RETURN STATUS:
  2394. // NVAPI_OK - Decrease of convergence was successfull.
  2395. // NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again.
  2396. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  2397. // NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  2398. // NVAPI_ERROR - Something is wrong (generic error).
  2399. //
  2400. ///////////////////////////////////////////////////////////////////////////////
  2401. var
  2402. NvAPI_Stereo_DecreaseConvergence : function (Handle: StereoHandle): NvAPI_Status; cdecl;
  2403. ///////////////////////////////////////////////////////////////////////////////
  2404. //
  2405. // FUNCTION NAME: NvAPI_Stereo_IncreaseConvergence
  2406. //
  2407. // PARAMETERS: stereoHandle(IN) - Stereo handle correspondent to device interface.
  2408. //
  2409. // SUPPORTED OS: Windows Vista and higher
  2410. //
  2411. // DESCRIPTION: Increases convergence for given device interface (same like Ctrl+F5 hotkey).
  2412. //
  2413. // HOW TO USE: After the stereo handle for device interface is created via successfull call to appropriate NvAPI_Stereo_CreateHandleFrom function.
  2414. //
  2415. // RETURN STATUS:
  2416. // NVAPI_OK - Increase of convergence was successfull.
  2417. // NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again.
  2418. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  2419. // NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  2420. // NVAPI_ERROR - Something is wrong (generic error).
  2421. //
  2422. ///////////////////////////////////////////////////////////////////////////////
  2423. var
  2424. NvAPI_Stereo_IncreaseConvergence : function (Handle: StereoHandle): NvAPI_Status; cdecl;
  2425. ///////////////////////////////////////////////////////////////////////////////
  2426. //
  2427. // FUNCTION NAME: NvAPI_Stereo_GetFrustumAdjustMode
  2428. //
  2429. // PARAMETERS: stereoHandle(IN) - Stereo handle correspondent to device interface.
  2430. // pFrustumAdjustMode(OUT) - Address of the NV_FRUSTUM_ADJUST_MODE type variable to store current frustum value in.
  2431. //
  2432. // SUPPORTED OS: Windows Vista and higher
  2433. //
  2434. // DESCRIPTION: Gets current frustum adjust mode value.
  2435. //
  2436. // HOW TO USE: After the stereo handle for device interface is created via successfull call to appropriate NvAPI_Stereo_CreateHandleFrom function.
  2437. //
  2438. // RETURN STATUS:
  2439. // NVAPI_OK - Retrieval of frustum adjust mode was successfull.
  2440. // NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again.
  2441. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  2442. // NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  2443. // NVAPI_ERROR - Something is wrong (generic error).
  2444. //
  2445. ///////////////////////////////////////////////////////////////////////////////
  2446. type
  2447. NV_FRUSTUM_ADJUST_MODE = Integer;
  2448. const
  2449. NVAPI_NO_FRUSTUM_ADJUST = 0; // Do not adjust frustum.
  2450. NVAPI_FRUSTUM_STRETCH = 1; // Stretch images in X.
  2451. NVAPI_FRUSTUM_CLEAR_EDGES = 2; // Clear corresponding edges for each eye.
  2452. var
  2453. NvAPI_Stereo_GetFrustumAdjustMode : function (Handle: StereoHandle;
  2454. var FrustumAdjustMode: NV_FRUSTUM_ADJUST_MODE): NvAPI_Status; cdecl;
  2455. ///////////////////////////////////////////////////////////////////////////////
  2456. //
  2457. // FUNCTION NAME: NvAPI_Stereo_SetFrustumAdjustMode
  2458. //
  2459. // PARAMETERS: stereoHandle(IN) - Stereo handle correspondent to device interface.
  2460. // newFrustumAdjustModeValue (IN) - New value for frustum adjust mode.
  2461. // Should be one of the symbolic constants defined in NV_FRUSTUM_ADJUST_MODE.
  2462. // Any other value will cause function to do nothing and return NVAPI_STEREO_FRUSTUM_ADJUST_MODE_NOT_SUPPORTED.
  2463. //
  2464. // SUPPORTED OS: Windows Vista and higher
  2465. //
  2466. // DESCRIPTION: Sets current frustum adjust mode value.
  2467. //
  2468. // HOW TO USE: After the stereo handle for device interface is created via successfull call to appropriate NvAPI_Stereo_CreateHandleFrom function.
  2469. //
  2470. // RETURN STATUS:
  2471. // NVAPI_OK - Retrieval of frustum adjust mode was successfull.
  2472. // NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again.
  2473. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  2474. // NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  2475. // NVAPI_STEREO_FRUSTUM_ADJUST_MODE_NOT_SUPPORTED - Given frustum adjust mode is not supported.
  2476. // NVAPI_ERROR - Something is wrong (generic error).
  2477. //
  2478. ///////////////////////////////////////////////////////////////////////////////
  2479. var
  2480. NvAPI_Stereo_SetFrustumAdjustMode : function (Handle: StereoHandle;
  2481. newFrustumAdjustModeValue: NV_FRUSTUM_ADJUST_MODE): NvAPI_Status; cdecl;
  2482. ///////////////////////////////////////////////////////////////////////////////
  2483. //
  2484. // FUNCTION NAME: NvAPI_Stereo_CaptureJpegImage
  2485. //
  2486. // PARAMETERS: stereoHandle(IN) - Stereo handle correspondent to device interface.
  2487. // quality(IN) - Quality of the JPEG image to be captured. Integer value betweeen 0 and 100.
  2488. //
  2489. // SUPPORTED OS: Windows Vista and higher
  2490. //
  2491. // DESCRIPTION: Captures current stereo image in JPEG stereo format with given quality.
  2492. // Only the last capture call per flip will be effective.
  2493. //
  2494. // HOW TO USE: After the stereo handle for device interface is created via successfull call to appropriate NvAPI_Stereo_CreateHandleFrom function.
  2495. //
  2496. // RETURN STATUS:
  2497. // NVAPI_OK - Image captured.
  2498. // NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again.
  2499. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  2500. // NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  2501. // NVAPI_STEREO_PARAMETER_OUT_OF_RANGE - Given quality is out of [0..100] range.
  2502. // NVAPI_ERROR - Something is wrong (generic error).
  2503. //
  2504. ///////////////////////////////////////////////////////////////////////////////
  2505. var
  2506. NvAPI_Stereo_CaptureJpegImage : function (Handle: StereoHandle; quality: NvU32): NvAPI_Status; cdecl;
  2507. ///////////////////////////////////////////////////////////////////////////////
  2508. //
  2509. // FUNCTION NAME: NvAPI_Stereo_CapturePngImage
  2510. //
  2511. // PARAMETERS: stereoHandle(IN) - Stereo handle correspondent to device interface.
  2512. //
  2513. // SUPPORTED OS: Windows Vista and higher
  2514. //
  2515. // DESCRIPTION: Captures current stereo image in PNG stereo format.
  2516. // Only the last capture call per flip will be effective.
  2517. //
  2518. // HOW TO USE: After the stereo handle for device interface is created via successfull call to appropriate NvAPI_Stereo_CreateHandleFrom function.
  2519. //
  2520. // RETURN STATUS:
  2521. // NVAPI_OK - Image captured.
  2522. // NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again.
  2523. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  2524. // NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  2525. // NVAPI_ERROR - Something is wrong (generic error).
  2526. //
  2527. ///////////////////////////////////////////////////////////////////////////////
  2528. var
  2529. NvAPI_Stereo_CapturePngImage : function (Handle: StereoHandle): NvAPI_Status; cdecl;
  2530. ///////////////////////////////////////////////////////////////////////////////
  2531. //
  2532. // FUNCTION NAME: NvAPI_Stereo_ReverseStereoBlitControl
  2533. //
  2534. // PARAMETERS: stereoHandle(IN) - Stereo handle correspondent to device interface.
  2535. // TurnOn(IN) != 0 - turns on,
  2536. // == 0 - turns off
  2537. //
  2538. // SUPPORTED OS: Windows Vista and higher
  2539. //
  2540. // DESCRIPTION: Turns on/off reverse stereo blit
  2541. //
  2542. // HOW TO USE: After the stereo handle for device interface is created via successfull call to appropriate
  2543. // NvAPI_Stereo_CreateHandleFrom function.
  2544. // After reversed stereo blit control turned on blit from stereo surface will
  2545. // produce right eye image in the left side of the destination surface and left
  2546. // eye image in the right side of the destination surface
  2547. // Conditions:
  2548. // 1. DstWidth == 2*SrcWidth
  2549. // 2. DstHeight == SrcHeight
  2550. // 3. Src surface is actually stereo surface.
  2551. // 4. SrcRect must be {0,0,SrcWidth,SrcHeight}
  2552. // 5. DstRect must be {0,0,DstWidth,DstHeight}
  2553. // In DX9 Dst surface has to be created as render target and StretchRect has to be used.
  2554. //
  2555. // RETURN STATUS:
  2556. // NVAPI_OK - Retrieval of frustum adjust mode was successfull.
  2557. // NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again.
  2558. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  2559. // NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  2560. // NVAPI_ERROR - Something is wrong (generic error).
  2561. //
  2562. ///////////////////////////////////////////////////////////////////////////////
  2563. var
  2564. NvAPI_Stereo_ReverseStereoBlitControl : function (Handle: StereoHandle; TurnOn: NvU8): NvAPI_Status; cdecl;
  2565. ///////////////////////////////////////////////////////////////////////////////
  2566. //
  2567. // FUNCTION NAME: NvAPI_Stereo_SetNotificationMessage
  2568. //
  2569. // PARAMETERS: stereoHandle(IN) - Stereo handle correspondent to device interface.
  2570. // hWnd(IN) - Window HWND that will be notified when user changed stereo driver state.
  2571. // Actual HWND must be cast to an NvU64.
  2572. // messageID(IN) - MessageID of the message that will be posted to hWnd
  2573. //
  2574. // SUPPORTED OS: Windows Vista and higher
  2575. //
  2576. // DESCRIPTION: Setup notification message that stereo driver will use to notify application
  2577. // when user changes stereo driver state.
  2578. // Call this API with NULL hWnd to prohibit notification.
  2579. //
  2580. //
  2581. // HOW TO USE: After the stereo handle for device interface is created via successfull call to appropriate
  2582. // NvAPI_Stereo_CreateHandleFrom function.
  2583. //
  2584. // When user changes stereo state Activated or Deactivated, separation or conversion
  2585. // stereo driver will post defined message with the folloing parameters
  2586. //
  2587. // wParam == MAKEWPARAM(l, h) where l == 0 if stereo is deactivated
  2588. // 1 if stereo is deactivated
  2589. // h - is current separation.
  2590. // Actual separation is float(h*100.f/0xFFFF);
  2591. // lParam is current conversion.
  2592. // Actual conversion is *(float*)&lParam
  2593. //
  2594. // RETURN STATUS:
  2595. // NVAPI_OK - Notification set.
  2596. // NVAPI_STEREO_INVALID_DEVICE_INTERFACE - Device interface is not valid. Create again, then attach again.
  2597. // NVAPI_API_NOT_INTIALIZED - NVAPI not initialized.
  2598. // NVAPI_STEREO_NOT_INITIALIZED - Stereo part of NVAPI not initialized.
  2599. // NVAPI_ERROR - Something is wrong (generic error).
  2600. //
  2601. ///////////////////////////////////////////////////////////////////////////////
  2602. var
  2603. NvAPI_Stereo_SetNotificationMessage : function (Handle: StereoHandle;
  2604. hWnd: NvU64; messageID : NvU64): NvAPI_Status; cdecl;
  2605. implementation
  2606. { Macros }
  2607. function GetNvAPIVersion(Ver: NvU32): NvU32;
  2608. begin
  2609. Result := Ver shr 16;
  2610. end;
  2611. function GetNvAPISize(Ver: NvU32): NvU32;
  2612. begin
  2613. Result := Ver and $FFFF;
  2614. end;
  2615. var
  2616. _NvAPI_SYS_GetChipSetInfo: function(var pChipSetInfo: TNvChipsetInfo): NvAPI_Status; cdecl;
  2617. function NvAPI_SYS_GetChipSetInfo(var pChipSetInfo: TNvChipsetInfo): NvAPI_Status;
  2618. begin
  2619. Result := _NvAPI_SYS_GetChipSetInfo(pChipSetInfo);
  2620. end;
  2621. function NvAPI_SYS_GetChipSetInfo(var pChipSetInfo: TNvChipsetInfoV2): NvAPI_Status;
  2622. begin
  2623. Result := _NvAPI_SYS_GetChipSetInfo(TNvChipsetInfo(Pointer(@pChipSetInfo)^));
  2624. end;
  2625. function NvAPI_SYS_GetChipSetInfo(var pChipSetInfo: TNvChipsetInfoV1): NvAPI_Status;
  2626. begin
  2627. Result := _NvAPI_SYS_GetChipSetInfo(TNvChipsetInfo(Pointer(@pChipSetInfo)^));
  2628. end;
  2629. { Initialization }
  2630. var
  2631. Initialized: Boolean = False;
  2632. type
  2633. PNvAPIFuncRec = ^TNvAPIFuncRec;
  2634. TNvAPIFuncRec = record
  2635. ID: Cardinal;
  2636. Func: Pointer;
  2637. end;
  2638. const
  2639. NvAPIFunctions: array[0..89] of TNvAPIFuncRec = (
  2640. (ID: $6C2D048C; Func: @@NvAPI_GetErrorMessage),
  2641. (ID: $01053FA5; Func: @@NvAPI_GetInterfaceVersionString),
  2642. (ID: $F951A4D1; Func: @@NvAPI_GetDisplayDriverVersion),
  2643. (ID: $9ABDD40D; Func: @@NvAPI_EnumNvidiaDisplayHandle),
  2644. (ID: $20DE9260; Func: @@NvAPI_EnumNvidiaUnAttachedDisplayHandle),
  2645. (ID: $35C29134; Func: @@NvAPI_GetAssociatedNvidiaDisplayHandle),
  2646. (ID: $E5AC921F; Func: @@NvAPI_EnumPhysicalGPUs),
  2647. (ID: $48B3EA59; Func: @@NvAPI_EnumLogicalGPUs),
  2648. (ID: $34EF9506; Func: @@NvAPI_GetPhysicalGPUsFromDisplay),
  2649. (ID: $5018ED61; Func: @@NvAPI_GetPhysicalGPUFromUnAttachedDisplay),
  2650. (ID: $EE1370CF; Func: @@NvAPI_GetLogicalGPUFromDisplay),
  2651. (ID: $ADD604D1; Func: @@NvAPI_GetLogicalGPUFromPhysicalGPU),
  2652. (ID: $AEA3FA32; Func: @@NvAPI_GetPhysicalGPUsFromLogicalGPU),
  2653. (ID: $22A78B05; Func: @@NvAPI_GetAssociatedNvidiaDisplayName),
  2654. (ID: $4888D790; Func: @@NvAPI_GetUnAttachedAssociatedDisplayName),
  2655. (ID: $63F9799E; Func: @@NvAPI_CreateDisplayFromUnAttachedDisplay),
  2656. (ID: $2863148D; Func: @@NvAPI_EnableHWCursor),
  2657. (ID: $AB163097; Func: @@NvAPI_DisableHWCursor),
  2658. (ID: $67B5DB55; Func: @@NvAPI_GetVBlankCounter),
  2659. (ID: $3092AC32; Func: @@NvAPI_SetRefreshRateOverride),
  2660. (ID: $D995937E; Func: @@NvAPI_GetAssociatedDisplayOutputId),
  2661. (ID: $C64FF367; Func: @@NvAPI_GetDisplayPortInfo),
  2662. (ID: $FA13E65A; Func: @@NvAPI_SetDisplayPort),
  2663. (ID: $6AE16EC3; Func: @@NvAPI_GetHDMISupportInfo),
  2664. (ID: $7D554F8E; Func: @@NvAPI_GPU_GetAllOutputs),
  2665. (ID: $1730BFC9; Func: @@NvAPI_GPU_GetConnectedOutputs),
  2666. (ID: $0680DE09; Func: @@NvAPI_GPU_GetConnectedSLIOutputs),
  2667. (ID: $CF8CAF39; Func: @@NvAPI_GPU_GetConnectedOutputsWithLidState),
  2668. (ID: $96043CC7; Func: @@NvAPI_GPU_GetConnectedSLIOutputsWithLidState),
  2669. (ID: $BAAABFCC; Func: @@NvAPI_GPU_GetSystemType),
  2670. (ID: $E3E89B6F; Func: @@NvAPI_GPU_GetActiveOutputs),
  2671. (ID: $37D32E69; Func: @@NvAPI_GPU_GetEDID),
  2672. (ID: $40A505E4; Func: @@NvAPI_GPU_GetOutputType),
  2673. (ID: $34C9C2D4; Func: @@NvAPI_GPU_ValidateOutputCombination),
  2674. (ID: $CEEE8E9F; Func: @@NvAPI_GPU_GetFullName),
  2675. (ID: $2DDFB66E; Func: @@NvAPI_GPU_GetPCIIdentifiers),
  2676. (ID: $C33BAEB1; Func: @@NvAPI_GPU_GetGPUType),
  2677. (ID: $1BB18724; Func: @@NvAPI_GPU_GetBusType),
  2678. (ID: $1BE0B8E5; Func: @@NvAPI_GPU_GetBusId),
  2679. (ID: $2A0A350F; Func: @@NvAPI_GPU_GetBusSlotId),
  2680. (ID: $E4715417; Func: @@NvAPI_GPU_GetIRQ),
  2681. (ID: $ACC3DA0A; Func: @@NvAPI_GPU_GetVbiosRevision),
  2682. (ID: $2D43FB31; Func: @@NvAPI_GPU_GetVbiosOEMRevision),
  2683. (ID: $A561FD7D; Func: @@NvAPI_GPU_GetVbiosVersionString),
  2684. (ID: $6E042794; Func: @@NvAPI_GPU_GetAGPAperture),
  2685. (ID: $C74925A0; Func: @@NvAPI_GPU_GetCurrentAGPRate),
  2686. (ID: $D048C3B1; Func: @@NvAPI_GPU_GetCurrentPCIEDownstreamWidth),
  2687. (ID: $46FBEB03; Func: @@NvAPI_GPU_GetPhysicalFrameBufferSize),
  2688. (ID: $5A04B644; Func: @@NvAPI_GPU_GetVirtualFrameBufferSize),
  2689. (ID: $E3640A56; Func: @@NvAPI_GPU_GetThermalSettings),
  2690. (ID: $2FDE12C5; Func: @@NvAPI_I2CRead),
  2691. (ID: $E812EB07; Func: @@NvAPI_I2CWrite)
  2692. ,
  2693. (ID: $53DABBCA; Func: @@_NvAPI_SYS_GetChipSetInfo),
  2694. (ID: $CDA14D8A; Func: @@NvAPI_SYS_GetLidAndDockInfo),
  2695. (ID: $3805EF7A; Func: @@NvAPI_OGL_ExpertModeSet),
  2696. (ID: $22ED9516; Func: @@NvAPI_OGL_ExpertModeGet),
  2697. (ID: $B47A657E; Func: @@NvAPI_OGL_ExpertModeDefaultsSet),
  2698. (ID: $AE921F12; Func: @@NvAPI_OGL_ExpertModeDefaultsGet),
  2699. (ID: $0957D7B6; Func: @@NvAPI_SetView),
  2700. (ID: $D6B99D89; Func: @@NvAPI_GetView),
  2701. (ID: $06B89E68; Func: @@NvAPI_SetViewEx),
  2702. (ID: $DBBC0AF4; Func: @@NvAPI_GetViewEx),
  2703. (ID: $66FB7FC0; Func: @@NvAPI_GetSupportedViews),
  2704. (ID: $BE7692EC; Func: @@NvAPI_Stereo_CreateConfigurationProfileRegistryKey), //76 NvAPI_Stereo_CreateConfigurationProfileRegistryKey
  2705. (ID: $F117B834; Func: @@NvAPI_Stereo_DeleteConfigurationProfileRegistryKey), //77 NvAPI_Stereo_DeleteConfigurationProfileRegistryKey
  2706. (ID: $24409F48; Func: @@NvAPI_Stereo_SetConfigurationProfileValue), //78 NvAPI_Stereo_SetConfigurationProfileValue
  2707. (ID: $49BCEECF; Func: @@NvAPI_Stereo_DeleteConfigurationProfileValue), //79 NvAPI_Stereo_DeleteConfigurationProfileValue
  2708. (ID: $239C4545; Func: @@NvAPI_Stereo_Enable), //80 NvAPI_Stereo_Enable
  2709. (ID: $2EC50C2B; Func: @@NvAPI_Stereo_Disable), //81 NvAPI_Stereo_Disable
  2710. (ID: $348FF8E1; Func: @@NvAPI_Stereo_IsEnabled), //82 NvAPI_Stereo_IsEnabled
  2711. (ID: $AC7E37F4; Func: @@NvAPI_Stereo_CreateHandleFromIUnknown), //83 NvAPI_Stereo_CreateHandleFromIUnknown
  2712. (ID: $3A153134; Func: @@NvAPI_Stereo_DestroyHandle), //84 NvAPI_Stereo_DestroyHandle
  2713. (ID: $F6A1AD68; Func: @@NvAPI_Stereo_Activate), //85 NvAPI_Stereo_Activate
  2714. (ID: $2D68DE96; Func: @@NvAPI_Stereo_Deactivate), //86 NvAPI_Stereo_Deactivate
  2715. (ID: $1FB0BC30; Func: @@NvAPI_Stereo_IsActivated), //87 NvAPI_Stereo_IsActivated
  2716. (ID: $451F2134; Func: @@NvAPI_Stereo_GetSeparation), //88 NvAPI_Stereo_GetSeparation
  2717. (ID: $5C069FA3; Func: @@NvAPI_Stereo_SetSeparation), //89 NvAPI_Stereo_SetSeparation
  2718. (ID: $DA044458; Func: @@NvAPI_Stereo_DecreaseSeparation), //90 NvAPI_Stereo_DecreaseSeparation
  2719. (ID: $C9A8ECEC; Func: @@NvAPI_Stereo_IncreaseSeparation), //91 NvAPI_Stereo_IncreaseSeparation
  2720. (ID: $4AB00934; Func: @@NvAPI_Stereo_GetConvergence), //92 NvAPI_Stereo_GetConvergence
  2721. (ID: $3DD6B54B; Func: @@NvAPI_Stereo_SetConvergence), //93 NvAPI_Stereo_SetConvergence
  2722. (ID: $4C87E317; Func: @@NvAPI_Stereo_DecreaseConvergence), //94 NvAPI_Stereo_DecreaseConvergence
  2723. (ID: $A17DAABE; Func: @@NvAPI_Stereo_IncreaseConvergence), //95 NvAPI_Stereo_IncreaseConvergence
  2724. (ID: $E6839B43; Func: @@NvAPI_Stereo_GetFrustumAdjustMode), //96 NvAPI_Stereo_GetFrustumAdjustMode
  2725. (ID: $7BE27FA2; Func: @@NvAPI_Stereo_SetFrustumAdjustMode), //97 NvAPI_Stereo_SetFrustumAdjustMode
  2726. (ID: $932CB140; Func: @@NvAPI_Stereo_CaptureJpegImage), //98 NvAPI_Stereo_CaptureJpegImage
  2727. (ID: $8B7E99B5; Func: @@NvAPI_Stereo_CapturePngImage), //99 NvAPI_Stereo_CapturePngImage
  2728. (ID: $3CD58F89; Func: @@NvAPI_Stereo_ReverseStereoBlitControl), //100 NvAPI_Stereo_ReverseStereoBlitControl
  2729. (ID: $6B9B409E; Func: @@NvAPI_Stereo_SetNotificationMessage), //101 NvAPI_Stereo_SetNotificationMessage
  2730. (ID: 0; Func: nil) // stop signal
  2731. );
  2732. function NotImplemented: NvAPI_Status; cdecl;
  2733. begin
  2734. Result := NVAPI_NO_IMPLEMENTATION;
  2735. end;
  2736. function NvAPI_Initialize;
  2737. const
  2738. NvAPILib = 'nvapi.dll';
  2739. NvAPI_ID_INIT = $0150E828;
  2740. var
  2741. Lib: THandle;
  2742. nvapi_QueryInterface: function(ID: LongWord): Pointer; cdecl;
  2743. InitFunc: function: Integer; stdcall;
  2744. P: Pointer;
  2745. Rec: PNvAPIFuncRec;
  2746. begin
  2747. if Initialized then
  2748. begin
  2749. Result := NVAPI_OK;
  2750. Exit;
  2751. end;
  2752. Lib := LoadLibrary(NvAPILib);
  2753. if Lib <> 0 then
  2754. begin
  2755. nvapi_QueryInterface := GetProcAddress(Lib, 'nvapi_QueryInterface');
  2756. Result := NVAPI_ERROR;
  2757. if Assigned(nvapi_QueryInterface) then
  2758. begin
  2759. InitFunc := nvapi_QueryInterface(NvAPI_ID_INIT);
  2760. if Assigned(InitFunc) then
  2761. begin
  2762. if InitFunc() >= 0 then
  2763. begin
  2764. { Initialize all function pointers }
  2765. Rec := @NvAPIFunctions;
  2766. while Rec.ID <> 0 do
  2767. begin
  2768. PPointer(Rec.Func)^ := @NotImplemented;
  2769. P := nvapi_QueryInterface(Rec.ID);
  2770. if P <> nil then
  2771. PPointer(Rec.Func)^ := P;
  2772. Inc(Rec);
  2773. end;
  2774. Result := NVAPI_OK;
  2775. end;
  2776. end;
  2777. end;
  2778. end
  2779. else begin
  2780. Result := NVAPI_LIBRARY_NOT_FOUND;
  2781. { Initialize all function to not implemented }
  2782. Rec := @NvAPIFunctions;
  2783. while Rec.ID <> 0 do
  2784. begin
  2785. PPointer(Rec.Func)^ := @NotImplemented;
  2786. Inc(Rec);
  2787. end;
  2788. end;
  2789. Initialized := Result = NVAPI_OK;
  2790. end;
  2791. end.