nvapi.pas 145 KB

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