DirectDraw.pas 255 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164
  1. {******************************************************************************}
  2. {* *}
  3. {* Copyright (C) Microsoft Corporation. All Rights Reserved. *}
  4. {* *}
  5. {* Files: ddraw.h dvp.h *}
  6. {* Content: DirectDraw and DirectDrawVideoPort include files *}
  7. {* *}
  8. {* DirectX 9.0 Delphi adaptation by Alexey Barkovoy *}
  9. {* E-Mail: clootie@reactor.ru *}
  10. {* *}
  11. {* Modified: 26-Jan-2003 *}
  12. {* *}
  13. {* Based upon : *}
  14. {* DirectX 7.0 Object Pascal adaptation by *}
  15. {* Erik Unger, e-Mail: DelphiDirectX@next-reality.com *}
  16. {* *}
  17. {* Latest version can be downloaded from: *}
  18. {* http://clootie.narod.ru/delphi/ *}
  19. {* *}
  20. {******************************************************************************}
  21. { }
  22. { Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI) }
  23. { }
  24. { The contents of this file are used with permission, subject to the Mozilla }
  25. { Public License Version 1.1 (the "License"); you may not use this file except }
  26. { in compliance with the License. You may obtain a copy of the License at }
  27. { http://www.mozilla.org/MPL/MPL-1.1.html }
  28. { }
  29. { Software distributed under the License is distributed on an "AS IS" basis, }
  30. { WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
  31. { the specific language governing rights and limitations under the License. }
  32. { }
  33. { Alternatively, the contents of this file may be used under the terms of the }
  34. { GNU Lesser General Public License (the "LGPL License"), in which case the }
  35. { provisions of the LGPL License are applicable instead of those above. }
  36. { If you wish to allow use of your version of this file only under the terms }
  37. { of the LGPL License and not to allow others to use your version of this file }
  38. { under the MPL, indicate your decision by deleting the provisions above and }
  39. { replace them with the notice and other provisions required by the LGPL }
  40. { License. If you do not delete the provisions above, a recipient may use }
  41. { your version of this file under either the MPL or the LGPL License. }
  42. { }
  43. { For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
  44. { }
  45. {******************************************************************************}
  46. ///////////////////////////////////////////////////////////////////////////////
  47. // Notes:
  48. //----------------------------------------------------------------------------
  49. // Possible input defines for this file, mapped to original C values:
  50. // DIRECTDRAW_VERSION_7 : DIRECTDRAW_VERSION = 0x0700,
  51. // DIRECTDRAW_VERSION_6 : DIRECTDRAW_VERSION = 0x0600,
  52. // DIRECTDRAW_VERSION_5 : DIRECTDRAW_VERSION = 0x0500,
  53. // DIRECTDRAW_VERSION_3 : DIRECTDRAW_VERSION = 0x0300,
  54. // DIRECTDRAW_VERSION_LESS_3 : DIRECTDRAW_VERSION < 0x0300,
  55. //
  56. // By default DIRECTDRAW_VERSION_7 (DIRECTDRAW_VERSION = 0x0700) is assumed
  57. //
  58. // Also you can use generic DIRECTXx defines, so:
  59. // DIRECTX7 equal to DIRECTDRAW_VERSION_7;
  60. // DIRECTX6 equal to DIRECTDRAW_VERSION_6;
  61. // DIRECTX5 equal to DIRECTDRAW_VERSION_5;
  62. // DIRECTX3 equal to DIRECTDRAW_VERSION_3
  63. ///////////////////////////////////////////////////////////////////////////////
  64. unit DirectDraw;
  65. interface
  66. {$I DirectX.inc}
  67. ////////////////////////////////////////////////////////////////////////
  68. // Global level dynamic loading support
  69. {$IFDEF DYNAMIC_LINK_ALL}
  70. {$DEFINE DIRECTDRAW_DYNAMIC_LINK}
  71. {$ENDIF}
  72. {$IFDEF DYNAMIC_LINK_EXPLICIT_ALL}
  73. {$DEFINE DIRECTDRAW_DYNAMIC_LINK_EXPLICIT}
  74. {$ENDIF}
  75. // Remove "dots" below to force some kind of dynamic linking
  76. {.$DEFINE DIRECTDRAW_DYNAMIC_LINK}
  77. {.$DEFINE DIRECTDRAW_DYNAMIC_LINK_EXPLICIT}
  78. ////////////////////////////////////////////////////////////////////////
  79. // Assume for what DirectDraw version we will compile headers
  80. {$IFDEF DIRECTX7}
  81. {$DEFINE DIRECTDRAW_VERSION_7}
  82. {$ENDIF}
  83. {$IFDEF DIRECTX6}
  84. {$DEFINE DIRECTDRAW_VERSION_6}
  85. {$ENDIF}
  86. {$IFDEF DIRECTX5}
  87. {$DEFINE DIRECTDRAW_VERSION_5}
  88. {$ENDIF}
  89. {$IFDEF DIRECTX3}
  90. {$DEFINE DIRECTDRAW_VERSION_3}
  91. {$ENDIF}
  92. {$IFNDEF DIRECTDRAW_VERSION_7}
  93. {$IFNDEF DIRECTDRAW_VERSION_6}
  94. {$IFNDEF DIRECTDRAW_VERSION_5}
  95. {$IFNDEF DIRECTDRAW_VERSION_3}
  96. {$IFNDEF DIRECTDRAW_VERSION_LESS_3}
  97. {$DEFINE DIRECTDRAW_VERSION_7} // Compiling for DirectDraw7 by default
  98. {$ENDIF}
  99. {$ENDIF}
  100. {$ENDIF}
  101. {$ENDIF}
  102. {$ENDIF}
  103. ////////////////////////////////////////////////////////////////////////
  104. // Emit conditionals to C++Builder compiler
  105. {$IFDEF DIRECTDRAW_VERSION_LESS_3}
  106. {$HPPEMIT '#define DIRECTDRAW_VERSION 0x0100'}
  107. {$ENDIF}
  108. {$IFDEF DIRECTDRAW_VERSION_3}
  109. {$HPPEMIT '#define DIRECTDRAW_VERSION 0x0300'}
  110. {$ENDIF}
  111. {$IFDEF DIRECTDRAW_VERSION_5}
  112. {$HPPEMIT '#define DIRECTDRAW_VERSION 0x0500'}
  113. {$ENDIF}
  114. {$IFDEF DIRECTDRAW_VERSION_6}
  115. {$HPPEMIT '#define DIRECTDRAW_VERSION 0x0600'}
  116. {$ENDIF}
  117. {$IFDEF DIRECTDRAW_VERSION_7}
  118. {$HPPEMIT '#define DIRECTDRAW_VERSION 0x0700'}
  119. {$ENDIF}
  120. ////////////////////////////////////////////////////////////////////////
  121. // Define symbols for '<=' comparision
  122. {$IFDEF DIRECTDRAW_VERSION_7}
  123. {$DEFINE DIRECTDRAW_VERSION_6}
  124. {$ENDIF}
  125. {$IFDEF DIRECTDRAW_VERSION_6}
  126. {$DEFINE DIRECTDRAW_VERSION_5}
  127. {$ENDIF}
  128. {$IFDEF DIRECTDRAW_VERSION_5}
  129. {$DEFINE DIRECTDRAW_VERSION_3}
  130. {$ENDIF}
  131. {$IFDEF DIRECTDRAW_VERSION_3}
  132. {$DEFINE DIRECTDRAW_VERSION_LESS_3}
  133. {$ENDIF}
  134. (*$HPPEMIT '#include "ddraw.h"' *)
  135. (*$HPPEMIT '#include "dvp.h"' *)
  136. uses
  137. Windows;
  138. (*==========================================================================;
  139. *
  140. * Copyright (C) Microsoft Corporation. All Rights Reserved.
  141. *
  142. * File: ddraw.h
  143. * Content: DirectDraw include file
  144. *
  145. ***************************************************************************)
  146. function MAKEFOURCC(ch0, ch1, ch2, ch3: Char): DWORD;
  147. {$EXTERNALSYM MAKEFOURCC}
  148. (*
  149. * FOURCC codes for DX compressed-texture pixel formats
  150. *)
  151. const
  152. //#define FOURCC_DXT1 (MAKEFOURCC('D','X','T','1'))
  153. FOURCC_DXT1 = DWORD(Byte('D') or (Byte('X') shl 8) or (Byte('T') shl 16) or (Byte('1') shl 24));
  154. {$EXTERNALSYM FOURCC_DXT1}
  155. //#define FOURCC_DXT2 (MAKEFOURCC('D','X','T','2'))
  156. FOURCC_DXT2 = DWORD(Byte('D') or (Byte('X') shl 8) or (Byte('T') shl 16) or (Byte('2') shl 24));
  157. {$EXTERNALSYM FOURCC_DXT2}
  158. //#define FOURCC_DXT3 (MAKEFOURCC('D','X','T','3'))
  159. FOURCC_DXT3 = DWORD(Byte('D') or (Byte('X') shl 8) or (Byte('T') shl 16) or (Byte('3') shl 24));
  160. {$EXTERNALSYM FOURCC_DXT3}
  161. //#define FOURCC_DXT4 (MAKEFOURCC('D','X','T','4'))
  162. FOURCC_DXT4 = DWORD(Byte('D') or (Byte('X') shl 8) or (Byte('T') shl 16) or (Byte('4') shl 24));
  163. {$EXTERNALSYM FOURCC_DXT4}
  164. //#define FOURCC_DXT5 (MAKEFOURCC('D','X','T','5'))
  165. FOURCC_DXT5 = DWORD(Byte('D') or (Byte('X') shl 8) or (Byte('T') shl 16) or (Byte('5') shl 24));
  166. {$EXTERNALSYM FOURCC_DXT5}
  167. (*
  168. * GUIDS used by DirectDraw objects
  169. *)
  170. const
  171. CLSID_DirectDraw: TGUID = '{D7B70EE0-4340-11CF-B063-0020AFC2CD35}';
  172. {$EXTERNALSYM CLSID_DirectDraw}
  173. CLSID_DirectDraw7: TGUID = '{3c305196-50db-11d3-9cfe-00c04fd930c5}';
  174. {$EXTERNALSYM CLSID_DirectDraw7}
  175. CLSID_DirectDrawClipper: TGUID = '{593817A0-7DB3-11CF-A2DE-00AA00b93356}';
  176. {$EXTERNALSYM CLSID_DirectDrawClipper}
  177. (* These GUID's defined later by typedefing to Delphi interfaces
  178. DEFINE_GUID( IID_IDirectDraw, 0x6C14DB80,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
  179. DEFINE_GUID( IID_IDirectDraw2, 0xB3A6F3E0,0x2B43,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xB9,0x33,0x56 );
  180. DEFINE_GUID( IID_IDirectDraw4, 0x9c59509a,0x39bd,0x11d1,0x8c,0x4a,0x00,0xc0,0x4f,0xd9,0x30,0xc5 );
  181. DEFINE_GUID( IID_IDirectDraw7, 0x15e65ec0,0x3b9c,0x11d2,0xb9,0x2f,0x00,0x60,0x97,0x97,0xea,0x5b );
  182. DEFINE_GUID( IID_IDirectDrawSurface, 0x6C14DB81,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
  183. DEFINE_GUID( IID_IDirectDrawSurface2, 0x57805885,0x6eec,0x11cf,0x94,0x41,0xa8,0x23,0x03,0xc1,0x0e,0x27 );
  184. DEFINE_GUID( IID_IDirectDrawSurface3, 0xDA044E00,0x69B2,0x11D0,0xA1,0xD5,0x00,0xAA,0x00,0xB8,0xDF,0xBB );
  185. DEFINE_GUID( IID_IDirectDrawSurface4, 0x0B2B8630,0xAD35,0x11D0,0x8E,0xA6,0x00,0x60,0x97,0x97,0xEA,0x5B );
  186. DEFINE_GUID( IID_IDirectDrawSurface7, 0x06675a80,0x3b9b,0x11d2,0xb9,0x2f,0x00,0x60,0x97,0x97,0xea,0x5b );
  187. DEFINE_GUID( IID_IDirectDrawPalette, 0x6C14DB84,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
  188. DEFINE_GUID( IID_IDirectDrawClipper, 0x6C14DB85,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
  189. DEFINE_GUID( IID_IDirectDrawColorControl, 0x4B9F0EE0,0x0D7E,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8 );
  190. DEFINE_GUID( IID_IDirectDrawGammaControl, 0x69C11C3E,0xB46B,0x11D1,0xAD,0x7A,0x00,0xC0,0x4F,0xC2,0x9B,0x4E );
  191. *)
  192. const
  193. DD_ROP_SPACE = (256 div 32); // space required to store ROP array
  194. {$EXTERNALSYM DD_ROP_SPACE}
  195. MAX_DDDEVICEID_STRING = 512;
  196. {$EXTERNALSYM MAX_DDDEVICEID_STRING}
  197. (*============================================================================
  198. *
  199. * DirectDraw Structures
  200. *
  201. * Various structures used to invoke DirectDraw.
  202. *
  203. *==========================================================================*)
  204. var
  205. NilGUID : TGUID = '{00000000-0000-0000-0000-000000000000}';
  206. type
  207. //Clootie: This was originally in Erik Unger headers - don't know why, so leave it alone
  208. TRefGUID = packed record
  209. case Integer of
  210. 1: (guid : PGUID);
  211. 2: (dwFlags : DWORD);
  212. end;
  213. REFGUID = PGUID;
  214. {$EXTERNALSYM REFGUID}
  215. {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectDraw);'}
  216. {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectDraw2);'}
  217. {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectDraw4);'}
  218. {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectDraw7);'}
  219. {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectDrawSurface);'}
  220. {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectDrawSurface2);'}
  221. {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectDrawSurface3);'}
  222. {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectDrawSurface4);'}
  223. {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectDrawSurface7);'}
  224. {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectDrawPalette);'}
  225. {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectDrawClipper);'}
  226. {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectDrawColorControl);'}
  227. {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectDrawGammaControl);'}
  228. IDirectDraw = interface;
  229. {$EXTERNALSYM IDirectDraw}
  230. IDirectDraw2 = interface;
  231. {$EXTERNALSYM IDirectDraw2}
  232. IDirectDraw4 = interface;
  233. {$EXTERNALSYM IDirectDraw4}
  234. IDirectDraw7 = interface;
  235. {$EXTERNALSYM IDirectDraw7}
  236. IDirectDrawSurface = interface;
  237. {$EXTERNALSYM IDirectDrawSurface}
  238. IDirectDrawSurface2 = interface;
  239. {$EXTERNALSYM IDirectDrawSurface2}
  240. IDirectDrawSurface3 = interface;
  241. {$EXTERNALSYM IDirectDrawSurface3}
  242. IDirectDrawSurface4 = interface;
  243. {$EXTERNALSYM IDirectDrawSurface4}
  244. IDirectDrawSurface7 = interface;
  245. {$EXTERNALSYM IDirectDrawSurface7}
  246. IDirectDrawPalette = interface;
  247. {$EXTERNALSYM IDirectDrawPalette}
  248. IDirectDrawClipper = interface;
  249. {$EXTERNALSYM IDirectDrawClipper}
  250. IDirectDrawColorControl = interface;
  251. {$EXTERNALSYM IDirectDrawColorControl}
  252. IDirectDrawGammaControl = interface;
  253. {$EXTERNALSYM IDirectDrawGammaControl}
  254. (*
  255. * Generic pixel format with 8-bit RGB and alpha components
  256. *)
  257. PDDARGB = ^TDDARGB;
  258. _DDARGB = packed record
  259. blue: Byte;
  260. green: Byte;
  261. red: Byte;
  262. alpha: Byte;
  263. end;
  264. {$EXTERNALSYM _DDARGB}
  265. DDARGB = _DDARGB;
  266. {$EXTERNALSYM DDARGB}
  267. TDDARGB = _DDARGB;
  268. (*
  269. * This version of the structure remains for backwards source compatibility.
  270. * The DDARGB structure is the one that should be used for all DirectDraw APIs.
  271. *)
  272. PDDRGBA = ^TDDRGBA;
  273. _DDRGBA = packed record
  274. red : Byte;
  275. green : Byte;
  276. blue : Byte;
  277. alpha : Byte;
  278. end;
  279. {$EXTERNALSYM _DDRGBA}
  280. DDRGBA = _DDRGBA;
  281. {$EXTERNALSYM DDRGBA}
  282. TDDRGBA = _DDRGBA;
  283. (*
  284. * TDDColorKey
  285. *)
  286. PDDColorKey = ^TDDColorKey;
  287. _DDCOLORKEY = packed record
  288. dwColorSpaceLowValue: DWORD; // low boundary of color space that is to
  289. // be treated as Color Key, inclusive
  290. dwColorSpaceHighValue: DWORD; // high boundary of color space that is
  291. // to be treated as Color Key, inclusive
  292. end;
  293. {$EXTERNALSYM _DDCOLORKEY}
  294. DDCOLORKEY = _DDCOLORKEY;
  295. {$EXTERNALSYM DDCOLORKEY}
  296. TDDColorKey = _DDCOLORKEY;
  297. // Delphi 5 and up don't allow interfaces in variant records
  298. // so we have to use pointers instead (which can be type-casted into interfaces):
  299. //{$IFDEF COMPILER5_UP}
  300. // PDirectDrawSurface = Pointer;
  301. //{$ELSE}
  302. // PDirectDrawSurface = IDirectDrawSurface;
  303. //{$ENDIF}
  304. PDirectDrawSurface = Pointer;
  305. (*
  306. * TDDBltFX
  307. * Used to pass override information to the DIRECTDRAWSURFACE callback Blt.
  308. *)
  309. PDDBltFX = ^TDDBltFX;
  310. _DDBLTFX = packed record
  311. dwSize : DWORD; // size of structure
  312. dwDDFX : DWORD; // FX operations
  313. dwROP : DWORD; // Win32 raster operations
  314. dwDDROP : DWORD; // Raster operations new for DirectDraw
  315. dwRotationAngle : DWORD; // Rotation angle for blt
  316. dwZBufferOpCode : DWORD; // ZBuffer compares
  317. dwZBufferLow : DWORD; // Low limit of Z buffer
  318. dwZBufferHigh : DWORD; // High limit of Z buffer
  319. dwZBufferBaseDest : DWORD; // Destination base value
  320. dwZDestConstBitDepth : DWORD; // Bit depth used to specify Z constant for destination
  321. case Integer of
  322. 0: (
  323. dwZDestConst : DWORD // Constant to use as Z buffer for dest
  324. );
  325. 1: (
  326. lpDDSZBufferDest : PDirectDrawSurface; // Surface to use as Z buffer for dest
  327. dwZSrcConstBitDepth : DWORD; // Bit depth used to specify Z constant for source
  328. case integer of
  329. 0: (
  330. dwZSrcConst : DWORD; // Constant to use as Z buffer for src
  331. );
  332. 1: (
  333. lpDDSZBufferSrc : PDirectDrawSurface; // Surface to use as Z buffer for src
  334. dwAlphaEdgeBlendBitDepth : DWORD; // Bit depth used to specify constant for alpha edge blend
  335. dwAlphaEdgeBlend : DWORD; // Alpha for edge blending
  336. dwReserved : DWORD;
  337. dwAlphaDestConstBitDepth : DWORD; // Bit depth used to specify alpha constant for destination
  338. case integer of
  339. 0: (
  340. dwAlphaDestConst : DWORD; // Constant to use as Alpha Channel
  341. );
  342. 1: (
  343. lpDDSAlphaDest : PDirectDrawSurface; // Surface to use as Alpha Channel
  344. dwAlphaSrcConstBitDepth : DWORD; // Bit depth used to specify alpha constant for source
  345. case integer of
  346. 0: (
  347. dwAlphaSrcConst : DWORD; // Constant to use as Alpha Channel
  348. );
  349. 1: (
  350. lpDDSAlphaSrc : PDirectDrawSurface; // Surface to use as Alpha Channel
  351. case integer of
  352. 0: (
  353. dwFillColor : DWORD; // color in RGB or Palettized
  354. );
  355. 1: (
  356. dwFillDepth : DWORD; // depth value for z-buffer
  357. );
  358. 2: (
  359. dwFillPixel : DWORD; // pixel value
  360. );
  361. 3: (
  362. lpDDSPattern : PDirectDrawSurface; // Surface to use as pattern
  363. ddckDestColorkey : TDDColorKey; // DestColorkey override
  364. ddckSrcColorkey : TDDColorKey; // SrcColorkey override
  365. )
  366. )
  367. )
  368. )
  369. )
  370. end;
  371. {$EXTERNALSYM _DDBLTFX}
  372. DDBLTFX = _DDBLTFX;
  373. {$EXTERNALSYM DDBLTFX}
  374. TDDBltFX = _DDBLTFX;
  375. (*
  376. * TDDSCaps
  377. *)
  378. PDDSCaps = ^TDDSCaps;
  379. _DDSCAPS = packed record
  380. dwCaps: DWORD; // capabilities of surface wanted
  381. end;
  382. {$EXTERNALSYM _DDSCAPS}
  383. DDSCAPS = _DDSCAPS;
  384. {$EXTERNALSYM DDSCAPS}
  385. TDDSCaps = _DDSCAPS;
  386. (*
  387. * TDDOSCaps
  388. *)
  389. PDDOSCaps = ^TDDOSCaps;
  390. _DDOSCAPS = packed record
  391. dwCaps: DWORD; // capabilities of surface wanted
  392. end;
  393. {$EXTERNALSYM _DDOSCAPS}
  394. DDOSCAPS = _DDOSCAPS;
  395. {$EXTERNALSYM DDOSCAPS}
  396. TDDOSCaps = _DDOSCAPS;
  397. (*
  398. * This structure is used internally by DirectDraw.
  399. *)
  400. PDDSCapsEx = ^TDDSCapsEx;
  401. _DDSCAPSEX = packed record
  402. dwCaps2 : DWORD;
  403. dwCaps3 : DWORD;
  404. dwCaps4 : DWORD;
  405. end;
  406. {$EXTERNALSYM _DDSCAPSEX}
  407. DDSCAPSEX = _DDSCAPSEX;
  408. {$EXTERNALSYM DDSCAPSEX}
  409. TDDSCapsEx = _DDSCAPSEX;
  410. (*
  411. * TDDSCaps2
  412. *)
  413. PDDSCaps2 = ^TDDSCaps2;
  414. _DDSCAPS2 = packed record
  415. dwCaps: DWORD; // capabilities of surface wanted
  416. dwCaps2 : DWORD;
  417. dwCaps3 : DWORD;
  418. dwCaps4 : DWORD;
  419. end;
  420. {$EXTERNALSYM _DDSCAPS2}
  421. DDSCAPS2 = _DDSCAPS2;
  422. {$EXTERNALSYM DDSCAPS2}
  423. TDDSCaps2 = _DDSCAPS2;
  424. (*
  425. * NOTE: Our choosen structure number scheme is to append a single digit to
  426. * the end of the structure giving the version that structure is associated
  427. * with.
  428. *)
  429. (*
  430. * This structure represents the DDCAPS structure released in DirectDraw 1.0. It is used internally
  431. * by DirectDraw to interpret caps passed into ddraw by drivers written prior to the release of DirectDraw 2.0.
  432. * New applications should use the DDCAPS structure defined below.
  433. *)
  434. PDDCaps_DX1 = ^TDDCaps_DX1;
  435. _DDCAPS_DX1 = packed record
  436. dwSize: DWORD; // size of the DDDRIVERCAPS structure
  437. dwCaps: DWORD; // driver specific capabilities
  438. dwCaps2: DWORD; // more driver specific capabilites
  439. dwCKeyCaps: DWORD; // color key capabilities of the surface
  440. dwFXCaps: DWORD; // driver specific stretching and effects capabilites
  441. dwFXAlphaCaps: DWORD; // alpha driver specific capabilities
  442. dwPalCaps: DWORD; // palette capabilities
  443. dwSVCaps: DWORD; // stereo vision capabilities
  444. dwAlphaBltConstBitDepths: DWORD; // DDBD_2,4,8
  445. dwAlphaBltPixelBitDepths: DWORD; // DDBD_1,2,4,8
  446. dwAlphaBltSurfaceBitDepths: DWORD; // DDBD_1,2,4,8
  447. dwAlphaOverlayConstBitDepths: DWORD; // DDBD_2,4,8
  448. dwAlphaOverlayPixelBitDepths: DWORD; // DDBD_1,2,4,8
  449. dwAlphaOverlaySurfaceBitDepths: DWORD; // DDBD_1,2,4,8
  450. dwZBufferBitDepths: DWORD; // DDBD_8,16,24,32
  451. dwVidMemTotal: DWORD; // total amount of video memory
  452. dwVidMemFree: DWORD; // amount of free video memory
  453. dwMaxVisibleOverlays: DWORD; // maximum number of visible overlays
  454. dwCurrVisibleOverlays: DWORD; // current number of visible overlays
  455. dwNumFourCCCodes: DWORD; // number of four cc codes
  456. dwAlignBoundarySrc: DWORD; // source rectangle alignment
  457. dwAlignSizeSrc: DWORD; // source rectangle byte size
  458. dwAlignBoundaryDest: DWORD; // dest rectangle alignment
  459. dwAlignSizeDest: DWORD; // dest rectangle byte size
  460. dwAlignStrideAlign: DWORD; // stride alignment
  461. dwRops: Array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported
  462. ddsCaps: TDDSCaps; // TDDSCaps structure has all the general capabilities
  463. dwMinOverlayStretch: DWORD; // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  464. dwMaxOverlayStretch: DWORD; // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  465. dwMinLiveVideoStretch: DWORD; // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  466. dwMaxLiveVideoStretch: DWORD; // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  467. dwMinHwCodecStretch: DWORD; // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  468. dwMaxHwCodecStretch: DWORD; // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  469. dwReserved1: DWORD; // reserved
  470. dwReserved2: DWORD; // reserved
  471. dwReserved3: DWORD; // reserved
  472. end;
  473. {$EXTERNALSYM _DDCAPS_DX1}
  474. DDCAPS_DX1 = _DDCAPS_DX1;
  475. {$EXTERNALSYM DDCAPS_DX1}
  476. TDDCaps_DX1 = _DDCAPS_DX1;
  477. (*
  478. * This structure is the TDDCaps structure as it was in version 2 and 3 of Direct X.
  479. * It is present for back compatability.
  480. *)
  481. PDDCaps_DX3 = ^TDDCaps_DX3;
  482. _DDCAPS_DX3 = packed record
  483. dwSize: DWORD; // size of the DDDRIVERCAPS structure
  484. dwCaps: DWORD; // driver specific capabilities
  485. dwCaps2: DWORD; // more driver specific capabilites
  486. dwCKeyCaps: DWORD; // color key capabilities of the surface
  487. dwFXCaps: DWORD; // driver specific stretching and effects capabilites
  488. dwFXAlphaCaps: DWORD; // alpha driver specific capabilities
  489. dwPalCaps: DWORD; // palette capabilities
  490. dwSVCaps: DWORD; // stereo vision capabilities
  491. dwAlphaBltConstBitDepths: DWORD; // DDBD_2,4,8
  492. dwAlphaBltPixelBitDepths: DWORD; // DDBD_1,2,4,8
  493. dwAlphaBltSurfaceBitDepths: DWORD; // DDBD_1,2,4,8
  494. dwAlphaOverlayConstBitDepths: DWORD; // DDBD_2,4,8
  495. dwAlphaOverlayPixelBitDepths: DWORD; // DDBD_1,2,4,8
  496. dwAlphaOverlaySurfaceBitDepths: DWORD; // DDBD_1,2,4,8
  497. dwZBufferBitDepths: DWORD; // DDBD_8,16,24,32
  498. dwVidMemTotal: DWORD; // total amount of video memory
  499. dwVidMemFree: DWORD; // amount of free video memory
  500. dwMaxVisibleOverlays: DWORD; // maximum number of visible overlays
  501. dwCurrVisibleOverlays: DWORD; // current number of visible overlays
  502. dwNumFourCCCodes: DWORD; // number of four cc codes
  503. dwAlignBoundarySrc: DWORD; // source rectangle alignment
  504. dwAlignSizeSrc: DWORD; // source rectangle byte size
  505. dwAlignBoundaryDest: DWORD; // dest rectangle alignment
  506. dwAlignSizeDest: DWORD; // dest rectangle byte size
  507. dwAlignStrideAlign: DWORD; // stride alignment
  508. dwRops: Array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported
  509. ddsCaps: TDDSCaps; // TDDSCaps structure has all the general capabilities
  510. dwMinOverlayStretch: DWORD; // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  511. dwMaxOverlayStretch: DWORD; // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  512. dwMinLiveVideoStretch: DWORD; // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  513. dwMaxLiveVideoStretch: DWORD; // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  514. dwMinHwCodecStretch: DWORD; // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  515. dwMaxHwCodecStretch: DWORD; // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  516. dwReserved1: DWORD; // reserved
  517. dwReserved2: DWORD; // reserved
  518. dwReserved3: DWORD; // reserved
  519. dwSVBCaps: DWORD; // driver specific capabilities for System->Vmem blts
  520. dwSVBCKeyCaps: DWORD; // driver color key capabilities for System->Vmem blts
  521. dwSVBFXCaps: DWORD; // driver FX capabilities for System->Vmem blts
  522. dwSVBRops: array[0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->Vmem blts
  523. dwVSBCaps: DWORD; // driver specific capabilities for Vmem->System blts
  524. dwVSBCKeyCaps: DWORD; // driver color key capabilities for Vmem->System blts
  525. dwVSBFXCaps: DWORD; // driver FX capabilities for Vmem->System blts
  526. dwVSBRops: array[0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for Vmem->System blts
  527. dwSSBCaps: DWORD; // driver specific capabilities for System->System blts
  528. dwSSBCKeyCaps: DWORD; // driver color key capabilities for System->System blts
  529. dwSSBFXCaps: DWORD; // driver FX capabilities for System->System blts
  530. dwSSBRops: array[0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->System blts
  531. dwReserved4 : DWORD;
  532. dwReserved5 : DWORD;
  533. dwReserved6 : DWORD;
  534. end;
  535. {$EXTERNALSYM _DDCAPS_DX3}
  536. DDCAPS_DX3 = _DDCAPS_DX3;
  537. {$EXTERNALSYM DDCAPS_DX3}
  538. TDDCaps_DX3 = _DDCAPS_DX3;
  539. (*
  540. * This structure is the TDDCaps structure as it was in version 5 of Direct X.
  541. * It is present for back compatability.
  542. *)
  543. PDDCaps_DX5 = ^TDDCaps_DX5;
  544. _DDCAPS_DX5 = packed record
  545. dwSize: DWORD; // size of the DDDRIVERCAPS structure
  546. dwCaps: DWORD; // driver specific capabilities
  547. dwCaps2: DWORD; // more driver specific capabilites
  548. dwCKeyCaps: DWORD; // color key capabilities of the surface
  549. dwFXCaps: DWORD; // driver specific stretching and effects capabilites
  550. dwFXAlphaCaps: DWORD; // alpha driver specific capabilities
  551. dwPalCaps: DWORD; // palette capabilities
  552. dwSVCaps: DWORD; // stereo vision capabilities
  553. dwAlphaBltConstBitDepths: DWORD; // DDBD_2,4,8
  554. dwAlphaBltPixelBitDepths: DWORD; // DDBD_1,2,4,8
  555. dwAlphaBltSurfaceBitDepths: DWORD; // DDBD_1,2,4,8
  556. dwAlphaOverlayConstBitDepths: DWORD; // DDBD_2,4,8
  557. dwAlphaOverlayPixelBitDepths: DWORD; // DDBD_1,2,4,8
  558. dwAlphaOverlaySurfaceBitDepths: DWORD; // DDBD_1,2,4,8
  559. dwZBufferBitDepths: DWORD; // DDBD_8,16,24,32
  560. dwVidMemTotal: DWORD; // total amount of video memory
  561. dwVidMemFree: DWORD; // amount of free video memory
  562. dwMaxVisibleOverlays: DWORD; // maximum number of visible overlays
  563. dwCurrVisibleOverlays: DWORD; // current number of visible overlays
  564. dwNumFourCCCodes: DWORD; // number of four cc codes
  565. dwAlignBoundarySrc: DWORD; // source rectangle alignment
  566. dwAlignSizeSrc: DWORD; // source rectangle byte size
  567. dwAlignBoundaryDest: DWORD; // dest rectangle alignment
  568. dwAlignSizeDest: DWORD; // dest rectangle byte size
  569. dwAlignStrideAlign: DWORD; // stride alignment
  570. dwRops: Array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported
  571. ddsCaps: TDDSCaps; // TDDSCaps structure has all the general capabilities
  572. dwMinOverlayStretch: DWORD; // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  573. dwMaxOverlayStretch: DWORD; // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  574. dwMinLiveVideoStretch: DWORD; // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  575. dwMaxLiveVideoStretch: DWORD; // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  576. dwMinHwCodecStretch: DWORD; // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  577. dwMaxHwCodecStretch: DWORD; // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  578. dwReserved1: DWORD; // reserved
  579. dwReserved2: DWORD; // reserved
  580. dwReserved3: DWORD; // reserved
  581. dwSVBCaps: DWORD; // driver specific capabilities for System->Vmem blts
  582. dwSVBCKeyCaps: DWORD; // driver color key capabilities for System->Vmem blts
  583. dwSVBFXCaps: DWORD; // driver FX capabilities for System->Vmem blts
  584. dwSVBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->Vmem blts
  585. dwVSBCaps: DWORD; // driver specific capabilities for Vmem->System blts
  586. dwVSBCKeyCaps: DWORD; // driver color key capabilities for Vmem->System blts
  587. dwVSBFXCaps: DWORD; // driver FX capabilities for Vmem->System blts
  588. dwVSBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for Vmem->System blts
  589. dwSSBCaps: DWORD; // driver specific capabilities for System->System blts
  590. dwSSBCKeyCaps: DWORD; // driver color key capabilities for System->System blts
  591. dwSSBFXCaps: DWORD; // driver FX capabilities for System->System blts
  592. dwSSBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->System blts
  593. // Members added for DX5:
  594. dwMaxVideoPorts: DWORD; // maximum number of usable video ports
  595. dwCurrVideoPorts: DWORD; // current number of video ports used
  596. dwSVBCaps2: DWORD; // more driver specific capabilities for System->Vmem blts
  597. dwNLVBCaps: DWORD; // driver specific capabilities for non-local->local vidmem blts
  598. dwNLVBCaps2: DWORD; // more driver specific capabilities non-local->local vidmem blts
  599. dwNLVBCKeyCaps: DWORD; // driver color key capabilities for non-local->local vidmem blts
  600. dwNLVBFXCaps: DWORD; // driver FX capabilities for non-local->local blts
  601. dwNLVBRops: Array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported for non-local->local blts
  602. end;
  603. {$EXTERNALSYM _DDCAPS_DX5}
  604. DDCAPS_DX5 = _DDCAPS_DX5;
  605. {$EXTERNALSYM DDCAPS_DX5}
  606. TDDCaps_DX5 = _DDCAPS_DX5;
  607. PDDCaps_DX6 = ^TDDCaps_DX6;
  608. _DDCAPS_DX6 = packed record
  609. dwSize: DWORD; // size of the DDDRIVERCAPS structure
  610. dwCaps: DWORD; // driver specific capabilities
  611. dwCaps2: DWORD; // more driver specific capabilites
  612. dwCKeyCaps: DWORD; // color key capabilities of the surface
  613. dwFXCaps: DWORD; // driver specific stretching and effects capabilites
  614. dwFXAlphaCaps: DWORD; // alpha driver specific capabilities
  615. dwPalCaps: DWORD; // palette capabilities
  616. dwSVCaps: DWORD; // stereo vision capabilities
  617. dwAlphaBltConstBitDepths: DWORD; // DDBD_2,4,8
  618. dwAlphaBltPixelBitDepths: DWORD; // DDBD_1,2,4,8
  619. dwAlphaBltSurfaceBitDepths: DWORD; // DDBD_1,2,4,8
  620. dwAlphaOverlayConstBitDepths: DWORD; // DDBD_2,4,8
  621. dwAlphaOverlayPixelBitDepths: DWORD; // DDBD_1,2,4,8
  622. dwAlphaOverlaySurfaceBitDepths: DWORD; // DDBD_1,2,4,8
  623. dwZBufferBitDepths: DWORD; // DDBD_8,16,24,32
  624. dwVidMemTotal: DWORD; // total amount of video memory
  625. dwVidMemFree: DWORD; // amount of free video memory
  626. dwMaxVisibleOverlays: DWORD; // maximum number of visible overlays
  627. dwCurrVisibleOverlays: DWORD; // current number of visible overlays
  628. dwNumFourCCCodes: DWORD; // number of four cc codes
  629. dwAlignBoundarySrc: DWORD; // source rectangle alignment
  630. dwAlignSizeSrc: DWORD; // source rectangle byte size
  631. dwAlignBoundaryDest: DWORD; // dest rectangle alignment
  632. dwAlignSizeDest: DWORD; // dest rectangle byte size
  633. dwAlignStrideAlign: DWORD; // stride alignment
  634. dwRops: Array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported
  635. ddsOldCaps: TDDSCaps; // Was dssCaps: TDDSCaps. ddsCaps is of type TDDScaps2 for DX6
  636. dwMinOverlayStretch: DWORD; // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  637. dwMaxOverlayStretch: DWORD; // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  638. dwMinLiveVideoStretch: DWORD; // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  639. dwMaxLiveVideoStretch: DWORD; // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  640. dwMinHwCodecStretch: DWORD; // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  641. dwMaxHwCodecStretch: DWORD; // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  642. dwReserved1: DWORD; // reserved
  643. dwReserved2: DWORD; // reserved
  644. dwReserved3: DWORD; // reserved
  645. dwSVBCaps: DWORD; // driver specific capabilities for System->Vmem blts
  646. dwSVBCKeyCaps: DWORD; // driver color key capabilities for System->Vmem blts
  647. dwSVBFXCaps: DWORD; // driver FX capabilities for System->Vmem blts
  648. dwSVBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->Vmem blts
  649. dwVSBCaps: DWORD; // driver specific capabilities for Vmem->System blts
  650. dwVSBCKeyCaps: DWORD; // driver color key capabilities for Vmem->System blts
  651. dwVSBFXCaps: DWORD; // driver FX capabilities for Vmem->System blts
  652. dwVSBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for Vmem->System blts
  653. dwSSBCaps: DWORD; // driver specific capabilities for System->System blts
  654. dwSSBCKeyCaps: DWORD; // driver color key capabilities for System->System blts
  655. dwSSBFXCaps: DWORD; // driver FX capabilities for System->System blts
  656. dwSSBRops: Array [0..DD_ROP_SPACE-1] of DWORD;// ROPS supported for System->System blts
  657. // Members added for DX5:
  658. dwMaxVideoPorts: DWORD; // maximum number of usable video ports
  659. dwCurrVideoPorts: DWORD; // current number of video ports used
  660. dwSVBCaps2: DWORD; // more driver specific capabilities for System->Vmem blts
  661. dwNLVBCaps: DWORD; // driver specific capabilities for non-local->local vidmem blts
  662. dwNLVBCaps2: DWORD; // more driver specific capabilities non-local->local vidmem blts
  663. dwNLVBCKeyCaps: DWORD; // driver color key capabilities for non-local->local vidmem blts
  664. dwNLVBFXCaps: DWORD; // driver FX capabilities for non-local->local blts
  665. dwNLVBRops: Array [0..DD_ROP_SPACE-1] of DWORD; // ROPS supported for non-local->local blts
  666. // Members added for DX6 release
  667. ddsCaps : TDDSCaps2 ; // Surface Caps
  668. end;
  669. {$EXTERNALSYM _DDCAPS_DX6}
  670. DDCAPS_DX6 = _DDCAPS_DX6;
  671. {$EXTERNALSYM DDCAPS_DX6}
  672. TDDCaps_DX6 = _DDCAPS_DX6;
  673. _DDCAPS_DX7 = TDDCaps_DX6;
  674. {$EXTERNALSYM _DDCAPS_DX7}
  675. DDCAPS_DX7 = _DDCAPS_DX7;
  676. {$EXTERNALSYM DDCAPS_DX7}
  677. PDDCaps_DX7 = ^TDDCaps_DX7;
  678. TDDCaps_DX7 = TDDCaps_DX6;
  679. {$IFDEF DIRECTDRAW_VERSION_7}
  680. PDDCaps = PDDCaps_DX7;
  681. TDDCaps = TDDCaps_DX7;
  682. {$ELSE}
  683. {$IFDEF DIRECTDRAW_VERSION_6}
  684. PDDCaps = PDDCaps_DX6;
  685. TDDCaps = TDDCaps_DX6;
  686. {$ELSE}
  687. {$IFDEF DIRECTDRAW_VERSION_5}
  688. PDDCaps = PDDCaps_DX5;
  689. TDDCaps = TDDCaps_DX5;
  690. {$ELSE}
  691. {$IFDEF DIRECTDRAW_VERSION_3}
  692. PDDCaps = PDDCaps_DX3;
  693. TDDCaps = TDDCaps_DX3;
  694. {$ELSE}
  695. PDDCaps = PDDCaps_DX1;
  696. TDDCaps = TDDCaps_DX1;
  697. {$ENDIF}
  698. {$ENDIF}
  699. {$ENDIF}
  700. {$ENDIF}
  701. (*
  702. * TDDPixelFormat
  703. *)
  704. PDDPixelFormat = ^TDDPixelFormat;
  705. _DDPIXELFORMAT = packed record
  706. dwSize: DWORD; // size of structure
  707. dwFlags: DWORD; // pixel format flags
  708. dwFourCC: DWORD; // (FOURCC code)
  709. case Integer of
  710. 1: (
  711. dwRGBBitCount : DWORD; // how many bits per pixel
  712. dwRBitMask : DWORD; // mask for red bit
  713. dwGBitMask : DWORD; // mask for green bits
  714. dwBBitMask : DWORD; // mask for blue bits
  715. dwRGBAlphaBitMask : DWORD; // mask for alpha channel
  716. );
  717. 2: (
  718. dwYUVBitCount : DWORD; // how many bits per pixel
  719. dwYBitMask : DWORD; // mask for Y bits
  720. dwUBitMask : DWORD; // mask for U bits
  721. dwVBitMask : DWORD; // mask for V bits
  722. dwYUVAlphaBitMask : DWORD; // mask for alpha channel
  723. );
  724. 3: (
  725. dwZBufferBitDepth : DWORD; // how many total bits/pixel in z buffer (including any stencil bits)
  726. dwStencilBitDepth : DWORD; // how many stencil bits (note: dwZBufferBitDepth-dwStencilBitDepth is total Z-only bits)
  727. dwZBitMask : DWORD; // mask for Z bits
  728. dwStencilBitMask : DWORD; // mask for stencil bits
  729. dwLuminanceAlphaBitMask : DWORD; // mask for alpha channel
  730. );
  731. 4: (
  732. dwAlphaBitDepth : DWORD; // how many bits for alpha channels
  733. dwLuminanceBitMask : DWORD; // mask for luminance bits
  734. dwBumpDvBitMask : DWORD; // mask for bump map V delta bits
  735. dwBumpLuminanceBitMask : DWORD; // mask for luminance in bump map
  736. dwRGBZBitMask : DWORD; // mask for Z channel
  737. );
  738. 5: (
  739. dwLuminanceBitCount : DWORD; // how many bits per pixel
  740. dwBumpDuBitMask : DWORD; // mask for bump map U delta bits
  741. Fill1, Fill2 : DWORD;
  742. dwYUVZBitMask : DWORD; // mask for Z channel
  743. );
  744. 6: ( dwBumpBitCount : DWORD; // how many bits per "buxel", total
  745. );
  746. end;
  747. {$EXTERNALSYM _DDPIXELFORMAT}
  748. DDPIXELFORMAT = _DDPIXELFORMAT;
  749. {$EXTERNALSYM DDPIXELFORMAT}
  750. TDDPixelFormat = _DDPIXELFORMAT;
  751. // These definitions are for compatibility with Erik Unger original conversion
  752. PDDPixelFormat_DX3 = PDDPixelFormat;
  753. TDDPixelFormat_DX3 = TDDPixelFormat;
  754. PDDPixelFormat_DX5 = PDDPixelFormat;
  755. TDDPixelFormat_DX5 = TDDPixelFormat;
  756. PDDPixelFormat_DX6 = PDDPixelFormat;
  757. TDDPixelFormat_DX6 = TDDPixelFormat;
  758. PDDPixelFormat_DX7 = PDDPixelFormat;
  759. TDDPixelFormat_DX7 = TDDPixelFormat;
  760. (*
  761. * TDDOverlayFX
  762. *)
  763. PDDOverlayFX = ^TDDOverlayFX;
  764. _DDOVERLAYFX = packed record
  765. dwSize: DWORD; // size of structure
  766. dwAlphaEdgeBlendBitDepth: DWORD; // Bit depth used to specify constant for alpha edge blend
  767. dwAlphaEdgeBlend: DWORD; // Constant to use as alpha for edge blend
  768. dwReserved: DWORD;
  769. dwAlphaDestConstBitDepth: DWORD; // Bit depth used to specify alpha constant for destination
  770. case Integer of
  771. 0: (
  772. dwAlphaDestConst: DWORD; // Constant to use as alpha channel for dest
  773. dwAlphaSrcConstBitDepth: DWORD; // Bit depth used to specify alpha constant for source
  774. dwAlphaSrcConst: DWORD; // Constant to use as alpha channel for src
  775. dckDestColorkey: TDDColorKey; // DestColorkey override
  776. dckSrcColorkey: TDDColorKey; // DestColorkey override
  777. dwDDFX: DWORD; // Overlay FX
  778. dwFlags: DWORD; // flags
  779. );
  780. 1: (
  781. lpDDSAlphaDest: PDirectDrawSurface; // Surface to use as alpha channel for dest
  782. filler: DWORD;
  783. lpDDSAlphaSrc: PDirectDrawSurface; // Surface to use as alpha channel for src
  784. );
  785. end;
  786. {$EXTERNALSYM _DDOVERLAYFX}
  787. DDOVERLAYFX = _DDOVERLAYFX;
  788. {$EXTERNALSYM DDOVERLAYFX}
  789. TDDOverlayFX = _DDOVERLAYFX;
  790. (*
  791. * TDDBltBatch: BltBatch entry structure
  792. *)
  793. PDDBltBatch = ^TDDBltBatch;
  794. _DDBLTBATCH = packed record
  795. lprDest: PRect;
  796. lpDDSSrc: IDirectDrawSurface;
  797. lprSrc: PRect;
  798. dwFlags: DWORD;
  799. lpDDBltFx: TDDBltFX;
  800. end;
  801. {$EXTERNALSYM _DDBLTBATCH}
  802. DDBLTBATCH = _DDBLTBATCH;
  803. {$EXTERNALSYM DDBLTBATCH}
  804. TDDBltBatch = _DDBLTBATCH;
  805. (*
  806. * TDDGammaRamp
  807. *)
  808. PDDGammaRamp = ^TDDGammaRamp;
  809. _DDGAMMARAMP = packed record
  810. red : array[0..255] of WORD;
  811. green : array[0..255] of WORD;
  812. blue : array[0..255] of WORD;
  813. end;
  814. {$EXTERNALSYM _DDGAMMARAMP}
  815. DDGAMMARAMP = _DDGAMMARAMP;
  816. {$EXTERNALSYM DDGAMMARAMP}
  817. TDDGammaRamp = _DDGAMMARAMP;
  818. (*
  819. * This is the structure within which DirectDraw returns data about the current graphics driver and chipset
  820. *)
  821. PDDDeviceIdentifier = ^TDDDeviceIdentifier;
  822. tagDDDEVICEIDENTIFIER = packed record
  823. //
  824. // These elements are for presentation to the user only. They should not be used to identify particular
  825. // drivers, since this is unreliable and many different strings may be associated with the same
  826. // device, and the same driver from different vendors.
  827. //
  828. szDriver: array[0..MAX_DDDEVICEID_STRING-1] of Char;
  829. szDescription: array[0..MAX_DDDEVICEID_STRING-1] of Char;
  830. //
  831. // This element is the version of the DirectDraw/3D driver. It is legal to do <, > comparisons
  832. // on the whole 64 bits. Caution should be exercised if you use this element to identify problematic
  833. // drivers. It is recommended that guidDeviceIdentifier is used for this purpose.
  834. //
  835. // This version has the form:
  836. // wProduct = HIWORD(liDriverVersion.HighPart)
  837. // wVersion = LOWORD(liDriverVersion.HighPart)
  838. // wSubVersion = HIWORD(liDriverVersion.LowPart)
  839. // wBuild = LOWORD(liDriverVersion.LowPart)
  840. //
  841. liDriverVersion: TLargeInteger; // Defined for applications and other 32 bit components
  842. //
  843. // These elements can be used to identify particular chipsets. Use with extreme caution.
  844. // dwVendorId Identifies the manufacturer. May be zero if unknown.
  845. // dwDeviceId Identifies the type of chipset. May be zero if unknown.
  846. // dwSubSysId Identifies the subsystem, typically this means the particular board. May be zero if unknown.
  847. // dwRevision Identifies the revision level of the chipset. May be zero if unknown.
  848. //
  849. dwVendorId: DWORD;
  850. dwDeviceId: DWORD;
  851. dwSubSysId: DWORD;
  852. dwRevision: DWORD;
  853. //
  854. // This element can be used to check changes in driver/chipset. This GUID is a unique identifier for the
  855. // driver/chipset pair. Use this element if you wish to track changes to the driver/chipset in order to
  856. // reprofile the graphics subsystem.
  857. // This element can also be used to identify particular problematic drivers.
  858. //
  859. guidDeviceIdentifier: TGUID;
  860. end;
  861. {$EXTERNALSYM tagDDDEVICEIDENTIFIER}
  862. DDDEVICEIDENTIFIER = tagDDDEVICEIDENTIFIER;
  863. {$EXTERNALSYM DDDEVICEIDENTIFIER}
  864. TDDDeviceIdentifier = tagDDDEVICEIDENTIFIER;
  865. PDDDeviceIdentifier2 = ^TDDDeviceIdentifier2;
  866. tagDDDEVICEIDENTIFIER2 = packed record
  867. //
  868. // These elements are for presentation to the user only. They should not be used to identify particular
  869. // drivers, since this is unreliable and many different strings may be associated with the same
  870. // device, and the same driver from different vendors.
  871. //
  872. szDriver: array[0..MAX_DDDEVICEID_STRING-1] of Char;
  873. szDescription: array[0..MAX_DDDEVICEID_STRING-1] of Char;
  874. //
  875. // This element is the version of the DirectDraw/3D driver. It is legal to do <, > comparisons
  876. // on the whole 64 bits. Caution should be exercised if you use this element to identify problematic
  877. // drivers. It is recommended that guidDeviceIdentifier is used for this purpose.
  878. //
  879. // This version has the form:
  880. // wProduct = HIWORD(liDriverVersion.HighPart)
  881. // wVersion = LOWORD(liDriverVersion.HighPart)
  882. // wSubVersion = HIWORD(liDriverVersion.LowPart)
  883. // wBuild = LOWORD(liDriverVersion.LowPart)
  884. //
  885. liDriverVersion: TLargeInteger; // Defined for applications and other 32 bit components
  886. //
  887. // These elements can be used to identify particular chipsets. Use with extreme caution.
  888. // dwVendorId Identifies the manufacturer. May be zero if unknown.
  889. // dwDeviceId Identifies the type of chipset. May be zero if unknown.
  890. // dwSubSysId Identifies the subsystem, typically this means the particular board. May be zero if unknown.
  891. // dwRevision Identifies the revision level of the chipset. May be zero if unknown.
  892. //
  893. dwVendorId: DWORD;
  894. dwDeviceId: DWORD;
  895. dwSubSysId: DWORD;
  896. dwRevision: DWORD;
  897. //
  898. // This element can be used to check changes in driver/chipset. This GUID is a unique identifier for the
  899. // driver/chipset pair. Use this element if you wish to track changes to the driver/chipset in order to
  900. // reprofile the graphics subsystem.
  901. // This element can also be used to identify particular problematic drivers.
  902. //
  903. guidDeviceIdentifier: TGUID;
  904. (*
  905. * This element is used to determine the Windows Hardware Quality Lab (WHQL)
  906. * certification level for this driver/device pair.
  907. *)
  908. dwWHQLLevel: DWORD;
  909. end;
  910. {$EXTERNALSYM tagDDDEVICEIDENTIFIER2}
  911. DDDEVICEIDENTIFIER2 = tagDDDEVICEIDENTIFIER2;
  912. {$EXTERNALSYM DDDEVICEIDENTIFIER2}
  913. TDDDeviceIdentifier2 = tagDDDEVICEIDENTIFIER2;
  914. (*
  915. * callbacks
  916. *)
  917. TClipperCallback = function(lpDDClipper: IDirectDrawClipper; hWnd: HWND;
  918. Code: DWORD; lpContext: Pointer): HResult; stdcall;
  919. {$NODEFINE TClipperCallback}
  920. {$HPPEMIT 'typedef LPCLIPPERCALLBACK TClipperCallback;'}
  921. TSurfacesStreamingCallback = function(arg: DWORD): HResult; stdcall;
  922. {$NODEFINE TSurfacesStreamingCallback}
  923. (*
  924. * TDDSurfaceDesc
  925. *)
  926. PDDSurfaceDesc = ^TDDSurfaceDesc;
  927. _DDSURFACEDESC = packed record
  928. dwSize: DWORD; // size of the TDDSurfaceDesc structure
  929. dwFlags: DWORD; // determines what fields are valid
  930. dwHeight: DWORD; // height of surface to be created
  931. dwWidth: DWORD; // width of input surface
  932. case Integer of
  933. 0: (
  934. dwLinearSize: DWORD; // unused at the moment
  935. );
  936. 1: (
  937. lPitch: Longint; // distance to start of next line (return value only)
  938. dwBackBufferCount: DWORD; // number of back buffers requested
  939. case Integer of
  940. 0: (
  941. dwMipMapCount: DWORD; // number of mip-map levels requested
  942. dwAlphaBitDepth: DWORD; // depth of alpha buffer requested
  943. dwReserved: DWORD; // reserved
  944. lpSurface: Pointer; // pointer to the associated surface memory
  945. ddckCKDestOverlay: TDDColorKey; // color key for destination overlay use
  946. ddckCKDestBlt: TDDColorKey; // color key for destination blt use
  947. ddckCKSrcOverlay: TDDColorKey; // color key for source overlay use
  948. ddckCKSrcBlt: TDDColorKey; // color key for source blt use
  949. ddpfPixelFormat: TDDPixelFormat; // pixel format description of the surface
  950. ddsCaps: TDDSCaps; // direct draw surface capabilities
  951. );
  952. 1: (
  953. dwZBufferBitDepth: DWORD; // depth of Z buffer requested
  954. );
  955. 2: (
  956. dwRefreshRate: DWORD; // refresh rate (used when display mode is described)
  957. );
  958. );
  959. end;
  960. {$EXTERNALSYM _DDSURFACEDESC}
  961. DDSURFACEDESC = _DDSURFACEDESC;
  962. {$EXTERNALSYM DDSURFACEDESC}
  963. TDDSurfaceDesc = _DDSURFACEDESC;
  964. // These definitions are for compatibility with Erik Unger original conversion
  965. PDDSurfaceDesc_DX5 = PDDSurfaceDesc;
  966. TDDSurfaceDesc_DX5 = TDDSurfaceDesc;
  967. PDDSurfaceDesc_DX6 = PDDSurfaceDesc;
  968. TDDSurfaceDesc_DX6 = TDDSurfaceDesc;
  969. (*
  970. * TDDSurfaceDesc2
  971. *)
  972. PDDSurfaceDesc2 = ^TDDSurfaceDesc2;
  973. _DDSURFACEDESC2 = packed record
  974. dwSize: DWORD; // size of the TDDSurfaceDesc structure
  975. dwFlags: DWORD; // determines what fields are valid
  976. dwHeight: DWORD; // height of surface to be created
  977. dwWidth: DWORD; // width of input surface
  978. case Integer of
  979. 0: (
  980. lPitch : Longint; // distance to start of next line (return value only)
  981. );
  982. 1: (
  983. dwLinearSize : DWORD; // Formless late-allocated optimized surface size
  984. dwBackBufferCount: DWORD; // number of back buffers requested
  985. case Integer of
  986. 0: (
  987. dwMipMapCount: DWORD; // number of mip-map levels requested
  988. dwAlphaBitDepth: DWORD; // depth of alpha buffer requested
  989. dwReserved: DWORD; // reserved
  990. lpSurface: Pointer; // pointer to the associated surface memory
  991. ddckCKDestOverlay: TDDColorKey; // color key for destination overlay use
  992. ddckCKDestBlt: TDDColorKey; // color key for destination blt use
  993. ddckCKSrcOverlay: TDDColorKey; // color key for source overlay use
  994. ddckCKSrcBlt: TDDColorKey; // color key for source blt use
  995. ddpfPixelFormat: TDDPixelFormat; // pixel format description of the surface
  996. ddsCaps: TDDSCaps2; // direct draw surface capabilities
  997. dwTextureStage: DWORD; // stage in multitexture cascade
  998. );
  999. 1: (
  1000. dwRefreshRate: DWORD; // refresh rate (used when display mode is described)
  1001. );
  1002. );
  1003. end;
  1004. {$EXTERNALSYM _DDSURFACEDESC2}
  1005. DDSURFACEDESC2 = _DDSURFACEDESC2;
  1006. {$EXTERNALSYM DDSURFACEDESC2}
  1007. TDDSurfaceDesc2 = _DDSURFACEDESC2;
  1008. (*
  1009. * TDDOptSurfaceDesc
  1010. *)
  1011. PDDOptSurfaceDesc = ^TDDOptSurfaceDesc;
  1012. _DDOPTSURFACEDESC = packed record
  1013. dwSize : DWORD; // size of the DDOPTSURFACEDESC structure
  1014. dwFlags : DWORD; // determines what fields are valid
  1015. ddSCaps : TDDSCaps2; // Common caps like: Memory type
  1016. ddOSCaps : TDDOSCaps; // Common caps like: Memory type
  1017. guid : TGUID; // Compression technique GUID
  1018. dwCompressionRatio : DWORD; // Compression ratio
  1019. end;
  1020. {$EXTERNALSYM _DDOPTSURFACEDESC}
  1021. DDOPTSURFACEDESC = _DDOPTSURFACEDESC;
  1022. {$EXTERNALSYM DDOPTSURFACEDESC}
  1023. TDDOptSurfaceDesc = _DDOPTSURFACEDESC;
  1024. (*
  1025. * DDCOLORCONTROL
  1026. *)
  1027. PDDColorControl = ^TDDColorControl;
  1028. _DDCOLORCONTROL = packed record
  1029. dwSize: DWORD;
  1030. dwFlags: DWORD;
  1031. lBrightness: Longint;
  1032. lContrast: Longint;
  1033. lHue: Longint;
  1034. lSaturation: Longint;
  1035. lSharpness: Longint;
  1036. lGamma: Longint;
  1037. lColorEnable: Longint;
  1038. dwReserved1: DWORD;
  1039. end;
  1040. {$EXTERNALSYM _DDCOLORCONTROL}
  1041. DDCOLORCONTROL = _DDCOLORCONTROL;
  1042. {$EXTERNALSYM DDCOLORCONTROL}
  1043. TDDColorControl = _DDCOLORCONTROL;
  1044. (*
  1045. * callbacks
  1046. *)
  1047. //{$IFNDEF WINNT}
  1048. TDDEnumModesCallback = function (const lpDDSurfaceDesc: TDDSurfaceDesc;
  1049. lpContext: Pointer): HResult; stdcall;
  1050. {$NODEFINE TDDEnumModesCallback}
  1051. {$HPPEMIT 'typedef LPCLIPPERCALLBACK TDDEnumModesCallback;'}
  1052. TDDEnumModesCallback2 = function (const lpDDSurfaceDesc: TDDSurfaceDesc2;
  1053. lpContext: Pointer): HResult; stdcall;
  1054. {$NODEFINE TDDEnumModesCallback2}
  1055. {$HPPEMIT 'typedef LPDDENUMMODESCALLBACK2 TDDEnumModesCallback2;'}
  1056. TDDEnumSurfacesCallback = function (lpDDSurface: IDirectDrawSurface;
  1057. const lpDDSurfaceDesc: TDDSurfaceDesc; lpContext: Pointer): HResult; stdcall;
  1058. {$NODEFINE TDDEnumSurfacesCallback}
  1059. {$HPPEMIT 'typedef LPDDENUMSURFACESCALLBACK TDDEnumSurfacesCallback;'}
  1060. TDDEnumSurfacesCallback2 = function (lpDDSurface: IDirectDrawSurface4;
  1061. const lpDDSurfaceDesc: TDDSurfaceDesc2; lpContext: Pointer): HResult; stdcall;
  1062. {$NODEFINE TDDEnumSurfacesCallback2}
  1063. {$HPPEMIT 'typedef LPDDENUMSURFACESCALLBACK2 TDDEnumSurfacesCallback2;'}
  1064. TDDEnumSurfacesCallback7 = function (lpDDSurface: IDirectDrawSurface7;
  1065. const lpDDSurfaceDesc: TDDSurfaceDesc2; lpContext: Pointer): HResult; stdcall;
  1066. {$NODEFINE TDDEnumSurfacesCallback7}
  1067. {$HPPEMIT 'typedef LPDDENUMSURFACESCALLBACK7 TDDEnumSurfacesCallback7;'}
  1068. //{$ENDIF}
  1069. (*
  1070. * INTERACES FOLLOW:
  1071. * IDirectDraw
  1072. * IDirectDrawClipper
  1073. * IDirectDrawPalette
  1074. * IDirectDrawSurface
  1075. *)
  1076. (*
  1077. * IDirectDraw
  1078. *)
  1079. IDirectDraw = interface(IUnknown)
  1080. ['{6C14DB80-A733-11CE-A521-0020AF0BE560}']
  1081. (*** IDirectDraw methods ***)
  1082. function Compact: HResult; stdcall;
  1083. function CreateClipper(dwFlags: DWORD;
  1084. out lplpDDClipper: IDirectDrawClipper;
  1085. pUnkOuter: IUnknown): HResult; stdcall;
  1086. function CreatePalette(dwFlags: DWORD; lpColorTable: Pointer;
  1087. out lplpDDPalette: IDirectDrawPalette;
  1088. pUnkOuter: IUnknown): HResult; stdcall;
  1089. function CreateSurface(var lpDDSurfaceDesc: TDDSurfaceDesc;
  1090. out lplpDDSurface: IDirectDrawSurface;
  1091. pUnkOuter: IUnknown): HResult; stdcall;
  1092. function DuplicateSurface(lpDDSurface: IDirectDrawSurface;
  1093. out lplpDupDDSurface: IDirectDrawSurface): HResult; stdcall;
  1094. function EnumDisplayModes(dwFlags: DWORD;
  1095. lpDDSurfaceDesc: PDDSurfaceDesc; lpContext: Pointer;
  1096. lpEnumModesCallback: TDDEnumModesCallback): HResult; stdcall;
  1097. function EnumSurfaces(dwFlags: DWORD; const lpDDSD: TDDSurfaceDesc;
  1098. lpContext: Pointer; lpEnumCallback: TDDEnumSurfacesCallback) :
  1099. HResult; stdcall;
  1100. function FlipToGDISurface: HResult; stdcall;
  1101. function GetCaps(lpDDDriverCaps: PDDCaps; lpDDHELCaps: PDDCaps): HResult; stdcall;
  1102. function GetDisplayMode(out lpDDSurfaceDesc: TDDSurfaceDesc): HResult; stdcall;
  1103. function GetFourCCCodes(var lpNumCodes: DWORD; lpCodes: PDWORD): HResult; stdcall;
  1104. function GetGDISurface(out lplpGDIDDSSurface: IDirectDrawSurface): HResult; stdcall;
  1105. function GetMonitorFrequency(out lpdwFrequency: DWORD): HResult; stdcall;
  1106. function GetScanLine(out lpdwScanLine: DWORD): HResult; stdcall;
  1107. function GetVerticalBlankStatus(out lpbIsInVB: BOOL): HResult; stdcall;
  1108. function Initialize(lpGUID: PGUID): HResult; stdcall;
  1109. function RestoreDisplayMode: HResult; stdcall;
  1110. function SetCooperativeLevel(hWnd: HWND; dwFlags: DWORD): HResult; stdcall;
  1111. (*** Warning! SetDisplayMode differs between DirectDraw 1 and DirectDraw 2 ***)
  1112. function SetDisplayMode(dwWidth: DWORD; dwHeight: DWORD;
  1113. dwBpp: DWORD): HResult; stdcall;
  1114. function WaitForVerticalBlank(dwFlags: DWORD; hEvent: THandle): HResult; stdcall;
  1115. end;
  1116. IDirectDraw2 = interface(IUnknown)
  1117. ['{B3A6F3E0-2B43-11CF-A2DE-00AA00B93356}']
  1118. (*** IDirectDraw methods ***)
  1119. function Compact: HResult; stdcall;
  1120. function CreateClipper(dwFlags: DWORD;
  1121. out lplpDDClipper: IDirectDrawClipper;
  1122. pUnkOuter: IUnknown): HResult; stdcall;
  1123. function CreatePalette(dwFlags: DWORD; lpColorTable: Pointer;
  1124. out lplpDDPalette: IDirectDrawPalette;
  1125. pUnkOuter: IUnknown): HResult; stdcall;
  1126. function CreateSurface(var lpDDSurfaceDesc: TDDSurfaceDesc;
  1127. out lplpDDSurface: IDirectDrawSurface;
  1128. pUnkOuter: IUnknown): HResult; stdcall;
  1129. function DuplicateSurface(lpDDSurface: IDirectDrawSurface;
  1130. out lplpDupDDSurface: IDirectDrawSurface): HResult; stdcall;
  1131. function EnumDisplayModes(dwFlags: DWORD;
  1132. lpDDSurfaceDesc: PDDSurfaceDesc; lpContext: Pointer;
  1133. lpEnumModesCallback: TDDEnumModesCallback): HResult; stdcall;
  1134. function EnumSurfaces(dwFlags: DWORD; var lpDDSD: TDDSurfaceDesc;
  1135. lpContext: Pointer; lpEnumCallback: TDDEnumSurfacesCallback): HResult; stdcall;
  1136. function FlipToGDISurface: HResult; stdcall;
  1137. function GetCaps(lpDDDriverCaps: PDDCaps; lpDDHELCaps: PDDCaps): HResult; stdcall;
  1138. function GetDisplayMode(out lpDDSurfaceDesc: TDDSurfaceDesc): HResult; stdcall;
  1139. function GetFourCCCodes(var lpNumCodes: DWORD; lpCodes: PDWORD): HResult; stdcall;
  1140. function GetGDISurface(out lplpGDIDDSSurface: IDirectDrawSurface): HResult; stdcall;
  1141. function GetMonitorFrequency(out lpdwFrequency: DWORD): HResult; stdcall;
  1142. function GetScanLine(out lpdwScanLine: DWORD): HResult; stdcall;
  1143. function GetVerticalBlankStatus(out lpbIsInVB: BOOL): HResult; stdcall;
  1144. function Initialize(lpGUID: PGUID): HResult; stdcall;
  1145. function RestoreDisplayMode: HResult; stdcall;
  1146. function SetCooperativeLevel(hWnd: HWND; dwFlags: DWORD): HResult; stdcall;
  1147. function SetDisplayMode(dwWidth: DWORD; dwHeight: DWORD; dwBPP: DWORD;
  1148. dwRefreshRate: DWORD; dwFlags: DWORD): HResult; stdcall;
  1149. function WaitForVerticalBlank(dwFlags: DWORD; hEvent: THandle): HResult; stdcall;
  1150. (*** Added in the v2 interface ***)
  1151. function GetAvailableVidMem(var lpDDSCaps: TDDSCaps;
  1152. out lpdwTotal, lpdwFree: DWORD): HResult; stdcall;
  1153. end;
  1154. IDirectDraw4 = interface(IUnknown)
  1155. ['{9c59509a-39bd-11d1-8c4a-00c04fd930c5}']
  1156. (*** IDirectDraw methods ***)
  1157. function Compact: HResult; stdcall;
  1158. function CreateClipper(dwFlags: DWORD;
  1159. out lplpDDClipper: IDirectDrawClipper;
  1160. pUnkOuter: IUnknown): HResult; stdcall;
  1161. function CreatePalette(dwFlags: DWORD; lpColorTable: Pointer;
  1162. out lplpDDPalette: IDirectDrawPalette;
  1163. pUnkOuter: IUnknown): HResult; stdcall;
  1164. function CreateSurface(const lpDDSurfaceDesc: TDDSurfaceDesc2;
  1165. out lplpDDSurface: IDirectDrawSurface4;
  1166. pUnkOuter: IUnknown): HResult; stdcall;
  1167. function DuplicateSurface(lpDDSurface: IDirectDrawSurface4;
  1168. out lplpDupDDSurface: IDirectDrawSurface4): HResult; stdcall;
  1169. function EnumDisplayModes(dwFlags: DWORD;
  1170. lpDDSurfaceDesc: PDDSurfaceDesc2; lpContext: Pointer;
  1171. lpEnumModesCallback: TDDEnumModesCallback2): HResult; stdcall;
  1172. function EnumSurfaces(dwFlags: DWORD; const lpDDSD: TDDSurfaceDesc2;
  1173. lpContext: Pointer; lpEnumCallback: TDDEnumSurfacesCallback2):
  1174. HResult; stdcall;
  1175. function FlipToGDISurface: HResult; stdcall;
  1176. function GetCaps(lpDDDriverCaps: PDDCaps; lpDDHELCaps: PDDCaps): HResult; stdcall;
  1177. function GetDisplayMode(out lpDDSurfaceDesc: TDDSurfaceDesc2): HResult; stdcall;
  1178. function GetFourCCCodes(var lpNumCodes: DWORD; lpCodes: PDWORD): HResult; stdcall;
  1179. function GetGDISurface(out lplpGDIDDSSurface: IDirectDrawSurface4): HResult; stdcall;
  1180. function GetMonitorFrequency(out lpdwFrequency: DWORD): HResult; stdcall;
  1181. function GetScanLine(out lpdwScanLine: DWORD): HResult; stdcall;
  1182. function GetVerticalBlankStatus(out lpbIsInVB: BOOL): HResult; stdcall;
  1183. function Initialize(lpGUID: PGUID): HResult; stdcall;
  1184. function RestoreDisplayMode: HResult; stdcall;
  1185. function SetCooperativeLevel(hWnd: HWND; dwFlags: DWORD): HResult; stdcall;
  1186. function SetDisplayMode(dwWidth: DWORD; dwHeight: DWORD; dwBPP: DWORD;
  1187. dwRefreshRate: DWORD; dwFlags: DWORD): HResult; stdcall;
  1188. function WaitForVerticalBlank(dwFlags: DWORD; hEvent: THandle): HResult; stdcall;
  1189. (*** Added in the v2 interface ***)
  1190. function GetAvailableVidMem(const lpDDSCaps: TDDSCaps2;
  1191. out lpdwTotal, lpdwFree: DWORD): HResult; stdcall;
  1192. (*** Added in the V4 Interface ***)
  1193. function GetSurfaceFromDC(hdc: Windows.HDC;
  1194. out lpDDS4: IDirectDrawSurface4): HResult; stdcall;
  1195. function RestoreAllSurfaces: HResult; stdcall;
  1196. function TestCooperativeLevel: HResult; stdcall;
  1197. function GetDeviceIdentifier(out lpdddi: TDDDeviceIdentifier;
  1198. dwFlags: DWORD): HResult; stdcall;
  1199. end;
  1200. IDirectDraw7 = interface(IUnknown)
  1201. ['{15e65ec0-3b9c-11d2-b92f-00609797ea5b}']
  1202. (*** IDirectDraw methods ***)
  1203. function Compact: HResult; stdcall;
  1204. function CreateClipper(dwFlags: DWORD;
  1205. out lplpDDClipper: IDirectDrawClipper;
  1206. pUnkOuter: IUnknown): HResult; stdcall;
  1207. function CreatePalette(dwFlags: DWORD; lpColorTable: Pointer;
  1208. out lplpDDPalette: IDirectDrawPalette;
  1209. pUnkOuter: IUnknown): HResult; stdcall;
  1210. function CreateSurface(const lpDDSurfaceDesc: TDDSurfaceDesc2;
  1211. out lplpDDSurface: IDirectDrawSurface7;
  1212. pUnkOuter: IUnknown): HResult; stdcall;
  1213. function DuplicateSurface(lpDDSurface: IDirectDrawSurface7;
  1214. out lplpDupDDSurface: IDirectDrawSurface7): HResult; stdcall;
  1215. function EnumDisplayModes(dwFlags: DWORD;
  1216. lpDDSurfaceDesc: PDDSurfaceDesc2; lpContext: Pointer;
  1217. lpEnumModesCallback: TDDEnumModesCallback2): HResult; stdcall;
  1218. function EnumSurfaces(dwFlags: DWORD; const lpDDSD: TDDSurfaceDesc2;
  1219. lpContext: Pointer; lpEnumCallback: TDDEnumSurfacesCallback7) :
  1220. HResult; stdcall;
  1221. function FlipToGDISurface: HResult; stdcall;
  1222. function GetCaps(lpDDDriverCaps: PDDCaps; lpDDHELCaps: PDDCaps): HResult; stdcall;
  1223. function GetDisplayMode(out lpDDSurfaceDesc: TDDSurfaceDesc2): HResult; stdcall;
  1224. function GetFourCCCodes(var lpNumCodes: DWORD; lpCodes: PDWORD): HResult; stdcall;
  1225. function GetGDISurface(out lplpGDIDDSSurface: IDirectDrawSurface7) :
  1226. HResult; stdcall;
  1227. function GetMonitorFrequency(out lpdwFrequency: DWORD): HResult; stdcall;
  1228. function GetScanLine(out lpdwScanLine: DWORD): HResult; stdcall;
  1229. function GetVerticalBlankStatus(out lpbIsInVB: BOOL): HResult; stdcall;
  1230. function Initialize(lpGUID: PGUID): HResult; stdcall;
  1231. function RestoreDisplayMode: HResult; stdcall;
  1232. function SetCooperativeLevel(hWnd: HWND; dwFlags: DWORD): HResult; stdcall;
  1233. function SetDisplayMode(dwWidth: DWORD; dwHeight: DWORD; dwBPP: DWORD;
  1234. dwRefreshRate: DWORD; dwFlags: DWORD): HResult; stdcall;
  1235. function WaitForVerticalBlank(dwFlags: DWORD; hEvent: THandle) :
  1236. HResult; stdcall;
  1237. (*** Added in the v2 interface ***)
  1238. function GetAvailableVidMem(const lpDDSCaps: TDDSCaps2;
  1239. out lpdwTotal, lpdwFree: DWORD): HResult; stdcall;
  1240. (*** Added in the V4 Interface ***)
  1241. function GetSurfaceFromDC(hdc: Windows.HDC;
  1242. out lpDDS: IDirectDrawSurface7): HResult; stdcall;
  1243. function RestoreAllSurfaces: HResult; stdcall;
  1244. function TestCooperativeLevel: HResult; stdcall;
  1245. function GetDeviceIdentifier(out lpdddi: TDDDeviceIdentifier2;
  1246. dwFlags: DWORD): HResult; stdcall;
  1247. function StartModeTest(const lpModesToTest; dwNumEntries, dwFlags: DWORD): HResult; stdcall;
  1248. function EvaluateMode(dwFlags: DWORD; out pSecondsUntilTimeout: DWORD): HResult; stdcall;
  1249. end;
  1250. (*
  1251. * IDirectDrawPalette
  1252. *)
  1253. IDirectDrawPalette = interface(IUnknown)
  1254. ['{6C14DB84-A733-11CE-A521-0020AF0BE560}']
  1255. (*** IDirectDrawPalette methods ***)
  1256. function GetCaps(out lpdwCaps: DWORD): HResult; stdcall;
  1257. function GetEntries(dwFlags: DWORD; dwBase: DWORD; dwNumEntries: DWORD;
  1258. lpEntries: Pointer): HResult; stdcall;
  1259. function Initialize(lpDD: IDirectDraw; dwFlags: DWORD;
  1260. lpDDColorTable: Pointer): HResult; stdcall;
  1261. function SetEntries(dwFlags: DWORD; dwStartingEntry: DWORD;
  1262. dwCount: DWORD; lpEntries: Pointer): HResult; stdcall;
  1263. end;
  1264. (*
  1265. * IDirectDrawClipper
  1266. *)
  1267. IDirectDrawClipper = interface(IUnknown)
  1268. ['{6C14DB85-A733-11CE-A521-0020AF0BE560}']
  1269. (*** IDirectDrawClipper methods ***)
  1270. function GetClipList(lpRect: PRect; lpClipList: PRgnData;
  1271. var lpdwSize: DWORD): HResult; stdcall;
  1272. function GetHWnd(out lphWnd: HWND): HResult; stdcall;
  1273. function Initialize(lpDD: IDirectDraw; dwFlags: DWORD): HResult; stdcall;
  1274. function IsClipListChanged(out lpbChanged: BOOL): HResult; stdcall;
  1275. function SetClipList(lpClipList: PRgnData; dwFlags: DWORD): HResult; stdcall;
  1276. function SetHWnd(dwFlags: DWORD; hWnd: HWND): HResult; stdcall;
  1277. end;
  1278. (*
  1279. * IDirectDrawSurface and related interfaces
  1280. *)
  1281. IDirectDrawSurface = interface(IUnknown)
  1282. ['{6C14DB81-A733-11CE-A521-0020AF0BE560}']
  1283. (*** IDirectDrawSurface methods ***)
  1284. function AddAttachedSurface(lpDDSAttachedSurface: IDirectDrawSurface) :
  1285. HResult; stdcall;
  1286. function AddOverlayDirtyRect(const lpRect: TRect): HResult; stdcall;
  1287. function Blt(lpDestRect: PRect;
  1288. lpDDSrcSurface: IDirectDrawSurface; lpSrcRect: PRect;
  1289. dwFlags: DWORD; lpDDBltFx: PDDBltFX): HResult; stdcall;
  1290. function BltBatch(const lpDDBltBatch: TDDBltBatch; dwCount: DWORD;
  1291. dwFlags: DWORD): HResult; stdcall;
  1292. function BltFast(dwX: DWORD; dwY: DWORD;
  1293. lpDDSrcSurface: IDirectDrawSurface; lpSrcRect: PRect;
  1294. dwTrans: DWORD): HResult; stdcall;
  1295. function DeleteAttachedSurface(dwFlags: DWORD;
  1296. lpDDSAttachedSurface: IDirectDrawSurface): HResult; stdcall;
  1297. function EnumAttachedSurfaces(lpContext: Pointer;
  1298. lpEnumSurfacesCallback: TDDEnumSurfacesCallback): HResult; stdcall;
  1299. function EnumOverlayZOrders(dwFlags: DWORD; lpContext: Pointer;
  1300. lpfnCallback: TDDEnumSurfacesCallback): HResult; stdcall;
  1301. function Flip(lpDDSurfaceTargetOverride: IDirectDrawSurface;
  1302. dwFlags: DWORD): HResult; stdcall;
  1303. function GetAttachedSurface(var lpDDSCaps: TDDSCaps;
  1304. (*out*)var lplpDDAttachedSurface: IDirectDrawSurface): HResult; stdcall;
  1305. function GetBltStatus(dwFlags: DWORD): HResult; stdcall;
  1306. function GetCaps(out lpDDSCaps: TDDSCaps): HResult; stdcall;
  1307. function GetClipper(out lplpDDClipper: IDirectDrawClipper): HResult; stdcall;
  1308. function GetColorKey(dwFlags: DWORD; out lpDDColorKey: TDDColorKey) :
  1309. HResult; stdcall;
  1310. function GetDC(out lphDC: HDC): HResult; stdcall;
  1311. function GetFlipStatus(dwFlags: DWORD): HResult; stdcall;
  1312. function GetOverlayPosition(out lplX, lplY: Longint): HResult; stdcall;
  1313. function GetPalette(out lplpDDPalette: IDirectDrawPalette): HResult; stdcall;
  1314. function GetPixelFormat(out lpDDPixelFormat: TDDPixelFormat): HResult; stdcall;
  1315. function GetSurfaceDesc(out lpDDSurfaceDesc: TDDSurfaceDesc): HResult; stdcall;
  1316. function Initialize(lpDD: IDirectDraw;
  1317. out lpDDSurfaceDesc: TDDSurfaceDesc): HResult; stdcall;
  1318. function IsLost: HResult; stdcall;
  1319. function Lock(lpDestRect: PRect; out lpDDSurfaceDesc:
  1320. TDDSurfaceDesc; dwFlags: DWORD; hEvent: THandle): HResult; stdcall;
  1321. function ReleaseDC(hDC: Windows.HDC): HResult; stdcall;
  1322. function _Restore: HResult; stdcall;
  1323. function SetClipper(lpDDClipper: IDirectDrawClipper): HResult; stdcall;
  1324. function SetColorKey(dwFlags: DWORD; lpDDColorKey: PDDColorKey) :
  1325. HResult; stdcall;
  1326. function SetOverlayPosition(lX, lY: Longint): HResult; stdcall;
  1327. function SetPalette(lpDDPalette: IDirectDrawPalette): HResult; stdcall;
  1328. function Unlock(lpSurfaceData: Pointer): HResult; stdcall;
  1329. function UpdateOverlay(lpSrcRect: PRect;
  1330. lpDDDestSurface: IDirectDrawSurface; lpDestRect: PRect;
  1331. dwFlags: DWORD; lpDDOverlayFx: PDDOverlayFX): HResult; stdcall;
  1332. function UpdateOverlayDisplay(dwFlags: DWORD): HResult; stdcall;
  1333. function UpdateOverlayZOrder(dwFlags: DWORD;
  1334. lpDDSReference: IDirectDrawSurface): HResult; stdcall;
  1335. end;
  1336. (*
  1337. * IDirectDrawSurface2 and related interfaces
  1338. *)
  1339. IDirectDrawSurface2 = interface(IUnknown)
  1340. ['{57805885-6eec-11cf-9441-a82303c10e27}']
  1341. (*** IDirectDrawSurface methods ***)
  1342. function AddAttachedSurface(lpDDSAttachedSurface: IDirectDrawSurface2) :
  1343. HResult; stdcall;
  1344. function AddOverlayDirtyRect(const lpRect: TRect): HResult; stdcall;
  1345. function Blt(lpDestRect: PRect;
  1346. lpDDSrcSurface: IDirectDrawSurface2; lpSrcRect: PRect;
  1347. dwFlags: DWORD; lpDDBltFx: PDDBltFX): HResult; stdcall;
  1348. function BltBatch(const lpDDBltBatch: TDDBltBatch; dwCount: DWORD;
  1349. dwFlags: DWORD): HResult; stdcall;
  1350. function BltFast(dwX: DWORD; dwY: DWORD;
  1351. lpDDSrcSurface: IDirectDrawSurface2; lpSrcRect: PRect;
  1352. dwTrans: DWORD): HResult; stdcall;
  1353. function DeleteAttachedSurface(dwFlags: DWORD;
  1354. lpDDSAttachedSurface: IDirectDrawSurface2): HResult; stdcall;
  1355. function EnumAttachedSurfaces(lpContext: Pointer;
  1356. lpEnumSurfacesCallback: TDDEnumSurfacesCallback): HResult; stdcall;
  1357. function EnumOverlayZOrders(dwFlags: DWORD; lpContext: Pointer;
  1358. lpfnCallback: TDDEnumSurfacesCallback): HResult; stdcall;
  1359. function Flip(lpDDSurfaceTargetOverride: IDirectDrawSurface2;
  1360. dwFlags: DWORD): HResult; stdcall;
  1361. function GetAttachedSurface(var lpDDSCaps: TDDSCaps;
  1362. out lplpDDAttachedSurface: IDirectDrawSurface2): HResult; stdcall;
  1363. function GetBltStatus(dwFlags: DWORD): HResult; stdcall;
  1364. function GetCaps(out lpDDSCaps: TDDSCaps): HResult; stdcall;
  1365. function GetClipper(out lplpDDClipper: IDirectDrawClipper): HResult; stdcall;
  1366. function GetColorKey(dwFlags: DWORD; out lpDDColorKey: TDDColorKey) :
  1367. HResult; stdcall;
  1368. function GetDC(out lphDC: HDC): HResult; stdcall;
  1369. function GetFlipStatus(dwFlags: DWORD): HResult; stdcall;
  1370. function GetOverlayPosition(out lplX, lplY: Longint): HResult; stdcall;
  1371. function GetPalette(out lplpDDPalette: IDirectDrawPalette): HResult; stdcall;
  1372. function GetPixelFormat(out lpDDPixelFormat: TDDPixelFormat): HResult; stdcall;
  1373. function GetSurfaceDesc(out lpDDSurfaceDesc: TDDSurfaceDesc): HResult; stdcall;
  1374. function Initialize(lpDD: IDirectDraw;
  1375. out lpDDSurfaceDesc: TDDSurfaceDesc): HResult; stdcall;
  1376. function IsLost: HResult; stdcall;
  1377. function Lock(lpDestRect: PRect;
  1378. out lpDDSurfaceDesc: TDDSurfaceDesc; dwFlags: DWORD;
  1379. hEvent: THandle): HResult; stdcall;
  1380. function ReleaseDC(hDC: Windows.HDC): HResult; stdcall;
  1381. function _Restore: HResult; stdcall;
  1382. function SetClipper(lpDDClipper: IDirectDrawClipper): HResult; stdcall;
  1383. function SetColorKey(dwFlags: DWORD; lpDDColorKey: PDDColorKey) :
  1384. HResult; stdcall;
  1385. function SetOverlayPosition(lX, lY: Longint): HResult; stdcall;
  1386. function SetPalette(lpDDPalette: IDirectDrawPalette): HResult; stdcall;
  1387. function Unlock(lpSurfaceData: Pointer): HResult; stdcall;
  1388. function UpdateOverlay(lpSrcRect: PRect;
  1389. lpDDDestSurface: IDirectDrawSurface2; lpDestRect: PRect;
  1390. dwFlags: DWORD; lpDDOverlayFx: PDDOverlayFX): HResult; stdcall;
  1391. function UpdateOverlayDisplay(dwFlags: DWORD): HResult; stdcall;
  1392. function UpdateOverlayZOrder(dwFlags: DWORD;
  1393. lpDDSReference: IDirectDrawSurface2): HResult; stdcall;
  1394. (*** Added in the v2 interface ***)
  1395. function GetDDInterface(var lplpDD: IDirectDraw): HResult; stdcall;
  1396. function PageLock(dwFlags: DWORD): HResult; stdcall;
  1397. function PageUnlock(dwFlags: DWORD): HResult; stdcall;
  1398. end;
  1399. IDirectDrawSurface3 = interface(IUnknown)
  1400. ['{DA044E00-69B2-11D0-A1D5-00AA00B8DFBB}']
  1401. (*** IDirectDrawSurface methods ***)
  1402. function AddAttachedSurface(lpDDSAttachedSurface: IDirectDrawSurface3) :
  1403. HResult; stdcall;
  1404. function AddOverlayDirtyRect(const lpRect: TRect): HResult; stdcall;
  1405. function Blt(lpDestRect: PRect;
  1406. lpDDSrcSurface: IDirectDrawSurface3; lpSrcRect: PRect;
  1407. dwFlags: DWORD; lpDDBltFx: PDDBltFX): HResult; stdcall;
  1408. function BltBatch(const lpDDBltBatch: TDDBltBatch; dwCount: DWORD;
  1409. dwFlags: DWORD): HResult; stdcall;
  1410. function BltFast(dwX: DWORD; dwY: DWORD;
  1411. lpDDSrcSurface: IDirectDrawSurface3; lpSrcRect: PRect;
  1412. dwTrans: DWORD): HResult; stdcall;
  1413. function DeleteAttachedSurface(dwFlags: DWORD;
  1414. lpDDSAttachedSurface: IDirectDrawSurface3): HResult; stdcall;
  1415. function EnumAttachedSurfaces(lpContext: Pointer;
  1416. lpEnumSurfacesCallback: TDDEnumSurfacesCallback): HResult; stdcall;
  1417. function EnumOverlayZOrders(dwFlags: DWORD; lpContext: Pointer;
  1418. lpfnCallback: TDDEnumSurfacesCallback): HResult; stdcall;
  1419. function Flip(lpDDSurfaceTargetOverride: IDirectDrawSurface3;
  1420. dwFlags: DWORD): HResult; stdcall;
  1421. function GetAttachedSurface(var lpDDSCaps: TDDSCaps;
  1422. out lplpDDAttachedSurface: IDirectDrawSurface3): HResult; stdcall;
  1423. function GetBltStatus(dwFlags: DWORD): HResult; stdcall;
  1424. function GetCaps(out lpDDSCaps: TDDSCaps): HResult; stdcall;
  1425. function GetClipper(out lplpDDClipper: IDirectDrawClipper): HResult; stdcall;
  1426. function GetColorKey(dwFlags: DWORD; out lpDDColorKey: TDDColorKey) :
  1427. HResult; stdcall;
  1428. function GetDC(out lphDC: HDC): HResult; stdcall;
  1429. function GetFlipStatus(dwFlags: DWORD): HResult; stdcall;
  1430. function GetOverlayPosition(out lplX, lplY: Longint): HResult; stdcall;
  1431. function GetPalette(out lplpDDPalette: IDirectDrawPalette): HResult; stdcall;
  1432. function GetPixelFormat(out lpDDPixelFormat: TDDPixelFormat): HResult; stdcall;
  1433. function GetSurfaceDesc(out lpDDSurfaceDesc: TDDSurfaceDesc): HResult; stdcall;
  1434. function Initialize(lpDD: IDirectDraw;
  1435. out lpDDSurfaceDesc: TDDSurfaceDesc): HResult; stdcall;
  1436. function IsLost: HResult; stdcall;
  1437. function Lock(lpDestRect: PRect;
  1438. out lpDDSurfaceDesc: TDDSurfaceDesc; dwFlags: DWORD;
  1439. hEvent: THandle): HResult; stdcall;
  1440. function ReleaseDC(hDC: Windows.HDC): HResult; stdcall;
  1441. function _Restore: HResult; stdcall;
  1442. function SetClipper(lpDDClipper: IDirectDrawClipper): HResult; stdcall;
  1443. function SetColorKey(dwFlags: DWORD; lpDDColorKey: PDDColorKey) :
  1444. HResult; stdcall;
  1445. function SetOverlayPosition(lX, lY: Longint): HResult; stdcall;
  1446. function SetPalette(lpDDPalette: IDirectDrawPalette): HResult; stdcall;
  1447. function Unlock(lpSurfaceData: Pointer): HResult; stdcall;
  1448. function UpdateOverlay(lpSrcRect: PRect;
  1449. lpDDDestSurface: IDirectDrawSurface3; lpDestRect: PRect;
  1450. dwFlags: DWORD; lpDDOverlayFx: PDDOverlayFX): HResult; stdcall;
  1451. function UpdateOverlayDisplay(dwFlags: DWORD): HResult; stdcall;
  1452. function UpdateOverlayZOrder(dwFlags: DWORD;
  1453. lpDDSReference: IDirectDrawSurface3): HResult; stdcall;
  1454. (*** Added in the v2 interface ***)
  1455. function GetDDInterface(out lplpDD: IDirectDraw): HResult; stdcall;
  1456. function PageLock(dwFlags: DWORD): HResult; stdcall;
  1457. function PageUnlock(dwFlags: DWORD): HResult; stdcall;
  1458. (*** Added in the V3 interface ***)
  1459. function SetSurfaceDesc(const lpddsd: TDDSurfaceDesc; dwFlags: DWORD): HResult; stdcall;
  1460. end;
  1461. (*
  1462. * IDirectDrawSurface4 and related interfaces
  1463. *)
  1464. IDirectDrawSurface4 = interface(IUnknown)
  1465. ['{0B2B8630-AD35-11D0-8EA6-00609797EA5B}']
  1466. (*** IDirectDrawSurface methods ***)
  1467. function AddAttachedSurface(lpDDSAttachedSurface: IDirectDrawSurface4) :
  1468. HResult; stdcall;
  1469. function AddOverlayDirtyRect(const lpRect: TRect): HResult; stdcall;
  1470. function Blt(lpDestRect: PRect;
  1471. lpDDSrcSurface: IDirectDrawSurface4; lpSrcRect: PRect;
  1472. dwFlags: DWORD; lpDDBltFx: PDDBltFX): HResult; stdcall;
  1473. function BltBatch(const lpDDBltBatch: TDDBltBatch; dwCount: DWORD;
  1474. dwFlags: DWORD): HResult; stdcall;
  1475. function BltFast(dwX: DWORD; dwY: DWORD;
  1476. lpDDSrcSurface: IDirectDrawSurface4; lpSrcRect: PRect;
  1477. dwTrans: DWORD): HResult; stdcall;
  1478. function DeleteAttachedSurface(dwFlags: DWORD;
  1479. lpDDSAttachedSurface: IDirectDrawSurface4): HResult; stdcall;
  1480. function EnumAttachedSurfaces(lpContext: Pointer;
  1481. lpEnumSurfacesCallback: TDDEnumSurfacesCallback2): HResult; stdcall;
  1482. function EnumOverlayZOrders(dwFlags: DWORD; lpContext: Pointer;
  1483. lpfnCallback: TDDEnumSurfacesCallback2): HResult; stdcall;
  1484. function Flip(lpDDSurfaceTargetOverride: IDirectDrawSurface4;
  1485. dwFlags: DWORD): HResult; stdcall;
  1486. function GetAttachedSurface(const lpDDSCaps: TDDSCaps2;
  1487. out lplpDDAttachedSurface: IDirectDrawSurface4): HResult; stdcall;
  1488. function GetBltStatus(dwFlags: DWORD): HResult; stdcall;
  1489. function GetCaps(out lpDDSCaps: TDDSCaps2): HResult; stdcall;
  1490. function GetClipper(out lplpDDClipper: IDirectDrawClipper): HResult; stdcall;
  1491. function GetColorKey(dwFlags: DWORD; out lpDDColorKey: TDDColorKey) :
  1492. HResult; stdcall;
  1493. function GetDC(out lphDC: HDC): HResult; stdcall;
  1494. function GetFlipStatus(dwFlags: DWORD): HResult; stdcall;
  1495. function GetOverlayPosition(out lplX, lplY: Longint): HResult; stdcall;
  1496. function GetPalette(out lplpDDPalette: IDirectDrawPalette): HResult; stdcall;
  1497. function GetPixelFormat(out lpDDPixelFormat: TDDPixelFormat): HResult; stdcall;
  1498. function GetSurfaceDesc(out lpDDSurfaceDesc: TDDSurfaceDesc2): HResult; stdcall;
  1499. function Initialize(lpDD: IDirectDraw;
  1500. out lpDDSurfaceDesc: TDDSurfaceDesc2): HResult; stdcall;
  1501. function IsLost: HResult; stdcall;
  1502. function Lock(lpDestRect: PRect;
  1503. out lpDDSurfaceDesc: TDDSurfaceDesc2; dwFlags: DWORD;
  1504. hEvent: THandle): HResult; stdcall;
  1505. function ReleaseDC(hDC: Windows.HDC): HResult; stdcall;
  1506. function _Restore: HResult; stdcall;
  1507. function SetClipper(lpDDClipper: IDirectDrawClipper): HResult; stdcall;
  1508. function SetColorKey(dwFlags: DWORD; lpDDColorKey: PDDColorKey) :
  1509. HResult; stdcall;
  1510. function SetOverlayPosition(lX, lY: Longint): HResult; stdcall;
  1511. function SetPalette(lpDDPalette: IDirectDrawPalette): HResult; stdcall;
  1512. function Unlock(lpRect: PRect): HResult; stdcall;
  1513. function UpdateOverlay(lpSrcRect: PRect;
  1514. lpDDDestSurface: IDirectDrawSurface4; lpDestRect: PRect;
  1515. dwFlags: DWORD; lpDDOverlayFx: PDDOverlayFX): HResult; stdcall;
  1516. function UpdateOverlayDisplay(dwFlags: DWORD): HResult; stdcall;
  1517. function UpdateOverlayZOrder(dwFlags: DWORD;
  1518. lpDDSReference: IDirectDrawSurface4): HResult; stdcall;
  1519. (*** Added in the v2 interface ***)
  1520. function GetDDInterface(out lplpDD: IUnknown): HResult; stdcall;
  1521. function PageLock(dwFlags: DWORD): HResult; stdcall;
  1522. function PageUnlock(dwFlags: DWORD): HResult; stdcall;
  1523. (*** Added in the V3 interface ***)
  1524. function SetSurfaceDesc(const lpddsd2: TDDSurfaceDesc2; dwFlags: DWORD): HResult; stdcall;
  1525. (*** Added in the v4 interface ***)
  1526. function SetPrivateData(const guidTag: TGUID; lpData: Pointer;
  1527. cbSize: DWORD; dwFlags: DWORD): HResult; stdcall;
  1528. function GetPrivateData(const guidTag: TGUID; lpBuffer: Pointer;
  1529. var lpcbBufferSize: DWORD): HResult; stdcall;
  1530. function FreePrivateData(const guidTag: TGUID): HResult; stdcall;
  1531. function GetUniquenessValue(out lpValue: DWORD): HResult; stdcall;
  1532. function ChangeUniquenessValue: HResult; stdcall;
  1533. end;
  1534. IDirectDrawSurface7 = interface(IUnknown)
  1535. ['{06675a80-3b9b-11d2-b92f-00609797ea5b}']
  1536. (*** IDirectDrawSurface methods ***)
  1537. function AddAttachedSurface(lpDDSAttachedSurface: IDirectDrawSurface7) :
  1538. HResult; stdcall;
  1539. function AddOverlayDirtyRect(const lpRect: TRect): HResult; stdcall;
  1540. function Blt(lpDestRect: PRect;
  1541. lpDDSrcSurface: IDirectDrawSurface7; lpSrcRect: PRect;
  1542. dwFlags: DWORD; lpDDBltFx: PDDBltFX): HResult; stdcall;
  1543. function BltBatch(const lpDDBltBatch: TDDBltBatch; dwCount: DWORD;
  1544. dwFlags: DWORD): HResult; stdcall;
  1545. function BltFast(dwX: DWORD; dwY: DWORD;
  1546. lpDDSrcSurface: IDirectDrawSurface7; lpSrcRect: PRect;
  1547. dwTrans: DWORD): HResult; stdcall;
  1548. function DeleteAttachedSurface(dwFlags: DWORD;
  1549. lpDDSAttachedSurface: IDirectDrawSurface7): HResult; stdcall;
  1550. function EnumAttachedSurfaces(lpContext: Pointer;
  1551. lpEnumSurfacesCallback: TDDEnumSurfacesCallback7): HResult; stdcall;
  1552. function EnumOverlayZOrders(dwFlags: DWORD; lpContext: Pointer;
  1553. lpfnCallback: TDDEnumSurfacesCallback7): HResult; stdcall;
  1554. function Flip(lpDDSurfaceTargetOverride: IDirectDrawSurface7;
  1555. dwFlags: DWORD): HResult; stdcall;
  1556. function GetAttachedSurface(const lpDDSCaps: TDDSCaps2;
  1557. out lplpDDAttachedSurface: IDirectDrawSurface7): HResult; stdcall;
  1558. function GetBltStatus(dwFlags: DWORD): HResult; stdcall;
  1559. function GetCaps(out lpDDSCaps: TDDSCaps2): HResult; stdcall;
  1560. function GetClipper(out lplpDDClipper: IDirectDrawClipper): HResult; stdcall;
  1561. function GetColorKey(dwFlags: DWORD; out lpDDColorKey: TDDColorKey) :
  1562. HResult; stdcall;
  1563. function GetDC(out lphDC: HDC): HResult; stdcall;
  1564. function GetFlipStatus(dwFlags: DWORD): HResult; stdcall;
  1565. function GetOverlayPosition(out lplX, lplY: Longint): HResult; stdcall;
  1566. function GetPalette(out lplpDDPalette: IDirectDrawPalette): HResult; stdcall;
  1567. function GetPixelFormat(out lpDDPixelFormat: TDDPixelFormat): HResult; stdcall;
  1568. function GetSurfaceDesc(out lpDDSurfaceDesc: TDDSurfaceDesc2): HResult; stdcall;
  1569. function Initialize(lpDD: IDirectDraw;
  1570. out lpDDSurfaceDesc: TDDSurfaceDesc2): HResult; stdcall;
  1571. function IsLost: HResult; stdcall;
  1572. function Lock(lpDestRect: PRect;
  1573. out lpDDSurfaceDesc: TDDSurfaceDesc2; dwFlags: DWORD;
  1574. hEvent: THandle): HResult; stdcall;
  1575. function ReleaseDC(hDC: Windows.HDC): HResult; stdcall;
  1576. function _Restore: HResult; stdcall;
  1577. function SetClipper(lpDDClipper: IDirectDrawClipper): HResult; stdcall;
  1578. function SetColorKey(dwFlags: DWORD; lpDDColorKey: PDDColorKey) :
  1579. HResult; stdcall;
  1580. function SetOverlayPosition(lX, lY: Longint): HResult; stdcall;
  1581. function SetPalette(lpDDPalette: IDirectDrawPalette): HResult; stdcall;
  1582. function Unlock(lpRect: PRect): HResult; stdcall;
  1583. function UpdateOverlay(lpSrcRect: PRect;
  1584. lpDDDestSurface: IDirectDrawSurface7; lpDestRect: PRect;
  1585. dwFlags: DWORD; lpDDOverlayFx: PDDOverlayFX): HResult; stdcall;
  1586. function UpdateOverlayDisplay(dwFlags: DWORD): HResult; stdcall;
  1587. function UpdateOverlayZOrder(dwFlags: DWORD;
  1588. lpDDSReference: IDirectDrawSurface7): HResult; stdcall;
  1589. (*** Added in the v2 interface ***)
  1590. function GetDDInterface(out lplpDD: IUnknown): HResult; stdcall;
  1591. function PageLock(dwFlags: DWORD): HResult; stdcall;
  1592. function PageUnlock(dwFlags: DWORD): HResult; stdcall;
  1593. (*** Added in the V3 interface ***)
  1594. function SetSurfaceDesc(const lpddsd2: TDDSurfaceDesc2; dwFlags: DWORD): HResult; stdcall;
  1595. (*** Added in the v4 interface ***)
  1596. function SetPrivateData(const guidTag: TGUID; lpData: Pointer;
  1597. cbSize: DWORD; dwFlags: DWORD): HResult; stdcall;
  1598. function GetPrivateData(const guidTag: TGUID; lpBuffer: Pointer;
  1599. var lpcbBufferSize: DWORD): HResult; stdcall;
  1600. function FreePrivateData(const guidTag: TGUID): HResult; stdcall;
  1601. function GetUniquenessValue(out lpValue: DWORD): HResult; stdcall;
  1602. function ChangeUniquenessValue: HResult; stdcall;
  1603. (*** Moved Texture7 methods here ***)
  1604. function SetPriority(dwPriority: DWORD): HResult; stdcall;
  1605. function GetPriority(out lpdwPriority: DWORD): HResult; stdcall;
  1606. function SetLOD(dwMaxLOD: DWORD): HResult; stdcall;
  1607. function GetLOD(out lpdwMaxLOD: DWORD): HResult; stdcall;
  1608. end;
  1609. IDirectDrawColorControl = interface(IUnknown)
  1610. ['{4B9F0EE0-0D7E-11D0-9B06-00A0C903A3B8}']
  1611. function GetColorControls(out lpColorControl: TDDColorControl): HResult; stdcall;
  1612. function SetColorControls(const lpColorControl: TDDColorControl): HResult; stdcall;
  1613. end;
  1614. (*
  1615. * IDirectDrawGammaControl
  1616. *)
  1617. IDirectDrawGammaControl = interface(IUnknown)
  1618. ['{69C11C3E-B46B-11D1-AD7A-00C04FC29B4E}']
  1619. function GetGammaRamp(dwFlags: DWORD; out lpRampData: TDDGammaRamp): HResult; stdcall;
  1620. function SetGammaRamp(dwFlags: DWORD; const lpRampData: TDDGammaRamp): HResult; stdcall;
  1621. end;
  1622. type
  1623. IID_IDirectDraw = IDirectDraw;
  1624. {$EXTERNALSYM IID_IDirectDraw}
  1625. IID_IDirectDraw2 = IDirectDraw2;
  1626. {$EXTERNALSYM IID_IDirectDraw2}
  1627. IID_IDirectDraw4 = IDirectDraw4;
  1628. {$EXTERNALSYM IID_IDirectDraw4}
  1629. IID_IDirectDraw7 = IDirectDraw7;
  1630. {$EXTERNALSYM IID_IDirectDraw7}
  1631. IID_IDirectDrawSurface = IDirectDrawSurface;
  1632. {$EXTERNALSYM IID_IDirectDrawSurface}
  1633. IID_IDirectDrawSurface2 = IDirectDrawSurface2;
  1634. {$EXTERNALSYM IID_IDirectDrawSurface2}
  1635. IID_IDirectDrawSurface3 = IDirectDrawSurface3;
  1636. {$EXTERNALSYM IID_IDirectDrawSurface3}
  1637. IID_IDirectDrawSurface4 = IDirectDrawSurface4;
  1638. {$EXTERNALSYM IID_IDirectDrawSurface4}
  1639. IID_IDirectDrawSurface7 = IDirectDrawSurface7;
  1640. {$EXTERNALSYM IID_IDirectDrawSurface7}
  1641. IID_IDirectDrawPalette = IDirectDrawPalette;
  1642. {$EXTERNALSYM IID_IDirectDrawPalette}
  1643. IID_IDirectDrawClipper = IDirectDrawClipper;
  1644. {$EXTERNALSYM IID_IDirectDrawClipper}
  1645. IID_IDirectDrawColorControl = IDirectDrawColorControl;
  1646. {$EXTERNALSYM IID_IDirectDrawColorControl}
  1647. IID_IDirectDrawGammaControl = IDirectDrawGammaControl;
  1648. {$EXTERNALSYM IID_IDirectDrawGammaControl}
  1649. const
  1650. (*
  1651. * ddsCaps field is valid.
  1652. *)
  1653. DDSD_CAPS = $00000001; // default
  1654. {$EXTERNALSYM DDSD_CAPS}
  1655. (*
  1656. * dwHeight field is valid.
  1657. *)
  1658. DDSD_HEIGHT = $00000002;
  1659. {$EXTERNALSYM DDSD_HEIGHT}
  1660. (*
  1661. * dwWidth field is valid.
  1662. *)
  1663. DDSD_WIDTH = $00000004;
  1664. {$EXTERNALSYM DDSD_WIDTH}
  1665. (*
  1666. * lPitch is valid.
  1667. *)
  1668. DDSD_PITCH = $00000008;
  1669. {$EXTERNALSYM DDSD_PITCH}
  1670. (*
  1671. * dwBackBufferCount is valid.
  1672. *)
  1673. DDSD_BACKBUFFERCOUNT = $00000020;
  1674. {$EXTERNALSYM DDSD_BACKBUFFERCOUNT}
  1675. (*
  1676. * dwZBufferBitDepth is valid. (shouldnt be used in DDSURFACEDESC2)
  1677. *)
  1678. DDSD_ZBUFFERBITDEPTH = $00000040;
  1679. {$EXTERNALSYM DDSD_ZBUFFERBITDEPTH}
  1680. (*
  1681. * dwAlphaBitDepth is valid.
  1682. *)
  1683. DDSD_ALPHABITDEPTH = $00000080;
  1684. {$EXTERNALSYM DDSD_ALPHABITDEPTH}
  1685. (*
  1686. * lpSurface is valid.
  1687. *)
  1688. DDSD_LPSURFACE = $00000800;
  1689. {$EXTERNALSYM DDSD_LPSURFACE}
  1690. (*
  1691. * ddpfPixelFormat is valid.
  1692. *)
  1693. DDSD_PIXELFORMAT = $00001000;
  1694. {$EXTERNALSYM DDSD_PIXELFORMAT}
  1695. (*
  1696. * ddckCKDestOverlay is valid.
  1697. *)
  1698. DDSD_CKDESTOVERLAY = $00002000;
  1699. {$EXTERNALSYM DDSD_CKDESTOVERLAY}
  1700. (*
  1701. * ddckCKDestBlt is valid.
  1702. *)
  1703. DDSD_CKDESTBLT = $00004000;
  1704. {$EXTERNALSYM DDSD_CKDESTBLT}
  1705. (*
  1706. * ddckCKSrcOverlay is valid.
  1707. *)
  1708. DDSD_CKSRCOVERLAY = $00008000;
  1709. {$EXTERNALSYM DDSD_CKSRCOVERLAY}
  1710. (*
  1711. * ddckCKSrcBlt is valid.
  1712. *)
  1713. DDSD_CKSRCBLT = $00010000;
  1714. {$EXTERNALSYM DDSD_CKSRCBLT}
  1715. (*
  1716. * dwMipMapCount is valid.
  1717. *)
  1718. DDSD_MIPMAPCOUNT = $00020000;
  1719. {$EXTERNALSYM DDSD_MIPMAPCOUNT}
  1720. (*
  1721. * dwRefreshRate is valid
  1722. *)
  1723. DDSD_REFRESHRATE = $00040000;
  1724. {$EXTERNALSYM DDSD_REFRESHRATE}
  1725. (*
  1726. * dwLinearSize is valid
  1727. *)
  1728. DDSD_LINEARSIZE = $00080000;
  1729. {$EXTERNALSYM DDSD_LINEARSIZE}
  1730. (*
  1731. * dwTextureStage is valid
  1732. *)
  1733. DDSD_TEXTURESTAGE = $00100000;
  1734. {$EXTERNALSYM DDSD_TEXTURESTAGE}
  1735. (*
  1736. * dwFVF is valid
  1737. *)
  1738. DDSD_FVF = $00200000;
  1739. {$EXTERNALSYM DDSD_FVF}
  1740. (*
  1741. * dwSrcVBHandle is valid
  1742. *)
  1743. DDSD_SRCVBHANDLE = $00400000;
  1744. {$EXTERNALSYM DDSD_SRCVBHANDLE}
  1745. (*
  1746. * dwDepth is valid
  1747. *)
  1748. DDSD_DEPTH = $00800000;
  1749. {$EXTERNALSYM DDSD_DEPTH}
  1750. (*
  1751. * All input fields are valid.
  1752. *)
  1753. DDSD_ALL = $00fff9ee;
  1754. {$EXTERNALSYM DDSD_ALL}
  1755. (*
  1756. * guid field is valid.
  1757. *)
  1758. DDOSD_GUID = $00000001;
  1759. {$EXTERNALSYM DDOSD_GUID}
  1760. (*
  1761. * dwCompressionRatio field is valid.
  1762. *)
  1763. DDOSD_COMPRESSION_RATIO = $00000002;
  1764. {$EXTERNALSYM DDOSD_COMPRESSION_RATIO}
  1765. (*
  1766. * ddSCaps field is valid.
  1767. *)
  1768. DDOSD_SCAPS = $00000004;
  1769. {$EXTERNALSYM DDOSD_SCAPS}
  1770. (*
  1771. * ddOSCaps field is valid.
  1772. *)
  1773. DDOSD_OSCAPS = $00000008;
  1774. {$EXTERNALSYM DDOSD_OSCAPS}
  1775. (*
  1776. * All input fields are valid.
  1777. *)
  1778. DDOSD_ALL = $0000000f;
  1779. {$EXTERNALSYM DDOSD_ALL}
  1780. (*
  1781. * The surface's optimized pixelformat is compressed
  1782. *)
  1783. DDOSDCAPS_OPTCOMPRESSED = $00000001;
  1784. {$EXTERNALSYM DDOSDCAPS_OPTCOMPRESSED}
  1785. (*
  1786. * The surface's optimized pixelformat is reordered
  1787. *)
  1788. DDOSDCAPS_OPTREORDERED = $00000002;
  1789. {$EXTERNALSYM DDOSDCAPS_OPTREORDERED}
  1790. (*
  1791. * The opt surface is a monolithic mipmap
  1792. *)
  1793. DDOSDCAPS_MONOLITHICMIPMAP = $00000004;
  1794. {$EXTERNALSYM DDOSDCAPS_MONOLITHICMIPMAP}
  1795. (*
  1796. * The valid Surf caps:
  1797. * DDSCAPS_SYSTEMMEMORY = $00000800;
  1798. * DDSCAPS_VIDEOMEMORY = $00004000;
  1799. * DDSCAPS_LOCALVIDMEM = $10000000;
  1800. * DDSCAPS_NONLOCALVIDMEM = $20000000;
  1801. *)
  1802. DDOSDCAPS_VALIDSCAPS = $30004800;
  1803. {$EXTERNALSYM DDOSDCAPS_VALIDSCAPS}
  1804. (*
  1805. * The valid OptSurf caps
  1806. *)
  1807. DDOSDCAPS_VALIDOSCAPS = $00000007;
  1808. {$EXTERNALSYM DDOSDCAPS_VALIDOSCAPS}
  1809. (*
  1810. * DDCOLORCONTROL
  1811. *)
  1812. (*
  1813. * lBrightness field is valid.
  1814. *)
  1815. DDCOLOR_BRIGHTNESS = $00000001;
  1816. {$EXTERNALSYM DDCOLOR_BRIGHTNESS}
  1817. (*
  1818. * lContrast field is valid.
  1819. *)
  1820. DDCOLOR_CONTRAST = $00000002;
  1821. {$EXTERNALSYM DDCOLOR_CONTRAST}
  1822. (*
  1823. * lHue field is valid.
  1824. *)
  1825. DDCOLOR_HUE = $00000004;
  1826. {$EXTERNALSYM DDCOLOR_HUE}
  1827. (*
  1828. * lSaturation field is valid.
  1829. *)
  1830. DDCOLOR_SATURATION = $00000008;
  1831. {$EXTERNALSYM DDCOLOR_SATURATION}
  1832. (*
  1833. * lSharpness field is valid.
  1834. *)
  1835. DDCOLOR_SHARPNESS = $00000010;
  1836. {$EXTERNALSYM DDCOLOR_SHARPNESS}
  1837. (*
  1838. * lGamma field is valid.
  1839. *)
  1840. DDCOLOR_GAMMA = $00000020;
  1841. {$EXTERNALSYM DDCOLOR_GAMMA}
  1842. (*
  1843. * lColorEnable field is valid.
  1844. *)
  1845. DDCOLOR_COLORENABLE = $00000040;
  1846. {$EXTERNALSYM DDCOLOR_COLORENABLE}
  1847. (*============================================================================
  1848. *
  1849. * Direct Draw Capability Flags
  1850. *
  1851. * These flags are used to describe the capabilities of a given Surface.
  1852. * All flags are bit flags.
  1853. *
  1854. *==========================================================================*)
  1855. (****************************************************************************
  1856. *
  1857. * DIRECTDRAWSURFACE CAPABILITY FLAGS
  1858. *
  1859. ****************************************************************************)
  1860. (*
  1861. * This bit currently has no meaning.
  1862. *)
  1863. DDSCAPS_RESERVED1 = $00000001;
  1864. {$EXTERNALSYM DDSCAPS_RESERVED1}
  1865. (*
  1866. * Indicates that this surface contains alpha-only information.
  1867. * (To determine if a surface is RGBA/YUVA, the pixel format must be
  1868. * interrogated.)
  1869. *)
  1870. DDSCAPS_ALPHA = $00000002;
  1871. {$EXTERNALSYM DDSCAPS_ALPHA}
  1872. (*
  1873. * Indicates that this surface is a backbuffer. It is generally
  1874. * set by CreateSurface when the DDSCAPS_FLIP capability bit is set.
  1875. * It indicates that this surface is THE back buffer of a surface
  1876. * flipping structure. DirectDraw supports N surfaces in a
  1877. * surface flipping structure. Only the surface that immediately
  1878. * precedeces the DDSCAPS_FRONTBUFFER has this capability bit set.
  1879. * The other surfaces are identified as back buffers by the presence
  1880. * of the DDSCAPS_FLIP capability, their attachment order, and the
  1881. * absence of the DDSCAPS_FRONTBUFFER and DDSCAPS_BACKBUFFER
  1882. * capabilities. The bit is sent to CreateSurface when a standalone
  1883. * back buffer is being created. This surface could be attached to
  1884. * a front buffer and/or back buffers to form a flipping surface
  1885. * structure after the CreateSurface call. See AddAttachments for
  1886. * a detailed description of the behaviors in this case.
  1887. *)
  1888. DDSCAPS_BACKBUFFER = $00000004;
  1889. {$EXTERNALSYM DDSCAPS_BACKBUFFER}
  1890. (*
  1891. * Indicates a complex surface structure is being described. A
  1892. * complex surface structure results in the creation of more than
  1893. * one surface. The additional surfaces are attached to the root
  1894. * surface. The complex structure can only be destroyed by
  1895. * destroying the root.
  1896. *)
  1897. DDSCAPS_COMPLEX = $00000008;
  1898. {$EXTERNALSYM DDSCAPS_COMPLEX}
  1899. (*
  1900. * Indicates that this surface is a part of a surface flipping structure.
  1901. * When it is passed to CreateSurface the DDSCAPS_FRONTBUFFER and
  1902. * DDSCAP_BACKBUFFER bits are not set. They are set by CreateSurface
  1903. * on the resulting creations. The dwBackBufferCount field in the
  1904. * TDDSurfaceDesc structure must be set to at least 1 in order for
  1905. * the CreateSurface call to succeed. The DDSCAPS_COMPLEX capability
  1906. * must always be set with creating multiple surfaces through CreateSurface.
  1907. *)
  1908. DDSCAPS_FLIP = $00000010;
  1909. {$EXTERNALSYM DDSCAPS_FLIP}
  1910. (*
  1911. * Indicates that this surface is THE front buffer of a surface flipping
  1912. * structure. It is generally set by CreateSurface when the DDSCAPS_FLIP
  1913. * capability bit is set.
  1914. * If this capability is sent to CreateSurface then a standalonw front buffer
  1915. * is created. This surface will not have the DDSCAPS_FLIP capability.
  1916. * It can be attached to other back buffers to form a flipping structure.
  1917. * See AddAttachments for a detailed description of the behaviors in this
  1918. * case.
  1919. *)
  1920. DDSCAPS_FRONTBUFFER = $00000020;
  1921. {$EXTERNALSYM DDSCAPS_FRONTBUFFER}
  1922. (*
  1923. * Indicates that this surface is any offscreen surface that is not an overlay,
  1924. * texture, zbuffer, front buffer, back buffer, or alpha surface. It is used
  1925. * to identify plain vanilla surfaces.
  1926. *)
  1927. DDSCAPS_OFFSCREENPLAIN = $00000040;
  1928. {$EXTERNALSYM DDSCAPS_OFFSCREENPLAIN}
  1929. (*
  1930. * Indicates that this surface is an overlay. It may or may not be directly visible
  1931. * depending on whether or not it is currently being overlayed onto the primary
  1932. * surface. DDSCAPS_VISIBLE can be used to determine whether or not it is being
  1933. * overlayed at the moment.
  1934. *)
  1935. DDSCAPS_OVERLAY = $00000080;
  1936. {$EXTERNALSYM DDSCAPS_OVERLAY}
  1937. (*
  1938. * Indicates that unique DirectDrawPalette objects can be created and
  1939. * attached to this surface.
  1940. *)
  1941. DDSCAPS_PALETTE = $00000100;
  1942. {$EXTERNALSYM DDSCAPS_PALETTE}
  1943. (*
  1944. * Indicates that this surface is the primary surface. The primary
  1945. * surface represents what the user is seeing at the moment.
  1946. *)
  1947. DDSCAPS_PRIMARYSURFACE = $00000200;
  1948. {$EXTERNALSYM DDSCAPS_PRIMARYSURFACE}
  1949. (*
  1950. * This flag used to be DDSCAPS_PRIMARYSURFACELEFT, which is now
  1951. * obsolete.
  1952. *)
  1953. DDSCAPS_RESERVED3 = $00000400;
  1954. {$EXTERNALSYM DDSCAPS_RESERVED3}
  1955. DDSCAPS_PRIMARYSURFACELEFT = DDSCAPS_RESERVED3;
  1956. {$EXTERNALSYM DDSCAPS_PRIMARYSURFACELEFT}
  1957. (*
  1958. * Indicates that this surface memory was allocated in system memory
  1959. *)
  1960. DDSCAPS_SYSTEMMEMORY = $00000800;
  1961. {$EXTERNALSYM DDSCAPS_SYSTEMMEMORY}
  1962. (*
  1963. * Indicates that this surface can be used as a 3D texture. It does not
  1964. * indicate whether or not the surface is being used for that purpose.
  1965. *)
  1966. DDSCAPS_TEXTURE = $00001000;
  1967. {$EXTERNALSYM DDSCAPS_TEXTURE}
  1968. (*
  1969. * Indicates that a surface may be a destination for 3D rendering. This
  1970. * bit must be set in order to query for a Direct3D Device Interface
  1971. * from this surface.
  1972. *)
  1973. DDSCAPS_3DDEVICE = $00002000;
  1974. {$EXTERNALSYM DDSCAPS_3DDEVICE}
  1975. (*
  1976. * Indicates that this surface exists in video memory.
  1977. *)
  1978. DDSCAPS_VIDEOMEMORY = $00004000;
  1979. {$EXTERNALSYM DDSCAPS_VIDEOMEMORY}
  1980. (*
  1981. * Indicates that changes made to this surface are immediately visible.
  1982. * It is always set for the primary surface and is set for overlays while
  1983. * they are being overlayed and texture maps while they are being textured.
  1984. *)
  1985. DDSCAPS_VISIBLE = $00008000;
  1986. {$EXTERNALSYM DDSCAPS_VISIBLE}
  1987. (*
  1988. * Indicates that only writes are permitted to the surface. Read accesses
  1989. * from the surface may or may not generate a protection fault, but the
  1990. * results of a read from this surface will not be meaningful. READ ONLY.
  1991. *)
  1992. DDSCAPS_WRITEONLY = $00010000;
  1993. {$EXTERNALSYM DDSCAPS_WRITEONLY}
  1994. (*
  1995. * Indicates that this surface is a z buffer. A z buffer does not contain
  1996. * displayable information. Instead it contains bit depth information that is
  1997. * used to determine which pixels are visible and which are obscured.
  1998. *)
  1999. DDSCAPS_ZBUFFER = $00020000;
  2000. {$EXTERNALSYM DDSCAPS_ZBUFFER}
  2001. (*
  2002. * Indicates surface will have a DC associated long term
  2003. *)
  2004. DDSCAPS_OWNDC = $00040000;
  2005. {$EXTERNALSYM DDSCAPS_OWNDC}
  2006. (*
  2007. * Indicates surface should be able to receive live video
  2008. *)
  2009. DDSCAPS_LIVEVIDEO = $00080000;
  2010. {$EXTERNALSYM DDSCAPS_LIVEVIDEO}
  2011. (*
  2012. * Indicates surface should be able to have a stream decompressed
  2013. * to it by the hardware.
  2014. *)
  2015. DDSCAPS_HWCODEC = $00100000;
  2016. {$EXTERNALSYM DDSCAPS_HWCODEC}
  2017. (*
  2018. * Surface is a ModeX surface.
  2019. *
  2020. *)
  2021. DDSCAPS_MODEX = $00200000;
  2022. {$EXTERNALSYM DDSCAPS_MODEX}
  2023. (*
  2024. * Indicates surface is one level of a mip-map. This surface will
  2025. * be attached to other DDSCAPS_MIPMAP surfaces to form the mip-map.
  2026. * This can be done explicitly, by creating a number of surfaces and
  2027. * attaching them with AddAttachedSurface or by implicitly by CreateSurface.
  2028. * If this bit is set then DDSCAPS_TEXTURE must also be set.
  2029. *)
  2030. DDSCAPS_MIPMAP = $00400000;
  2031. {$EXTERNALSYM DDSCAPS_MIPMAP}
  2032. (*
  2033. * This bit is reserved. It should not be specified.
  2034. *)
  2035. DDSCAPS_RESERVED2 = $00800000;
  2036. {$EXTERNALSYM DDSCAPS_RESERVED2}
  2037. (*
  2038. * Indicates that memory for the surface is not allocated until the surface
  2039. * is loaded (via the Direct3D texture Load() function).
  2040. *)
  2041. DDSCAPS_ALLOCONLOAD = $04000000;
  2042. {$EXTERNALSYM DDSCAPS_ALLOCONLOAD}
  2043. (*
  2044. * Indicates that the surface will recieve data from a video port.
  2045. *)
  2046. DDSCAPS_VIDEOPORT = $08000000;
  2047. {$EXTERNALSYM DDSCAPS_VIDEOPORT}
  2048. (*
  2049. * Indicates that a video memory surface is resident in true, local video
  2050. * memory rather than non-local video memory. If this flag is specified then
  2051. * so must DDSCAPS_VIDEOMEMORY. This flag is mutually exclusive with
  2052. * DDSCAPS_NONLOCALVIDMEM.
  2053. *)
  2054. DDSCAPS_LOCALVIDMEM = $10000000;
  2055. {$EXTERNALSYM DDSCAPS_LOCALVIDMEM}
  2056. (*
  2057. * Indicates that a video memory surface is resident in non-local video
  2058. * memory rather than true, local video memory. If this flag is specified
  2059. * then so must DDSCAPS_VIDEOMEMORY. This flag is mutually exclusive with
  2060. * DDSCAPS_LOCALVIDMEM.
  2061. *)
  2062. DDSCAPS_NONLOCALVIDMEM = $20000000;
  2063. {$EXTERNALSYM DDSCAPS_NONLOCALVIDMEM}
  2064. (*
  2065. * Indicates that this surface is a standard VGA mode surface, and not a
  2066. * ModeX surface. (This flag will never be set in combination with the
  2067. * DDSCAPS_MODEX flag).
  2068. *)
  2069. DDSCAPS_STANDARDVGAMODE = $40000000;
  2070. {$EXTERNALSYM DDSCAPS_STANDARDVGAMODE}
  2071. (*
  2072. * Indicates that this surface will be an optimized surface. This flag is
  2073. * currently only valid in conjunction with the DDSCAPS_TEXTURE flag. The surface
  2074. * will be created without any underlying video memory until loaded.
  2075. *)
  2076. DDSCAPS_OPTIMIZED = $80000000;
  2077. {$EXTERNALSYM DDSCAPS_OPTIMIZED}
  2078. (*
  2079. * This bit is reserved
  2080. *)
  2081. DDSCAPS2_RESERVED4 = $00000002;
  2082. {$EXTERNALSYM DDSCAPS2_RESERVED4}
  2083. DDSCAPS2_HARDWAREDEINTERLACE = $00000000;
  2084. {$EXTERNALSYM DDSCAPS2_HARDWAREDEINTERLACE}
  2085. (*
  2086. * Indicates to the driver that this surface will be locked very frequently
  2087. * (for procedural textures, dynamic lightmaps, etc). Surfaces with this cap
  2088. * set must also have DDSCAPS_TEXTURE. This cap cannot be used with
  2089. * DDSCAPS2_HINTSTATIC and DDSCAPS2_OPAQUE.
  2090. *)
  2091. DDSCAPS2_HINTDYNAMIC = $00000004;
  2092. {$EXTERNALSYM DDSCAPS2_HINTDYNAMIC}
  2093. (*
  2094. * Indicates to the driver that this surface can be re-ordered/retiled on
  2095. * load. This operation will not change the size of the texture. It is
  2096. * relatively fast and symmetrical, since the application may lock these
  2097. * bits (although it will take a performance hit when doing so). Surfaces
  2098. * with this cap set must also have DDSCAPS_TEXTURE. This cap cannot be
  2099. * used with DDSCAPS2_HINTDYNAMIC and DDSCAPS2_OPAQUE.
  2100. *)
  2101. DDSCAPS2_HINTSTATIC = $00000008;
  2102. {$EXTERNALSYM DDSCAPS2_HINTSTATIC}
  2103. (*
  2104. * Indicates that the client would like this texture surface to be managed by the
  2105. * DirectDraw/Direct3D runtime. Surfaces with this cap set must also have
  2106. * DDSCAPS_TEXTURE and DDSCAPS_SYSTEMMEMORY.
  2107. *)
  2108. DDSCAPS2_TEXTUREMANAGE = $00000010;
  2109. {$EXTERNALSYM DDSCAPS2_TEXTUREMANAGE}
  2110. (*
  2111. * These bits are reserved for internal use *)
  2112. DDSCAPS2_RESERVED1 = $00000020;
  2113. {$EXTERNALSYM DDSCAPS2_RESERVED1}
  2114. DDSCAPS2_RESERVED2 = $00000040;
  2115. {$EXTERNALSYM DDSCAPS2_RESERVED2}
  2116. (*
  2117. * Indicates to the driver that this surface will never be locked again.
  2118. * The driver is free to optimize this surface via retiling and actual compression.
  2119. * All calls to Lock() or Blts from this surface will fail. Surfaces with this
  2120. * cap set must also have DDSCAPS_TEXTURE. This cap cannot be used with
  2121. * DDSCAPS2_HINTDYNAMIC and DDSCAPS2_HINTSTATIC.
  2122. *)
  2123. DDSCAPS2_OPAQUE = $00000080;
  2124. {$EXTERNALSYM DDSCAPS2_OPAQUE}
  2125. (*
  2126. * Applications should set this bit at CreateSurface time to indicate that they
  2127. * intend to use antialiasing. Only valid if DDSCAPS_3DDEVICE is also set.
  2128. *)
  2129. DDSCAPS2_HINTANTIALIASING = $00000100;
  2130. {$EXTERNALSYM DDSCAPS2_HINTANTIALIASING}
  2131. (*
  2132. * This flag is used at CreateSurface time to indicate that this set of
  2133. * surfaces is a cubic environment map
  2134. *)
  2135. DDSCAPS2_CUBEMAP = $00000200;
  2136. {$EXTERNALSYM DDSCAPS2_CUBEMAP}
  2137. (*
  2138. * These flags preform two functions:
  2139. * - At CreateSurface time, they define which of the six cube faces are
  2140. * required by the application.
  2141. * - After creation, each face in the cubemap will have exactly one of these
  2142. * bits set.
  2143. *)
  2144. DDSCAPS2_CUBEMAP_POSITIVEX = $00000400;
  2145. {$EXTERNALSYM DDSCAPS2_CUBEMAP_POSITIVEX}
  2146. DDSCAPS2_CUBEMAP_NEGATIVEX = $00000800;
  2147. {$EXTERNALSYM DDSCAPS2_CUBEMAP_NEGATIVEX}
  2148. DDSCAPS2_CUBEMAP_POSITIVEY = $00001000;
  2149. {$EXTERNALSYM DDSCAPS2_CUBEMAP_POSITIVEY}
  2150. DDSCAPS2_CUBEMAP_NEGATIVEY = $00002000;
  2151. {$EXTERNALSYM DDSCAPS2_CUBEMAP_NEGATIVEY}
  2152. DDSCAPS2_CUBEMAP_POSITIVEZ = $00004000;
  2153. {$EXTERNALSYM DDSCAPS2_CUBEMAP_POSITIVEZ}
  2154. DDSCAPS2_CUBEMAP_NEGATIVEZ = $00008000;
  2155. {$EXTERNALSYM DDSCAPS2_CUBEMAP_NEGATIVEZ}
  2156. (*
  2157. * This macro may be used to specify all faces of a cube map at CreateSurface time
  2158. *)
  2159. DDSCAPS2_CUBEMAP_ALLFACES = ( DDSCAPS2_CUBEMAP_POSITIVEX or
  2160. DDSCAPS2_CUBEMAP_NEGATIVEX or
  2161. DDSCAPS2_CUBEMAP_POSITIVEY or
  2162. DDSCAPS2_CUBEMAP_NEGATIVEY or
  2163. DDSCAPS2_CUBEMAP_POSITIVEZ or
  2164. DDSCAPS2_CUBEMAP_NEGATIVEZ );
  2165. {$EXTERNALSYM DDSCAPS2_CUBEMAP_ALLFACES}
  2166. (*
  2167. * This flag is an additional flag which is present on mipmap sublevels from DX7 onwards
  2168. * It enables easier use of GetAttachedSurface rather than EnumAttachedSurfaces for surface
  2169. * constructs such as Cube Maps, wherein there are more than one mipmap surface attached
  2170. * to the root surface.
  2171. * This caps bit is ignored by CreateSurface
  2172. *)
  2173. DDSCAPS2_MIPMAPSUBLEVEL = $00010000;
  2174. {$EXTERNALSYM DDSCAPS2_MIPMAPSUBLEVEL}
  2175. (* This flag indicates that the texture should be managed by D3D only *)
  2176. DDSCAPS2_D3DTEXTUREMANAGE = $00020000;
  2177. {$EXTERNALSYM DDSCAPS2_D3DTEXTUREMANAGE}
  2178. (* This flag indicates that the managed surface can be safely lost *)
  2179. DDSCAPS2_DONOTPERSIST = $00040000;
  2180. {$EXTERNALSYM DDSCAPS2_DONOTPERSIST}
  2181. (* indicates that this surface is part of a stereo flipping chain *)
  2182. DDSCAPS2_STEREOSURFACELEFT = $00080000;
  2183. {$EXTERNALSYM DDSCAPS2_STEREOSURFACELEFT}
  2184. (*
  2185. * Indicates that the surface is a volume.
  2186. * Can be combined with DDSCAPS_MIPMAP to indicate a multi-level volume
  2187. *)
  2188. DDSCAPS2_VOLUME = $00200000;
  2189. {$EXTERNALSYM DDSCAPS2_VOLUME}
  2190. (*
  2191. * Indicates that the surface may be locked multiple times by the application.
  2192. * This cap cannot be used with DDSCAPS2_OPAQUE.
  2193. *)
  2194. DDSCAPS2_NOTUSERLOCKABLE = $00400000;
  2195. {$EXTERNALSYM DDSCAPS2_NOTUSERLOCKABLE}
  2196. (*
  2197. * Indicates that the vertex buffer data can be used to render points and
  2198. * point sprites.
  2199. *)
  2200. DDSCAPS2_POINTS = $00800000;
  2201. {$EXTERNALSYM DDSCAPS2_POINTS}
  2202. (*
  2203. * Indicates that the vertex buffer data can be used to render rt pactches.
  2204. *)
  2205. DDSCAPS2_RTPATCHES = $01000000;
  2206. {$EXTERNALSYM DDSCAPS2_RTPATCHES}
  2207. (*
  2208. * Indicates that the vertex buffer data can be used to render n patches.
  2209. *)
  2210. DDSCAPS2_NPATCHES = $02000000;
  2211. {$EXTERNALSYM DDSCAPS2_NPATCHES}
  2212. (*
  2213. * This bit is reserved for internal use
  2214. *)
  2215. DDSCAPS2_RESERVED3 = $04000000;
  2216. {$EXTERNALSYM DDSCAPS2_RESERVED3}
  2217. (*
  2218. * Indicates that the contents of the backbuffer do not have to be preserved
  2219. * the contents of the backbuffer after they are presented.
  2220. *)
  2221. DDSCAPS2_DISCARDBACKBUFFER = $10000000;
  2222. {$EXTERNALSYM DDSCAPS2_DISCARDBACKBUFFER}
  2223. (*
  2224. * Indicates that all surfaces in this creation chain should be given an alpha channel.
  2225. * This flag will be set on primary surface chains that may have no explicit pixel format
  2226. * (and thus take on the format of the current display mode).
  2227. * The driver should infer that all these surfaces have a format having an alpha channel.
  2228. * (e.g. assume D3DFMT_A8R8G8B8 if the display mode is x888.)
  2229. *)
  2230. DDSCAPS2_ENABLEALPHACHANNEL = $20000000;
  2231. {$EXTERNALSYM DDSCAPS2_ENABLEALPHACHANNEL}
  2232. (*
  2233. * Indicates that all surfaces in this creation chain is extended primary surface format.
  2234. * This flag will be set on extended primary surface chains that always have explicit pixel
  2235. * format and the pixel format is typically GDI (Graphics Device Interface) couldn't handle,
  2236. * thus only used with fullscreen application. (e.g. D3DFMT_A2R10G10B10 format)
  2237. *)
  2238. DDSCAPS2_EXTENDEDFORMATPRIMARY = $40000000;
  2239. {$EXTERNALSYM DDSCAPS2_EXTENDEDFORMATPRIMARY}
  2240. (*
  2241. * Indicates that all surfaces in this creation chain is additional primary surface.
  2242. * This flag will be set on primary surface chains which must present on the adapter
  2243. * id provided on dwCaps4. Typically this will be used to create secondary primary surface
  2244. * on DualView display adapter.
  2245. *)
  2246. DDSCAPS2_ADDITIONALPRIMARY = $80000000;
  2247. {$EXTERNALSYM DDSCAPS2_ADDITIONALPRIMARY}
  2248. (*
  2249. * This is a mask that indicates the set of bits that may be set
  2250. * at createsurface time to indicate number of samples per pixel
  2251. * when multisampling
  2252. *)
  2253. DDSCAPS3_MULTISAMPLE_MASK = $0000001F;
  2254. {$EXTERNALSYM DDSCAPS3_MULTISAMPLE_MASK}
  2255. (*
  2256. * This is a mask that indicates the set of bits that may be set
  2257. * at createsurface time to indicate the quality level of rendering
  2258. * for the current number of samples per pixel
  2259. *)
  2260. DDSCAPS3_MULTISAMPLE_QUALITY_MASK = $000000E0;
  2261. {$EXTERNALSYM DDSCAPS3_MULTISAMPLE_QUALITY_MASK}
  2262. DDSCAPS3_MULTISAMPLE_QUALITY_SHIFT = 5;
  2263. {$EXTERNALSYM DDSCAPS3_MULTISAMPLE_QUALITY_SHIFT}
  2264. (*
  2265. * This bit is reserved for internal use
  2266. *)
  2267. DDSCAPS3_RESERVED1 = $00000100;
  2268. {$EXTERNALSYM DDSCAPS3_RESERVED1}
  2269. (*
  2270. * This bit is reserved for internal use
  2271. *)
  2272. DDSCAPS3_RESERVED2 = $00000200;
  2273. {$EXTERNALSYM DDSCAPS3_RESERVED2}
  2274. (*
  2275. * This indicates whether this surface has light-weight miplevels
  2276. *)
  2277. DDSCAPS3_LIGHTWEIGHTMIPMAP = $00000400;
  2278. {$EXTERNALSYM DDSCAPS3_LIGHTWEIGHTMIPMAP}
  2279. (*
  2280. * This indicates that the mipsublevels for this surface are auto-generated
  2281. *)
  2282. DDSCAPS3_AUTOGENMIPMAP = $00000800;
  2283. {$EXTERNALSYM DDSCAPS3_AUTOGENMIPMAP}
  2284. (*
  2285. * This indicates that the mipsublevels for this surface are auto-generated
  2286. *)
  2287. DDSCAPS3_DMAP = $00001000;
  2288. {$EXTERNALSYM DDSCAPS3_DMAP}
  2289. (****************************************************************************
  2290. *
  2291. * DIRECTDRAW DRIVER CAPABILITY FLAGS
  2292. *
  2293. ****************************************************************************)
  2294. (*
  2295. * Display hardware has 3D acceleration.
  2296. *)
  2297. DDCAPS_3D = $00000001;
  2298. {$EXTERNALSYM DDCAPS_3D}
  2299. (*
  2300. * Indicates that DirectDraw will support only dest rectangles that are aligned
  2301. * on DIRECTDRAWCAPS.dwAlignBoundaryDest boundaries of the surface, respectively.
  2302. * READ ONLY.
  2303. *)
  2304. DDCAPS_ALIGNBOUNDARYDEST = $00000002;
  2305. {$EXTERNALSYM DDCAPS_ALIGNBOUNDARYDEST}
  2306. (*
  2307. * Indicates that DirectDraw will support only source rectangles whose sizes in
  2308. * BYTEs are DIRECTDRAWCAPS.dwAlignSizeDest multiples, respectively. READ ONLY.
  2309. *)
  2310. DDCAPS_ALIGNSIZEDEST = $00000004;
  2311. {$EXTERNALSYM DDCAPS_ALIGNSIZEDEST}
  2312. (*
  2313. * Indicates that DirectDraw will support only source rectangles that are aligned
  2314. * on DIRECTDRAWCAPS.dwAlignBoundarySrc boundaries of the surface, respectively.
  2315. * READ ONLY.
  2316. *)
  2317. DDCAPS_ALIGNBOUNDARYSRC = $00000008;
  2318. {$EXTERNALSYM DDCAPS_ALIGNBOUNDARYSRC}
  2319. (*
  2320. * Indicates that DirectDraw will support only source rectangles whose sizes in
  2321. * BYTEs are DIRECTDRAWCAPS.dwAlignSizeSrc multiples, respectively. READ ONLY.
  2322. *)
  2323. DDCAPS_ALIGNSIZESRC = $00000010;
  2324. {$EXTERNALSYM DDCAPS_ALIGNSIZESRC}
  2325. (*
  2326. * Indicates that DirectDraw will create video memory surfaces that have a stride
  2327. * alignment equal to DIRECTDRAWCAPS.dwAlignStride. READ ONLY.
  2328. *)
  2329. DDCAPS_ALIGNSTRIDE = $00000020;
  2330. {$EXTERNALSYM DDCAPS_ALIGNSTRIDE}
  2331. (*
  2332. * Display hardware is capable of blt operations.
  2333. *)
  2334. DDCAPS_BLT = $00000040;
  2335. {$EXTERNALSYM DDCAPS_BLT}
  2336. (*
  2337. * Display hardware is capable of asynchronous blt operations.
  2338. *)
  2339. DDCAPS_BLTQUEUE = $00000080;
  2340. {$EXTERNALSYM DDCAPS_BLTQUEUE}
  2341. (*
  2342. * Display hardware is capable of color space conversions during the blt operation.
  2343. *)
  2344. DDCAPS_BLTFOURCC = $00000100;
  2345. {$EXTERNALSYM DDCAPS_BLTFOURCC}
  2346. (*
  2347. * Display hardware is capable of stretching during blt operations.
  2348. *)
  2349. DDCAPS_BLTSTRETCH = $00000200;
  2350. {$EXTERNALSYM DDCAPS_BLTSTRETCH}
  2351. (*
  2352. * Display hardware is shared with GDI.
  2353. *)
  2354. DDCAPS_GDI = $00000400;
  2355. {$EXTERNALSYM DDCAPS_GDI}
  2356. (*
  2357. * Display hardware can overlay.
  2358. *)
  2359. DDCAPS_OVERLAY = $00000800;
  2360. {$EXTERNALSYM DDCAPS_OVERLAY}
  2361. (*
  2362. * Set if display hardware supports overlays but can not clip them.
  2363. *)
  2364. DDCAPS_OVERLAYCANTCLIP = $00001000;
  2365. {$EXTERNALSYM DDCAPS_OVERLAYCANTCLIP}
  2366. (*
  2367. * Indicates that overlay hardware is capable of color space conversions during
  2368. * the overlay operation.
  2369. *)
  2370. DDCAPS_OVERLAYFOURCC = $00002000;
  2371. {$EXTERNALSYM DDCAPS_OVERLAYFOURCC}
  2372. (*
  2373. * Indicates that stretching can be done by the overlay hardware.
  2374. *)
  2375. DDCAPS_OVERLAYSTRETCH = $00004000;
  2376. {$EXTERNALSYM DDCAPS_OVERLAYSTRETCH}
  2377. (*
  2378. * Indicates that unique DirectDrawPalettes can be created for DirectDrawSurfaces
  2379. * other than the primary surface.
  2380. *)
  2381. DDCAPS_PALETTE = $00008000;
  2382. {$EXTERNALSYM DDCAPS_PALETTE}
  2383. (*
  2384. * Indicates that palette changes can be syncd with the veritcal refresh.
  2385. *)
  2386. DDCAPS_PALETTEVSYNC = $00010000;
  2387. {$EXTERNALSYM DDCAPS_PALETTEVSYNC}
  2388. (*
  2389. * Display hardware can return the current scan line.
  2390. *)
  2391. DDCAPS_READSCANLINE = $00020000;
  2392. {$EXTERNALSYM DDCAPS_READSCANLINE}
  2393. (*
  2394. * This flag used to bo DDCAPS_STEREOVIEW, which is now obsolete
  2395. *)
  2396. DDCAPS_RESERVED1 = $00040000;
  2397. {$EXTERNALSYM DDCAPS_RESERVED1}
  2398. (*
  2399. * Display hardware is capable of generating a vertical blank interrupt.
  2400. *)
  2401. DDCAPS_VBI = $00080000;
  2402. {$EXTERNALSYM DDCAPS_VBI}
  2403. (*
  2404. * Supports the use of z buffers with blt operations.
  2405. *)
  2406. DDCAPS_ZBLTS = $00100000;
  2407. {$EXTERNALSYM DDCAPS_ZBLTS}
  2408. (*
  2409. * Supports Z Ordering of overlays.
  2410. *)
  2411. DDCAPS_ZOVERLAYS = $00200000;
  2412. {$EXTERNALSYM DDCAPS_ZOVERLAYS}
  2413. (*
  2414. * Supports color key
  2415. *)
  2416. DDCAPS_COLORKEY = $00400000;
  2417. {$EXTERNALSYM DDCAPS_COLORKEY}
  2418. (*
  2419. * Supports alpha surfaces
  2420. *)
  2421. DDCAPS_ALPHA = $00800000;
  2422. {$EXTERNALSYM DDCAPS_ALPHA}
  2423. (*
  2424. * colorkey is hardware assisted(DDCAPS_COLORKEY will also be set)
  2425. *)
  2426. DDCAPS_COLORKEYHWASSIST = $01000000;
  2427. {$EXTERNALSYM DDCAPS_COLORKEYHWASSIST}
  2428. (*
  2429. * no hardware support at all
  2430. *)
  2431. DDCAPS_NOHARDWARE = $02000000;
  2432. {$EXTERNALSYM DDCAPS_NOHARDWARE}
  2433. (*
  2434. * Display hardware is capable of color fill with bltter
  2435. *)
  2436. DDCAPS_BLTCOLORFILL = $04000000;
  2437. {$EXTERNALSYM DDCAPS_BLTCOLORFILL}
  2438. (*
  2439. * Display hardware is bank switched, and potentially very slow at
  2440. * random access to VRAM.
  2441. *)
  2442. DDCAPS_BANKSWITCHED = $08000000;
  2443. {$EXTERNALSYM DDCAPS_BANKSWITCHED}
  2444. (*
  2445. * Display hardware is capable of depth filling Z-buffers with bltter
  2446. *)
  2447. DDCAPS_BLTDEPTHFILL = $10000000;
  2448. {$EXTERNALSYM DDCAPS_BLTDEPTHFILL}
  2449. (*
  2450. * Display hardware is capable of clipping while bltting.
  2451. *)
  2452. DDCAPS_CANCLIP = $20000000;
  2453. {$EXTERNALSYM DDCAPS_CANCLIP}
  2454. (*
  2455. * Display hardware is capable of clipping while stretch bltting.
  2456. *)
  2457. DDCAPS_CANCLIPSTRETCHED = $40000000;
  2458. {$EXTERNALSYM DDCAPS_CANCLIPSTRETCHED}
  2459. (*
  2460. * Display hardware is capable of bltting to or from system memory
  2461. *)
  2462. DDCAPS_CANBLTSYSMEM = $80000000;
  2463. {$EXTERNALSYM DDCAPS_CANBLTSYSMEM}
  2464. (****************************************************************************
  2465. *
  2466. * MORE DIRECTDRAW DRIVER CAPABILITY FLAGS (dwCaps2)
  2467. *
  2468. ****************************************************************************)
  2469. (*
  2470. * Display hardware is certified
  2471. *)
  2472. DDCAPS2_CERTIFIED = $00000001;
  2473. {$EXTERNALSYM DDCAPS2_CERTIFIED}
  2474. (*
  2475. * Driver cannot interleave 2D operations (lock and blt) to surfaces with
  2476. * Direct3D rendering operations between calls to BeginScene() and EndScene()
  2477. *)
  2478. DDCAPS2_NO2DDURING3DSCENE = $00000002;
  2479. {$EXTERNALSYM DDCAPS2_NO2DDURING3DSCENE}
  2480. (*
  2481. * Display hardware contains a video port
  2482. *)
  2483. DDCAPS2_VIDEOPORT = $00000004;
  2484. {$EXTERNALSYM DDCAPS2_VIDEOPORT}
  2485. (*
  2486. * The overlay can be automatically flipped according to the video port
  2487. * VSYNCs, providing automatic doubled buffered display of video port
  2488. * data using an overlay
  2489. *)
  2490. DDCAPS2_AUTOFLIPOVERLAY = $00000008;
  2491. {$EXTERNALSYM DDCAPS2_AUTOFLIPOVERLAY}
  2492. (*
  2493. * Overlay can display each field of interlaced data individually while
  2494. * it is interleaved in memory without causing jittery artifacts.
  2495. *)
  2496. DDCAPS2_CANBOBINTERLEAVED = $00000010;
  2497. {$EXTERNALSYM DDCAPS2_CANBOBINTERLEAVED}
  2498. (*
  2499. * Overlay can display each field of interlaced data individually while
  2500. * it is not interleaved in memory without causing jittery artifacts.
  2501. *)
  2502. DDCAPS2_CANBOBNONINTERLEAVED = $00000020;
  2503. {$EXTERNALSYM DDCAPS2_CANBOBNONINTERLEAVED}
  2504. (*
  2505. * The overlay surface contains color controls (brightness, sharpness, etc.)
  2506. *)
  2507. DDCAPS2_COLORCONTROLOVERLAY = $00000040;
  2508. {$EXTERNALSYM DDCAPS2_COLORCONTROLOVERLAY}
  2509. (*
  2510. * The primary surface contains color controls (gamma, etc.)
  2511. *)
  2512. DDCAPS2_COLORCONTROLPRIMARY = $00000080;
  2513. {$EXTERNALSYM DDCAPS2_COLORCONTROLPRIMARY}
  2514. (*
  2515. * RGBZ -> RGB supported for 16:16 RGB:Z
  2516. *)
  2517. DDCAPS2_CANDROPZ16BIT = $00000100;
  2518. {$EXTERNALSYM DDCAPS2_CANDROPZ16BIT}
  2519. (*
  2520. * Driver supports non-local video memory.
  2521. *)
  2522. DDCAPS2_NONLOCALVIDMEM = $00000200;
  2523. {$EXTERNALSYM DDCAPS2_NONLOCALVIDMEM}
  2524. (*
  2525. * Dirver supports non-local video memory but has different capabilities for
  2526. * non-local video memory surfaces. If this bit is set then so must
  2527. * DDCAPS2_NONLOCALVIDMEM.
  2528. *)
  2529. DDCAPS2_NONLOCALVIDMEMCAPS = $00000400;
  2530. {$EXTERNALSYM DDCAPS2_NONLOCALVIDMEMCAPS}
  2531. (*
  2532. * Driver neither requires nor prefers surfaces to be pagelocked when performing
  2533. * blts involving system memory surfaces
  2534. *)
  2535. DDCAPS2_NOPAGELOCKREQUIRED = $00000800;
  2536. {$EXTERNALSYM DDCAPS2_NOPAGELOCKREQUIRED}
  2537. (*
  2538. * Driver can create surfaces which are wider than the primary surface
  2539. *)
  2540. DDCAPS2_WIDESURFACES = $00001000;
  2541. {$EXTERNALSYM DDCAPS2_WIDESURFACES}
  2542. (*
  2543. * Driver supports bob without using a video port by handling the
  2544. * DDFLIP_ODD and DDFLIP_EVEN flags specified in Flip.
  2545. *)
  2546. DDCAPS2_CANFLIPODDEVEN = $00002000;
  2547. {$EXTERNALSYM DDCAPS2_CANFLIPODDEVEN}
  2548. (*
  2549. * Driver supports bob using hardware
  2550. *)
  2551. DDCAPS2_CANBOBHARDWARE = $00004000;
  2552. {$EXTERNALSYM DDCAPS2_CANBOBHARDWARE}
  2553. (*
  2554. * Driver supports bltting any FOURCC surface to another surface of the same FOURCC
  2555. *)
  2556. DDCAPS2_COPYFOURCC = $00008000;
  2557. {$EXTERNALSYM DDCAPS2_COPYFOURCC}
  2558. (*
  2559. * Driver supports loadable gamma ramps for the primary surface
  2560. *)
  2561. DDCAPS2_PRIMARYGAMMA = $00020000;
  2562. {$EXTERNALSYM DDCAPS2_PRIMARYGAMMA}
  2563. (*
  2564. * Driver can render in windowed mode.
  2565. *)
  2566. DDCAPS2_CANRENDERWINDOWED = $00080000;
  2567. {$EXTERNALSYM DDCAPS2_CANRENDERWINDOWED}
  2568. (*
  2569. * A calibrator is available to adjust the gamma ramp according to the
  2570. * physical display properties so that the result will be identical on
  2571. * all calibrated systems.
  2572. *)
  2573. DDCAPS2_CANCALIBRATEGAMMA = $00100000;
  2574. {$EXTERNALSYM DDCAPS2_CANCALIBRATEGAMMA}
  2575. (*
  2576. * Indicates that the driver will respond to DDFLIP_INTERVALn flags
  2577. *)
  2578. DDCAPS2_FLIPINTERVAL = $00200000;
  2579. {$EXTERNALSYM DDCAPS2_FLIPINTERVAL}
  2580. (*
  2581. * Indicates that the driver will respond to DDFLIP_NOVSYNC
  2582. *)
  2583. DDCAPS2_FLIPNOVSYNC = $00400000;
  2584. {$EXTERNALSYM DDCAPS2_FLIPNOVSYNC}
  2585. (*
  2586. * Driver supports management of video memory, if this flag is ON,
  2587. * driver manages the texture if requested with DDSCAPS2_TEXTUREMANAGE on
  2588. * DirectX manages the texture if this flag is OFF and surface has DDSCAPS2_TEXTUREMANAGE on
  2589. *)
  2590. DDCAPS2_CANMANAGETEXTURE = $00800000;
  2591. {$EXTERNALSYM DDCAPS2_CANMANAGETEXTURE}
  2592. (*
  2593. * The Direct3D texture manager uses this cap to decide whether to put managed
  2594. * surfaces in non-local video memory. If the cap is set, the texture manager will
  2595. * put managed surfaces in non-local vidmem. Drivers that cannot texture from
  2596. * local vidmem SHOULD NOT set this cap.
  2597. *)
  2598. DDCAPS2_TEXMANINNONLOCALVIDMEM = $01000000;
  2599. {$EXTERNALSYM DDCAPS2_TEXMANINNONLOCALVIDMEM}
  2600. (*
  2601. * Indicates that the driver supports DX7 type of stereo in at least one mode (which may
  2602. * not necessarily be the current mode). Applications should use IDirectDraw7 (or higher)
  2603. * ::EnumDisplayModes and check the DDSURFACEDESC.ddsCaps.dwCaps2 field for the presence of
  2604. * DDSCAPS2_STEREOSURFACELEFT to check if a particular mode supports stereo. The application
  2605. * can also use IDirectDraw7(or higher)::GetDisplayMode to check the current mode.
  2606. *)
  2607. DDCAPS2_STEREO = $02000000;
  2608. {$EXTERNALSYM DDCAPS2_STEREO}
  2609. (*
  2610. * This caps bit is intended for internal DirectDraw use.
  2611. * -It is only valid if DDCAPS2_NONLOCALVIDMEMCAPS is set.
  2612. * -If this bit is set, then DDCAPS_CANBLTSYSMEM MUST be set by the driver (and
  2613. * all the assoicated system memory blt caps must be correct).
  2614. * -It implies that the system->video blt caps in DDCAPS also apply to system to
  2615. * nonlocal blts. I.e. the dwSVBCaps, dwSVBCKeyCaps, dwSVBFXCaps and dwSVBRops
  2616. * members of DDCAPS (DDCORECAPS) are filled in correctly.
  2617. * -Any blt from system to nonlocal memory that matches these caps bits will
  2618. * be passed to the driver.
  2619. *
  2620. * NOTE: This is intended to enable the driver itself to do efficient reordering
  2621. * of textures. This is NOT meant to imply that hardware can write into AGP memory.
  2622. * This operation is not currently supported.
  2623. *)
  2624. DDCAPS2_SYSTONONLOCAL_AS_SYSTOLOCAL = $04000000;
  2625. {$EXTERNALSYM DDCAPS2_SYSTONONLOCAL_AS_SYSTOLOCAL}
  2626. (*
  2627. * was DDCAPS2_PUREHAL
  2628. *)
  2629. DDCAPS2_RESERVED1 = $08000000;
  2630. {$EXTERNALSYM DDCAPS2_RESERVED1}
  2631. (*
  2632. * Driver supports management of video memory, if this flag is ON,
  2633. * driver manages the resource if requested with DDSCAPS2_TEXTUREMANAGE on
  2634. * DirectX manages the resource if this flag is OFF and surface has DDSCAPS2_TEXTUREMANAGE on
  2635. *)
  2636. DDCAPS2_CANMANAGERESOURCE = $10000000;
  2637. {$EXTERNALSYM DDCAPS2_CANMANAGERESOURCE}
  2638. (*
  2639. * Driver supports dynamic textures. This will allow the application to set
  2640. * D3DUSAGE_DYNAMIC (DDSCAPS2_HINTDYNAMIC for drivers) at texture create time.
  2641. * Video memory dynamic textures WILL be lockable by applications. It is
  2642. * expected that these locks will be very efficient (which implies that the
  2643. * driver should always maintain a linear copy, a pointer to which can be
  2644. * quickly handed out to the application).
  2645. *)
  2646. DDCAPS2_DYNAMICTEXTURES = $20000000;
  2647. {$EXTERNALSYM DDCAPS2_DYNAMICTEXTURES}
  2648. (*
  2649. * Driver supports auto-generation of mipmaps.
  2650. *)
  2651. DDCAPS2_CANAUTOGENMIPMAP = $40000000;
  2652. {$EXTERNALSYM DDCAPS2_CANAUTOGENMIPMAP}
  2653. (****************************************************************************
  2654. *
  2655. * DIRECTDRAW FX ALPHA CAPABILITY FLAGS
  2656. *
  2657. ****************************************************************************)
  2658. (*
  2659. * Supports alpha blending around the edge of a source color keyed surface.
  2660. * For Blt.
  2661. *)
  2662. DDFXALPHACAPS_BLTALPHAEDGEBLEND = $00000001;
  2663. {$EXTERNALSYM DDFXALPHACAPS_BLTALPHAEDGEBLEND}
  2664. (*
  2665. * Supports alpha information in the pixel format. The bit depth of alpha
  2666. * information in the pixel format can be 1,2,4, or 8. The alpha value becomes
  2667. * more opaque as the alpha value increases. (0 is transparent.)
  2668. * For Blt.
  2669. *)
  2670. DDFXALPHACAPS_BLTALPHAPIXELS = $00000002;
  2671. {$EXTERNALSYM DDFXALPHACAPS_BLTALPHAPIXELS}
  2672. (*
  2673. * Supports alpha information in the pixel format. The bit depth of alpha
  2674. * information in the pixel format can be 1,2,4, or 8. The alpha value
  2675. * becomes more transparent as the alpha value increases. (0 is opaque.)
  2676. * This flag can only be set if DDCAPS_ALPHA is set.
  2677. * For Blt.
  2678. *)
  2679. DDFXALPHACAPS_BLTALPHAPIXELSNEG = $00000004;
  2680. {$EXTERNALSYM DDFXALPHACAPS_BLTALPHAPIXELSNEG}
  2681. (*
  2682. * Supports alpha only surfaces. The bit depth of an alpha only surface can be
  2683. * 1,2,4, or 8. The alpha value becomes more opaque as the alpha value increases.
  2684. * (0 is transparent.)
  2685. * For Blt.
  2686. *)
  2687. DDFXALPHACAPS_BLTALPHASURFACES = $00000008;
  2688. {$EXTERNALSYM DDFXALPHACAPS_BLTALPHASURFACES}
  2689. (*
  2690. * The depth of the alpha channel data can range can be 1,2,4, or 8.
  2691. * The NEG suffix indicates that this alpha channel becomes more transparent
  2692. * as the alpha value increases. (0 is opaque.) This flag can only be set if
  2693. * DDCAPS_ALPHA is set.
  2694. * For Blt.
  2695. *)
  2696. DDFXALPHACAPS_BLTALPHASURFACESNEG = $00000010;
  2697. {$EXTERNALSYM DDFXALPHACAPS_BLTALPHASURFACESNEG}
  2698. (*
  2699. * Supports alpha blending around the edge of a source color keyed surface.
  2700. * For Overlays.
  2701. *)
  2702. DDFXALPHACAPS_OVERLAYALPHAEDGEBLEND = $00000020;
  2703. {$EXTERNALSYM DDFXALPHACAPS_OVERLAYALPHAEDGEBLEND}
  2704. (*
  2705. * Supports alpha information in the pixel format. The bit depth of alpha
  2706. * information in the pixel format can be 1,2,4, or 8. The alpha value becomes
  2707. * more opaque as the alpha value increases. (0 is transparent.)
  2708. * For Overlays.
  2709. *)
  2710. DDFXALPHACAPS_OVERLAYALPHAPIXELS = $00000040;
  2711. {$EXTERNALSYM DDFXALPHACAPS_OVERLAYALPHAPIXELS}
  2712. (*
  2713. * Supports alpha information in the pixel format. The bit depth of alpha
  2714. * information in the pixel format can be 1,2,4, or 8. The alpha value
  2715. * becomes more transparent as the alpha value increases. (0 is opaque.)
  2716. * This flag can only be set if DDCAPS_ALPHA is set.
  2717. * For Overlays.
  2718. *)
  2719. DDFXALPHACAPS_OVERLAYALPHAPIXELSNEG = $00000080;
  2720. {$EXTERNALSYM DDFXALPHACAPS_OVERLAYALPHAPIXELSNEG}
  2721. (*
  2722. * Supports alpha only surfaces. The bit depth of an alpha only surface can be
  2723. * 1,2,4, or 8. The alpha value becomes more opaque as the alpha value increases.
  2724. * (0 is transparent.)
  2725. * For Overlays.
  2726. *)
  2727. DDFXALPHACAPS_OVERLAYALPHASURFACES = $00000100;
  2728. {$EXTERNALSYM DDFXALPHACAPS_OVERLAYALPHASURFACES}
  2729. (*
  2730. * The depth of the alpha channel data can range can be 1,2,4, or 8.
  2731. * The NEG suffix indicates that this alpha channel becomes more transparent
  2732. * as the alpha value increases. (0 is opaque.) This flag can only be set if
  2733. * DDCAPS_ALPHA is set.
  2734. * For Overlays.
  2735. *)
  2736. DDFXALPHACAPS_OVERLAYALPHASURFACESNEG = $00000200;
  2737. {$EXTERNALSYM DDFXALPHACAPS_OVERLAYALPHASURFACESNEG}
  2738. (****************************************************************************
  2739. *
  2740. * DIRECTDRAW FX CAPABILITY FLAGS
  2741. *
  2742. ****************************************************************************)
  2743. (*
  2744. * Uses arithmetic operations to stretch and shrink surfaces during blt
  2745. * rather than pixel doubling techniques. Along the Y axis.
  2746. *)
  2747. DDFXCAPS_BLTARITHSTRETCHY = $00000020;
  2748. {$EXTERNALSYM DDFXCAPS_BLTARITHSTRETCHY}
  2749. (*
  2750. * Uses arithmetic operations to stretch during blt
  2751. * rather than pixel doubling techniques. Along the Y axis. Only
  2752. * works for x1, x2, etc.
  2753. *)
  2754. DDFXCAPS_BLTARITHSTRETCHYN = $00000010;
  2755. {$EXTERNALSYM DDFXCAPS_BLTARITHSTRETCHYN}
  2756. (*
  2757. * Supports mirroring left to right in blt.
  2758. *)
  2759. DDFXCAPS_BLTMIRRORLEFTRIGHT = $00000040;
  2760. {$EXTERNALSYM DDFXCAPS_BLTMIRRORLEFTRIGHT}
  2761. (*
  2762. * Supports mirroring top to bottom in blt.
  2763. *)
  2764. DDFXCAPS_BLTMIRRORUPDOWN = $00000080;
  2765. {$EXTERNALSYM DDFXCAPS_BLTMIRRORUPDOWN}
  2766. (*
  2767. * Supports arbitrary rotation for blts.
  2768. *)
  2769. DDFXCAPS_BLTROTATION = $00000100;
  2770. {$EXTERNALSYM DDFXCAPS_BLTROTATION}
  2771. (*
  2772. * Supports 90 degree rotations for blts.
  2773. *)
  2774. DDFXCAPS_BLTROTATION90 = $00000200;
  2775. {$EXTERNALSYM DDFXCAPS_BLTROTATION90}
  2776. (*
  2777. * DirectDraw supports arbitrary shrinking of a surface along the
  2778. * x axis (horizontal direction) for blts.
  2779. *)
  2780. DDFXCAPS_BLTSHRINKX = $00000400;
  2781. {$EXTERNALSYM DDFXCAPS_BLTSHRINKX}
  2782. (*
  2783. * DirectDraw supports integer shrinking (1x,2x,) of a surface
  2784. * along the x axis (horizontal direction) for blts.
  2785. *)
  2786. DDFXCAPS_BLTSHRINKXN = $00000800;
  2787. {$EXTERNALSYM DDFXCAPS_BLTSHRINKXN}
  2788. (*
  2789. * DirectDraw supports arbitrary shrinking of a surface along the
  2790. * y axis (horizontal direction) for blts.
  2791. *)
  2792. DDFXCAPS_BLTSHRINKY = $00001000;
  2793. {$EXTERNALSYM DDFXCAPS_BLTSHRINKY}
  2794. (*
  2795. * DirectDraw supports integer shrinking (1x,2x,) of a surface
  2796. * along the y axis (vertical direction) for blts.
  2797. *)
  2798. DDFXCAPS_BLTSHRINKYN = $00002000;
  2799. {$EXTERNALSYM DDFXCAPS_BLTSHRINKYN}
  2800. (*
  2801. * DirectDraw supports arbitrary stretching of a surface along the
  2802. * x axis (horizontal direction) for blts.
  2803. *)
  2804. DDFXCAPS_BLTSTRETCHX = $00004000;
  2805. {$EXTERNALSYM DDFXCAPS_BLTSTRETCHX}
  2806. (*
  2807. * DirectDraw supports integer stretching (1x,2x,) of a surface
  2808. * along the x axis (horizontal direction) for blts.
  2809. *)
  2810. DDFXCAPS_BLTSTRETCHXN = $00008000;
  2811. {$EXTERNALSYM DDFXCAPS_BLTSTRETCHXN}
  2812. (*
  2813. * DirectDraw supports arbitrary stretching of a surface along the
  2814. * y axis (horizontal direction) for blts.
  2815. *)
  2816. DDFXCAPS_BLTSTRETCHY = $00010000;
  2817. {$EXTERNALSYM DDFXCAPS_BLTSTRETCHY}
  2818. (*
  2819. * DirectDraw supports integer stretching (1x,2x,) of a surface
  2820. * along the y axis (vertical direction) for blts.
  2821. *)
  2822. DDFXCAPS_BLTSTRETCHYN = $00020000;
  2823. {$EXTERNALSYM DDFXCAPS_BLTSTRETCHYN}
  2824. (*
  2825. * Uses arithmetic operations to stretch and shrink surfaces during
  2826. * overlay rather than pixel doubling techniques. Along the Y axis
  2827. * for overlays.
  2828. *)
  2829. DDFXCAPS_OVERLAYARITHSTRETCHY = $00040000;
  2830. {$EXTERNALSYM DDFXCAPS_OVERLAYARITHSTRETCHY}
  2831. (*
  2832. * Uses arithmetic operations to stretch surfaces during
  2833. * overlay rather than pixel doubling techniques. Along the Y axis
  2834. * for overlays. Only works for x1, x2, etc.
  2835. *)
  2836. DDFXCAPS_OVERLAYARITHSTRETCHYN = $00000008;
  2837. {$EXTERNALSYM DDFXCAPS_OVERLAYARITHSTRETCHYN}
  2838. (*
  2839. * DirectDraw supports arbitrary shrinking of a surface along the
  2840. * x axis (horizontal direction) for overlays.
  2841. *)
  2842. DDFXCAPS_OVERLAYSHRINKX = $00080000;
  2843. {$EXTERNALSYM DDFXCAPS_OVERLAYSHRINKX}
  2844. (*
  2845. * DirectDraw supports integer shrinking (1x,2x,) of a surface
  2846. * along the x axis (horizontal direction) for overlays.
  2847. *)
  2848. DDFXCAPS_OVERLAYSHRINKXN = $00100000;
  2849. {$EXTERNALSYM DDFXCAPS_OVERLAYSHRINKXN}
  2850. (*
  2851. * DirectDraw supports arbitrary shrinking of a surface along the
  2852. * y axis (horizontal direction) for overlays.
  2853. *)
  2854. DDFXCAPS_OVERLAYSHRINKY = $00200000;
  2855. {$EXTERNALSYM DDFXCAPS_OVERLAYSHRINKY}
  2856. (*
  2857. * DirectDraw supports integer shrinking (1x,2x,) of a surface
  2858. * along the y axis (vertical direction) for overlays.
  2859. *)
  2860. DDFXCAPS_OVERLAYSHRINKYN = $00400000;
  2861. {$EXTERNALSYM DDFXCAPS_OVERLAYSHRINKYN}
  2862. (*
  2863. * DirectDraw supports arbitrary stretching of a surface along the
  2864. * x axis (horizontal direction) for overlays.
  2865. *)
  2866. DDFXCAPS_OVERLAYSTRETCHX = $00800000;
  2867. {$EXTERNALSYM DDFXCAPS_OVERLAYSTRETCHX}
  2868. (*
  2869. * DirectDraw supports integer stretching (1x,2x,) of a surface
  2870. * along the x axis (horizontal direction) for overlays.
  2871. *)
  2872. DDFXCAPS_OVERLAYSTRETCHXN = $01000000;
  2873. {$EXTERNALSYM DDFXCAPS_OVERLAYSTRETCHXN}
  2874. (*
  2875. * DirectDraw supports arbitrary stretching of a surface along the
  2876. * y axis (horizontal direction) for overlays.
  2877. *)
  2878. DDFXCAPS_OVERLAYSTRETCHY = $02000000;
  2879. {$EXTERNALSYM DDFXCAPS_OVERLAYSTRETCHY}
  2880. (*
  2881. * DirectDraw supports integer stretching (1x,2x,) of a surface
  2882. * along the y axis (vertical direction) for overlays.
  2883. *)
  2884. DDFXCAPS_OVERLAYSTRETCHYN = $04000000;
  2885. {$EXTERNALSYM DDFXCAPS_OVERLAYSTRETCHYN}
  2886. (*
  2887. * DirectDraw supports mirroring of overlays across the vertical axis
  2888. *)
  2889. DDFXCAPS_OVERLAYMIRRORLEFTRIGHT = $08000000;
  2890. {$EXTERNALSYM DDFXCAPS_OVERLAYMIRRORLEFTRIGHT}
  2891. (*
  2892. * DirectDraw supports mirroring of overlays across the horizontal axis
  2893. *)
  2894. DDFXCAPS_OVERLAYMIRRORUPDOWN = $10000000;
  2895. {$EXTERNALSYM DDFXCAPS_OVERLAYMIRRORUPDOWN}
  2896. (*
  2897. * DirectDraw supports deinterlacing of overlay surfaces
  2898. *)
  2899. DDFXCAPS_OVERLAYDEINTERLACE = $20000000;
  2900. {$EXTERNALSYM DDFXCAPS_OVERLAYDEINTERLACE}
  2901. (*
  2902. * Driver can do alpha blending for blits.
  2903. *)
  2904. DDFXCAPS_BLTALPHA = $00000001;
  2905. {$EXTERNALSYM DDFXCAPS_BLTALPHA}
  2906. (*
  2907. * Driver can do geometric transformations (or warps) for blits.
  2908. *)
  2909. DDFXCAPS_BLTTRANSFORM = $00000002;
  2910. {$EXTERNALSYM DDFXCAPS_BLTTRANSFORM}
  2911. (*
  2912. * Driver can do surface-reconstruction filtering for warped blits.
  2913. *)
  2914. DDFXCAPS_BLTFILTER = DDFXCAPS_BLTARITHSTRETCHY;
  2915. {$EXTERNALSYM DDFXCAPS_BLTFILTER}
  2916. (*
  2917. * Driver can do alpha blending for overlays.
  2918. *)
  2919. DDFXCAPS_OVERLAYALPHA = $00000004;
  2920. {$EXTERNALSYM DDFXCAPS_OVERLAYALPHA}
  2921. (*
  2922. * Driver can do geometric transformations (or warps) for overlays.
  2923. *)
  2924. DDFXCAPS_OVERLAYTRANSFORM = $20000000;
  2925. {$EXTERNALSYM DDFXCAPS_OVERLAYTRANSFORM}
  2926. (*
  2927. * Driver can do surface-reconstruction filtering for warped overlays.
  2928. *)
  2929. DDFXCAPS_OVERLAYFILTER = DDFXCAPS_OVERLAYARITHSTRETCHY;
  2930. {$EXTERNALSYM DDFXCAPS_OVERLAYFILTER}
  2931. (****************************************************************************
  2932. *
  2933. * DIRECTDRAW STEREO VIEW CAPABILITIES
  2934. *
  2935. ****************************************************************************)
  2936. (*
  2937. * This flag used to be DDSVCAPS_ENIGMA, which is now obsolete
  2938. *)
  2939. DDSVCAPS_RESERVED1 = $00000001;
  2940. {$EXTERNALSYM DDSVCAPS_RESERVED1}
  2941. (*
  2942. * This flag used to be DDSVCAPS_FLICKER, which is now obsolete
  2943. *)
  2944. DDSVCAPS_RESERVED2 = $00000002;
  2945. {$EXTERNALSYM DDSVCAPS_RESERVED2}
  2946. (*
  2947. * This flag used to be DDSVCAPS_REDBLUE, which is now obsolete
  2948. *)
  2949. DDSVCAPS_RESERVED3 = $00000004;
  2950. {$EXTERNALSYM DDSVCAPS_RESERVED3}
  2951. (*
  2952. * This flag used to be DDSVCAPS_SPLIT, which is now obsolete
  2953. *)
  2954. DDSVCAPS_RESERVED4 = $00000008;
  2955. {$EXTERNALSYM DDSVCAPS_RESERVED4}
  2956. (*
  2957. * The stereo view is accomplished with switching technology
  2958. *)
  2959. DDSVCAPS_STEREOSEQUENTIAL = $00000010;
  2960. {$EXTERNALSYM DDSVCAPS_STEREOSEQUENTIAL}
  2961. (****************************************************************************
  2962. *
  2963. * DIRECTDRAWPALETTE CAPABILITIES
  2964. *
  2965. ****************************************************************************)
  2966. (*
  2967. * Index is 4 bits. There are sixteen color entries in the palette table.
  2968. *)
  2969. DDPCAPS_4BIT = $00000001;
  2970. {$EXTERNALSYM DDPCAPS_4BIT}
  2971. (*
  2972. * Index is onto a 8 bit color index. This field is only valid with the
  2973. * DDPCAPS_1BIT, DDPCAPS_2BIT or DDPCAPS_4BIT capability and the target
  2974. * surface is in 8bpp. Each color entry is one byte long and is an index
  2975. * into destination surface's 8bpp palette.
  2976. *)
  2977. DDPCAPS_8BITENTRIES = $00000002;
  2978. {$EXTERNALSYM DDPCAPS_8BITENTRIES}
  2979. (*
  2980. * Index is 8 bits. There are 256 color entries in the palette table.
  2981. *)
  2982. DDPCAPS_8BIT = $00000004;
  2983. {$EXTERNALSYM DDPCAPS_8BIT}
  2984. (*
  2985. * Indicates that this DIRECTDRAWPALETTE should use the palette color array
  2986. * passed into the lpDDColorArray parameter to initialize the DIRECTDRAWPALETTE
  2987. * object.
  2988. * This flag is obsolete. DirectDraw always initializes the color array from
  2989. * the lpDDColorArray parameter. The definition remains for source-level
  2990. * compatibility.
  2991. *)
  2992. DDPCAPS_INITIALIZE = $00000008;
  2993. {$EXTERNALSYM DDPCAPS_INITIALIZE}
  2994. (*
  2995. * This palette is the one attached to the primary surface. Changing this
  2996. * table has immediate effect on the display unless DDPSETPAL_VSYNC is specified
  2997. * and supported.
  2998. *)
  2999. DDPCAPS_PRIMARYSURFACE = $00000010;
  3000. {$EXTERNALSYM DDPCAPS_PRIMARYSURFACE}
  3001. (*
  3002. * This palette is the one attached to the primary surface left. Changing
  3003. * this table has immediate effect on the display for the left eye unless
  3004. * DDPSETPAL_VSYNC is specified and supported.
  3005. *)
  3006. DDPCAPS_PRIMARYSURFACELEFT = $00000020;
  3007. {$EXTERNALSYM DDPCAPS_PRIMARYSURFACELEFT}
  3008. (*
  3009. * This palette can have all 256 entries defined
  3010. *)
  3011. DDPCAPS_ALLOW256 = $00000040;
  3012. {$EXTERNALSYM DDPCAPS_ALLOW256}
  3013. (*
  3014. * This palette can have modifications to it synced with the monitors
  3015. * refresh rate.
  3016. *)
  3017. DDPCAPS_VSYNC = $00000080;
  3018. {$EXTERNALSYM DDPCAPS_VSYNC}
  3019. (*
  3020. * Index is 1 bit. There are two color entries in the palette table.
  3021. *)
  3022. DDPCAPS_1BIT = $00000100;
  3023. {$EXTERNALSYM DDPCAPS_1BIT}
  3024. (*
  3025. * Index is 2 bit. There are four color entries in the palette table.
  3026. *)
  3027. DDPCAPS_2BIT = $00000200;
  3028. {$EXTERNALSYM DDPCAPS_2BIT}
  3029. (*
  3030. * The peFlags member of PALETTEENTRY denotes an 8 bit alpha value
  3031. *)
  3032. DDPCAPS_ALPHA = $00000400;
  3033. {$EXTERNALSYM DDPCAPS_ALPHA}
  3034. (****************************************************************************
  3035. *
  3036. * DIRECTDRAWPALETTE SETENTRY CONSTANTS
  3037. *
  3038. ****************************************************************************)
  3039. (****************************************************************************
  3040. *
  3041. * DIRECTDRAWPALETTE GETENTRY CONSTANTS
  3042. *
  3043. ****************************************************************************)
  3044. (* 0 is the only legal value *)
  3045. (****************************************************************************
  3046. *
  3047. * DIRECTDRAWSURFACE SETPRIVATEDATA CONSTANTS
  3048. *
  3049. ****************************************************************************)
  3050. (*
  3051. * The passed pointer is an IUnknown ptr. The cbData argument to SetPrivateData
  3052. * must be set to SizeOf(IUnknown^). DirectDraw will call AddRef through this
  3053. * pointer and Release when the private data is destroyed. This includes when
  3054. * the surface or palette is destroyed before such priovate data is destroyed.
  3055. *)
  3056. DDSPD_IUNKNOWNPOINTER = $00000001;
  3057. {$EXTERNALSYM DDSPD_IUNKNOWNPOINTER}
  3058. (*
  3059. * Private data is only valid for the current state of the object,
  3060. * as determined by the uniqueness value.
  3061. *)
  3062. DDSPD_VOLATILE = $00000002;
  3063. {$EXTERNALSYM DDSPD_VOLATILE}
  3064. (****************************************************************************
  3065. *
  3066. * DIRECTDRAWSURFACE SETPALETTE CONSTANTS
  3067. *
  3068. ****************************************************************************)
  3069. (****************************************************************************
  3070. *
  3071. * DIRECTDRAW BITDEPTH CONSTANTS
  3072. *
  3073. * NOTE: These are only used to indicate supported bit depths. These
  3074. * are flags only, they are not to be used as an actual bit depth. The
  3075. * absolute numbers 1, 2, 4, 8, 16, 24 and 32 are used to indicate actual
  3076. * bit depths in a surface or for changing the display mode.
  3077. *
  3078. ****************************************************************************)
  3079. (*
  3080. * 1 bit per pixel.
  3081. *)
  3082. DDBD_1 = $00004000;
  3083. {$EXTERNALSYM DDBD_1}
  3084. (*
  3085. * 2 bits per pixel.
  3086. *)
  3087. DDBD_2 = $00002000;
  3088. {$EXTERNALSYM DDBD_2}
  3089. (*
  3090. * 4 bits per pixel.
  3091. *)
  3092. DDBD_4 = $00001000;
  3093. {$EXTERNALSYM DDBD_4}
  3094. (*
  3095. * 8 bits per pixel.
  3096. *)
  3097. DDBD_8 = $00000800;
  3098. {$EXTERNALSYM DDBD_8}
  3099. (*
  3100. * 16 bits per pixel.
  3101. *)
  3102. DDBD_16 = $00000400;
  3103. {$EXTERNALSYM DDBD_16}
  3104. (*
  3105. * 24 bits per pixel.
  3106. *)
  3107. DDBD_24 = $00000200;
  3108. {$EXTERNALSYM DDBD_24}
  3109. (*
  3110. * 32 bits per pixel.
  3111. *)
  3112. DDBD_32 = $00000100;
  3113. {$EXTERNALSYM DDBD_32}
  3114. (****************************************************************************
  3115. *
  3116. * DIRECTDRAWSURFACE SET/GET COLOR KEY FLAGS
  3117. *
  3118. ****************************************************************************)
  3119. (*
  3120. * Set if the structure contains a color space. Not set if the structure
  3121. * contains a single color key.
  3122. *)
  3123. DDCKEY_COLORSPACE = $00000001;
  3124. {$EXTERNALSYM DDCKEY_COLORSPACE}
  3125. (*
  3126. * Set if the structure specifies a color key or color space which is to be
  3127. * used as a destination color key for blt operations.
  3128. *)
  3129. DDCKEY_DESTBLT = $00000002;
  3130. {$EXTERNALSYM DDCKEY_DESTBLT}
  3131. (*
  3132. * Set if the structure specifies a color key or color space which is to be
  3133. * used as a destination color key for overlay operations.
  3134. *)
  3135. DDCKEY_DESTOVERLAY = $00000004;
  3136. {$EXTERNALSYM DDCKEY_DESTOVERLAY}
  3137. (*
  3138. * Set if the structure specifies a color key or color space which is to be
  3139. * used as a source color key for blt operations.
  3140. *)
  3141. DDCKEY_SRCBLT = $00000008;
  3142. {$EXTERNALSYM DDCKEY_SRCBLT}
  3143. (*
  3144. * Set if the structure specifies a color key or color space which is to be
  3145. * used as a source color key for overlay operations.
  3146. *)
  3147. DDCKEY_SRCOVERLAY = $00000010;
  3148. {$EXTERNALSYM DDCKEY_SRCOVERLAY}
  3149. (****************************************************************************
  3150. *
  3151. * DIRECTDRAW COLOR KEY CAPABILITY FLAGS
  3152. *
  3153. ****************************************************************************)
  3154. (*
  3155. * Supports transparent blting using a color key to identify the replaceable
  3156. * bits of the destination surface for RGB colors.
  3157. *)
  3158. DDCKEYCAPS_DESTBLT = $00000001;
  3159. {$EXTERNALSYM DDCKEYCAPS_DESTBLT}
  3160. (*
  3161. * Supports transparent blting using a color space to identify the replaceable
  3162. * bits of the destination surface for RGB colors.
  3163. *)
  3164. DDCKEYCAPS_DESTBLTCLRSPACE = $00000002;
  3165. {$EXTERNALSYM DDCKEYCAPS_DESTBLTCLRSPACE}
  3166. (*
  3167. * Supports transparent blting using a color space to identify the replaceable
  3168. * bits of the destination surface for YUV colors.
  3169. *)
  3170. DDCKEYCAPS_DESTBLTCLRSPACEYUV = $00000004;
  3171. {$EXTERNALSYM DDCKEYCAPS_DESTBLTCLRSPACEYUV}
  3172. (*
  3173. * Supports transparent blting using a color key to identify the replaceable
  3174. * bits of the destination surface for YUV colors.
  3175. *)
  3176. DDCKEYCAPS_DESTBLTYUV = $00000008;
  3177. {$EXTERNALSYM DDCKEYCAPS_DESTBLTYUV}
  3178. (*
  3179. * Supports overlaying using colorkeying of the replaceable bits of the surface
  3180. * being overlayed for RGB colors.
  3181. *)
  3182. DDCKEYCAPS_DESTOVERLAY = $00000010;
  3183. {$EXTERNALSYM DDCKEYCAPS_DESTOVERLAY}
  3184. (*
  3185. * Supports a color space as the color key for the destination for RGB colors.
  3186. *)
  3187. DDCKEYCAPS_DESTOVERLAYCLRSPACE = $00000020;
  3188. {$EXTERNALSYM DDCKEYCAPS_DESTOVERLAYCLRSPACE}
  3189. (*
  3190. * Supports a color space as the color key for the destination for YUV colors.
  3191. *)
  3192. DDCKEYCAPS_DESTOVERLAYCLRSPACEYUV = $00000040;
  3193. {$EXTERNALSYM DDCKEYCAPS_DESTOVERLAYCLRSPACEYUV}
  3194. (*
  3195. * Supports only one active destination color key value for visible overlay
  3196. * surfaces.
  3197. *)
  3198. DDCKEYCAPS_DESTOVERLAYONEACTIVE = $00000080;
  3199. {$EXTERNALSYM DDCKEYCAPS_DESTOVERLAYONEACTIVE}
  3200. (*
  3201. * Supports overlaying using colorkeying of the replaceable bits of the
  3202. * surface being overlayed for YUV colors.
  3203. *)
  3204. DDCKEYCAPS_DESTOVERLAYYUV = $00000100;
  3205. {$EXTERNALSYM DDCKEYCAPS_DESTOVERLAYYUV}
  3206. (*
  3207. * Supports transparent blting using the color key for the source with
  3208. * this surface for RGB colors.
  3209. *)
  3210. DDCKEYCAPS_SRCBLT = $00000200;
  3211. {$EXTERNALSYM DDCKEYCAPS_SRCBLT}
  3212. (*
  3213. * Supports transparent blting using a color space for the source with
  3214. * this surface for RGB colors.
  3215. *)
  3216. DDCKEYCAPS_SRCBLTCLRSPACE = $00000400;
  3217. {$EXTERNALSYM DDCKEYCAPS_SRCBLTCLRSPACE}
  3218. (*
  3219. * Supports transparent blting using a color space for the source with
  3220. * this surface for YUV colors.
  3221. *)
  3222. DDCKEYCAPS_SRCBLTCLRSPACEYUV = $00000800;
  3223. {$EXTERNALSYM DDCKEYCAPS_SRCBLTCLRSPACEYUV}
  3224. (*
  3225. * Supports transparent blting using the color key for the source with
  3226. * this surface for YUV colors.
  3227. *)
  3228. DDCKEYCAPS_SRCBLTYUV = $00001000;
  3229. {$EXTERNALSYM DDCKEYCAPS_SRCBLTYUV}
  3230. (*
  3231. * Supports overlays using the color key for the source with this
  3232. * overlay surface for RGB colors.
  3233. *)
  3234. DDCKEYCAPS_SRCOVERLAY = $00002000;
  3235. {$EXTERNALSYM DDCKEYCAPS_SRCOVERLAY}
  3236. (*
  3237. * Supports overlays using a color space as the source color key for
  3238. * the overlay surface for RGB colors.
  3239. *)
  3240. DDCKEYCAPS_SRCOVERLAYCLRSPACE = $00004000;
  3241. {$EXTERNALSYM DDCKEYCAPS_SRCOVERLAYCLRSPACE}
  3242. (*
  3243. * Supports overlays using a color space as the source color key for
  3244. * the overlay surface for YUV colors.
  3245. *)
  3246. DDCKEYCAPS_SRCOVERLAYCLRSPACEYUV = $00008000;
  3247. {$EXTERNALSYM DDCKEYCAPS_SRCOVERLAYCLRSPACEYUV}
  3248. (*
  3249. * Supports only one active source color key value for visible
  3250. * overlay surfaces.
  3251. *)
  3252. DDCKEYCAPS_SRCOVERLAYONEACTIVE = $00010000;
  3253. {$EXTERNALSYM DDCKEYCAPS_SRCOVERLAYONEACTIVE}
  3254. (*
  3255. * Supports overlays using the color key for the source with this
  3256. * overlay surface for YUV colors.
  3257. *)
  3258. DDCKEYCAPS_SRCOVERLAYYUV = $00020000;
  3259. {$EXTERNALSYM DDCKEYCAPS_SRCOVERLAYYUV}
  3260. (*
  3261. * there are no bandwidth trade-offs for using colorkey with an overlay
  3262. *)
  3263. DDCKEYCAPS_NOCOSTOVERLAY = $00040000;
  3264. {$EXTERNALSYM DDCKEYCAPS_NOCOSTOVERLAY}
  3265. (****************************************************************************
  3266. *
  3267. * DIRECTDRAW PIXELFORMAT FLAGS
  3268. *
  3269. ****************************************************************************)
  3270. (*
  3271. * The surface has alpha channel information in the pixel format.
  3272. *)
  3273. DDPF_ALPHAPIXELS = $00000001;
  3274. {$EXTERNALSYM DDPF_ALPHAPIXELS}
  3275. (*
  3276. * The pixel format contains alpha only information
  3277. *)
  3278. DDPF_ALPHA = $00000002;
  3279. {$EXTERNALSYM DDPF_ALPHA}
  3280. (*
  3281. * The FourCC code is valid.
  3282. *)
  3283. DDPF_FOURCC = $00000004;
  3284. {$EXTERNALSYM DDPF_FOURCC}
  3285. (*
  3286. * The surface is 4-bit color indexed.
  3287. *)
  3288. DDPF_PALETTEINDEXED4 = $00000008;
  3289. {$EXTERNALSYM DDPF_PALETTEINDEXED4}
  3290. (*
  3291. * The surface is indexed into a palette which stores indices
  3292. * into the destination surface's 8-bit palette.
  3293. *)
  3294. DDPF_PALETTEINDEXEDTO8 = $00000010;
  3295. {$EXTERNALSYM DDPF_PALETTEINDEXEDTO8}
  3296. (*
  3297. * The surface is 8-bit color indexed.
  3298. *)
  3299. DDPF_PALETTEINDEXED8 = $00000020;
  3300. {$EXTERNALSYM DDPF_PALETTEINDEXED8}
  3301. (*
  3302. * The RGB data in the pixel format structure is valid.
  3303. *)
  3304. DDPF_RGB = $00000040;
  3305. {$EXTERNALSYM DDPF_RGB}
  3306. (*
  3307. * The surface will accept pixel data in the format specified
  3308. * and compress it during the write.
  3309. *)
  3310. DDPF_COMPRESSED = $00000080;
  3311. {$EXTERNALSYM DDPF_COMPRESSED}
  3312. (*
  3313. * The surface will accept RGB data and translate it during
  3314. * the write to YUV data. The format of the data to be written
  3315. * will be contained in the pixel format structure. The DDPF_RGB
  3316. * flag will be set.
  3317. *)
  3318. DDPF_RGBTOYUV = $00000100;
  3319. {$EXTERNALSYM DDPF_RGBTOYUV}
  3320. (*
  3321. * pixel format is YUV - YUV data in pixel format struct is valid
  3322. *)
  3323. DDPF_YUV = $00000200;
  3324. {$EXTERNALSYM DDPF_YUV}
  3325. (*
  3326. * pixel format is a z buffer only surface
  3327. *)
  3328. DDPF_ZBUFFER = $00000400;
  3329. {$EXTERNALSYM DDPF_ZBUFFER}
  3330. (*
  3331. * The surface is 1-bit color indexed.
  3332. *)
  3333. DDPF_PALETTEINDEXED1 = $00000800;
  3334. {$EXTERNALSYM DDPF_PALETTEINDEXED1}
  3335. (*
  3336. * The surface is 2-bit color indexed.
  3337. *)
  3338. DDPF_PALETTEINDEXED2 = $00001000;
  3339. {$EXTERNALSYM DDPF_PALETTEINDEXED2}
  3340. (*
  3341. * The surface contains Z information in the pixels
  3342. *)
  3343. DDPF_ZPIXELS = $00002000;
  3344. {$EXTERNALSYM DDPF_ZPIXELS}
  3345. (*
  3346. * The surface contains stencil information along with Z
  3347. *)
  3348. DDPF_STENCILBUFFER = $00004000;
  3349. {$EXTERNALSYM DDPF_STENCILBUFFER}
  3350. (*
  3351. * Premultiplied alpha format -- the color components have been
  3352. * premultiplied by the alpha component.
  3353. *)
  3354. DDPF_ALPHAPREMULT = $00008000;
  3355. {$EXTERNALSYM DDPF_ALPHAPREMULT}
  3356. (*
  3357. * Luminance data in the pixel format is valid.
  3358. * Use this flag for luminance-only or luminance+alpha surfaces,
  3359. * the bit depth is then ddpf.dwLuminanceBitCount.
  3360. *)
  3361. DDPF_LUMINANCE = $00020000;
  3362. {$EXTERNALSYM DDPF_LUMINANCE}
  3363. (*
  3364. * Luminance data in the pixel format is valid.
  3365. * Use this flag when hanging luminance off bumpmap surfaces,
  3366. * the bit mask for the luminance portion of the pixel is then
  3367. * ddpf.dwBumpLuminanceBitMask
  3368. *)
  3369. DDPF_BUMPLUMINANCE = $00040000;
  3370. {$EXTERNALSYM DDPF_BUMPLUMINANCE}
  3371. (*
  3372. * Bump map dUdV data in the pixel format is valid.
  3373. *)
  3374. DDPF_BUMPDUDV = $00080000;
  3375. {$EXTERNALSYM DDPF_BUMPDUDV}
  3376. (*===========================================================================
  3377. *
  3378. *
  3379. * DIRECTDRAW CALLBACK FLAGS
  3380. *
  3381. *
  3382. *==========================================================================*)
  3383. (****************************************************************************
  3384. *
  3385. * DIRECTDRAW ENUMSURFACES FLAGS
  3386. *
  3387. ****************************************************************************)
  3388. (*
  3389. * Enumerate all of the surfaces that meet the search criterion.
  3390. *)
  3391. DDENUMSURFACES_ALL = $00000001;
  3392. {$EXTERNALSYM DDENUMSURFACES_ALL}
  3393. {$EXTERNALSYM DDENUMSURFACES_ALL}
  3394. (*
  3395. * A search hit is a surface that matches the surface description.
  3396. *)
  3397. DDENUMSURFACES_MATCH = $00000002;
  3398. {$EXTERNALSYM DDENUMSURFACES_MATCH}
  3399. (*
  3400. * A search hit is a surface that does not match the surface description.
  3401. *)
  3402. DDENUMSURFACES_NOMATCH = $00000004;
  3403. {$EXTERNALSYM DDENUMSURFACES_NOMATCH}
  3404. (*
  3405. * Enumerate the first surface that can be created which meets the search criterion.
  3406. *)
  3407. DDENUMSURFACES_CANBECREATED = $00000008;
  3408. {$EXTERNALSYM DDENUMSURFACES_CANBECREATED}
  3409. (*
  3410. * Enumerate the surfaces that already exist that meet the search criterion.
  3411. *)
  3412. DDENUMSURFACES_DOESEXIST = $00000010;
  3413. {$EXTERNALSYM DDENUMSURFACES_DOESEXIST}
  3414. (****************************************************************************
  3415. *
  3416. * DIRECTDRAW SETDISPLAYMODE FLAGS
  3417. *
  3418. ****************************************************************************)
  3419. (*
  3420. * The desired mode is a standard VGA mode
  3421. *)
  3422. DDSDM_STANDARDVGAMODE = $00000001;
  3423. {$EXTERNALSYM DDSDM_STANDARDVGAMODE}
  3424. (****************************************************************************
  3425. *
  3426. * DIRECTDRAW ENUMDISPLAYMODES FLAGS
  3427. *
  3428. ****************************************************************************)
  3429. (*
  3430. * Enumerate Modes with different refresh rates. EnumDisplayModes guarantees
  3431. * that a particular mode will be enumerated only once. This flag specifies whether
  3432. * the refresh rate is taken into account when determining if a mode is unique.
  3433. *)
  3434. DDEDM_REFRESHRATES = $00000001;
  3435. {$EXTERNALSYM DDEDM_REFRESHRATES}
  3436. (*
  3437. * Enumerate VGA modes. Specify this flag if you wish to enumerate supported VGA
  3438. * modes such as mode 0x13 in addition to the usual ModeX modes (which are always
  3439. * enumerated if the application has previously called SetCooperativeLevel with the
  3440. * DDSCL_ALLOWMODEX flag set).
  3441. *)
  3442. DDEDM_STANDARDVGAMODES = $00000002;
  3443. {$EXTERNALSYM DDEDM_STANDARDVGAMODES}
  3444. (****************************************************************************
  3445. *
  3446. * DIRECTDRAW SETCOOPERATIVELEVEL FLAGS
  3447. *
  3448. ****************************************************************************)
  3449. (*
  3450. * Exclusive mode owner will be responsible for the entire primary surface.
  3451. * GDI can be ignored. used with DD
  3452. *)
  3453. DDSCL_FULLSCREEN = $00000001;
  3454. {$EXTERNALSYM DDSCL_FULLSCREEN}
  3455. (*
  3456. * allow CTRL_ALT_DEL to work while in fullscreen exclusive mode
  3457. *)
  3458. DDSCL_ALLOWREBOOT = $00000002;
  3459. {$EXTERNALSYM DDSCL_ALLOWREBOOT}
  3460. (*
  3461. * prevents DDRAW from modifying the application window.
  3462. * prevents DDRAW from minimize/restore the application window on activation.
  3463. *)
  3464. DDSCL_NOWINDOWCHANGES = $00000004;
  3465. {$EXTERNALSYM DDSCL_NOWINDOWCHANGES}
  3466. (*
  3467. * app wants to work as a regular Windows application
  3468. *)
  3469. DDSCL_NORMAL = $00000008;
  3470. {$EXTERNALSYM DDSCL_NORMAL}
  3471. (*
  3472. * app wants exclusive access
  3473. *)
  3474. DDSCL_EXCLUSIVE = $00000010;
  3475. {$EXTERNALSYM DDSCL_EXCLUSIVE}
  3476. (*
  3477. * app can deal with non-windows display modes
  3478. *)
  3479. DDSCL_ALLOWMODEX = $00000040;
  3480. {$EXTERNALSYM DDSCL_ALLOWMODEX}
  3481. (*
  3482. * this window will receive the focus messages
  3483. *)
  3484. DDSCL_SETFOCUSWINDOW = $00000080;
  3485. {$EXTERNALSYM DDSCL_SETFOCUSWINDOW}
  3486. (*
  3487. * this window is associated with the DDRAW object and will
  3488. * cover the screen in fullscreen mode
  3489. *)
  3490. DDSCL_SETDEVICEWINDOW = $00000100;
  3491. {$EXTERNALSYM DDSCL_SETDEVICEWINDOW}
  3492. (*
  3493. * app wants DDRAW to create a window to be associated with the
  3494. * DDRAW object
  3495. *)
  3496. DDSCL_CREATEDEVICEWINDOW = $00000200;
  3497. {$EXTERNALSYM DDSCL_CREATEDEVICEWINDOW}
  3498. (*
  3499. * App explicitly asks DDRAW/D3D to be multithread safe. This makes D3D
  3500. * take the global crtisec more frequently.
  3501. *)
  3502. DDSCL_MULTITHREADED = $00000400;
  3503. {$EXTERNALSYM DDSCL_MULTITHREADED}
  3504. (*
  3505. * App specifies that it would like to keep the FPU set up for optimal Direct3D
  3506. * performance (single precision and exceptions disabled) so Direct3D
  3507. * does not need to explicitly set the FPU each time. This is assumed by
  3508. * default in DirectX 7. See also DDSCL_FPUPRESERVE
  3509. *)
  3510. DDSCL_FPUSETUP = $00000800;
  3511. {$EXTERNALSYM DDSCL_FPUSETUP}
  3512. (*
  3513. * App specifies that it needs either double precision FPU or FPU exceptions
  3514. * enabled. This makes Direct3D explicitly set the FPU state eah time it is
  3515. * called. Setting the flag will reduce Direct3D performance. The flag is
  3516. * assumed by default in DirectX 6 and earlier. See also DDSCL_FPUSETUP
  3517. *)
  3518. DDSCL_FPUPRESERVE = $00001000;
  3519. {$EXTERNALSYM DDSCL_FPUPRESERVE}
  3520. (****************************************************************************
  3521. *
  3522. * DIRECTDRAW BLT FLAGS
  3523. *
  3524. ****************************************************************************)
  3525. (*
  3526. * Use the alpha information in the pixel format or the alpha channel surface
  3527. * attached to the destination surface as the alpha channel for this blt.
  3528. *)
  3529. DDBLT_ALPHADEST = $00000001;
  3530. {$EXTERNALSYM DDBLT_ALPHADEST}
  3531. (*
  3532. * Use the dwConstAlphaDest field in the DDBLTFX structure as the alpha channel
  3533. * for the destination surface for this blt.
  3534. *)
  3535. DDBLT_ALPHADESTCONSTOVERRIDE = $00000002;
  3536. {$EXTERNALSYM DDBLT_ALPHADESTCONSTOVERRIDE}
  3537. (*
  3538. * The NEG suffix indicates that the destination surface becomes more
  3539. * transparent as the alpha value increases. (0 is opaque)
  3540. *)
  3541. DDBLT_ALPHADESTNEG = $00000004;
  3542. {$EXTERNALSYM DDBLT_ALPHADESTNEG}
  3543. (*
  3544. * Use the lpDDSAlphaDest field in the DDBLTFX structure as the alpha
  3545. * channel for the destination for this blt.
  3546. *)
  3547. DDBLT_ALPHADESTSURFACEOVERRIDE = $00000008;
  3548. {$EXTERNALSYM DDBLT_ALPHADESTSURFACEOVERRIDE}
  3549. (*
  3550. * Use the dwAlphaEdgeBlend field in the DDBLTFX structure as the alpha channel
  3551. * for the edges of the image that border the color key colors.
  3552. *)
  3553. DDBLT_ALPHAEDGEBLEND = $00000010;
  3554. {$EXTERNALSYM DDBLT_ALPHAEDGEBLEND}
  3555. (*
  3556. * Use the alpha information in the pixel format or the alpha channel surface
  3557. * attached to the source surface as the alpha channel for this blt.
  3558. *)
  3559. DDBLT_ALPHASRC = $00000020;
  3560. {$EXTERNALSYM DDBLT_ALPHASRC}
  3561. (*
  3562. * Use the dwConstAlphaSrc field in the DDBLTFX structure as the alpha channel
  3563. * for the source for this blt.
  3564. *)
  3565. DDBLT_ALPHASRCCONSTOVERRIDE = $00000040;
  3566. {$EXTERNALSYM DDBLT_ALPHASRCCONSTOVERRIDE}
  3567. (*
  3568. * The NEG suffix indicates that the source surface becomes more transparent
  3569. * as the alpha value increases. (0 is opaque)
  3570. *)
  3571. DDBLT_ALPHASRCNEG = $00000080;
  3572. {$EXTERNALSYM DDBLT_ALPHASRCNEG}
  3573. (*
  3574. * Use the lpDDSAlphaSrc field in the DDBLTFX structure as the alpha channel
  3575. * for the source for this blt.
  3576. *)
  3577. DDBLT_ALPHASRCSURFACEOVERRIDE = $00000100;
  3578. {$EXTERNALSYM DDBLT_ALPHASRCSURFACEOVERRIDE}
  3579. (*
  3580. * Do this blt asynchronously through the FIFO in the order received. If
  3581. * there is no room in the hardware FIFO fail the call.
  3582. *)
  3583. DDBLT_ASYNC = $00000200;
  3584. {$EXTERNALSYM DDBLT_ASYNC}
  3585. (*
  3586. * Uses the dwFillColor field in the DDBLTFX structure as the RGB color
  3587. * to fill the destination rectangle on the destination surface with.
  3588. *)
  3589. DDBLT_COLORFILL = $00000400;
  3590. {$EXTERNALSYM DDBLT_COLORFILL}
  3591. (*
  3592. * Uses the dwDDFX field in the DDBLTFX structure to specify the effects
  3593. * to use for the blt.
  3594. *)
  3595. DDBLT_DDFX = $00000800;
  3596. {$EXTERNALSYM DDBLT_DDFX}
  3597. (*
  3598. * Uses the dwDDROPS field in the DDBLTFX structure to specify the ROPS
  3599. * that are not part of the Win32 API.
  3600. *)
  3601. DDBLT_DDROPS = $00001000;
  3602. {$EXTERNALSYM DDBLT_DDROPS}
  3603. (*
  3604. * Use the color key associated with the destination surface.
  3605. *)
  3606. DDBLT_KEYDEST = $00002000;
  3607. {$EXTERNALSYM DDBLT_KEYDEST}
  3608. (*
  3609. * Use the dckDestColorkey field in the DDBLTFX structure as the color key
  3610. * for the destination surface.
  3611. *)
  3612. DDBLT_KEYDESTOVERRIDE = $00004000;
  3613. {$EXTERNALSYM DDBLT_KEYDESTOVERRIDE}
  3614. (*
  3615. * Use the color key associated with the source surface.
  3616. *)
  3617. DDBLT_KEYSRC = $00008000;
  3618. {$EXTERNALSYM DDBLT_KEYSRC}
  3619. (*
  3620. * Use the dckSrcColorkey field in the DDBLTFX structure as the color key
  3621. * for the source surface.
  3622. *)
  3623. DDBLT_KEYSRCOVERRIDE = $00010000;
  3624. {$EXTERNALSYM DDBLT_KEYSRCOVERRIDE}
  3625. (*
  3626. * Use the dwROP field in the DDBLTFX structure for the raster operation
  3627. * for this blt. These ROPs are the same as the ones defined in the Win32 API.
  3628. *)
  3629. DDBLT_ROP = $00020000;
  3630. {$EXTERNALSYM DDBLT_ROP}
  3631. (*
  3632. * Use the dwRotationAngle field in the DDBLTFX structure as the angle
  3633. * (specified in 1/100th of a degree) to rotate the surface.
  3634. *)
  3635. DDBLT_ROTATIONANGLE = $00040000;
  3636. {$EXTERNALSYM DDBLT_ROTATIONANGLE}
  3637. (*
  3638. * Z-buffered blt using the z-buffers attached to the source and destination
  3639. * surfaces and the dwZBufferOpCode field in the DDBLTFX structure as the
  3640. * z-buffer opcode.
  3641. *)
  3642. DDBLT_ZBUFFER = $00080000;
  3643. {$EXTERNALSYM DDBLT_ZBUFFER}
  3644. (*
  3645. * Z-buffered blt using the dwConstDest Zfield and the dwZBufferOpCode field
  3646. * in the DDBLTFX structure as the z-buffer and z-buffer opcode respectively
  3647. * for the destination.
  3648. *)
  3649. DDBLT_ZBUFFERDESTCONSTOVERRIDE = $00100000;
  3650. {$EXTERNALSYM DDBLT_ZBUFFERDESTCONSTOVERRIDE}
  3651. (*
  3652. * Z-buffered blt using the lpDDSDestZBuffer field and the dwZBufferOpCode
  3653. * field in the DDBLTFX structure as the z-buffer and z-buffer opcode
  3654. * respectively for the destination.
  3655. *)
  3656. DDBLT_ZBUFFERDESTOVERRIDE = $00200000;
  3657. {$EXTERNALSYM DDBLT_ZBUFFERDESTOVERRIDE}
  3658. (*
  3659. * Z-buffered blt using the dwConstSrcZ field and the dwZBufferOpCode field
  3660. * in the DDBLTFX structure as the z-buffer and z-buffer opcode respectively
  3661. * for the source.
  3662. *)
  3663. DDBLT_ZBUFFERSRCCONSTOVERRIDE = $00400000;
  3664. {$EXTERNALSYM DDBLT_ZBUFFERSRCCONSTOVERRIDE}
  3665. (*
  3666. * Z-buffered blt using the lpDDSSrcZBuffer field and the dwZBufferOpCode
  3667. * field in the DDBLTFX structure as the z-buffer and z-buffer opcode
  3668. * respectively for the source.
  3669. *)
  3670. DDBLT_ZBUFFERSRCOVERRIDE = $00800000;
  3671. {$EXTERNALSYM DDBLT_ZBUFFERSRCOVERRIDE}
  3672. (*
  3673. * wait until the device is ready to handle the blt
  3674. * this will cause blt to not return DDERR_WASSTILLDRAWING
  3675. *)
  3676. DDBLT_WAIT = $01000000;
  3677. {$EXTERNALSYM DDBLT_WAIT}
  3678. (*
  3679. * Uses the dwFillDepth field in the DDBLTFX structure as the depth value
  3680. * to fill the destination rectangle on the destination Z-buffer surface
  3681. * with.
  3682. *)
  3683. DDBLT_DEPTHFILL = $02000000;
  3684. {$EXTERNALSYM DDBLT_DEPTHFILL}
  3685. (*
  3686. * Return immediately (with DDERR_WASSTILLDRAWING) if the device is not
  3687. * ready to schedule the blt at the time Blt() is called.
  3688. *)
  3689. DDBLT_DONOTWAIT = $08000000;
  3690. {$EXTERNALSYM DDBLT_DONOTWAIT}
  3691. (*
  3692. * These flags indicate a presentation blt (i.e. a blt
  3693. * that moves surface contents from an offscreen back buffer to the primary
  3694. * surface). The driver is not allowed to "queue" more than three such blts.
  3695. * The "end" of the presentation blt is indicated, since the
  3696. * blt may be clipped, in which case the runtime will call the driver with
  3697. * several blts. All blts (even if not clipped) are tagged with DDBLT_PRESENTATION
  3698. * and the last (even if not clipped) additionally with DDBLT_LAST_PRESENTATION.
  3699. * Thus the true rule is that the driver must not schedule a DDBLT_PRESENTATION
  3700. * blt if there are 3 or more DDBLT_PRESENTLAST blts in the hardware pipe.
  3701. * If there are such blts in the pipe, the driver should return DDERR_WASSTILLDRAWING
  3702. * until the oldest queued DDBLT_LAST_PRESENTATION blts has been retired (i.e. the
  3703. * pixels have been actually written to the primary surface). Once the oldest blt
  3704. * has been retired, the driver is free to schedule the current blt.
  3705. * The goal is to provide a mechanism whereby the device's hardware queue never
  3706. * gets more than 3 frames ahead of the frames being generated by the application.
  3707. * When excessive queueing occurs, applications become unusable because the application
  3708. * visibly lags user input, and such problems make windowed interactive applications impossible.
  3709. * Some drivers may not have sufficient knowledge of their hardware's FIFO to know
  3710. * when a certain blt has been retired. Such drivers should code cautiously, and
  3711. * simply not allow any frames to be queued at all. DDBLT_LAST_PRESENTATION should cause
  3712. * such drivers to return DDERR_WASSTILLDRAWING until the accelerator is completely
  3713. * finished- exactly as if the application had called Lock on the source surface
  3714. * before calling Blt.
  3715. * In other words, the driver is allowed and encouraged to
  3716. * generate as much latency as it can, but never more than 3 frames worth.
  3717. * Implementation detail: Drivers should count blts against the SOURCE surface, not
  3718. * against the primary surface. This enables multiple parallel windowed application
  3719. * to function more optimally.
  3720. * This flag is passed only to DX8 or higher drivers.
  3721. *
  3722. * APPLICATIONS DO NOT SET THESE FLAGS. THEY ARE SET BY THE DIRECTDRAW RUNTIME.
  3723. *
  3724. *)
  3725. DDBLT_PRESENTATION = $10000000;
  3726. {$EXTERNALSYM DDBLT_PRESENTATION}
  3727. DDBLT_LAST_PRESENTATION = $20000000;
  3728. {$EXTERNALSYM DDBLT_LAST_PRESENTATION}
  3729. (*
  3730. * If DDBLT_EXTENDED_FLAGS is set, then the driver should re-interpret
  3731. * other flags according to the definitions that follow.
  3732. * For example, bit 0 (0x00000001L) means DDBLT_ALPHADEST, unless
  3733. * DDBLT_EXTENDED_FLAGS is also set, in which case bit 0 means
  3734. * DDBLT_EXTENDED_LINEAR_CONTENT.
  3735. * Only DirectX9 and higher drivers will be given extended blt flags.
  3736. * Only flags explicitly mentioned here should be re-interpreted.
  3737. * All other flags retain their original meanings.
  3738. *
  3739. * List of re-interpreted flags:
  3740. *
  3741. * Bit Hex value New meaning old meaning
  3742. * ---------------------------------------------------------------
  3743. * 2 0x00000004 DDBLT_EXTENDED_LINEAR_CONTENT DDBLT_ALPHADESTNEG
  3744. * 4 0x00000010 DDBLT_EXTENDED_PRESENTATION_STRETCHFACTOR DDBLT_ALPHAEDGEBLEND
  3745. *
  3746. *
  3747. * NOTE: APPLICATIONS SHOULD NOT SET THIS FLAG. THIS FLAG IS INTENDED
  3748. * FOR USE BY THE DIRECT3D RUNTIME.
  3749. *)
  3750. DDBLT_EXTENDED_FLAGS = $40000000;
  3751. {$EXTERNALSYM DDBLT_EXTENDED_FLAGS}
  3752. (*
  3753. * EXTENDED FLAG. SEE DEFINITION OF DDBLT_EXTENDED_FLAGS.
  3754. * This flag indidcates that the source surface contains content in a
  3755. * linear color space. The driver may perform gamma correction to the
  3756. * desktop color space (i.e. sRGB, gamma 2.2) as part of this blt.
  3757. * If the device can perform such a conversion as part of the copy,
  3758. * the driver should also set D3DCAPS3_LINEAR_TO_SRGB_PRESENTATION
  3759. *
  3760. * NOTE: APPLICATIONS SHOULD NOT SET THIS FLAG. THIS FLAG IS INTENDED
  3761. * FOR USE BY THE DIRECT3D RUNTIME. Use IDirect3DSwapChain9::Present
  3762. * and specify D3DPRESENT_LINEAR_CONTENT in order to use this functionality.
  3763. *)
  3764. DDBLT_EXTENDED_LINEAR_CONTENT = $00000004;
  3765. {$EXTERNALSYM DDBLT_EXTENDED_LINEAR_CONTENT}
  3766. (****************************************************************************
  3767. *
  3768. * BLTFAST FLAGS
  3769. *
  3770. ****************************************************************************)
  3771. DDBLTFAST_NOCOLORKEY = $00000000;
  3772. {$EXTERNALSYM DDBLTFAST_NOCOLORKEY}
  3773. DDBLTFAST_SRCCOLORKEY = $00000001;
  3774. {$EXTERNALSYM DDBLTFAST_SRCCOLORKEY}
  3775. DDBLTFAST_DESTCOLORKEY = $00000002;
  3776. {$EXTERNALSYM DDBLTFAST_DESTCOLORKEY}
  3777. DDBLTFAST_WAIT = $00000010;
  3778. {$EXTERNALSYM DDBLTFAST_WAIT}
  3779. DDBLTFAST_DONOTWAIT = $00000020;
  3780. {$EXTERNALSYM DDBLTFAST_DONOTWAIT}
  3781. (****************************************************************************
  3782. *
  3783. * FLIP FLAGS
  3784. *
  3785. ****************************************************************************)
  3786. DDFLIP_WAIT = $00000001;
  3787. {$EXTERNALSYM DDFLIP_WAIT}
  3788. (*
  3789. * Indicates that the target surface contains the even field of video data.
  3790. * This flag is only valid with an overlay surface.
  3791. *)
  3792. DDFLIP_EVEN = $00000002;
  3793. {$EXTERNALSYM DDFLIP_EVEN}
  3794. (*
  3795. * Indicates that the target surface contains the odd field of video data.
  3796. * This flag is only valid with an overlay surface.
  3797. *)
  3798. DDFLIP_ODD = $00000004;
  3799. {$EXTERNALSYM DDFLIP_ODD}
  3800. (*
  3801. * Causes DirectDraw to perform the physical flip immediately and return
  3802. * to the application. Typically, what was the front buffer but is now the back
  3803. * buffer will still be visible (depending on timing) until the next vertical
  3804. * retrace. Subsequent operations involving the two flipped surfaces will
  3805. * not check to see if the physical flip has finished (i.e. will not return
  3806. * DDERR_WASSTILLDRAWING for that reason (but may for other reasons)).
  3807. * This allows an application to perform Flips at a higher frequency than the
  3808. * monitor refresh rate, but may introduce visible artifacts.
  3809. * Only effective if DDCAPS2_FLIPNOVSYNC is set. If that bit is not set,
  3810. * DDFLIP_NOVSYNC has no effect.
  3811. *)
  3812. DDFLIP_NOVSYNC = $00000008;
  3813. {$EXTERNALSYM DDFLIP_NOVSYNC}
  3814. (*
  3815. * Flip Interval Flags. These flags indicate how many vertical retraces to wait between
  3816. * each flip. The default is one. DirectDraw will return DDERR_WASSTILLDRAWING for each
  3817. * surface involved in the flip until the specified number of vertical retraces has
  3818. * ocurred. Only effective if DDCAPS2_FLIPINTERVAL is set. If that bit is not set,
  3819. * DDFLIP_INTERVALn has no effect.
  3820. *)
  3821. (*
  3822. * DirectDraw will flip on every other vertical sync
  3823. *)
  3824. DDFLIP_INTERVAL2 = $02000000;
  3825. {$EXTERNALSYM DDFLIP_INTERVAL2}
  3826. (*
  3827. * DirectDraw will flip on every third vertical sync
  3828. *)
  3829. DDFLIP_INTERVAL3 = $03000000;
  3830. {$EXTERNALSYM DDFLIP_INTERVAL3}
  3831. (*
  3832. * DirectDraw will flip on every fourth vertical sync
  3833. *)
  3834. DDFLIP_INTERVAL4 = $04000000;
  3835. {$EXTERNALSYM DDFLIP_INTERVAL4}
  3836. (*
  3837. * DirectDraw will flip and display a main stereo surface
  3838. *)
  3839. DDFLIP_STEREO = $00000010;
  3840. {$EXTERNALSYM DDFLIP_STEREO}
  3841. (*
  3842. * On IDirectDrawSurface7 and higher interfaces, the default is DDFLIP_WAIT. If you wish
  3843. * to override the default and use time when the accelerator is busy (as denoted by
  3844. * the DDERR_WASSTILLDRAWING return code) then use DDFLIP_DONOTWAIT.
  3845. *)
  3846. DDFLIP_DONOTWAIT = $00000020;
  3847. {$EXTERNALSYM DDFLIP_DONOTWAIT}
  3848. (****************************************************************************
  3849. *
  3850. * DIRECTDRAW SURFACE OVERLAY FLAGS
  3851. *
  3852. ****************************************************************************)
  3853. (*
  3854. * Use the alpha information in the pixel format or the alpha channel surface
  3855. * attached to the destination surface as the alpha channel for the
  3856. * destination overlay.
  3857. *)
  3858. DDOVER_ALPHADEST = $00000001;
  3859. {$EXTERNALSYM DDOVER_ALPHADEST}
  3860. (*
  3861. * Use the dwConstAlphaDest field in the DDOVERLAYFX structure as the
  3862. * destination alpha channel for this overlay.
  3863. *)
  3864. DDOVER_ALPHADESTCONSTOVERRIDE = $00000002;
  3865. {$EXTERNALSYM DDOVER_ALPHADESTCONSTOVERRIDE}
  3866. (*
  3867. * The NEG suffix indicates that the destination surface becomes more
  3868. * transparent as the alpha value increases.
  3869. *)
  3870. DDOVER_ALPHADESTNEG = $00000004;
  3871. {$EXTERNALSYM DDOVER_ALPHADESTNEG}
  3872. (*
  3873. * Use the lpDDSAlphaDest field in the DDOVERLAYFX structure as the alpha
  3874. * channel destination for this overlay.
  3875. *)
  3876. DDOVER_ALPHADESTSURFACEOVERRIDE = $00000008;
  3877. {$EXTERNALSYM DDOVER_ALPHADESTSURFACEOVERRIDE}
  3878. (*
  3879. * Use the dwAlphaEdgeBlend field in the DDOVERLAYFX structure as the alpha
  3880. * channel for the edges of the image that border the color key colors.
  3881. *)
  3882. DDOVER_ALPHAEDGEBLEND = $00000010;
  3883. {$EXTERNALSYM DDOVER_ALPHAEDGEBLEND}
  3884. (*
  3885. * Use the alpha information in the pixel format or the alpha channel surface
  3886. * attached to the source surface as the source alpha channel for this overlay.
  3887. *)
  3888. DDOVER_ALPHASRC = $00000020;
  3889. {$EXTERNALSYM DDOVER_ALPHASRC}
  3890. (*
  3891. * Use the dwConstAlphaSrc field in the DDOVERLAYFX structure as the source
  3892. * alpha channel for this overlay.
  3893. *)
  3894. DDOVER_ALPHASRCCONSTOVERRIDE = $00000040;
  3895. {$EXTERNALSYM DDOVER_ALPHASRCCONSTOVERRIDE}
  3896. (*
  3897. * The NEG suffix indicates that the source surface becomes more transparent
  3898. * as the alpha value increases.
  3899. *)
  3900. DDOVER_ALPHASRCNEG = $00000080;
  3901. {$EXTERNALSYM DDOVER_ALPHASRCNEG}
  3902. (*
  3903. * Use the lpDDSAlphaSrc field in the DDOVERLAYFX structure as the alpha channel
  3904. * source for this overlay.
  3905. *)
  3906. DDOVER_ALPHASRCSURFACEOVERRIDE = $00000100;
  3907. {$EXTERNALSYM DDOVER_ALPHASRCSURFACEOVERRIDE}
  3908. (*
  3909. * Turn this overlay off.
  3910. *)
  3911. DDOVER_HIDE = $00000200;
  3912. {$EXTERNALSYM DDOVER_HIDE}
  3913. (*
  3914. * Use the color key associated with the destination surface.
  3915. *)
  3916. DDOVER_KEYDEST = $00000400;
  3917. {$EXTERNALSYM DDOVER_KEYDEST}
  3918. (*
  3919. * Use the dckDestColorkey field in the DDOVERLAYFX structure as the color key
  3920. * for the destination surface
  3921. *)
  3922. DDOVER_KEYDESTOVERRIDE = $00000800;
  3923. {$EXTERNALSYM DDOVER_KEYDESTOVERRIDE}
  3924. (*
  3925. * Use the color key associated with the source surface.
  3926. *)
  3927. DDOVER_KEYSRC = $00001000;
  3928. {$EXTERNALSYM DDOVER_KEYSRC}
  3929. (*
  3930. * Use the dckSrcColorkey field in the DDOVERLAYFX structure as the color key
  3931. * for the source surface.
  3932. *)
  3933. DDOVER_KEYSRCOVERRIDE = $00002000;
  3934. {$EXTERNALSYM DDOVER_KEYSRCOVERRIDE}
  3935. (*
  3936. * Turn this overlay on.
  3937. *)
  3938. DDOVER_SHOW = $00004000;
  3939. {$EXTERNALSYM DDOVER_SHOW}
  3940. (*
  3941. * Add a dirty rect to an emulated overlayed surface.
  3942. *)
  3943. DDOVER_ADDDIRTYRECT = $00008000;
  3944. {$EXTERNALSYM DDOVER_ADDDIRTYRECT}
  3945. (*
  3946. * Redraw all dirty rects on an emulated overlayed surface.
  3947. *)
  3948. DDOVER_REFRESHDIRTYRECTS = $00010000;
  3949. {$EXTERNALSYM DDOVER_REFRESHDIRTYRECTS}
  3950. (*
  3951. * Redraw the entire surface on an emulated overlayed surface.
  3952. *)
  3953. DDOVER_REFRESHALL = $00020000;
  3954. {$EXTERNALSYM DDOVER_REFRESHALL}
  3955. (*
  3956. * Use the overlay FX flags to define special overlay FX
  3957. *)
  3958. DDOVER_DDFX = $00080000;
  3959. {$EXTERNALSYM DDOVER_DDFX}
  3960. (*
  3961. * Autoflip the overlay when ever the video port autoflips
  3962. *)
  3963. DDOVER_AUTOFLIP = $00100000;
  3964. {$EXTERNALSYM DDOVER_AUTOFLIP}
  3965. (*
  3966. * Display each field of video port data individually without
  3967. * causing any jittery artifacts
  3968. *)
  3969. DDOVER_BOB = $00200000;
  3970. {$EXTERNALSYM DDOVER_BOB}
  3971. (*
  3972. * Indicates that bob/weave decisions should not be overridden by other
  3973. * interfaces.
  3974. *)
  3975. DDOVER_OVERRIDEBOBWEAVE = $00400000;
  3976. {$EXTERNALSYM DDOVER_OVERRIDEBOBWEAVE}
  3977. (*
  3978. * Indicates that the surface memory is composed of interleaved fields.
  3979. *)
  3980. DDOVER_INTERLEAVED = $00800000;
  3981. {$EXTERNALSYM DDOVER_INTERLEAVED}
  3982. (*
  3983. * Indicates that bob will be performed using hardware rather than
  3984. * software or emulated.
  3985. *)
  3986. DDOVER_BOBHARDWARE = $01000000;
  3987. {$EXTERNALSYM DDOVER_BOBHARDWARE}
  3988. (*
  3989. * Indicates that overlay FX structure contains valid ARGB scaling factors.
  3990. *)
  3991. DDOVER_ARGBSCALEFACTORS = $02000000;
  3992. {$EXTERNALSYM DDOVER_ARGBSCALEFACTORS}
  3993. (*
  3994. * Indicates that ARGB scaling factors can be degraded to fit driver capabilities.
  3995. *)
  3996. DDOVER_DEGRADEARGBSCALING = $04000000;
  3997. {$EXTERNALSYM DDOVER_DEGRADEARGBSCALING}
  3998. (****************************************************************************
  3999. *
  4000. * DIRECTDRAWSURFACE LOCK FLAGS
  4001. *
  4002. ****************************************************************************)
  4003. (*
  4004. * The default. Set to indicate that Lock should return a valid memory pointer
  4005. * to the top of the specified rectangle. If no rectangle is specified then a
  4006. * pointer to the top of the surface is returned.
  4007. *)
  4008. DDLOCK_SURFACEMEMORYPTR = $00000000; // = default
  4009. {$EXTERNALSYM DDLOCK_SURFACEMEMORYPTR}
  4010. (*
  4011. * Set to indicate that Lock should wait until it can obtain a valid memory
  4012. * pointer before returning. If this bit is set, Lock will never return
  4013. * DDERR_WASSTILLDRAWING.
  4014. *)
  4015. DDLOCK_WAIT = $00000001;
  4016. {$EXTERNALSYM DDLOCK_WAIT}
  4017. (*
  4018. * Set if an event handle is being passed to Lock. Lock will trigger the event
  4019. * when it can return the surface memory pointer requested.
  4020. *)
  4021. DDLOCK_EVENT = $00000002;
  4022. {$EXTERNALSYM DDLOCK_EVENT}
  4023. (*
  4024. * Indicates that the surface being locked will only be read from.
  4025. *)
  4026. DDLOCK_READONLY = $00000010;
  4027. {$EXTERNALSYM DDLOCK_READONLY}
  4028. (*
  4029. * Indicates that the surface being locked will only be written to
  4030. *)
  4031. DDLOCK_WRITEONLY = $00000020;
  4032. {$EXTERNALSYM DDLOCK_WRITEONLY}
  4033. (*
  4034. * Indicates that a system wide lock should not be taken when this surface
  4035. * is locked. This has several advantages (cursor responsiveness, ability
  4036. * to call more Windows functions, easier debugging) when locking video
  4037. * memory surfaces. However, an application specifying this flag must
  4038. * comply with a number of conditions documented in the help file.
  4039. * Furthermore, this flag cannot be specified when locking the primary.
  4040. *)
  4041. DDLOCK_NOSYSLOCK = $00000800;
  4042. {$EXTERNALSYM DDLOCK_NOSYSLOCK}
  4043. (*
  4044. * Used only with Direct3D Vertex Buffer Locks. Indicates that no vertices
  4045. * that were referred to in Draw*PrimtiveVB calls since the start of the
  4046. * frame (or the last lock without this flag) will be modified during the
  4047. * lock. This can be useful when one is only appending data to the vertex
  4048. * buffer
  4049. *)
  4050. DDLOCK_NOOVERWRITE = $00001000;
  4051. {$EXTERNALSYM DDLOCK_NOOVERWRITE}
  4052. (*
  4053. * Indicates that no assumptions will be made about the contents of the
  4054. * surface or vertex buffer during this lock.
  4055. * This enables two things:
  4056. * - Direct3D or the driver may provide an alternative memory
  4057. * area as the vertex buffer. This is useful when one plans to clear the
  4058. * contents of the vertex buffer and fill in new data.
  4059. * - Drivers sometimes store surface data in a re-ordered format.
  4060. * When the application locks the surface, the driver is forced to un-re-order
  4061. * the surface data before allowing the application to see the surface contents.
  4062. * This flag is a hint to the driver that it can skip the un-re-ordering process
  4063. * since the application plans to overwrite every single pixel in the surface
  4064. * or locked rectangle (and so erase any un-re-ordered pixels anyway).
  4065. * Applications should always set this flag when they intend to overwrite the entire
  4066. * surface or locked rectangle.
  4067. *)
  4068. DDLOCK_DISCARDCONTENTS = $00002000;
  4069. {$EXTERNALSYM DDLOCK_DISCARDCONTENTS}
  4070. (*
  4071. * DDLOCK_OKTOSWAP is an older, less informative name for DDLOCK_DISCARDCONTENTS
  4072. *)
  4073. DDLOCK_OKTOSWAP = $00002000;
  4074. {$EXTERNALSYM DDLOCK_OKTOSWAP}
  4075. (*
  4076. * On IDirectDrawSurface7 and higher interfaces, the default is DDLOCK_WAIT. If you wish
  4077. * to override the default and use time when the accelerator is busy (as denoted by
  4078. * the DDERR_WASSTILLDRAWING return code) then use DDLOCK_DONOTWAIT.
  4079. *)
  4080. DDLOCK_DONOTWAIT = $00004000;
  4081. {$EXTERNALSYM DDLOCK_DONOTWAIT}
  4082. (*
  4083. * This indicates volume texture lock with front and back specified.
  4084. *)
  4085. DDLOCK_HASVOLUMETEXTUREBOXRECT = $00008000;
  4086. {$EXTERNALSYM DDLOCK_HASVOLUMETEXTUREBOXRECT}
  4087. (*
  4088. * This indicates that the driver should not update dirty rect information for this lock.
  4089. *)
  4090. DDLOCK_NODIRTYUPDATE = $00010000;
  4091. {$EXTERNALSYM DDLOCK_NODIRTYUPDATE}
  4092. (****************************************************************************
  4093. *
  4094. * DIRECTDRAWSURFACE PAGELOCK FLAGS
  4095. *
  4096. ****************************************************************************)
  4097. (*
  4098. * No flags defined at present
  4099. *)
  4100. (****************************************************************************
  4101. *
  4102. * DIRECTDRAWSURFACE PAGEUNLOCK FLAGS
  4103. *
  4104. ****************************************************************************)
  4105. (*
  4106. * No flags defined at present
  4107. *)
  4108. (****************************************************************************
  4109. *
  4110. * DIRECTDRAWSURFACE BLT FX FLAGS
  4111. *
  4112. ****************************************************************************)
  4113. (*
  4114. * If stretching, use arithmetic stretching along the Y axis for this blt.
  4115. *)
  4116. DDBLTFX_ARITHSTRETCHY = $00000001;
  4117. {$EXTERNALSYM DDBLTFX_ARITHSTRETCHY}
  4118. (*
  4119. * Do this blt mirroring the surface left to right. Spin the
  4120. * surface around its y-axis.
  4121. *)
  4122. DDBLTFX_MIRRORLEFTRIGHT = $00000002;
  4123. {$EXTERNALSYM DDBLTFX_MIRRORLEFTRIGHT}
  4124. (*
  4125. * Do this blt mirroring the surface up and down. Spin the surface
  4126. * around its x-axis.
  4127. *)
  4128. DDBLTFX_MIRRORUPDOWN = $00000004;
  4129. {$EXTERNALSYM DDBLTFX_MIRRORUPDOWN}
  4130. (*
  4131. * Schedule this blt to avoid tearing.
  4132. *)
  4133. DDBLTFX_NOTEARING = $00000008;
  4134. {$EXTERNALSYM DDBLTFX_NOTEARING}
  4135. (*
  4136. * Do this blt rotating the surface one hundred and eighty degrees.
  4137. *)
  4138. DDBLTFX_ROTATE180 = $00000010;
  4139. {$EXTERNALSYM DDBLTFX_ROTATE180}
  4140. (*
  4141. * Do this blt rotating the surface two hundred and seventy degrees.
  4142. *)
  4143. DDBLTFX_ROTATE270 = $00000020;
  4144. {$EXTERNALSYM DDBLTFX_ROTATE270}
  4145. (*
  4146. * Do this blt rotating the surface ninety degrees.
  4147. *)
  4148. DDBLTFX_ROTATE90 = $00000040;
  4149. {$EXTERNALSYM DDBLTFX_ROTATE90}
  4150. (*
  4151. * Do this z blt using dwZBufferLow and dwZBufferHigh as range values
  4152. * specified to limit the bits copied from the source surface.
  4153. *)
  4154. DDBLTFX_ZBUFFERRANGE = $00000080;
  4155. {$EXTERNALSYM DDBLTFX_ZBUFFERRANGE}
  4156. (*
  4157. * Do this z blt adding the dwZBufferBaseDest to each of the sources z values
  4158. * before comparing it with the desting z values.
  4159. *)
  4160. DDBLTFX_ZBUFFERBASEDEST = $00000100;
  4161. {$EXTERNALSYM DDBLTFX_ZBUFFERBASEDEST}
  4162. (****************************************************************************
  4163. *
  4164. * DIRECTDRAWSURFACE OVERLAY FX FLAGS
  4165. *
  4166. ****************************************************************************)
  4167. (*
  4168. * If stretching, use arithmetic stretching along the Y axis for this overlay.
  4169. *)
  4170. DDOVERFX_ARITHSTRETCHY = $00000001;
  4171. {$EXTERNALSYM DDOVERFX_ARITHSTRETCHY}
  4172. (*
  4173. * Mirror the overlay across the vertical axis
  4174. *)
  4175. DDOVERFX_MIRRORLEFTRIGHT = $00000002;
  4176. {$EXTERNALSYM DDOVERFX_MIRRORLEFTRIGHT}
  4177. (*
  4178. * Mirror the overlay across the horizontal axis
  4179. *)
  4180. DDOVERFX_MIRRORUPDOWN = $00000004;
  4181. {$EXTERNALSYM DDOVERFX_MIRRORUPDOWN}
  4182. (*
  4183. * Deinterlace the overlay, if possible
  4184. *)
  4185. DDOVERFX_DEINTERLACE = $00000008;
  4186. {$EXTERNALSYM DDOVERFX_DEINTERLACE}
  4187. (****************************************************************************
  4188. *
  4189. * DIRECTDRAW WAITFORVERTICALBLANK FLAGS
  4190. *
  4191. ****************************************************************************)
  4192. (*
  4193. * return when the vertical blank interval begins
  4194. *)
  4195. DDWAITVB_BLOCKBEGIN = $00000001;
  4196. {$EXTERNALSYM DDWAITVB_BLOCKBEGIN}
  4197. (*
  4198. * set up an event to trigger when the vertical blank begins
  4199. *)
  4200. DDWAITVB_BLOCKBEGINEVENT = $00000002;
  4201. {$EXTERNALSYM DDWAITVB_BLOCKBEGINEVENT}
  4202. (*
  4203. * return when the vertical blank interval ends and display begins
  4204. *)
  4205. DDWAITVB_BLOCKEND = $00000004;
  4206. {$EXTERNALSYM DDWAITVB_BLOCKEND}
  4207. (****************************************************************************
  4208. *
  4209. * DIRECTDRAW GETFLIPSTATUS FLAGS
  4210. *
  4211. ****************************************************************************)
  4212. (*
  4213. * is it OK to flip now?
  4214. *)
  4215. DDGFS_CANFLIP = $00000001;
  4216. {$EXTERNALSYM DDGFS_CANFLIP}
  4217. (*
  4218. * is the last flip finished?
  4219. *)
  4220. DDGFS_ISFLIPDONE = $00000002;
  4221. {$EXTERNALSYM DDGFS_ISFLIPDONE}
  4222. (****************************************************************************
  4223. *
  4224. * DIRECTDRAW GETBLTSTATUS FLAGS
  4225. *
  4226. ****************************************************************************)
  4227. (*
  4228. * is it OK to blt now?
  4229. *)
  4230. DDGBS_CANBLT = $00000001;
  4231. {$EXTERNALSYM DDGBS_CANBLT}
  4232. (*
  4233. * is the blt to the surface finished?
  4234. *)
  4235. DDGBS_ISBLTDONE = $00000002;
  4236. {$EXTERNALSYM DDGBS_ISBLTDONE}
  4237. (****************************************************************************
  4238. *
  4239. * DIRECTDRAW ENUMOVERLAYZORDER FLAGS
  4240. *
  4241. ****************************************************************************)
  4242. (*
  4243. * Enumerate overlays back to front.
  4244. *)
  4245. DDENUMOVERLAYZ_BACKTOFRONT = $00000000;
  4246. {$EXTERNALSYM DDENUMOVERLAYZ_BACKTOFRONT}
  4247. (*
  4248. * Enumerate overlays front to back
  4249. *)
  4250. DDENUMOVERLAYZ_FRONTTOBACK = $00000001;
  4251. {$EXTERNALSYM DDENUMOVERLAYZ_FRONTTOBACK}
  4252. (****************************************************************************
  4253. *
  4254. * DIRECTDRAW UPDATEOVERLAYZORDER FLAGS
  4255. *
  4256. ****************************************************************************)
  4257. (*
  4258. * Send overlay to front
  4259. *)
  4260. DDOVERZ_SENDTOFRONT = $00000000;
  4261. {$EXTERNALSYM DDOVERZ_SENDTOFRONT}
  4262. (*
  4263. * Send overlay to back
  4264. *)
  4265. DDOVERZ_SENDTOBACK = $00000001;
  4266. {$EXTERNALSYM DDOVERZ_SENDTOBACK}
  4267. (*
  4268. * Move Overlay forward
  4269. *)
  4270. DDOVERZ_MOVEFORWARD = $00000002;
  4271. {$EXTERNALSYM DDOVERZ_MOVEFORWARD}
  4272. (*
  4273. * Move Overlay backward
  4274. *)
  4275. DDOVERZ_MOVEBACKWARD = $00000003;
  4276. {$EXTERNALSYM DDOVERZ_MOVEBACKWARD}
  4277. (*
  4278. * Move Overlay in front of relative surface
  4279. *)
  4280. DDOVERZ_INSERTINFRONTOF = $00000004;
  4281. {$EXTERNALSYM DDOVERZ_INSERTINFRONTOF}
  4282. (*
  4283. * Move Overlay in back of relative surface
  4284. *)
  4285. DDOVERZ_INSERTINBACKOF = $00000005;
  4286. {$EXTERNALSYM DDOVERZ_INSERTINBACKOF}
  4287. (****************************************************************************
  4288. *
  4289. * DIRECTDRAW SETGAMMARAMP FLAGS
  4290. *
  4291. ****************************************************************************)
  4292. (*
  4293. * Request calibrator to adjust the gamma ramp according to the physical
  4294. * properties of the display so that the result should appear identical
  4295. * on all systems.
  4296. *)
  4297. DDSGR_CALIBRATE = $00000001;
  4298. {$EXTERNALSYM DDSGR_CALIBRATE}
  4299. (****************************************************************************
  4300. *
  4301. * DIRECTDRAW STARTMODETEST FLAGS
  4302. *
  4303. ****************************************************************************)
  4304. (*
  4305. * Indicates that the mode being tested has passed
  4306. *)
  4307. DDSMT_ISTESTREQUIRED = $00000001;
  4308. {$EXTERNALSYM DDSMT_ISTESTREQUIRED}
  4309. (****************************************************************************
  4310. *
  4311. * DIRECTDRAW EVALUATEMODE FLAGS
  4312. *
  4313. ****************************************************************************)
  4314. (*
  4315. * Indicates that the mode being tested has passed
  4316. *)
  4317. DDEM_MODEPASSED = $00000001;
  4318. {$EXTERNALSYM DDEM_MODEPASSED}
  4319. (*
  4320. * Indicates that the mode being tested has failed
  4321. *)
  4322. DDEM_MODEFAILED = $00000002;
  4323. {$EXTERNALSYM DDEM_MODEFAILED}
  4324. (*===========================================================================
  4325. *
  4326. *
  4327. * DIRECTDRAW RETURN CODES
  4328. *
  4329. * The return values from DirectDraw Commands and Surface that return an HRESULT
  4330. * are codes from DirectDraw concerning the results of the action
  4331. * requested by DirectDraw.
  4332. *
  4333. *==========================================================================*)
  4334. (*
  4335. * Status is OK
  4336. *
  4337. * Issued by: DirectDraw Commands and all callbacks
  4338. *)
  4339. DD_OK = 0;
  4340. {$EXTERNALSYM DD_OK}
  4341. DD_FALSE = S_FALSE;
  4342. {$EXTERNALSYM DD_FALSE}
  4343. (****************************************************************************
  4344. *
  4345. * DIRECTDRAW ENUMCALLBACK RETURN VALUES
  4346. *
  4347. * EnumCallback returns are used to control the flow of the DIRECTDRAW and
  4348. * DIRECTDRAWSURFACE object enumerations. They can only be returned by
  4349. * enumeration callback routines.
  4350. *
  4351. ****************************************************************************)
  4352. (*
  4353. * stop the enumeration
  4354. *)
  4355. DDENUMRET_CANCEL = 0;
  4356. {$EXTERNALSYM DDENUMRET_CANCEL}
  4357. (*
  4358. * continue the enumeration
  4359. *)
  4360. DDENUMRET_OK = 1;
  4361. {$EXTERNALSYM DDENUMRET_OK}
  4362. (****************************************************************************
  4363. *
  4364. * DIRECTDRAW ERRORS
  4365. *
  4366. * Errors are represented by negative values and cannot be combined.
  4367. *
  4368. ****************************************************************************)
  4369. const
  4370. _FACDD = $876;
  4371. {$EXTERNALSYM _FACDD}
  4372. _MAKE_DDHRESULT = HResult(1 shl 31) or HResult(_FACDD shl 16);
  4373. //#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code )
  4374. function MAKE_DDHRESULT(Code: DWORD): HResult;
  4375. {$EXTERNALSYM MAKE_DDHRESULT}
  4376. const
  4377. (*
  4378. * This object is already initialized
  4379. *)
  4380. DDERR_ALREADYINITIALIZED = HResult(_MAKE_DDHRESULT + 5);
  4381. {$EXTERNALSYM DDERR_ALREADYINITIALIZED}
  4382. (*
  4383. * This surface can not be attached to the requested surface.
  4384. *)
  4385. DDERR_CANNOTATTACHSURFACE = HResult(_MAKE_DDHRESULT + 10);
  4386. {$EXTERNALSYM DDERR_CANNOTATTACHSURFACE}
  4387. (*
  4388. * This surface can not be detached from the requested surface.
  4389. *)
  4390. DDERR_CANNOTDETACHSURFACE = HResult(_MAKE_DDHRESULT + 20);
  4391. {$EXTERNALSYM DDERR_CANNOTDETACHSURFACE}
  4392. (*
  4393. * Support is currently not available.
  4394. *)
  4395. DDERR_CURRENTLYNOTAVAIL = HResult(_MAKE_DDHRESULT + 40);
  4396. {$EXTERNALSYM DDERR_CURRENTLYNOTAVAIL}
  4397. (*
  4398. * An exception was encountered while performing the requested operation
  4399. *)
  4400. DDERR_EXCEPTION = HResult(_MAKE_DDHRESULT + 55);
  4401. {$EXTERNALSYM DDERR_EXCEPTION}
  4402. (*
  4403. * Generic failure.
  4404. *)
  4405. DDERR_GENERIC = E_FAIL;
  4406. {$EXTERNALSYM DDERR_GENERIC}
  4407. (*
  4408. * Height of rectangle provided is not a multiple of reqd alignment
  4409. *)
  4410. DDERR_HEIGHTALIGN = HResult(_MAKE_DDHRESULT + 90);
  4411. {$EXTERNALSYM DDERR_HEIGHTALIGN}
  4412. (*
  4413. * Unable to match primary surface creation request with existing
  4414. * primary surface.
  4415. *)
  4416. DDERR_INCOMPATIBLEPRIMARY = HResult(_MAKE_DDHRESULT + 95);
  4417. {$EXTERNALSYM DDERR_INCOMPATIBLEPRIMARY}
  4418. (*
  4419. * One or more of the caps bits passed to the callback are incorrect.
  4420. *)
  4421. DDERR_INVALIDCAPS = HResult(_MAKE_DDHRESULT + 100);
  4422. {$EXTERNALSYM DDERR_INVALIDCAPS}
  4423. (*
  4424. * DirectDraw does not support provided Cliplist.
  4425. *)
  4426. DDERR_INVALIDCLIPLIST = HResult(_MAKE_DDHRESULT + 110);
  4427. {$EXTERNALSYM DDERR_INVALIDCLIPLIST}
  4428. (*
  4429. * DirectDraw does not support the requested mode
  4430. *)
  4431. DDERR_INVALIDMODE = HResult(_MAKE_DDHRESULT + 120);
  4432. {$EXTERNALSYM DDERR_INVALIDMODE}
  4433. (*
  4434. * DirectDraw received a pointer that was an invalid DIRECTDRAW object.
  4435. *)
  4436. DDERR_INVALIDOBJECT = HResult(_MAKE_DDHRESULT + 130);
  4437. {$EXTERNALSYM DDERR_INVALIDOBJECT}
  4438. (*
  4439. * One or more of the parameters passed to the callback function are
  4440. * incorrect.
  4441. *)
  4442. DDERR_INVALIDPARAMS = E_INVALIDARG;
  4443. {$EXTERNALSYM DDERR_INVALIDPARAMS}
  4444. (*
  4445. * pixel format was invalid as specified
  4446. *)
  4447. DDERR_INVALIDPIXELFORMAT = HResult(_MAKE_DDHRESULT + 145);
  4448. {$EXTERNALSYM DDERR_INVALIDPIXELFORMAT}
  4449. (*
  4450. * Rectangle provided was invalid.
  4451. *)
  4452. DDERR_INVALIDRECT = HResult(_MAKE_DDHRESULT + 150);
  4453. {$EXTERNALSYM DDERR_INVALIDRECT}
  4454. (*
  4455. * Operation could not be carried out because one or more surfaces are locked
  4456. *)
  4457. DDERR_LOCKEDSURFACES = HResult(_MAKE_DDHRESULT + 160);
  4458. {$EXTERNALSYM DDERR_LOCKEDSURFACES}
  4459. (*
  4460. * There is no 3D present.
  4461. *)
  4462. DDERR_NO3D = HResult(_MAKE_DDHRESULT + 170);
  4463. {$EXTERNALSYM DDERR_NO3D}
  4464. (*
  4465. * Operation could not be carried out because there is no alpha accleration
  4466. * hardware present or available.
  4467. *)
  4468. DDERR_NOALPHAHW = HResult(_MAKE_DDHRESULT + 180);
  4469. {$EXTERNALSYM DDERR_NOALPHAHW}
  4470. (*
  4471. * Operation could not be carried out because there is no stereo
  4472. * hardware present or available.
  4473. *)
  4474. DDERR_NOSTEREOHARDWARE = HResult(_MAKE_DDHRESULT + 181);
  4475. {$EXTERNALSYM DDERR_NOSTEREOHARDWARE}
  4476. (*
  4477. * Operation could not be carried out because there is no hardware
  4478. * present which supports stereo surfaces
  4479. *)
  4480. DDERR_NOSURFACELEFT = HResult(_MAKE_DDHRESULT + 182);
  4481. {$EXTERNALSYM DDERR_NOSURFACELEFT}
  4482. (*
  4483. * no clip list available
  4484. *)
  4485. DDERR_NOCLIPLIST = HResult(_MAKE_DDHRESULT + 205);
  4486. {$EXTERNALSYM DDERR_NOCLIPLIST}
  4487. (*
  4488. * Operation could not be carried out because there is no color conversion
  4489. * hardware present or available.
  4490. *)
  4491. DDERR_NOCOLORCONVHW = HResult(_MAKE_DDHRESULT + 210);
  4492. {$EXTERNALSYM DDERR_NOCOLORCONVHW}
  4493. (*
  4494. * Create function called without DirectDraw object method SetCooperativeLevel
  4495. * being called.
  4496. *)
  4497. DDERR_NOCOOPERATIVELEVELSET = HResult(_MAKE_DDHRESULT + 212);
  4498. {$EXTERNALSYM DDERR_NOCOOPERATIVELEVELSET}
  4499. (*
  4500. * Surface doesn't currently have a color key
  4501. *)
  4502. DDERR_NOCOLORKEY = HResult(_MAKE_DDHRESULT + 215);
  4503. {$EXTERNALSYM DDERR_NOCOLORKEY}
  4504. (*
  4505. * Operation could not be carried out because there is no hardware support
  4506. * of the dest color key.
  4507. *)
  4508. DDERR_NOCOLORKEYHW = HResult(_MAKE_DDHRESULT + 220);
  4509. {$EXTERNALSYM DDERR_NOCOLORKEYHW}
  4510. (*
  4511. * No DirectDraw support possible with current display driver
  4512. *)
  4513. DDERR_NODIRECTDRAWSUPPORT = HResult(_MAKE_DDHRESULT + 222);
  4514. {$EXTERNALSYM DDERR_NODIRECTDRAWSUPPORT}
  4515. (*
  4516. * Operation requires the application to have exclusive mode but the
  4517. * application does not have exclusive mode.
  4518. *)
  4519. DDERR_NOEXCLUSIVEMODE = HResult(_MAKE_DDHRESULT + 225);
  4520. {$EXTERNALSYM DDERR_NOEXCLUSIVEMODE}
  4521. (*
  4522. * Flipping visible surfaces is not supported.
  4523. *)
  4524. DDERR_NOFLIPHW = HResult(_MAKE_DDHRESULT + 230);
  4525. {$EXTERNALSYM DDERR_NOFLIPHW}
  4526. (*
  4527. * There is no GDI present.
  4528. *)
  4529. DDERR_NOGDI = HResult(_MAKE_DDHRESULT + 240);
  4530. {$EXTERNALSYM DDERR_NOGDI}
  4531. (*
  4532. * Operation could not be carried out because there is no hardware present
  4533. * or available.
  4534. *)
  4535. DDERR_NOMIRRORHW = HResult(_MAKE_DDHRESULT + 250);
  4536. {$EXTERNALSYM DDERR_NOMIRRORHW}
  4537. (*
  4538. * Requested item was not found
  4539. *)
  4540. DDERR_NOTFOUND = HResult(_MAKE_DDHRESULT + 255);
  4541. {$EXTERNALSYM DDERR_NOTFOUND}
  4542. (*
  4543. * Operation could not be carried out because there is no overlay hardware
  4544. * present or available.
  4545. *)
  4546. DDERR_NOOVERLAYHW = HResult(_MAKE_DDHRESULT + 260);
  4547. {$EXTERNALSYM DDERR_NOOVERLAYHW}
  4548. (*
  4549. * Operation could not be carried out because the source and destination
  4550. * rectangles are on the same surface and overlap each other.
  4551. *)
  4552. DDERR_OVERLAPPINGRECTS = HResult(_MAKE_DDHRESULT + 270);
  4553. {$EXTERNALSYM DDERR_OVERLAPPINGRECTS}
  4554. (*
  4555. * Operation could not be carried out because there is no appropriate raster
  4556. * op hardware present or available.
  4557. *)
  4558. DDERR_NORASTEROPHW = HResult(_MAKE_DDHRESULT + 280);
  4559. {$EXTERNALSYM DDERR_NORASTEROPHW}
  4560. (*
  4561. * Operation could not be carried out because there is no rotation hardware
  4562. * present or available.
  4563. *)
  4564. DDERR_NOROTATIONHW = HResult(_MAKE_DDHRESULT + 290);
  4565. {$EXTERNALSYM DDERR_NOROTATIONHW}
  4566. (*
  4567. * Operation could not be carried out because there is no hardware support
  4568. * for stretching
  4569. *)
  4570. DDERR_NOSTRETCHHW = HResult(_MAKE_DDHRESULT + 310);
  4571. {$EXTERNALSYM DDERR_NOSTRETCHHW}
  4572. (*
  4573. * DirectDrawSurface is not in 4 bit color palette and the requested operation
  4574. * requires 4 bit color palette.
  4575. *)
  4576. DDERR_NOT4BITCOLOR = HResult(_MAKE_DDHRESULT + 316);
  4577. {$EXTERNALSYM DDERR_NOT4BITCOLOR}
  4578. (*
  4579. * DirectDrawSurface is not in 4 bit color index palette and the requested
  4580. * operation requires 4 bit color index palette.
  4581. *)
  4582. DDERR_NOT4BITCOLORINDEX = HResult(_MAKE_DDHRESULT + 317);
  4583. {$EXTERNALSYM DDERR_NOT4BITCOLORINDEX}
  4584. (*
  4585. * DirectDraw Surface is not in 8 bit color mode and the requested operation
  4586. * requires 8 bit color.
  4587. *)
  4588. DDERR_NOT8BITCOLOR = HResult(_MAKE_DDHRESULT + 320);
  4589. {$EXTERNALSYM DDERR_NOT8BITCOLOR}
  4590. (*
  4591. * Operation could not be carried out because there is no texture mapping
  4592. * hardware present or available.
  4593. *)
  4594. DDERR_NOTEXTUREHW = HResult(_MAKE_DDHRESULT + 330);
  4595. {$EXTERNALSYM DDERR_NOTEXTUREHW}
  4596. (*
  4597. * Operation could not be carried out because there is no hardware support
  4598. * for vertical blank synchronized operations.
  4599. *)
  4600. DDERR_NOVSYNCHW = HResult(_MAKE_DDHRESULT + 335);
  4601. {$EXTERNALSYM DDERR_NOVSYNCHW}
  4602. (*
  4603. * Operation could not be carried out because there is no hardware support
  4604. * for zbuffer blting.
  4605. *)
  4606. DDERR_NOZBUFFERHW = HResult(_MAKE_DDHRESULT + 340);
  4607. {$EXTERNALSYM DDERR_NOZBUFFERHW}
  4608. (*
  4609. * Overlay surfaces could not be z layered based on their BltOrder because
  4610. * the hardware does not support z layering of overlays.
  4611. *)
  4612. DDERR_NOZOVERLAYHW = HResult(_MAKE_DDHRESULT + 350);
  4613. {$EXTERNALSYM DDERR_NOZOVERLAYHW}
  4614. (*
  4615. * The hardware needed for the requested operation has already been
  4616. * allocated.
  4617. *)
  4618. DDERR_OUTOFCAPS = HResult(_MAKE_DDHRESULT + 360);
  4619. {$EXTERNALSYM DDERR_OUTOFCAPS}
  4620. (*
  4621. * DirectDraw does not have enough memory to perform the operation.
  4622. *)
  4623. DDERR_OUTOFMEMORY = E_OUTOFMEMORY;
  4624. {$EXTERNALSYM DDERR_OUTOFMEMORY}
  4625. (*
  4626. * DirectDraw does not have enough memory to perform the operation.
  4627. *)
  4628. DDERR_OUTOFVIDEOMEMORY = HResult(_MAKE_DDHRESULT + 380);
  4629. {$EXTERNALSYM DDERR_OUTOFVIDEOMEMORY}
  4630. (*
  4631. * hardware does not support clipped overlays
  4632. *)
  4633. DDERR_OVERLAYCANTCLIP = HResult(_MAKE_DDHRESULT + 382);
  4634. {$EXTERNALSYM DDERR_OVERLAYCANTCLIP}
  4635. (*
  4636. * Can only have ony color key active at one time for overlays
  4637. *)
  4638. DDERR_OVERLAYCOLORKEYONLYONEACTIVE = HResult(_MAKE_DDHRESULT + 384);
  4639. {$EXTERNALSYM DDERR_OVERLAYCOLORKEYONLYONEACTIVE}
  4640. (*
  4641. * Access to this palette is being refused because the palette is already
  4642. * locked by another thread.
  4643. *)
  4644. DDERR_PALETTEBUSY = HResult(_MAKE_DDHRESULT + 387);
  4645. {$EXTERNALSYM DDERR_PALETTEBUSY}
  4646. (*
  4647. * No src color key specified for this operation.
  4648. *)
  4649. DDERR_COLORKEYNOTSET = HResult(_MAKE_DDHRESULT + 400);
  4650. {$EXTERNALSYM DDERR_COLORKEYNOTSET}
  4651. (*
  4652. * This surface is already attached to the surface it is being attached to.
  4653. *)
  4654. DDERR_SURFACEALREADYATTACHED = HResult(_MAKE_DDHRESULT + 410);
  4655. {$EXTERNALSYM DDERR_SURFACEALREADYATTACHED}
  4656. (*
  4657. * This surface is already a dependency of the surface it is being made a
  4658. * dependency of.
  4659. *)
  4660. DDERR_SURFACEALREADYDEPENDENT = HResult(_MAKE_DDHRESULT + 420);
  4661. {$EXTERNALSYM DDERR_SURFACEALREADYDEPENDENT}
  4662. (*
  4663. * Access to this surface is being refused because the surface is already
  4664. * locked by another thread.
  4665. *)
  4666. DDERR_SURFACEBUSY = HResult(_MAKE_DDHRESULT + 430);
  4667. {$EXTERNALSYM DDERR_SURFACEBUSY}
  4668. (*
  4669. * Access to this surface is being refused because no driver exists
  4670. * which can supply a pointer to the surface.
  4671. * This is most likely to happen when attempting to lock the primary
  4672. * surface when no DCI provider is present.
  4673. * Will also happen on attempts to lock an optimized surface.
  4674. *)
  4675. DDERR_CANTLOCKSURFACE = HResult(_MAKE_DDHRESULT + 435);
  4676. {$EXTERNALSYM DDERR_CANTLOCKSURFACE}
  4677. (*
  4678. * Access to Surface refused because Surface is obscured.
  4679. *)
  4680. DDERR_SURFACEISOBSCURED = HResult(_MAKE_DDHRESULT + 440);
  4681. {$EXTERNALSYM DDERR_SURFACEISOBSCURED}
  4682. (*
  4683. * Access to this surface is being refused because the surface is gone.
  4684. * The DIRECTDRAWSURFACE object representing this surface should
  4685. * have Restore called on it.
  4686. *)
  4687. DDERR_SURFACELOST = HResult(_MAKE_DDHRESULT + 450);
  4688. {$EXTERNALSYM DDERR_SURFACELOST}
  4689. (*
  4690. * The requested surface is not attached.
  4691. *)
  4692. DDERR_SURFACENOTATTACHED = HResult(_MAKE_DDHRESULT + 460);
  4693. {$EXTERNALSYM DDERR_SURFACENOTATTACHED}
  4694. (*
  4695. * Height requested by DirectDraw is too large.
  4696. *)
  4697. DDERR_TOOBIGHEIGHT = HResult(_MAKE_DDHRESULT + 470);
  4698. {$EXTERNALSYM DDERR_TOOBIGHEIGHT}
  4699. (*
  4700. * Size requested by DirectDraw is too large -- The individual height and
  4701. * width are OK.
  4702. *)
  4703. DDERR_TOOBIGSIZE = HResult(_MAKE_DDHRESULT + 480);
  4704. {$EXTERNALSYM DDERR_TOOBIGSIZE}
  4705. (*
  4706. * Width requested by DirectDraw is too large.
  4707. *)
  4708. DDERR_TOOBIGWIDTH = HResult(_MAKE_DDHRESULT + 490);
  4709. {$EXTERNALSYM DDERR_TOOBIGWIDTH}
  4710. (*
  4711. * Action not supported.
  4712. *)
  4713. DDERR_UNSUPPORTED = E_NOTIMPL;
  4714. {$EXTERNALSYM DDERR_UNSUPPORTED}
  4715. (*
  4716. * FOURCC format requested is unsupported by DirectDraw
  4717. *)
  4718. DDERR_UNSUPPORTEDFORMAT = HResult(_MAKE_DDHRESULT + 510);
  4719. {$EXTERNALSYM DDERR_UNSUPPORTEDFORMAT}
  4720. (*
  4721. * Bitmask in the pixel format requested is unsupported by DirectDraw
  4722. *)
  4723. DDERR_UNSUPPORTEDMASK = HResult(_MAKE_DDHRESULT + 520);
  4724. {$EXTERNALSYM DDERR_UNSUPPORTEDMASK}
  4725. (*
  4726. * The specified stream contains invalid data
  4727. *)
  4728. DDERR_INVALIDSTREAM = HResult(_MAKE_DDHRESULT + 521);
  4729. {$EXTERNALSYM DDERR_INVALIDSTREAM}
  4730. (*
  4731. * vertical blank is in progress
  4732. *)
  4733. DDERR_VERTICALBLANKINPROGRESS = HResult(_MAKE_DDHRESULT + 537);
  4734. {$EXTERNALSYM DDERR_VERTICALBLANKINPROGRESS}
  4735. (*
  4736. * Informs DirectDraw that the previous Blt which is transfering information
  4737. * to or from this Surface is incomplete.
  4738. *)
  4739. DDERR_WASSTILLDRAWING = HResult(_MAKE_DDHRESULT + 540);
  4740. {$EXTERNALSYM DDERR_WASSTILLDRAWING}
  4741. (*
  4742. * The specified surface type requires specification of the COMPLEX flag
  4743. *)
  4744. DDERR_DDSCAPSCOMPLEXREQUIRED = HResult(_MAKE_DDHRESULT + 542);
  4745. {$EXTERNALSYM DDERR_DDSCAPSCOMPLEXREQUIRED}
  4746. (*
  4747. * Rectangle provided was not horizontally aligned on reqd. boundary
  4748. *)
  4749. DDERR_XALIGN = HResult(_MAKE_DDHRESULT + 560);
  4750. {$EXTERNALSYM DDERR_XALIGN}
  4751. (*
  4752. * The GUID passed to DirectDrawCreate is not a valid DirectDraw driver
  4753. * identifier.
  4754. *)
  4755. DDERR_INVALIDDIRECTDRAWGUID = HResult(_MAKE_DDHRESULT + 561);
  4756. {$EXTERNALSYM DDERR_INVALIDDIRECTDRAWGUID}
  4757. (*
  4758. * A DirectDraw object representing this driver has already been created
  4759. * for this process.
  4760. *)
  4761. DDERR_DIRECTDRAWALREADYCREATED = HResult(_MAKE_DDHRESULT + 562);
  4762. {$EXTERNALSYM DDERR_DIRECTDRAWALREADYCREATED}
  4763. (*
  4764. * A hardware only DirectDraw object creation was attempted but the driver
  4765. * did not support any hardware.
  4766. *)
  4767. DDERR_NODIRECTDRAWHW = HResult(_MAKE_DDHRESULT + 563);
  4768. {$EXTERNALSYM DDERR_NODIRECTDRAWHW}
  4769. (*
  4770. * this process already has created a primary surface
  4771. *)
  4772. DDERR_PRIMARYSURFACEALREADYEXISTS = HResult(_MAKE_DDHRESULT + 564);
  4773. {$EXTERNALSYM DDERR_PRIMARYSURFACEALREADYEXISTS}
  4774. (*
  4775. * software emulation not available.
  4776. *)
  4777. DDERR_NOEMULATION = HResult(_MAKE_DDHRESULT + 565);
  4778. {$EXTERNALSYM DDERR_NOEMULATION}
  4779. (*
  4780. * region passed to Clipper::GetClipList is too small.
  4781. *)
  4782. DDERR_REGIONTOOSMALL = HResult(_MAKE_DDHRESULT + 566);
  4783. {$EXTERNALSYM DDERR_REGIONTOOSMALL}
  4784. (*
  4785. * an attempt was made to set a clip list for a clipper objec that
  4786. * is already monitoring an hwnd.
  4787. *)
  4788. DDERR_CLIPPERISUSINGHWND = HResult(_MAKE_DDHRESULT + 567);
  4789. {$EXTERNALSYM DDERR_CLIPPERISUSINGHWND}
  4790. (*
  4791. * No clipper object attached to surface object
  4792. *)
  4793. DDERR_NOCLIPPERATTACHED = HResult(_MAKE_DDHRESULT + 568);
  4794. {$EXTERNALSYM DDERR_NOCLIPPERATTACHED}
  4795. (*
  4796. * Clipper notification requires an HWND or
  4797. * no HWND has previously been set as the CooperativeLevel HWND.
  4798. *)
  4799. DDERR_NOHWND = HResult(_MAKE_DDHRESULT + 569);
  4800. {$EXTERNALSYM DDERR_NOHWND}
  4801. (*
  4802. * HWND used by DirectDraw CooperativeLevel has been subclassed,
  4803. * this prevents DirectDraw from restoring state.
  4804. *)
  4805. DDERR_HWNDSUBCLASSED = HResult(_MAKE_DDHRESULT + 570);
  4806. {$EXTERNALSYM DDERR_HWNDSUBCLASSED}
  4807. (*
  4808. * The CooperativeLevel HWND has already been set.
  4809. * It can not be reset while the process has surfaces or palettes created.
  4810. *)
  4811. DDERR_HWNDALREADYSET = HResult(_MAKE_DDHRESULT + 571);
  4812. {$EXTERNALSYM DDERR_HWNDALREADYSET}
  4813. (*
  4814. * No palette object attached to this surface.
  4815. *)
  4816. DDERR_NOPALETTEATTACHED = HResult(_MAKE_DDHRESULT + 572);
  4817. {$EXTERNALSYM DDERR_NOPALETTEATTACHED}
  4818. (*
  4819. * No hardware support for 16 or 256 color palettes.
  4820. *)
  4821. DDERR_NOPALETTEHW = HResult(_MAKE_DDHRESULT + 573);
  4822. {$EXTERNALSYM DDERR_NOPALETTEHW}
  4823. (*
  4824. * If a clipper object is attached to the source surface passed into a
  4825. * BltFast call.
  4826. *)
  4827. DDERR_BLTFASTCANTCLIP = HResult(_MAKE_DDHRESULT + 574);
  4828. {$EXTERNALSYM DDERR_BLTFASTCANTCLIP}
  4829. (*
  4830. * No blter.
  4831. *)
  4832. DDERR_NOBLTHW = HResult(_MAKE_DDHRESULT + 575);
  4833. {$EXTERNALSYM DDERR_NOBLTHW}
  4834. (*
  4835. * No DirectDraw ROP hardware.
  4836. *)
  4837. DDERR_NODDROPSHW = HResult(_MAKE_DDHRESULT + 576);
  4838. {$EXTERNALSYM DDERR_NODDROPSHW}
  4839. (*
  4840. * returned when GetOverlayPosition is called on a hidden overlay
  4841. *)
  4842. DDERR_OVERLAYNOTVISIBLE = HResult(_MAKE_DDHRESULT + 577);
  4843. {$EXTERNALSYM DDERR_OVERLAYNOTVISIBLE}
  4844. (*
  4845. * returned when GetOverlayPosition is called on a overlay that UpdateOverlay
  4846. * has never been called on to establish a destionation.
  4847. *)
  4848. DDERR_NOOVERLAYDEST = HResult(_MAKE_DDHRESULT + 578);
  4849. {$EXTERNALSYM DDERR_NOOVERLAYDEST}
  4850. (*
  4851. * returned when the position of the overlay on the destionation is no longer
  4852. * legal for that destionation.
  4853. *)
  4854. DDERR_INVALIDPOSITION = HResult(_MAKE_DDHRESULT + 579);
  4855. {$EXTERNALSYM DDERR_INVALIDPOSITION}
  4856. (*
  4857. * returned when an overlay member is called for a non-overlay surface
  4858. *)
  4859. DDERR_NOTAOVERLAYSURFACE = HResult(_MAKE_DDHRESULT + 580);
  4860. {$EXTERNALSYM DDERR_NOTAOVERLAYSURFACE}
  4861. (*
  4862. * An attempt was made to set the cooperative level when it was already
  4863. * set to exclusive.
  4864. *)
  4865. DDERR_EXCLUSIVEMODEALREADYSET = HResult(_MAKE_DDHRESULT + 581);
  4866. {$EXTERNALSYM DDERR_EXCLUSIVEMODEALREADYSET}
  4867. (*
  4868. * An attempt has been made to flip a surface that is not flippable.
  4869. *)
  4870. DDERR_NOTFLIPPABLE = HResult(_MAKE_DDHRESULT + 582);
  4871. {$EXTERNALSYM DDERR_NOTFLIPPABLE}
  4872. (*
  4873. * Can't duplicate primary & 3D surfaces, or surfaces that are implicitly
  4874. * created.
  4875. *)
  4876. DDERR_CANTDUPLICATE = HResult(_MAKE_DDHRESULT + 583);
  4877. {$EXTERNALSYM DDERR_CANTDUPLICATE}
  4878. (*
  4879. * Surface was not locked. An attempt to unlock a surface that was not
  4880. * locked at all, or by this process, has been attempted.
  4881. *)
  4882. DDERR_NOTLOCKED = HResult(_MAKE_DDHRESULT + 584);
  4883. {$EXTERNALSYM DDERR_NOTLOCKED}
  4884. (*
  4885. * Windows can not create any more DCs, or a DC was requested for a paltte-indexed
  4886. * surface when the surface had no palette AND the display mode was not palette-indexed
  4887. * (in this case DirectDraw cannot select a proper palette into the DC)
  4888. *)
  4889. DDERR_CANTCREATEDC = HResult(_MAKE_DDHRESULT + 585);
  4890. {$EXTERNALSYM DDERR_CANTCREATEDC}
  4891. (*
  4892. * No DC was ever created for this surface.
  4893. *)
  4894. DDERR_NODC = HResult(_MAKE_DDHRESULT + 586);
  4895. {$EXTERNALSYM DDERR_NODC}
  4896. (*
  4897. * This surface can not be restored because it was created in a different
  4898. * mode.
  4899. *)
  4900. DDERR_WRONGMODE = HResult(_MAKE_DDHRESULT + 587);
  4901. {$EXTERNALSYM DDERR_WRONGMODE}
  4902. (*
  4903. * This surface can not be restored because it is an implicitly created
  4904. * surface.
  4905. *)
  4906. DDERR_IMPLICITLYCREATED = HResult(_MAKE_DDHRESULT + 588);
  4907. {$EXTERNALSYM DDERR_IMPLICITLYCREATED}
  4908. (*
  4909. * The surface being used is not a palette-based surface
  4910. *)
  4911. DDERR_NOTPALETTIZED = HResult(_MAKE_DDHRESULT + 589);
  4912. {$EXTERNALSYM DDERR_NOTPALETTIZED}
  4913. (*
  4914. * The display is currently in an unsupported mode
  4915. *)
  4916. DDERR_UNSUPPORTEDMODE = HResult(_MAKE_DDHRESULT + 590);
  4917. {$EXTERNALSYM DDERR_UNSUPPORTEDMODE}
  4918. (*
  4919. * Operation could not be carried out because there is no mip-map
  4920. * texture mapping hardware present or available.
  4921. *)
  4922. DDERR_NOMIPMAPHW = HResult(_MAKE_DDHRESULT + 591);
  4923. {$EXTERNALSYM DDERR_NOMIPMAPHW}
  4924. (*
  4925. * The requested action could not be performed because the surface was of
  4926. * the wrong type.
  4927. *)
  4928. DDERR_INVALIDSURFACETYPE = HResult(_MAKE_DDHRESULT + 592);
  4929. {$EXTERNALSYM DDERR_INVALIDSURFACETYPE}
  4930. (*
  4931. * Device does not support optimized surfaces, therefore no video memory optimized surfaces
  4932. *)
  4933. DDERR_NOOPTIMIZEHW = HResult(_MAKE_DDHRESULT + 600);
  4934. {$EXTERNALSYM DDERR_NOOPTIMIZEHW}
  4935. (*
  4936. * Surface is an optimized surface, but has not yet been allocated any memory
  4937. *)
  4938. DDERR_NOTLOADED = HResult(_MAKE_DDHRESULT + 601);
  4939. {$EXTERNALSYM DDERR_NOTLOADED}
  4940. (*
  4941. * Attempt was made to create or set a device window without first setting
  4942. * the focus window
  4943. *)
  4944. DDERR_NOFOCUSWINDOW = HResult(_MAKE_DDHRESULT + 602);
  4945. {$EXTERNALSYM DDERR_NOFOCUSWINDOW}
  4946. (*
  4947. * Attempt was made to set a palette on a mipmap sublevel
  4948. *)
  4949. DDERR_NOTONMIPMAPSUBLEVEL = HResult(_MAKE_DDHRESULT + 603);
  4950. {$EXTERNALSYM DDERR_NOTONMIPMAPSUBLEVEL}
  4951. (*
  4952. * A DC has already been returned for this surface. Only one DC can be
  4953. * retrieved per surface.
  4954. *)
  4955. DDERR_DCALREADYCREATED = HResult(_MAKE_DDHRESULT + 620);
  4956. {$EXTERNALSYM DDERR_DCALREADYCREATED}
  4957. (*
  4958. * An attempt was made to allocate non-local video memory from a device
  4959. * that does not support non-local video memory.
  4960. *)
  4961. DDERR_NONONLOCALVIDMEM = HResult(_MAKE_DDHRESULT + 630);
  4962. {$EXTERNALSYM DDERR_NONONLOCALVIDMEM}
  4963. (*
  4964. * The attempt to page lock a surface failed.
  4965. *)
  4966. DDERR_CANTPAGELOCK = HResult(_MAKE_DDHRESULT + 640);
  4967. {$EXTERNALSYM DDERR_CANTPAGELOCK}
  4968. (*
  4969. * The attempt to page unlock a surface failed.
  4970. *)
  4971. DDERR_CANTPAGEUNLOCK = HResult(_MAKE_DDHRESULT + 660);
  4972. {$EXTERNALSYM DDERR_CANTPAGEUNLOCK}
  4973. (*
  4974. * An attempt was made to page unlock a surface with no outstanding page locks.
  4975. *)
  4976. DDERR_NOTPAGELOCKED = HResult(_MAKE_DDHRESULT + 680);
  4977. {$EXTERNALSYM DDERR_NOTPAGELOCKED}
  4978. (*
  4979. * There is more data available than the specified buffer size could hold
  4980. *)
  4981. DDERR_MOREDATA = HResult(_MAKE_DDHRESULT + 690);
  4982. {$EXTERNALSYM DDERR_MOREDATA}
  4983. (*
  4984. * The data has expired and is therefore no longer valid.
  4985. *)
  4986. DDERR_EXPIRED = HResult(_MAKE_DDHRESULT + 691);
  4987. {$EXTERNALSYM DDERR_EXPIRED}
  4988. (*
  4989. * The mode test has finished executing.
  4990. *)
  4991. DDERR_TESTFINISHED = HResult(_MAKE_DDHRESULT + 692);
  4992. {$EXTERNALSYM DDERR_TESTFINISHED}
  4993. (*
  4994. * The mode test has switched to a new mode.
  4995. *)
  4996. DDERR_NEWMODE = HResult(_MAKE_DDHRESULT + 693);
  4997. {$EXTERNALSYM DDERR_NEWMODE}
  4998. (*
  4999. * D3D has not yet been initialized.
  5000. *)
  5001. DDERR_D3DNOTINITIALIZED = HResult(_MAKE_DDHRESULT + 694);
  5002. {$EXTERNALSYM DDERR_D3DNOTINITIALIZED}
  5003. (*
  5004. * The video port is not active
  5005. *)
  5006. DDERR_VIDEONOTACTIVE = HResult(_MAKE_DDHRESULT + 695);
  5007. {$EXTERNALSYM DDERR_VIDEONOTACTIVE}
  5008. (*
  5009. * The monitor does not have EDID data.
  5010. *)
  5011. DDERR_NOMONITORINFORMATION = HResult(_MAKE_DDHRESULT + 696);
  5012. {$EXTERNALSYM DDERR_NOMONITORINFORMATION}
  5013. (*
  5014. * The driver does not enumerate display mode refresh rates.
  5015. *)
  5016. DDERR_NODRIVERSUPPORT = HResult(_MAKE_DDHRESULT + 697);
  5017. {$EXTERNALSYM DDERR_NODRIVERSUPPORT}
  5018. (*
  5019. * Surfaces created by one direct draw device cannot be used directly by
  5020. * another direct draw device.
  5021. *)
  5022. DDERR_DEVICEDOESNTOWNSURFACE = HResult(_MAKE_DDHRESULT + 699);
  5023. {$EXTERNALSYM DDERR_DEVICEDOESNTOWNSURFACE}
  5024. (*
  5025. * An attempt was made to invoke an interface member of a DirectDraw object
  5026. * created by CoCreateInstance() before it was initialized.
  5027. *)
  5028. DDERR_NOTINITIALIZED = CO_E_NOTINITIALIZED;
  5029. {$EXTERNALSYM DDERR_NOTINITIALIZED}
  5030. (* Alpha bit depth constants *)
  5031. (*
  5032. * API's
  5033. *)
  5034. const
  5035. DirectDrawDll = 'ddraw.dll';
  5036. type
  5037. HMonitor = THandle;
  5038. {$EXTERNALSYM HMonitor}
  5039. TDDEnumCallbackA = function (lpGUID: PGUID; lpDriverDescription: PAnsiChar;
  5040. lpDriverName: PAnsiChar; lpContext: Pointer): BOOL; stdcall;
  5041. {$EXTERNALSYM TDDEnumCallbackA}
  5042. TDDEnumCallbackW = function (lpGUID: PGUID; lpDriverDescription: PWideChar;
  5043. lpDriverName: PWideChar; lpContext: Pointer): BOOL; stdcall;
  5044. {$EXTERNALSYM TDDEnumCallbackW}
  5045. TDDEnumCallback = function (lpGUID: PGUID; lpDriverDescription: PChar;
  5046. lpDriverName: PChar; lpContext: Pointer): BOOL; stdcall;
  5047. {$EXTERNALSYM TDDEnumCallback}
  5048. TDDEnumCallbackExA = function (lpGUID: PGUID; lpDriverDescription: PAnsiChar;
  5049. lpDriverName: PAnsiChar; lpContext: Pointer; Monitor: HMonitor): BOOL;
  5050. stdcall;
  5051. {$EXTERNALSYM TDDEnumCallbackExA}
  5052. TDDEnumCallbackExW = function (lpGUID: PGUID; lpDriverDescription: PWideChar;
  5053. lpDriverName: PWideChar; lpContext: Pointer; Monitor: HMonitor): BOOL;
  5054. stdcall;
  5055. {$EXTERNALSYM TDDEnumCallbackExW}
  5056. TDDEnumCallbackEx = function (lpGUID: PGUID; lpDriverDescription: PChar;
  5057. lpDriverName: PChar; lpContext: Pointer; Monitor: HMonitor): BOOL;
  5058. stdcall;
  5059. {$EXTERNALSYM TDDEnumCallbackEx}
  5060. function DirectDrawLoaded: Boolean;
  5061. function UnLoadDirectDraw: Boolean;
  5062. function LoadDirectDraw: Boolean;
  5063. {$IFDEF DIRECTDRAW_DYNAMIC_LINK}
  5064. var
  5065. DirectDrawEnumerateA : function (lpCallback: TDDEnumCallbackA;
  5066. lpContext: Pointer): HResult; stdcall;
  5067. {$EXTERNALSYM DirectDrawEnumerateA}
  5068. DirectDrawEnumerateW : function (lpCallback: TDDEnumCallbackW;
  5069. lpContext: Pointer): HResult; stdcall;
  5070. {$EXTERNALSYM DirectDrawEnumerateW}
  5071. DirectDrawEnumerate : function (lpCallback: TDDEnumCallback;
  5072. lpContext: Pointer): HResult; stdcall;
  5073. {$EXTERNALSYM DirectDrawEnumerate}
  5074. DirectDrawEnumerateExA : function (lpCallback: TDDEnumCallbackExA;
  5075. lpContext: Pointer; dwFlags: DWORD): HResult; stdcall;
  5076. {$EXTERNALSYM DirectDrawEnumerateExA}
  5077. DirectDrawEnumerateExW : function (lpCallback: TDDEnumCallbackExW;
  5078. lpContext: Pointer; dwFlags: DWORD): HResult; stdcall;
  5079. {$EXTERNALSYM DirectDrawEnumerateExW}
  5080. DirectDrawEnumerateEx : function (lpCallback: TDDEnumCallbackEx;
  5081. lpContext: Pointer; dwFlags: DWORD): HResult; stdcall;
  5082. {$EXTERNALSYM DirectDrawEnumerateEx}
  5083. DirectDrawCreate : function (lpGUID: PGUID;
  5084. out lplpDD: IDirectDraw;
  5085. pUnkOuter: IUnknown): HResult; stdcall;
  5086. {$EXTERNALSYM DirectDrawCreate}
  5087. DirectDrawCreateEx : function (lpGUID: PGUID;
  5088. out lplpDD: IDirectDraw7; const iid: TGUID;
  5089. pUnkOuter: IUnknown): HResult; stdcall;
  5090. {$EXTERNALSYM DirectDrawCreateEx}
  5091. DirectDrawCreateClipper : function (dwFlags: DWORD;
  5092. out lplpDDClipper: IDirectDrawClipper;
  5093. pUnkOuter: IUnknown): HResult; stdcall;
  5094. {$EXTERNALSYM DirectDrawCreateClipper}
  5095. {$ELSE}
  5096. function DirectDrawEnumerateA(lpCallback: TDDEnumCallbackA; lpContext: Pointer): HResult; stdcall; external DirectDrawDll;
  5097. {$EXTERNALSYM DirectDrawEnumerateA}
  5098. function DirectDrawEnumerateW(lpCallback: TDDEnumCallbackW; lpContext: Pointer): HResult; stdcall; external DirectDrawDll;
  5099. {$EXTERNALSYM DirectDrawEnumerateW}
  5100. function DirectDrawEnumerate(lpCallback: TDDEnumCallback; lpContext: Pointer): HResult; stdcall;
  5101. external DirectDrawDll name {$IFDEF UNICODE}'DirectDrawEnumerateW'{$ELSE}'DirectDrawEnumerateA'{$ENDIF};
  5102. {$EXTERNALSYM DirectDrawEnumerate}
  5103. function DirectDrawEnumerateExA(lpCallback: TDDEnumCallbackExA; lpContext: Pointer; dwFlags: DWORD): HResult; stdcall; external DirectDrawDll;
  5104. {$EXTERNALSYM DirectDrawEnumerateExA}
  5105. function DirectDrawEnumerateExW(lpCallback: TDDEnumCallbackExW; lpContext: Pointer; dwFlags: DWORD): HResult; stdcall; external DirectDrawDll;
  5106. {$EXTERNALSYM DirectDrawEnumerateExW}
  5107. function DirectDrawEnumerateEx(lpCallback: TDDEnumCallbackEx; lpContext: Pointer; dwFlags: DWORD): HResult; stdcall;
  5108. external DirectDrawDll name {$IFDEF UNICODE}'DirectDrawEnumerateExW'{$ELSE}'DirectDrawEnumerateExA'{$ENDIF};
  5109. {$EXTERNALSYM DirectDrawEnumerateEx}
  5110. function DirectDrawCreate(lpGUID: PGUID; out lplpDD: IDirectDraw;
  5111. pUnkOuter: IUnknown): HResult; stdcall; external DirectDrawDll;
  5112. {$EXTERNALSYM DirectDrawCreate}
  5113. function DirectDrawCreateEx(lpGUID: PGUID; out lplpDD: IDirectDraw7;
  5114. const iid: TGUID; pUnkOuter: IUnknown): HResult; stdcall; external DirectDrawDll;
  5115. {$EXTERNALSYM DirectDrawCreateEx}
  5116. function DirectDrawCreateClipper(dwFlags: DWORD; out lplpDDClipper: IDirectDrawClipper;
  5117. pUnkOuter: IUnknown): HResult; stdcall; external DirectDrawDll;
  5118. {$EXTERNALSYM DirectDrawCreateClipper}
  5119. {$ENDIF}
  5120. const
  5121. (*
  5122. * Flags for DirectDrawEnumerateEx
  5123. * DirectDrawEnumerateEx supercedes DirectDrawEnumerate. You must use GetProcAddress to
  5124. * obtain a function pointer (of type LPDIRECTDRAWENUMERATEEX) to DirectDrawEnumerateEx.
  5125. * By default, only the primary display device is enumerated.
  5126. * DirectDrawEnumerate is equivalent to DirectDrawEnumerate(,,DDENUM_NONDISPLAYDEVICES)
  5127. *)
  5128. (*
  5129. * This flag causes enumeration of any GDI display devices which are part of
  5130. * the Windows Desktop
  5131. *)
  5132. DDENUM_ATTACHEDSECONDARYDEVICES = $00000001;
  5133. {$EXTERNALSYM DDENUM_ATTACHEDSECONDARYDEVICES}
  5134. (*
  5135. * This flag causes enumeration of any GDI display devices which are not
  5136. * part of the Windows Desktop
  5137. *)
  5138. DDENUM_DETACHEDSECONDARYDEVICES = $00000002;
  5139. {$EXTERNALSYM DDENUM_DETACHEDSECONDARYDEVICES}
  5140. (*
  5141. * This flag causes enumeration of non-display devices
  5142. *)
  5143. DDENUM_NONDISPLAYDEVICES = $00000004;
  5144. {$EXTERNALSYM DDENUM_NONDISPLAYDEVICES}
  5145. REGSTR_KEY_DDHW_DESCRIPTION = 'Description';
  5146. {$EXTERNALSYM REGSTR_KEY_DDHW_DESCRIPTION}
  5147. REGSTR_KEY_DDHW_DRIVERNAME = 'DriverName';
  5148. {$EXTERNALSYM REGSTR_KEY_DDHW_DRIVERNAME}
  5149. REGSTR_PATH_DDHW = 'Hardware\DirectDrawDrivers';
  5150. {$EXTERNALSYM REGSTR_PATH_DDHW}
  5151. DDCREATE_HARDWAREONLY = $00000001;
  5152. {$EXTERNALSYM DDCREATE_HARDWAREONLY}
  5153. DDCREATE_EMULATIONONLY = $00000002;
  5154. {$EXTERNALSYM DDCREATE_EMULATIONONLY}
  5155. (*
  5156. * Flags for the IDirectDraw4::GetDeviceIdentifier method
  5157. *)
  5158. (*
  5159. * This flag causes GetDeviceIdentifier to return information about the host (typically 2D) adapter in a system equipped
  5160. * with a stacked secondary 3D adapter. Such an adapter appears to the application as if it were part of the
  5161. * host adapter, but is typically physcially located on a separate card. The stacked secondary's information is
  5162. * returned when GetDeviceIdentifier's dwFlags field is zero, since this most accurately reflects the qualities
  5163. * of the DirectDraw object involved.
  5164. *)
  5165. DDGDI_GETHOSTIDENTIFIER = $00000001;
  5166. {$EXTERNALSYM DDGDI_GETHOSTIDENTIFIER}
  5167. (*
  5168. * Macros for interpretting DDEVICEIDENTIFIER2.dwWHQLLevel
  5169. *)
  5170. function GET_WHQL_YEAR(dwWHQLLevel: DWORD): DWORD;
  5171. {$EXTERNALSYM GET_WHQL_YEAR}
  5172. function GET_WHQL_MONTH(dwWHQLLevel: DWORD): DWORD;
  5173. {$EXTERNALSYM GET_WHQL_MONTH}
  5174. function GET_WHQL_DAY(dwWHQLLevel: DWORD): DWORD;
  5175. {$EXTERNALSYM GET_WHQL_DAY}
  5176. (*==========================================================================;
  5177. *
  5178. * Copyright (C) 1996-1997 Microsoft Corporation. All Rights Reserved.
  5179. *
  5180. * File: dvp.h
  5181. * Content: DirectDrawVideoPort include file
  5182. *
  5183. ***************************************************************************)
  5184. const
  5185. (*
  5186. * GUIDS used by DirectDrawVideoPort objects
  5187. *)
  5188. (*
  5189. IID_IDDVideoPortContainer,
  5190. IID_IDirectDrawVideoPort,
  5191. IID_IDirectDrawVideoPortNotify
  5192. - are defined later in Delphi header
  5193. *)
  5194. DDVPTYPE_E_HREFH_VREFH: TGUID = (D1:$54F39980;D2:$DA60;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
  5195. {$EXTERNALSYM DDVPTYPE_E_HREFH_VREFH}
  5196. DDVPTYPE_E_HREFH_VREFL: TGUID = (D1:$92783220;D2:$DA60;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
  5197. {$EXTERNALSYM DDVPTYPE_E_HREFH_VREFL}
  5198. DDVPTYPE_E_HREFL_VREFH: TGUID = (D1:$A07A02E0;D2:$DA60;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
  5199. {$EXTERNALSYM DDVPTYPE_E_HREFL_VREFH}
  5200. DDVPTYPE_E_HREFL_VREFL: TGUID = (D1:$E09C77E0;D2:$DA60;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
  5201. {$EXTERNALSYM DDVPTYPE_E_HREFL_VREFL}
  5202. DDVPTYPE_CCIR656: TGUID = (D1:$FCA326A0;D2:$DA60;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
  5203. {$EXTERNALSYM DDVPTYPE_CCIR656}
  5204. DDVPTYPE_BROOKTREE: TGUID = (D1:$1352A560;D2:$DA61;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
  5205. {$EXTERNALSYM DDVPTYPE_BROOKTREE}
  5206. DDVPTYPE_PHILIPS: TGUID = (D1:$332CF160;D2:$DA61;D3:$11CF;D4:($9B,$06,$00,$A0,$C9,$03,$A3,$B8));
  5207. {$EXTERNALSYM DDVPTYPE_PHILIPS}
  5208. (*
  5209. * These definitions are required to allow polymorphic structure members (i.e. those
  5210. * that are referred to both as DWORDs and as pointers) to resolve into a type
  5211. * of correct size to hold the largest of those two types (i.e. pointer) on 64 bit
  5212. * systems. For 32 bit environments, ULONG_PTR resolves to a DWORD.
  5213. *)
  5214. type
  5215. ULONG_PTR = DWORD;
  5216. {$EXTERNALSYM ULONG_PTR}
  5217. (*============================================================================
  5218. *
  5219. * DirectDraw Structures
  5220. *
  5221. * Various structures used to invoke DirectDraw.
  5222. *
  5223. *==========================================================================*)
  5224. type
  5225. (*
  5226. * DDVIDEOPORTCONNECT
  5227. *)
  5228. PDDVideoPortConnect = ^TDDVideoPortConnect;
  5229. _DDVIDEOPORTCONNECT = packed record
  5230. dwSize: DWORD; // size of the TDDVideoPortConnect structure
  5231. dwPortWidth: DWORD; // Width of the video port
  5232. guidTypeID: TGUID; // Description of video port connection
  5233. dwFlags: DWORD; // Connection flags
  5234. dwReserved1: ULONG_PTR; // Reserved, set to zero.
  5235. end;
  5236. {$EXTERNALSYM _DDVIDEOPORTCONNECT}
  5237. DDVIDEOPORTCONNECT = _DDVIDEOPORTCONNECT;
  5238. {$EXTERNALSYM DDVIDEOPORTCONNECT}
  5239. TDDVideoPortConnect = _DDVIDEOPORTCONNECT;
  5240. (*
  5241. * DDVIDEOPORTCAPS
  5242. *)
  5243. PDDVideoPortCaps = ^TDDVideoPortCaps;
  5244. _DDVIDEOPORTCAPS = packed record
  5245. dwSize: DWORD; // size of the TDDVideoPortCaps structure
  5246. dwFlags: DWORD; // indicates which fields contain data
  5247. dwMaxWidth: DWORD; // max width of the video port field
  5248. dwMaxVBIWidth: DWORD; // max width of the VBI data
  5249. dwMaxHeight: DWORD; // max height of the video port field
  5250. dwVideoPortID: DWORD; // Video port ID (0 - (dwMaxVideoPorts -1))
  5251. dwCaps: DWORD; // Video port capabilities
  5252. dwFX: DWORD; // More video port capabilities
  5253. dwNumAutoFlipSurfaces: DWORD; // Number of autoflippable surfaces
  5254. dwAlignVideoPortBoundary: DWORD; // Byte restriction of placement within the surface
  5255. dwAlignVideoPortPrescaleWidth: DWORD; // Byte restriction of width after prescaling
  5256. dwAlignVideoPortCropBoundary: DWORD; // Byte restriction of left cropping
  5257. dwAlignVideoPortCropWidth: DWORD; // Byte restriction of cropping width
  5258. dwPreshrinkXStep: DWORD; // Width can be shrunk in steps of 1/x
  5259. dwPreshrinkYStep: DWORD; // Height can be shrunk in steps of 1/x
  5260. dwNumVBIAutoFlipSurfaces: DWORD; // Number of VBI autoflippable surfaces allowed
  5261. dwNumPreferredAutoflip: DWORD; // Optimal number of autoflippable surfaces for hardware
  5262. wNumFilterTapsX: Word; // Number of taps the prescaler uses in the X direction (0 - no prescale, 1 - replication, etc.)
  5263. wNumFilterTapsY: Word; // Number of taps the prescaler uses in the Y direction (0 - no prescale, 1 - replication, etc.)
  5264. end;
  5265. {$EXTERNALSYM _DDVIDEOPORTCAPS}
  5266. DDVIDEOPORTCAPS = _DDVIDEOPORTCAPS;
  5267. {$EXTERNALSYM DDVIDEOPORTCAPS}
  5268. TDDVideoPortCaps = _DDVIDEOPORTCAPS;
  5269. const
  5270. (*
  5271. * The dwMaxWidth and dwMaxVBIWidth members are valid
  5272. *)
  5273. DDVPD_WIDTH = $00000001;
  5274. {$EXTERNALSYM DDVPD_WIDTH}
  5275. (*
  5276. * The dwMaxHeight member is valid
  5277. *)
  5278. DDVPD_HEIGHT = $00000002;
  5279. {$EXTERNALSYM DDVPD_HEIGHT}
  5280. (*
  5281. * The dwVideoPortID member is valid
  5282. *)
  5283. DDVPD_ID = $00000004;
  5284. {$EXTERNALSYM DDVPD_ID}
  5285. (*
  5286. * The dwCaps member is valid
  5287. *)
  5288. DDVPD_CAPS = $00000008;
  5289. {$EXTERNALSYM DDVPD_CAPS}
  5290. (*
  5291. * The dwFX member is valid
  5292. *)
  5293. DDVPD_FX = $00000010;
  5294. {$EXTERNALSYM DDVPD_FX}
  5295. (*
  5296. * The dwNumAutoFlipSurfaces member is valid
  5297. *)
  5298. DDVPD_AUTOFLIP = $00000020;
  5299. {$EXTERNALSYM DDVPD_AUTOFLIP}
  5300. (*
  5301. * All of the alignment members are valid
  5302. *)
  5303. DDVPD_ALIGN = $00000040;
  5304. {$EXTERNALSYM DDVPD_ALIGN}
  5305. (*
  5306. * The dwNumPreferredAutoflip member is valid
  5307. *)
  5308. DDVPD_PREFERREDAUTOFLIP = $00000080;
  5309. {$EXTERNALSYM DDVPD_PREFERREDAUTOFLIP}
  5310. (*
  5311. * The wNumFilterTapsX and wNumFilterTapsY fields are valid
  5312. *)
  5313. DDVPD_FILTERQUALITY = $00000100;
  5314. {$EXTERNALSYM DDVPD_FILTERQUALITY}
  5315. type
  5316. (*
  5317. * DDVIDEOPORTDESC
  5318. *)
  5319. PDDVideoPortDesc = ^TDDVideoPortDesc;
  5320. _DDVIDEOPORTDESC = packed record
  5321. dwSize: DWORD; // size of the TDDVideoPortDesc structure
  5322. dwFieldWidth: DWORD; // width of the video port field
  5323. dwVBIWidth: DWORD; // width of the VBI data
  5324. dwFieldHeight: DWORD; // height of the video port field
  5325. dwMicrosecondsPerField: DWORD; // Microseconds per video field
  5326. dwMaxPixelsPerSecond: DWORD; // Maximum pixel rate per second
  5327. dwVideoPortID: DWORD; // Video port ID (0 - (dwMaxVideoPorts -1))
  5328. dwReserved1: DWORD; // Reserved for future use - set to zero (struct padding)
  5329. VideoPortType: TDDVideoPortConnect; // Description of video port connection
  5330. dwReserved2: DWORD; // Reserved for future use - set to zero
  5331. dwReserved3: DWORD; // Reserved for future use - set to zero
  5332. end;
  5333. {$EXTERNALSYM _DDVIDEOPORTDESC}
  5334. DDVIDEOPORTDESC = _DDVIDEOPORTDESC;
  5335. {$EXTERNALSYM DDVIDEOPORTDESC}
  5336. TDDVideoPortDesc = _DDVIDEOPORTDESC;
  5337. (*
  5338. * DDVIDEOPORTINFO
  5339. *)
  5340. PDDVideoPortInfo = ^TDDVideoPortInfo;
  5341. _DDVIDEOPORTINFO = packed record
  5342. dwSize: DWORD; // Size of the structure
  5343. dwOriginX: DWORD; // Placement of the video data within the surface.
  5344. dwOriginY: DWORD; // Placement of the video data within the surface.
  5345. dwVPFlags: DWORD; // Video port options
  5346. rCrop: TRect; // Cropping rectangle (optional).
  5347. dwPrescaleWidth: DWORD; // Determines pre-scaling/zooming in the X direction (optional).
  5348. dwPrescaleHeight: DWORD; // Determines pre-scaling/zooming in the Y direction (optional).
  5349. lpddpfInputFormat: PDDPixelFormat; // Video format written to the video port
  5350. lpddpfVBIInputFormat: PDDPixelFormat; // Input format of the VBI data
  5351. lpddpfVBIOutputFormat: PDDPixelFormat; // Output format of the data
  5352. dwVBIHeight: DWORD; // Specifies the number of lines of data within the vertical blanking interval.
  5353. dwReserved1: DWORD; // Reserved for future use - set to zero
  5354. dwReserved2: DWORD; // Reserved for future use - set to zero
  5355. end;
  5356. {$EXTERNALSYM _DDVIDEOPORTINFO}
  5357. DDVIDEOPORTINFO = _DDVIDEOPORTINFO;
  5358. {$EXTERNALSYM DDVIDEOPORTINFO}
  5359. TDDVideoPortInfo = _DDVIDEOPORTINFO;
  5360. (*
  5361. * DDVIDEOPORTBANDWIDTH
  5362. *)
  5363. PDDVideoPortBandWidth = ^TDDVideoPortBandWidth;
  5364. _DDVIDEOPORTBANDWIDTH = packed record
  5365. dwSize: DWORD; // Size of the structure
  5366. dwCaps: DWORD;
  5367. dwOverlay: DWORD; // Zoom factor at which overlay is supported
  5368. dwColorkey: DWORD; // Zoom factor at which overlay w/ colorkey is supported
  5369. dwYInterpolate: DWORD; // Zoom factor at which overlay w/ Y interpolation is supported
  5370. dwYInterpAndColorkey: DWORD; // Zoom factor at which ovelray w/ Y interpolation and colorkeying is supported
  5371. dwReserved1: DWORD; // Reserved for future use - set to zero
  5372. dwReserved2: DWORD; // Reserved for future use - set to zero
  5373. end;
  5374. {$EXTERNALSYM _DDVIDEOPORTBANDWIDTH}
  5375. DDVIDEOPORTBANDWIDTH = _DDVIDEOPORTBANDWIDTH;
  5376. {$EXTERNALSYM DDVIDEOPORTBANDWIDTH}
  5377. TDDVideoPortBandWidth = _DDVIDEOPORTBANDWIDTH;
  5378. (*
  5379. * DDVIDEOPORTSTATUS
  5380. *)
  5381. PDDVideoPortStatus = ^TDDVideoPortStatus;
  5382. _DDVIDEOPORTSTATUS = record
  5383. dwSize: DWORD; // Size of the structure
  5384. bInUse: BOOL; // TRUE if video port is currently being used
  5385. dwFlags: DWORD; // Currently not used
  5386. dwReserved1: DWORD; // Reserved for future use
  5387. VideoPortType: TDDVideoPortConnect; // Information about the connection
  5388. dwReserved2: DWORD; // Reserved for future use
  5389. dwReserved3: DWORD; // Reserved for future use
  5390. end;
  5391. {$EXTERNALSYM _DDVIDEOPORTSTATUS}
  5392. DDVIDEOPORTSTATUS = _DDVIDEOPORTSTATUS;
  5393. {$EXTERNALSYM DDVIDEOPORTSTATUS}
  5394. TDDVideoPortStatus = _DDVIDEOPORTSTATUS;
  5395. (*
  5396. * DDVIDEOPORTNOTIFY
  5397. *)
  5398. PDDVideoPortNotify = ^TDDVideoPortNotify;
  5399. _DDVIDEOPORTNOTIFY = packed record
  5400. ApproximateTimeStamp: Int64; // Timestamp in the event notification
  5401. lField: Longint; // 0 if even, 1 if odd, -1 if unknown
  5402. dwSurfaceIndex: Longword; // Index in the surface chain of the surface that received the sample
  5403. lDone: Longint; // Call InterlockedIncrement on this when done with sample
  5404. end;
  5405. {$EXTERNALSYM _DDVIDEOPORTNOTIFY}
  5406. DDVIDEOPORTNOTIFY = _DDVIDEOPORTNOTIFY;
  5407. {$EXTERNALSYM DDVIDEOPORTNOTIFY}
  5408. TDDVideoPortNotify = _DDVIDEOPORTNOTIFY;
  5409. (*============================================================================
  5410. *
  5411. * Video Port Flags
  5412. *
  5413. * All flags are bit flags.
  5414. *
  5415. *==========================================================================*)
  5416. const
  5417. (****************************************************************************
  5418. *
  5419. * VIDEOPORT DDVIDEOPORTCONNECT / TDDVideoPortConnect FLAGS
  5420. *
  5421. ****************************************************************************)
  5422. (*
  5423. * When this is set by the driver and passed to the client, this
  5424. * indicates that the video port is capable of double clocking the data.
  5425. * When this is set by the client, this indicates that the video port
  5426. * should enable double clocking. This flag is only valid with external
  5427. * syncs.
  5428. *)
  5429. DDVPCONNECT_DOUBLECLOCK = $00000001;
  5430. {$EXTERNALSYM DDVPCONNECT_DOUBLECLOCK}
  5431. (*
  5432. * When this is set by the driver and passed to the client, this
  5433. * indicates that the video port is capable of using an external VACT
  5434. * signal. When this is set by the client, this indicates that the
  5435. * video port should use the external VACT signal.
  5436. *)
  5437. DDVPCONNECT_VACT = $00000002;
  5438. {$EXTERNALSYM DDVPCONNECT_VACT}
  5439. (*
  5440. * When this is set by the driver and passed to the client, this
  5441. * indicates that the video port is capable of treating even fields
  5442. * like odd fields and visa versa. When this is set by the client,
  5443. * this indicates that the video port should treat even fields like odd
  5444. * fields.
  5445. *)
  5446. DDVPCONNECT_INVERTPOLARITY = $00000004;
  5447. {$EXTERNALSYM DDVPCONNECT_INVERTPOLARITY}
  5448. (*
  5449. * Indicates that any data written to the video port during the VREF
  5450. * period will not be written into the frame buffer. This flag is read only.
  5451. *)
  5452. DDVPCONNECT_DISCARDSVREFDATA = $00000008;
  5453. {$EXTERNALSYM DDVPCONNECT_DISCARDSVREFDATA}
  5454. (*
  5455. * When this is set be the driver and passed to the client, this
  5456. * indicates that the device will write half lines into the frame buffer
  5457. * if half lines are provided by the decoder. If this is set by the client,
  5458. * this indicates that the decoder will be supplying half lines.
  5459. *)
  5460. DDVPCONNECT_HALFLINE = $00000010;
  5461. {$EXTERNALSYM DDVPCONNECT_HALFLINE}
  5462. (*
  5463. * Indicates that the signal is interlaced. This flag is only
  5464. * set by the client.
  5465. *)
  5466. DDVPCONNECT_INTERLACED = $00000020;
  5467. {$EXTERNALSYM DDVPCONNECT_INTERLACED}
  5468. (*
  5469. * Indicates that video port is shareable and that this video port
  5470. * will use the even fields. This flag is only set by the client.
  5471. *)
  5472. DDVPCONNECT_SHAREEVEN = $00000040;
  5473. {$EXTERNALSYM DDVPCONNECT_SHAREEVEN}
  5474. (*
  5475. * Indicates that video port is shareable and that this video port
  5476. * will use the odd fields. This flag is only set by the client.
  5477. *)
  5478. DDVPCONNECT_SHAREODD = $00000080;
  5479. {$EXTERNALSYM DDVPCONNECT_SHAREODD}
  5480. (****************************************************************************
  5481. *
  5482. * VIDEOPORT DDVIDEOPORTDESC / TDDVideoPortDesc CAPS
  5483. *
  5484. ****************************************************************************)
  5485. (*
  5486. * Flip can be performed automatically to avoid tearing.
  5487. *)
  5488. DDVPCAPS_AUTOFLIP = $00000001;
  5489. {$EXTERNALSYM DDVPCAPS_AUTOFLIP}
  5490. (*
  5491. * Supports interlaced video
  5492. *)
  5493. DDVPCAPS_INTERLACED = $00000002;
  5494. {$EXTERNALSYM DDVPCAPS_INTERLACED}
  5495. (*
  5496. * Supports non-interlaced video
  5497. *)
  5498. DDVPCAPS_NONINTERLACED = $00000004;
  5499. {$EXTERNALSYM DDVPCAPS_NONINTERLACED}
  5500. (*
  5501. * Indicates that the device can return whether the current field
  5502. * of an interlaced signal is even or odd.
  5503. *)
  5504. DDVPCAPS_READBACKFIELD = $00000008;
  5505. {$EXTERNALSYM DDVPCAPS_READBACKFIELD}
  5506. (*
  5507. * Indicates that the device can return the current line of video
  5508. * being written into the frame buffer.
  5509. *)
  5510. DDVPCAPS_READBACKLINE = $00000010;
  5511. {$EXTERNALSYM DDVPCAPS_READBACKLINE}
  5512. (*
  5513. * Allows two gen-locked video streams to share a single video port,
  5514. * where one stream uses the even fields and the other uses the odd
  5515. * fields. Separate parameters (including address, scaling,
  5516. * cropping, etc.) are maintained for both fields.)
  5517. *)
  5518. DDVPCAPS_SHAREABLE = $00000020;
  5519. {$EXTERNALSYM DDVPCAPS_SHAREABLE}
  5520. (*
  5521. * Even fields of video can be automatically discarded.
  5522. *)
  5523. DDVPCAPS_SKIPEVENFIELDS = $00000040;
  5524. {$EXTERNALSYM DDVPCAPS_SKIPEVENFIELDS}
  5525. (*
  5526. * Odd fields of video can be automatically discarded.
  5527. *)
  5528. DDVPCAPS_SKIPODDFIELDS = $00000080;
  5529. {$EXTERNALSYM DDVPCAPS_SKIPODDFIELDS}
  5530. (*
  5531. * Indicates that the device is capable of driving the graphics
  5532. * VSYNC with the video port VSYNC.
  5533. *)
  5534. DDVPCAPS_SYNCMASTER = $00000100;
  5535. {$EXTERNALSYM DDVPCAPS_SYNCMASTER}
  5536. (*
  5537. * Indicates that data within the vertical blanking interval can
  5538. * be written to a different surface.
  5539. *)
  5540. DDVPCAPS_VBISURFACE = $00000200;
  5541. {$EXTERNALSYM DDVPCAPS_VBISURFACE}
  5542. (*
  5543. * Indicates that the video port can perform color operations
  5544. * on the incoming data before it is written to the frame buffer.
  5545. *)
  5546. DDVPCAPS_COLORCONTROL = $00000400;
  5547. {$EXTERNALSYM DDVPCAPS_COLORCONTROL}
  5548. (*
  5549. * Indicates that the video port can accept VBI data in a different
  5550. * width or format than the regular video data.
  5551. *)
  5552. DDVPCAPS_OVERSAMPLEDVBI = $00000800;
  5553. {$EXTERNALSYM DDVPCAPS_OVERSAMPLEDVBI}
  5554. (*
  5555. * Indicates that the video port can write data directly to system memory
  5556. *)
  5557. DDVPCAPS_SYSTEMMEMORY = $00001000;
  5558. {$EXTERNALSYM DDVPCAPS_SYSTEMMEMORY}
  5559. (*
  5560. * Indicates that the VBI and video portions of the video stream can
  5561. * be controlled by an independent processes.
  5562. *)
  5563. DDVPCAPS_VBIANDVIDEOINDEPENDENT = $00002000;
  5564. {$EXTERNALSYM DDVPCAPS_VBIANDVIDEOINDEPENDENT}
  5565. (*
  5566. * Indicates that the video port contains high quality hardware
  5567. * de-interlacing hardware that should be used instead of the
  5568. * bob/weave algorithms.
  5569. *)
  5570. DDVPCAPS_HARDWAREDEINTERLACE = $00004000;
  5571. {$EXTERNALSYM DDVPCAPS_HARDWAREDEINTERLACE}
  5572. (****************************************************************************
  5573. *
  5574. * VIDEOPORT DDVIDEOPORTDESC / TDDVideoPortDesc FX
  5575. *
  5576. ****************************************************************************)
  5577. (*
  5578. * Limited cropping is available to crop out the vertical interval data.
  5579. *)
  5580. DDVPFX_CROPTOPDATA = $00000001;
  5581. {$EXTERNALSYM DDVPFX_CROPTOPDATA}
  5582. (*
  5583. * Incoming data can be cropped in the X direction before it is written
  5584. * to the surface.
  5585. *)
  5586. DDVPFX_CROPX = $00000002;
  5587. {$EXTERNALSYM DDVPFX_CROPX}
  5588. (*
  5589. * Incoming data can be cropped in the Y direction before it is written
  5590. * to the surface.
  5591. *)
  5592. DDVPFX_CROPY = $00000004;
  5593. {$EXTERNALSYM DDVPFX_CROPY}
  5594. (*
  5595. * Supports interleaving interlaced fields in memory.
  5596. *)
  5597. DDVPFX_INTERLEAVE = $00000008;
  5598. {$EXTERNALSYM DDVPFX_INTERLEAVE}
  5599. (*
  5600. * Supports mirroring left to right as the video data is written
  5601. * into the frame buffer.
  5602. *)
  5603. DDVPFX_MIRRORLEFTRIGHT = $00000010;
  5604. {$EXTERNALSYM DDVPFX_MIRRORLEFTRIGHT}
  5605. (*
  5606. * Supports mirroring top to bottom as the video data is written
  5607. * into the frame buffer.
  5608. *)
  5609. DDVPFX_MIRRORUPDOWN = $00000020;
  5610. {$EXTERNALSYM DDVPFX_MIRRORUPDOWN}
  5611. (*
  5612. * Data can be arbitrarily shrunk in the X direction before it
  5613. * is written to the surface.
  5614. *)
  5615. DDVPFX_PRESHRINKX = $00000040;
  5616. {$EXTERNALSYM DDVPFX_PRESHRINKX}
  5617. (*
  5618. * Data can be arbitrarily shrunk in the Y direction before it
  5619. * is written to the surface.
  5620. *)
  5621. DDVPFX_PRESHRINKY = $00000080;
  5622. {$EXTERNALSYM DDVPFX_PRESHRINKY}
  5623. (*
  5624. * Data can be binary shrunk (1/2, 1/4, 1/8, etc.) in the X
  5625. * direction before it is written to the surface.
  5626. *)
  5627. DDVPFX_PRESHRINKXB = $00000100;
  5628. {$EXTERNALSYM DDVPFX_PRESHRINKXB}
  5629. (*
  5630. * Data can be binary shrunk (1/2, 1/4, 1/8, etc.) in the Y
  5631. * direction before it is written to the surface.
  5632. *)
  5633. DDVPFX_PRESHRINKYB = $00000200;
  5634. {$EXTERNALSYM DDVPFX_PRESHRINKYB}
  5635. (*
  5636. * Data can be shrunk in increments of 1/x in the X direction
  5637. * (where X is specified in the TDDVideoPortCaps.dwPreshrinkXStep)
  5638. * before it is written to the surface.
  5639. *)
  5640. DDVPFX_PRESHRINKXS = $00000400;
  5641. {$EXTERNALSYM DDVPFX_PRESHRINKXS}
  5642. (*
  5643. * Data can be shrunk in increments of 1/x in the Y direction
  5644. * (where X is specified in the TDDVideoPortCaps.dwPreshrinkYStep)
  5645. * before it is written to the surface.
  5646. *)
  5647. DDVPFX_PRESHRINKYS = $00000800;
  5648. {$EXTERNALSYM DDVPFX_PRESHRINKYS}
  5649. (*
  5650. * Data can be arbitrarily stretched in the X direction before
  5651. * it is written to the surface.
  5652. *)
  5653. DDVPFX_PRESTRETCHX = $00001000;
  5654. {$EXTERNALSYM DDVPFX_PRESTRETCHX}
  5655. (*
  5656. * Data can be arbitrarily stretched in the Y direction before
  5657. * it is written to the surface.
  5658. *)
  5659. DDVPFX_PRESTRETCHY = $00002000;
  5660. {$EXTERNALSYM DDVPFX_PRESTRETCHY}
  5661. (*
  5662. * Data can be integer stretched in the X direction before it is
  5663. * written to the surface.
  5664. *)
  5665. DDVPFX_PRESTRETCHXN = $00004000;
  5666. {$EXTERNALSYM DDVPFX_PRESTRETCHXN}
  5667. (*
  5668. * Data can be integer stretched in the Y direction before it is
  5669. * written to the surface.
  5670. *)
  5671. DDVPFX_PRESTRETCHYN = $00008000;
  5672. {$EXTERNALSYM DDVPFX_PRESTRETCHYN}
  5673. (*
  5674. * Indicates that data within the vertical blanking interval can
  5675. * be converted independently of the remaining video data.
  5676. *)
  5677. DDVPFX_VBICONVERT = $00010000;
  5678. {$EXTERNALSYM DDVPFX_VBICONVERT}
  5679. (*
  5680. * Indicates that scaling can be disabled for data within the
  5681. * vertical blanking interval.
  5682. *)
  5683. DDVPFX_VBINOSCALE = $00020000;
  5684. {$EXTERNALSYM DDVPFX_VBINOSCALE}
  5685. (*
  5686. * Indicates that the video data can ignore the left and right
  5687. * cropping coordinates when cropping oversampled VBI data.
  5688. *)
  5689. DDVPFX_IGNOREVBIXCROP = $00040000;
  5690. {$EXTERNALSYM DDVPFX_IGNOREVBIXCROP}
  5691. (*
  5692. * Indicates that interleaving can be disabled for data within the
  5693. * vertical blanking interval.
  5694. *)
  5695. DDVPFX_VBINOINTERLEAVE = $00080000;
  5696. {$EXTERNALSYM DDVPFX_VBINOINTERLEAVE}
  5697. (****************************************************************************
  5698. *
  5699. * VIDEOPORT DDVIDEOPORTINFO / TDDVideoPortInfo FLAGS
  5700. *
  5701. ****************************************************************************)
  5702. (*
  5703. * Perform automatic flipping. Auto-flipping is performed between
  5704. * the overlay surface that was attached to the video port using
  5705. * IDirectDrawVideoPort::AttachSurface and the overlay surfaces that
  5706. * are attached to the surface via the IDirectDrawSurface::AttachSurface
  5707. * method. The flip order is the order in which the overlay surfaces
  5708. * were. attached.
  5709. *)
  5710. DDVP_AUTOFLIP = $00000001;
  5711. {$EXTERNALSYM DDVP_AUTOFLIP}
  5712. (*
  5713. * Perform conversion using the ddpfOutputFormat information.
  5714. *)
  5715. DDVP_CONVERT = $00000002;
  5716. {$EXTERNALSYM DDVP_CONVERT}
  5717. (*
  5718. * Perform cropping using the specified rectangle.
  5719. *)
  5720. DDVP_CROP = $00000004;
  5721. {$EXTERNALSYM DDVP_CROP}
  5722. (*
  5723. * Indicates that interlaced fields should be interleaved in memory.
  5724. *)
  5725. DDVP_INTERLEAVE = $00000008;
  5726. {$EXTERNALSYM DDVP_INTERLEAVE}
  5727. (*
  5728. * Indicates that the data should be mirrored left to right as it's
  5729. * written into the frame buffer.
  5730. *)
  5731. DDVP_MIRRORLEFTRIGHT = $00000010;
  5732. {$EXTERNALSYM DDVP_MIRRORLEFTRIGHT}
  5733. (*
  5734. * Indicates that the data should be mirrored top to bottom as it's
  5735. * written into the frame buffer.
  5736. *)
  5737. DDVP_MIRRORUPDOWN = $00000020;
  5738. {$EXTERNALSYM DDVP_MIRRORUPDOWN}
  5739. (*
  5740. * Perform pre-scaling/zooming based on the pre-scale parameters.
  5741. *)
  5742. DDVP_PRESCALE = $00000040;
  5743. {$EXTERNALSYM DDVP_PRESCALE}
  5744. (*
  5745. * Ignore input of even fields.
  5746. *)
  5747. DDVP_SKIPEVENFIELDS = $00000080;
  5748. {$EXTERNALSYM DDVP_SKIPEVENFIELDS}
  5749. (*
  5750. * Ignore input of odd fields.
  5751. *)
  5752. DDVP_SKIPODDFIELDS = $00000100;
  5753. {$EXTERNALSYM DDVP_SKIPODDFIELDS}
  5754. (*
  5755. * Drive the graphics VSYNCs using the video port VYSNCs.
  5756. *)
  5757. DDVP_SYNCMASTER = $00000200;
  5758. {$EXTERNALSYM DDVP_SYNCMASTER}
  5759. (*
  5760. * The ddpfVBIOutputFormatFormat member contains data that should be used
  5761. * to convert the data within the vertical blanking interval.
  5762. *)
  5763. DDVP_VBICONVERT = $00000400;
  5764. {$EXTERNALSYM DDVP_VBICONVERT}
  5765. (*
  5766. * Indicates that data within the vertical blanking interval
  5767. * should not be scaled.
  5768. *)
  5769. DDVP_VBINOSCALE = $00000800;
  5770. {$EXTERNALSYM DDVP_VBINOSCALE}
  5771. (*
  5772. * Indicates that these bob/weave decisions should not be
  5773. * overriden by other interfaces.
  5774. *)
  5775. DDVP_OVERRIDEBOBWEAVE = $00001000;
  5776. {$EXTERNALSYM DDVP_OVERRIDEBOBWEAVE}
  5777. (*
  5778. * Indicates that the video data should ignore the left and right
  5779. * cropping coordinates when cropping the VBI data.
  5780. *)
  5781. DDVP_IGNOREVBIXCROP = $00002000;
  5782. {$EXTERNALSYM DDVP_IGNOREVBIXCROP}
  5783. (*
  5784. * Indicates that interleaving can be disabled for data within the
  5785. * vertical blanking interval.
  5786. *)
  5787. DDVP_VBINOINTERLEAVE = $00004000;
  5788. {$EXTERNALSYM DDVP_VBINOINTERLEAVE}
  5789. (*
  5790. * Indicates that the video port should use the hardware
  5791. * de-interlacing hardware.
  5792. *)
  5793. DDVP_HARDWAREDEINTERLACE = $00008000;
  5794. {$EXTERNALSYM DDVP_HARDWAREDEINTERLACE}
  5795. (****************************************************************************
  5796. *
  5797. * DIRIRECTDRAWVIDEOPORT GETINPUTFORMAT/GETOUTPUTFORMAT FLAGS
  5798. *
  5799. ****************************************************************************)
  5800. (*
  5801. * Return formats for the video data
  5802. *)
  5803. DDVPFORMAT_VIDEO = $00000001;
  5804. {$EXTERNALSYM DDVPFORMAT_VIDEO}
  5805. (*
  5806. * Return formats for the VBI data
  5807. *)
  5808. DDVPFORMAT_VBI = $00000002;
  5809. {$EXTERNALSYM DDVPFORMAT_VBI}
  5810. (****************************************************************************
  5811. *
  5812. * DIRIRECTDRAWVIDEOPORT SETTARGETSURFACE FLAGS
  5813. *
  5814. ****************************************************************************)
  5815. (*
  5816. * Surface should receive video data (and VBI data if a surface
  5817. * is not explicitly attached for that purpose)
  5818. *)
  5819. DDVPTARGET_VIDEO = $00000001;
  5820. {$EXTERNALSYM DDVPTARGET_VIDEO}
  5821. (*
  5822. * Surface should receive VBI data
  5823. *)
  5824. DDVPTARGET_VBI = $00000002;
  5825. {$EXTERNALSYM DDVPTARGET_VBI}
  5826. (****************************************************************************
  5827. *
  5828. * DIRIRECTDRAWVIDEOPORT WAITFORSYNC FLAGS
  5829. *
  5830. ****************************************************************************)
  5831. (*
  5832. * Waits until the beginning of the next VSYNC
  5833. *)
  5834. DDVPWAIT_BEGIN = $00000001;
  5835. {$EXTERNALSYM DDVPWAIT_BEGIN}
  5836. (*
  5837. * Waits until the end of the next/current VSYNC
  5838. *)
  5839. DDVPWAIT_END = $00000002;
  5840. {$EXTERNALSYM DDVPWAIT_END}
  5841. (*
  5842. * Waits until the beginning of the specified line
  5843. *)
  5844. DDVPWAIT_LINE = $00000003;
  5845. {$EXTERNALSYM DDVPWAIT_LINE}
  5846. (****************************************************************************
  5847. *
  5848. * DIRECTDRAWVIDEOPORT FLIP FLAGS
  5849. *
  5850. ****************************************************************************)
  5851. (*
  5852. * Flips the normal video surface
  5853. *)
  5854. DDVPFLIP_VIDEO = $00000001;
  5855. {$EXTERNALSYM DDVPFLIP_VIDEO}
  5856. (*
  5857. * Flips the VBI surface
  5858. *)
  5859. DDVPFLIP_VBI = $00000002;
  5860. {$EXTERNALSYM DDVPFLIP_VBI}
  5861. (****************************************************************************
  5862. *
  5863. * DIRIRECTDRAWVIDEOPORT GETVIDEOSIGNALSTATUS VALUES
  5864. *
  5865. ****************************************************************************)
  5866. (*
  5867. * No video signal is present at the video port
  5868. *)
  5869. DDVPSQ_NOSIGNAL = $00000001;
  5870. {$EXTERNALSYM DDVPSQ_NOSIGNAL}
  5871. (*
  5872. * A valid video signal is present at the video port
  5873. *)
  5874. DDVPSQ_SIGNALOK = $00000002;
  5875. {$EXTERNALSYM DDVPSQ_SIGNALOK}
  5876. (****************************************************************************
  5877. *
  5878. * VIDEOPORTBANDWIDTH Flags
  5879. *
  5880. ****************************************************************************)
  5881. (*
  5882. * The specified height/width refer to the size of the video port data
  5883. * written into memory, after prescaling has occured.
  5884. *)
  5885. DDVPB_VIDEOPORT = $00000001;
  5886. {$EXTERNALSYM DDVPB_VIDEOPORT}
  5887. (*
  5888. * The specified height/width refer to the source size of the overlay.
  5889. *)
  5890. DDVPB_OVERLAY = $00000002;
  5891. {$EXTERNALSYM DDVPB_OVERLAY}
  5892. (*
  5893. * This is a query for the device to return which caps this device requires.
  5894. *)
  5895. DDVPB_TYPE = $00000004;
  5896. {$EXTERNALSYM DDVPB_TYPE}
  5897. (****************************************************************************
  5898. *
  5899. * VIDEOPORTBANDWIDTH Caps
  5900. *
  5901. ****************************************************************************)
  5902. (*
  5903. * The bandwidth for this device is dependant on the overlay source size.
  5904. *)
  5905. DDVPBCAPS_SOURCE = $00000001;
  5906. {$EXTERNALSYM DDVPBCAPS_SOURCE}
  5907. (*
  5908. * The bandwidth for this device is dependant on the overlay destination
  5909. * size.
  5910. *)
  5911. DDVPBCAPS_DESTINATION = $00000002;
  5912. {$EXTERNALSYM DDVPBCAPS_DESTINATION}
  5913. (****************************************************************************
  5914. *
  5915. * DDVIDEOPORTCONTAINER CreateVideoPort flags
  5916. *
  5917. ****************************************************************************)
  5918. (*
  5919. * The process only wants to control the VBI portion of the video stream.
  5920. *)
  5921. DDVPCREATE_VBIONLY = $00000001;
  5922. {$EXTERNALSYM DDVPCREATE_VBIONLY}
  5923. (*
  5924. * The process only wants to control the non-VBI (video) portion of
  5925. * the video stream.
  5926. *)
  5927. DDVPCREATE_VIDEOONLY = $00000002;
  5928. {$EXTERNALSYM DDVPCREATE_VIDEOONLY}
  5929. (****************************************************************************
  5930. *
  5931. * DDVIDEOPORTSTATUS flags
  5932. *
  5933. ****************************************************************************)
  5934. (*
  5935. * The video port interface is only controlling the VBI portion of the
  5936. * video stream
  5937. *)
  5938. DDVPSTATUS_VBIONLY = $00000001;
  5939. {$EXTERNALSYM DDVPSTATUS_VBIONLY}
  5940. (*
  5941. * The video port interface is only controlling the video portion of the
  5942. * video stream
  5943. *)
  5944. DDVPSTATUS_VIDEOONLY = $00000002;
  5945. {$EXTERNALSYM DDVPSTATUS_VIDEOONLY}
  5946. type
  5947. (*
  5948. * API's
  5949. *)
  5950. TDDEnumVideoCallback = function (lpTDDVideoPortCaps: PDDVideoPortCaps;
  5951. lpContext: Pointer): HResult; stdcall;
  5952. {$EXTERNALSYM TDDEnumVideoCallback}
  5953. (*
  5954. * INTERACES FOLLOW:
  5955. * IDirectDrawVideoPort
  5956. * IVideoPort
  5957. *)
  5958. IDirectDrawVideoPort = interface;
  5959. {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectDrawVideoPort);'}
  5960. {$EXTERNALSYM IDirectDrawVideoPort}
  5961. (*
  5962. * IDirectDrawVideoPortContainer
  5963. *)
  5964. {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDDVideoPortContainer);'}
  5965. {$EXTERNALSYM IDDVideoPortContainer}
  5966. IDDVideoPortContainer = interface(IUnknown)
  5967. ['{6C142760-A733-11CE-A521-0020AF0BE560}']
  5968. (*** IDDVideoPortContainer methods ***)
  5969. function CreateVideoPort(dwFlags: DWORD; var lpTDDVideoPortDesc:
  5970. TDDVideoPortDesc; var lplpDDVideoPort: IDirectDrawVideoPort;
  5971. pUnkOuter: IUnknown): HResult; stdcall;
  5972. function EnumVideoPorts(dwFlags: DWORD;
  5973. lpTDDVideoPortCaps: PDDVideoPortCaps; lpContext: Pointer;
  5974. lpEnumVideoCallback: TDDEnumVideoCallback): HResult; stdcall;
  5975. function GetVideoPortConnectInfo(dwPortId: DWORD; var lpNumEntries: DWORD;
  5976. lpConnectInfo: PDDVideoPortConnect): HResult; stdcall;
  5977. function QueryVideoPortStatus(dwPortId: DWORD;
  5978. var lpVPStatus: TDDVideoPortStatus): HResult; stdcall;
  5979. end;
  5980. (*
  5981. * IDirectDrawVideoPort
  5982. *)
  5983. IDirectDrawVideoPort = interface(IUnknown)
  5984. ['{B36D93E0-2B43-11CF-A2DE-00AA00B93356}']
  5985. (*** IDirectDrawVideoPort methods ***)
  5986. function Flip(lpDDSurface: IDirectDrawSurface; dwFlags: DWORD): HResult; stdcall;
  5987. function GetBandwidthInfo(var lpddpfFormat: TDDPixelFormat;
  5988. dwWidth: DWORD; dwHeight: DWORD; dwFlags: DWORD;
  5989. var lpBandwidth: TDDVideoPortBandWidth): HResult; stdcall;
  5990. function GetColorControls(var lpColorControl: TDDColorControl): HResult; stdcall;
  5991. function GetInputFormats(var lpNumFormats: DWORD; var lpFormats:
  5992. TDDPixelFormat; dwFlags: DWORD): HResult; stdcall;
  5993. function GetOutputFormats(var lpInputFormat: TDDPixelFormat;
  5994. var lpNumFormats: DWORD; lpFormats: PDDPixelFormat; dwFlags: DWORD):
  5995. HResult; stdcall;
  5996. function GetFieldPolarity(var lpbVideoField: BOOL): HResult; stdcall;
  5997. function GetVideoLine(var lpdwLine: DWORD): HResult; stdcall;
  5998. function GetVideoSignalStatus(varlpdwStatus: DWORD): HResult; stdcall;
  5999. function SetColorControls(var lpColorControl: TDDColorControl): HResult; stdcall;
  6000. function SetTargetSurface(lpDDSurface: IDirectDrawSurface; dwFlags: DWORD):
  6001. HResult; stdcall;
  6002. function StartVideo(var lpVideoInfo: TDDVideoPortInfo): HResult; stdcall;
  6003. function StopVideo: HResult; stdcall;
  6004. function UpdateVideo(var lpVideoInfo: TDDVideoPortInfo): HResult; stdcall;
  6005. function WaitForSync(dwFlags: DWORD; dwLine: DWORD; dwTimeout: DWORD):
  6006. HResult; stdcall;
  6007. end;
  6008. IID_IDDVideoPortContainer = IDDVideoPortContainer;
  6009. {$EXTERNALSYM IID_IDDVideoPortContainer}
  6010. IID_IDirectDrawVideoPort = IDirectDrawVideoPort;
  6011. {$EXTERNALSYM IID_IDirectDrawVideoPort}
  6012. (*
  6013. * IDirectDrawVideoPort
  6014. *)
  6015. {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectDrawVideoPortNotify);'}
  6016. {$EXTERNALSYM IDirectDrawVideoPortNotify}
  6017. IDirectDrawVideoPortNotify = interface(IUnknown)
  6018. ['{6C142760-A733-11CE-A521-0020AF0BE560}']
  6019. (*** IVideoPort methods ***)
  6020. function AcquireNotification(hEvent: THandle; const params: TDDVideoPortNotify): HResult; stdcall;
  6021. function ReleaseNotification(hEvent: THandle): HResult; stdcall;
  6022. end;
  6023. var
  6024. DDrawDLL : HMODULE = 0;
  6025. function DDErrorString(Value: HResult): String;
  6026. implementation
  6027. //#define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code )
  6028. function MAKE_DDHRESULT(Code: DWORD): HResult;
  6029. begin
  6030. Result:= MakeResult(1, _FACDD, code);
  6031. end;
  6032. //#define GET_WHQL_YEAR( dwWHQLLevel ) \
  6033. // ( (dwWHQLLevel) / 0x10000 )
  6034. function GET_WHQL_YEAR(dwWHQLLevel: DWORD): DWORD;
  6035. begin
  6036. Result := (dwWHQLLevel) div $10000;
  6037. end;
  6038. //#define GET_WHQL_MONTH( dwWHQLLevel ) \
  6039. // ( ( (dwWHQLLevel) / 0x100 ) & 0x00ff )
  6040. function GET_WHQL_MONTH(dwWHQLLevel: DWORD): DWORD;
  6041. begin
  6042. Result := ((dwWHQLLevel) div $100) and $00ff;
  6043. end;
  6044. //#define GET_WHQL_DAY( dwWHQLLevel ) \
  6045. // ( (dwWHQLLevel) & 0xff )
  6046. function GET_WHQL_DAY(dwWHQLLevel: DWORD): DWORD;
  6047. begin
  6048. Result := (dwWHQLLevel) and $ff;
  6049. end;
  6050. function MAKEFOURCC(ch0, ch1, ch2, ch3: Char): DWORD;
  6051. begin
  6052. Result := DWORD(Byte(ch0) shl 0) or
  6053. DWORD(Byte(ch1) shl 8) or
  6054. DWORD(Byte(ch2) shl 16) or
  6055. DWORD(Byte(ch3) shl 24);
  6056. end;
  6057. function DDErrorString(Value: HResult): String;
  6058. begin
  6059. case Value of
  6060. DD_OK: Result := 'The request completed successfully.';
  6061. DDERR_ALREADYINITIALIZED: Result := 'This object is already initialized.';
  6062. DDERR_BLTFASTCANTCLIP: Result := ' if a clipper object is attached to the source surface passed into a BltFast call.';
  6063. DDERR_CANNOTATTACHSURFACE: Result := 'This surface can not be attached to the requested surface.';
  6064. DDERR_CANNOTDETACHSURFACE: Result := 'This surface can not be detached from the requested surface.';
  6065. DDERR_CANTCREATEDC: Result := 'Windows can not create any more DCs.';
  6066. DDERR_CANTDUPLICATE: Result := 'Cannot duplicate primary & 3D surfaces, or surfaces that are implicitly created.';
  6067. DDERR_CLIPPERISUSINGHWND: Result := 'An attempt was made to set a cliplist for a clipper object that is already monitoring an hwnd.';
  6068. DDERR_COLORKEYNOTSET: Result := 'No src color key specified for this operation.';
  6069. DDERR_CURRENTLYNOTAVAIL: Result := 'Support is currently not available.';
  6070. DDERR_DIRECTDRAWALREADYCREATED: Result := 'A DirectDraw object representing this driver has already been created for this process.';
  6071. DDERR_EXCEPTION: Result := 'An exception was encountered while performing the requested operation.';
  6072. DDERR_EXCLUSIVEMODEALREADYSET: Result := 'An attempt was made to set the cooperative level when it was already set to exclusive.';
  6073. DDERR_GENERIC: Result := 'Generic failure.';
  6074. DDERR_HEIGHTALIGN: Result := 'Height of rectangle provided is not a multiple of reqd alignment.';
  6075. DDERR_HWNDALREADYSET: Result := 'The CooperativeLevel HWND has already been set. It can not be reset while the process has surfaces or palettes created.';
  6076. DDERR_HWNDSUBCLASSED: Result := 'HWND used by DirectDraw CooperativeLevel has been subclassed, this prevents DirectDraw from restoring state.';
  6077. DDERR_IMPLICITLYCREATED: Result := 'This surface can not be restored because it is an implicitly created surface.';
  6078. DDERR_INCOMPATIBLEPRIMARY: Result := 'Unable to match primary surface creation request with existing primary surface.';
  6079. DDERR_INVALIDCAPS: Result := 'One or more of the caps bits passed to the callback are incorrect.';
  6080. DDERR_INVALIDCLIPLIST: Result := 'DirectDraw does not support the provided cliplist.';
  6081. DDERR_INVALIDDIRECTDRAWGUID: Result := 'The GUID passed to DirectDrawCreate is not a valid DirectDraw driver identifier.';
  6082. DDERR_INVALIDMODE: Result := 'DirectDraw does not support the requested mode.';
  6083. DDERR_INVALIDOBJECT: Result := 'DirectDraw received a pointer that was an invalid DIRECTDRAW object.';
  6084. DDERR_INVALIDPARAMS: Result := 'One or more of the parameters passed to the function are incorrect.';
  6085. DDERR_INVALIDPIXELFORMAT: Result := 'The pixel format was invalid as specified.';
  6086. DDERR_INVALIDPOSITION: Result := 'Returned when the position of the overlay on the destination is no longer legal for that destination.';
  6087. DDERR_INVALIDRECT: Result := 'Rectangle provided was invalid.';
  6088. DDERR_LOCKEDSURFACES: Result := 'Operation could not be carried out because one or more surfaces are locked.';
  6089. DDERR_NO3D: Result := 'There is no 3D present.';
  6090. DDERR_NOALPHAHW: Result := 'Operation could not be carried out because there is no alpha accleration hardware present or available.';
  6091. DDERR_NOBLTHW: Result := 'No blitter hardware present.';
  6092. DDERR_NOCLIPLIST: Result := 'No cliplist available.';
  6093. DDERR_NOCLIPPERATTACHED: Result := 'No clipper object attached to surface object.';
  6094. DDERR_NOCOLORCONVHW: Result := 'Operation could not be carried out because there is no color conversion hardware present or available.';
  6095. DDERR_NOCOLORKEY: Result := 'Surface does not currently have a color key';
  6096. DDERR_NOCOLORKEYHW: Result := 'Operation could not be carried out because there is no hardware support of the destination color key.';
  6097. DDERR_NOCOOPERATIVELEVELSET: Result := 'Create function called without DirectDraw object method SetCooperativeLevel being called.';
  6098. DDERR_NODC: Result := 'No DC was ever created for this surface.';
  6099. DDERR_NODDROPSHW: Result := 'No DirectDraw ROP hardware.';
  6100. DDERR_NODIRECTDRAWHW: Result := 'A hardware-only DirectDraw object creation was attempted but the driver did not support any hardware.';
  6101. DDERR_NOEMULATION: Result := 'Software emulation not available.';
  6102. DDERR_NOEXCLUSIVEMODE: Result := 'Operation requires the application to have exclusive mode but the application does not have exclusive mode.';
  6103. DDERR_NOFLIPHW: Result := 'Flipping visible surfaces is not supported.';
  6104. DDERR_NOGDI: Result := 'There is no GDI present.';
  6105. DDERR_NOHWND: Result := 'Clipper notification requires an HWND or no HWND has previously been set as the CooperativeLevel HWND.';
  6106. DDERR_NOMIRRORHW: Result := 'Operation could not be carried out because there is no hardware present or available.';
  6107. DDERR_NOOVERLAYDEST: Result := 'Returned when GetOverlayPosition is called on an overlay that UpdateOverlay has never been called on to establish a destination.';
  6108. DDERR_NOOVERLAYHW: Result := 'Operation could not be carried out because there is no overlay hardware present or available.';
  6109. DDERR_NOPALETTEATTACHED: Result := 'No palette object attached to this surface.';
  6110. DDERR_NOPALETTEHW: Result := 'No hardware support for 16 or 256 color palettes.';
  6111. DDERR_NORASTEROPHW: Result := 'Operation could not be carried out because there is no appropriate raster op hardware present or available.';
  6112. DDERR_NOROTATIONHW: Result := 'Operation could not be carried out because there is no rotation hardware present or available.';
  6113. DDERR_NOSTRETCHHW: Result := 'Operation could not be carried out because there is no hardware support for stretching.';
  6114. DDERR_NOT4BITCOLOR: Result := 'DirectDrawSurface is not in 4 bit color palette and the requested operation requires 4 bit color palette.';
  6115. DDERR_NOT4BITCOLORINDEX: Result := 'DirectDrawSurface is not in 4 bit color index palette and the requested operation requires 4 bit color index palette.';
  6116. DDERR_NOT8BITCOLOR: Result := 'DirectDrawSurface is not in 8 bit color mode and the requested operation requires 8 bit color.';
  6117. DDERR_NOTAOVERLAYSURFACE: Result := 'Returned when an overlay member is called for a non-overlay surface.';
  6118. DDERR_NOTEXTUREHW: Result := 'Operation could not be carried out because there is no texture mapping hardware present or available.';
  6119. DDERR_NOTFLIPPABLE: Result := 'An attempt has been made to flip a surface that is not flippable.';
  6120. DDERR_NOTFOUND: Result := 'Requested item was not found.';
  6121. DDERR_NOTLOCKED: Result := 'Surface was not locked. An attempt to unlock a surface that was not locked at all, or by this process, has been attempted.';
  6122. DDERR_NOTPALETTIZED: Result := 'The surface being used is not a palette-based surface.';
  6123. DDERR_NOVSYNCHW: Result := 'Operation could not be carried out because there is no hardware support for vertical blank synchronized operations.';
  6124. DDERR_NOZBUFFERHW: Result := 'Operation could not be carried out because there is no hardware support for zbuffer blitting.';
  6125. DDERR_NOZOVERLAYHW: Result := 'Overlay surfaces could not be z layered based on their BltOrder because the hardware does not support z layering of overlays.';
  6126. DDERR_OUTOFCAPS: Result := 'The hardware needed for the requested operation has already been allocated.';
  6127. DDERR_OUTOFMEMORY: Result := 'DirectDraw does not have enough memory to perform the operation.';
  6128. DDERR_OUTOFVIDEOMEMORY: Result := 'DirectDraw does not have enough memory to perform the operation.';
  6129. DDERR_OVERLAYCANTCLIP: Result := 'The hardware does not support clipped overlays.';
  6130. DDERR_OVERLAYCOLORKEYONLYONEACTIVE: Result := 'Can only have ony color key active at one time for overlays.';
  6131. DDERR_OVERLAYNOTVISIBLE: Result := 'Returned when GetOverlayPosition is called on a hidden overlay.';
  6132. DDERR_PALETTEBUSY: Result := 'Access to this palette is being refused because the palette is already locked by another thread.';
  6133. DDERR_PRIMARYSURFACEALREADYEXISTS: Result := 'This process already has created a primary surface.';
  6134. DDERR_REGIONTOOSMALL: Result := 'Region passed to Clipper::GetClipList is too small.';
  6135. DDERR_SURFACEALREADYATTACHED: Result := 'This surface is already attached to the surface it is being attached to.';
  6136. DDERR_SURFACEALREADYDEPENDENT: Result := 'This surface is already a dependency of the surface it is being made a dependency of.';
  6137. DDERR_SURFACEBUSY: Result := 'Access to this surface is being refused because the surface is already locked by another thread.';
  6138. DDERR_SURFACEISOBSCURED: Result := 'Access to surface refused because the surface is obscured.';
  6139. DDERR_SURFACELOST: Result := 'Access to this surface is being refused because the surface memory is gone. The DirectDrawSurface object representing this surface should have Restore called on it.';
  6140. DDERR_SURFACENOTATTACHED: Result := 'The requested surface is not attached.';
  6141. DDERR_TOOBIGHEIGHT: Result := 'Height requested by DirectDraw is too large.';
  6142. DDERR_TOOBIGSIZE: Result := 'Size requested by DirectDraw is too large, but the individual height and width are OK.';
  6143. DDERR_TOOBIGWIDTH: Result := 'Width requested by DirectDraw is too large.';
  6144. DDERR_UNSUPPORTED: Result := 'Action not supported.';
  6145. DDERR_UNSUPPORTEDFORMAT: Result := 'FOURCC format requested is unsupported by DirectDraw.';
  6146. DDERR_UNSUPPORTEDMASK: Result := 'Bitmask in the pixel format requested is unsupported by DirectDraw.';
  6147. DDERR_VERTICALBLANKINPROGRESS: Result := 'Vertical blank is in progress.';
  6148. DDERR_WASSTILLDRAWING: Result := 'Informs DirectDraw that the previous Blt which is transfering information to or from this Surface is incomplete.';
  6149. DDERR_WRONGMODE: Result := 'This surface can not be restored because it was created in a different mode.';
  6150. DDERR_XALIGN: Result := 'Rectangle provided was not horizontally aligned on required boundary.';
  6151. // new:
  6152. DDERR_OVERLAPPINGRECTS: Result := 'Operation could not be carried out because the source and destination rectangles are on the same surface and overlap each other.';
  6153. DDERR_INVALIDSTREAM: Result := 'The specified stream contains invalid data';
  6154. DDERR_UNSUPPORTEDMODE: Result := 'The display is currently in an unsupported mode';
  6155. DDERR_NOMIPMAPHW: Result := 'Operation could not be carried out because there is no mip-map texture mapping hardware present or available.';
  6156. DDERR_INVALIDSURFACETYPE: Result := 'The requested action could not be performed because the surface was of the wrong type.';
  6157. DDERR_NOOPTIMIZEHW: Result := 'Device does not support optimized surfaces, therefore no video memory optimized surfaces';
  6158. DDERR_NOTLOADED: Result := 'Surface is an optimized surface, but has not yet been allocated any memory';
  6159. DDERR_NOFOCUSWINDOW: Result := 'Attempt was made to create or set a device window without first setting the focus window';
  6160. DDERR_DCALREADYCREATED: Result := 'A DC has already been returned for this surface. Only one DC can be retrieved per surface.';
  6161. DDERR_NONONLOCALVIDMEM: Result := 'An attempt was made to allocate non-local video memory from a device that does not support non-local video memory.';
  6162. DDERR_CANTPAGELOCK: Result := 'The attempt to page lock a surface failed.';
  6163. DDERR_CANTPAGEUNLOCK: Result := 'The attempt to page unlock a surface failed.';
  6164. DDERR_NOTPAGELOCKED: Result := 'An attempt was made to page unlock a surface with no outstanding page locks.';
  6165. DDERR_MOREDATA: Result := 'There is more data available than the specified buffer size could hold';
  6166. DDERR_EXPIRED: Result := 'The data has expired and is therefore no longer valid.';
  6167. DDERR_VIDEONOTACTIVE: Result := 'The video port is not active';
  6168. DDERR_DEVICEDOESNTOWNSURFACE: Result := 'Surfaces created by one direct draw device cannot be used directly by another direct draw device.';
  6169. DDERR_NOTINITIALIZED: Result := 'An attempt was made to invoke an interface member of a DirectDraw object created by CoCreateInstance() before it was initialized.';
  6170. else Result := 'Unrecognized Error';
  6171. end;
  6172. end;
  6173. {$IFDEF DIRECTDRAW_DYNAMIC_LINK}
  6174. var
  6175. DirectDrawLib: THandle = 0;
  6176. function DirectDrawLoaded: Boolean;
  6177. begin
  6178. Result:= DirectDrawLib <> 0;
  6179. end;
  6180. function UnLoadDirectDraw: Boolean;
  6181. begin
  6182. Result:= True;
  6183. if DirectDrawLoaded then
  6184. begin
  6185. Result:= FreeLibrary(DirectDrawLib);
  6186. DirectDrawEnumerateA := nil;
  6187. DirectDrawEnumerateW := nil;
  6188. DirectDrawEnumerate := nil;
  6189. DirectDrawEnumerateExA := nil;
  6190. DirectDrawEnumerateExW := nil;
  6191. DirectDrawEnumerateEx := nil;
  6192. DirectDrawCreate := nil;
  6193. DirectDrawCreateEx := nil;
  6194. DirectDrawCreateClipper := nil;
  6195. {$IFDEF WINNT}
  6196. NtDirectDrawCreate := nil;
  6197. {$ENDIF}
  6198. DirectDrawLib:= 0;
  6199. end;
  6200. end;
  6201. function LoadDirectDraw: Boolean;
  6202. begin
  6203. Result:= DirectDrawLoaded;
  6204. if (not Result) then
  6205. begin
  6206. DirectDrawLib:= LoadLibrary(DirectDrawDll);
  6207. if DirectDrawLoaded then
  6208. begin
  6209. DirectDrawEnumerateA := GetProcAddress(DirectDrawLib, 'DirectDrawEnumerateA');
  6210. DirectDrawEnumerateW := GetProcAddress(DirectDrawLib, 'DirectDrawEnumerateW');
  6211. {$IFDEF UNICODE}
  6212. DirectDrawEnumerate := GetProcAddress(DirectDrawLib, 'DirectDrawEnumerateW');
  6213. {$ELSE}
  6214. DirectDrawEnumerate := GetProcAddress(DirectDrawLib, 'DirectDrawEnumerateA');
  6215. {$ENDIF}
  6216. DirectDrawEnumerateExA := GetProcAddress(DirectDrawLib, 'DirectDrawEnumerateExA');
  6217. DirectDrawEnumerateExW := GetProcAddress(DirectDrawLib, 'DirectDrawEnumerateExW');
  6218. {$IFDEF UNICODE}
  6219. DirectDrawEnumerateEx := GetProcAddress(DirectDrawLib, 'DirectDrawEnumerateExW');
  6220. {$ELSE}
  6221. DirectDrawEnumerateEx := GetProcAddress(DirectDrawLib, 'DirectDrawEnumerateExA');
  6222. {$ENDIF}
  6223. DirectDrawCreate := GetProcAddress(DDrawDLL,'DirectDrawCreate');
  6224. DirectDrawCreateEx := GetProcAddress(DDrawDLL,'DirectDrawCreateEx');
  6225. DirectDrawCreateClipper := GetProcAddress(DDrawDLL,'DirectDrawCreateClipper');
  6226. {$IFDEF WINNT}
  6227. NtDirectDrawCreate := GetProcAddress(DDrawDLL,'NtDirectDrawCreate');
  6228. {$ENDIF}
  6229. Result:= Assigned(DirectDrawCreate); // At least basic procedure is found!
  6230. if not Result then UnLoadDirectDraw;
  6231. end;
  6232. end;
  6233. end;
  6234. {$ELSE}
  6235. function DirectDrawLoaded: Boolean;
  6236. begin // Stub function for static linking
  6237. Result:= True;
  6238. end;
  6239. function UnLoadDirectDraw: Boolean;
  6240. begin // Stub function for static linking
  6241. Result:= True; // should emulate "normal" behaviour
  6242. end;
  6243. function LoadDirectDraw: Boolean;
  6244. begin // Stub function for static linking
  6245. Result:= True;
  6246. end;
  6247. {$ENDIF}
  6248. {$IFDEF DIRECTDRAW_DYNAMIC_LINK}
  6249. initialization
  6250. {$IFNDEF DIRECTDRAW_DYNAMIC_LINK_EXPLICIT}
  6251. LoadDirectDraw;
  6252. {$ENDIF}
  6253. finalization
  6254. UnLoadDirectDraw;
  6255. {$ENDIF}
  6256. end.