glfw3.pas 195 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302
  1. unit glfw3;
  2. { This unit is automatically generated by Chet:
  3. https://github.com/neslib/Chet }
  4. {$MINENUMSIZE 4}
  5. interface
  6. const
  7. {$IF Defined(WIN64)}
  8. libglfw3 = 'glfw3';
  9. _PU = '';
  10. {$ELSE}
  11. {$MESSAGE Error 'Unsupported platform'}
  12. {$ENDIF}
  13. const
  14. (* APIENTRY __stdcall *)
  15. (* WINGDIAPI __declspec ( dllimport ) *)
  16. (* CALLBACK __stdcall *)
  17. GLFW_VERSION_MAJOR = 3;
  18. GLFW_VERSION_MINOR = 4;
  19. GLFW_VERSION_REVISION = 0;
  20. GLFW_TRUE = 1;
  21. GLFW_FALSE = 0;
  22. GLFW_RELEASE = 0;
  23. GLFW_PRESS = 1;
  24. GLFW_REPEAT = 2;
  25. GLFW_HAT_CENTERED = 0;
  26. GLFW_HAT_UP = 1;
  27. GLFW_HAT_RIGHT = 2;
  28. GLFW_HAT_DOWN = 4;
  29. GLFW_HAT_LEFT = 8;
  30. GLFW_HAT_RIGHT_UP = (GLFW_HAT_RIGHT or GLFW_HAT_UP);
  31. GLFW_HAT_RIGHT_DOWN = (GLFW_HAT_RIGHT or GLFW_HAT_DOWN);
  32. GLFW_HAT_LEFT_UP = (GLFW_HAT_LEFT or GLFW_HAT_UP);
  33. GLFW_HAT_LEFT_DOWN = (GLFW_HAT_LEFT or GLFW_HAT_DOWN);
  34. GLFW_KEY_UNKNOWN = -1;
  35. GLFW_KEY_SPACE = 32;
  36. GLFW_KEY_APOSTROPHE = 39;
  37. GLFW_KEY_COMMA = 44;
  38. GLFW_KEY_MINUS = 45;
  39. GLFW_KEY_PERIOD = 46;
  40. GLFW_KEY_SLASH = 47;
  41. GLFW_KEY_0 = 48;
  42. GLFW_KEY_1 = 49;
  43. GLFW_KEY_2 = 50;
  44. GLFW_KEY_3 = 51;
  45. GLFW_KEY_4 = 52;
  46. GLFW_KEY_5 = 53;
  47. GLFW_KEY_6 = 54;
  48. GLFW_KEY_7 = 55;
  49. GLFW_KEY_8 = 56;
  50. GLFW_KEY_9 = 57;
  51. GLFW_KEY_SEMICOLON = 59;
  52. GLFW_KEY_EQUAL = 61;
  53. GLFW_KEY_A = 65;
  54. GLFW_KEY_B = 66;
  55. GLFW_KEY_C = 67;
  56. GLFW_KEY_D = 68;
  57. GLFW_KEY_E = 69;
  58. GLFW_KEY_F = 70;
  59. GLFW_KEY_G = 71;
  60. GLFW_KEY_H = 72;
  61. GLFW_KEY_I = 73;
  62. GLFW_KEY_J = 74;
  63. GLFW_KEY_K = 75;
  64. GLFW_KEY_L = 76;
  65. GLFW_KEY_M = 77;
  66. GLFW_KEY_N = 78;
  67. GLFW_KEY_O = 79;
  68. GLFW_KEY_P = 80;
  69. GLFW_KEY_Q = 81;
  70. GLFW_KEY_R = 82;
  71. GLFW_KEY_S = 83;
  72. GLFW_KEY_T = 84;
  73. GLFW_KEY_U = 85;
  74. GLFW_KEY_V = 86;
  75. GLFW_KEY_W = 87;
  76. GLFW_KEY_X = 88;
  77. GLFW_KEY_Y = 89;
  78. GLFW_KEY_Z = 90;
  79. GLFW_KEY_LEFT_BRACKET = 91;
  80. GLFW_KEY_BACKSLASH = 92;
  81. GLFW_KEY_RIGHT_BRACKET = 93;
  82. GLFW_KEY_GRAVE_ACCENT = 96;
  83. GLFW_KEY_WORLD_1 = 161;
  84. GLFW_KEY_WORLD_2 = 162;
  85. GLFW_KEY_ESCAPE = 256;
  86. GLFW_KEY_ENTER = 257;
  87. GLFW_KEY_TAB = 258;
  88. GLFW_KEY_BACKSPACE = 259;
  89. GLFW_KEY_INSERT = 260;
  90. GLFW_KEY_DELETE = 261;
  91. GLFW_KEY_RIGHT = 262;
  92. GLFW_KEY_LEFT = 263;
  93. GLFW_KEY_DOWN = 264;
  94. GLFW_KEY_UP = 265;
  95. GLFW_KEY_PAGE_UP = 266;
  96. GLFW_KEY_PAGE_DOWN = 267;
  97. GLFW_KEY_HOME = 268;
  98. GLFW_KEY_END = 269;
  99. GLFW_KEY_CAPS_LOCK = 280;
  100. GLFW_KEY_SCROLL_LOCK = 281;
  101. GLFW_KEY_NUM_LOCK = 282;
  102. GLFW_KEY_PRINT_SCREEN = 283;
  103. GLFW_KEY_PAUSE = 284;
  104. GLFW_KEY_F1 = 290;
  105. GLFW_KEY_F2 = 291;
  106. GLFW_KEY_F3 = 292;
  107. GLFW_KEY_F4 = 293;
  108. GLFW_KEY_F5 = 294;
  109. GLFW_KEY_F6 = 295;
  110. GLFW_KEY_F7 = 296;
  111. GLFW_KEY_F8 = 297;
  112. GLFW_KEY_F9 = 298;
  113. GLFW_KEY_F10 = 299;
  114. GLFW_KEY_F11 = 300;
  115. GLFW_KEY_F12 = 301;
  116. GLFW_KEY_F13 = 302;
  117. GLFW_KEY_F14 = 303;
  118. GLFW_KEY_F15 = 304;
  119. GLFW_KEY_F16 = 305;
  120. GLFW_KEY_F17 = 306;
  121. GLFW_KEY_F18 = 307;
  122. GLFW_KEY_F19 = 308;
  123. GLFW_KEY_F20 = 309;
  124. GLFW_KEY_F21 = 310;
  125. GLFW_KEY_F22 = 311;
  126. GLFW_KEY_F23 = 312;
  127. GLFW_KEY_F24 = 313;
  128. GLFW_KEY_F25 = 314;
  129. GLFW_KEY_KP_0 = 320;
  130. GLFW_KEY_KP_1 = 321;
  131. GLFW_KEY_KP_2 = 322;
  132. GLFW_KEY_KP_3 = 323;
  133. GLFW_KEY_KP_4 = 324;
  134. GLFW_KEY_KP_5 = 325;
  135. GLFW_KEY_KP_6 = 326;
  136. GLFW_KEY_KP_7 = 327;
  137. GLFW_KEY_KP_8 = 328;
  138. GLFW_KEY_KP_9 = 329;
  139. GLFW_KEY_KP_DECIMAL = 330;
  140. GLFW_KEY_KP_DIVIDE = 331;
  141. GLFW_KEY_KP_MULTIPLY = 332;
  142. GLFW_KEY_KP_SUBTRACT = 333;
  143. GLFW_KEY_KP_ADD = 334;
  144. GLFW_KEY_KP_ENTER = 335;
  145. GLFW_KEY_KP_EQUAL = 336;
  146. GLFW_KEY_LEFT_SHIFT = 340;
  147. GLFW_KEY_LEFT_CONTROL = 341;
  148. GLFW_KEY_LEFT_ALT = 342;
  149. GLFW_KEY_LEFT_SUPER = 343;
  150. GLFW_KEY_RIGHT_SHIFT = 344;
  151. GLFW_KEY_RIGHT_CONTROL = 345;
  152. GLFW_KEY_RIGHT_ALT = 346;
  153. GLFW_KEY_RIGHT_SUPER = 347;
  154. GLFW_KEY_MENU = 348;
  155. GLFW_KEY_LAST = GLFW_KEY_MENU;
  156. GLFW_MOD_SHIFT = $0001;
  157. GLFW_MOD_CONTROL = $0002;
  158. GLFW_MOD_ALT = $0004;
  159. GLFW_MOD_SUPER = $0008;
  160. GLFW_MOD_CAPS_LOCK = $0010;
  161. GLFW_MOD_NUM_LOCK = $0020;
  162. GLFW_MOUSE_BUTTON_1 = 0;
  163. GLFW_MOUSE_BUTTON_2 = 1;
  164. GLFW_MOUSE_BUTTON_3 = 2;
  165. GLFW_MOUSE_BUTTON_4 = 3;
  166. GLFW_MOUSE_BUTTON_5 = 4;
  167. GLFW_MOUSE_BUTTON_6 = 5;
  168. GLFW_MOUSE_BUTTON_7 = 6;
  169. GLFW_MOUSE_BUTTON_8 = 7;
  170. GLFW_MOUSE_BUTTON_LAST = GLFW_MOUSE_BUTTON_8;
  171. GLFW_MOUSE_BUTTON_LEFT = GLFW_MOUSE_BUTTON_1;
  172. GLFW_MOUSE_BUTTON_RIGHT = GLFW_MOUSE_BUTTON_2;
  173. GLFW_MOUSE_BUTTON_MIDDLE = GLFW_MOUSE_BUTTON_3;
  174. GLFW_JOYSTICK_1 = 0;
  175. GLFW_JOYSTICK_2 = 1;
  176. GLFW_JOYSTICK_3 = 2;
  177. GLFW_JOYSTICK_4 = 3;
  178. GLFW_JOYSTICK_5 = 4;
  179. GLFW_JOYSTICK_6 = 5;
  180. GLFW_JOYSTICK_7 = 6;
  181. GLFW_JOYSTICK_8 = 7;
  182. GLFW_JOYSTICK_9 = 8;
  183. GLFW_JOYSTICK_10 = 9;
  184. GLFW_JOYSTICK_11 = 10;
  185. GLFW_JOYSTICK_12 = 11;
  186. GLFW_JOYSTICK_13 = 12;
  187. GLFW_JOYSTICK_14 = 13;
  188. GLFW_JOYSTICK_15 = 14;
  189. GLFW_JOYSTICK_16 = 15;
  190. GLFW_JOYSTICK_LAST = GLFW_JOYSTICK_16;
  191. GLFW_GAMEPAD_BUTTON_A = 0;
  192. GLFW_GAMEPAD_BUTTON_B = 1;
  193. GLFW_GAMEPAD_BUTTON_X = 2;
  194. GLFW_GAMEPAD_BUTTON_Y = 3;
  195. GLFW_GAMEPAD_BUTTON_LEFT_BUMPER = 4;
  196. GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER = 5;
  197. GLFW_GAMEPAD_BUTTON_BACK = 6;
  198. GLFW_GAMEPAD_BUTTON_START = 7;
  199. GLFW_GAMEPAD_BUTTON_GUIDE = 8;
  200. GLFW_GAMEPAD_BUTTON_LEFT_THUMB = 9;
  201. GLFW_GAMEPAD_BUTTON_RIGHT_THUMB = 10;
  202. GLFW_GAMEPAD_BUTTON_DPAD_UP = 11;
  203. GLFW_GAMEPAD_BUTTON_DPAD_RIGHT = 12;
  204. GLFW_GAMEPAD_BUTTON_DPAD_DOWN = 13;
  205. GLFW_GAMEPAD_BUTTON_DPAD_LEFT = 14;
  206. GLFW_GAMEPAD_BUTTON_LAST = GLFW_GAMEPAD_BUTTON_DPAD_LEFT;
  207. GLFW_GAMEPAD_BUTTON_CROSS = GLFW_GAMEPAD_BUTTON_A;
  208. GLFW_GAMEPAD_BUTTON_CIRCLE = GLFW_GAMEPAD_BUTTON_B;
  209. GLFW_GAMEPAD_BUTTON_SQUARE = GLFW_GAMEPAD_BUTTON_X;
  210. GLFW_GAMEPAD_BUTTON_TRIANGLE = GLFW_GAMEPAD_BUTTON_Y;
  211. GLFW_GAMEPAD_AXIS_LEFT_X = 0;
  212. GLFW_GAMEPAD_AXIS_LEFT_Y = 1;
  213. GLFW_GAMEPAD_AXIS_RIGHT_X = 2;
  214. GLFW_GAMEPAD_AXIS_RIGHT_Y = 3;
  215. GLFW_GAMEPAD_AXIS_LEFT_TRIGGER = 4;
  216. GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER = 5;
  217. GLFW_GAMEPAD_AXIS_LAST = GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER;
  218. GLFW_NO_ERROR = 0;
  219. GLFW_NOT_INITIALIZED = $00010001;
  220. GLFW_NO_CURRENT_CONTEXT = $00010002;
  221. GLFW_INVALID_ENUM = $00010003;
  222. GLFW_INVALID_VALUE = $00010004;
  223. GLFW_OUT_OF_MEMORY = $00010005;
  224. GLFW_API_UNAVAILABLE = $00010006;
  225. GLFW_VERSION_UNAVAILABLE = $00010007;
  226. GLFW_PLATFORM_ERROR = $00010008;
  227. GLFW_FORMAT_UNAVAILABLE = $00010009;
  228. GLFW_NO_WINDOW_CONTEXT = $0001000A;
  229. GLFW_CURSOR_UNAVAILABLE = $0001000B;
  230. GLFW_FEATURE_UNAVAILABLE = $0001000C;
  231. GLFW_FEATURE_UNIMPLEMENTED = $0001000D;
  232. GLFW_PLATFORM_UNAVAILABLE = $0001000E;
  233. GLFW_FOCUSED = $00020001;
  234. GLFW_ICONIFIED = $00020002;
  235. GLFW_RESIZABLE = $00020003;
  236. GLFW_VISIBLE = $00020004;
  237. GLFW_DECORATED = $00020005;
  238. GLFW_AUTO_ICONIFY = $00020006;
  239. GLFW_FLOATING = $00020007;
  240. GLFW_MAXIMIZED = $00020008;
  241. GLFW_CENTER_CURSOR = $00020009;
  242. GLFW_TRANSPARENT_FRAMEBUFFER = $0002000A;
  243. GLFW_HOVERED = $0002000B;
  244. GLFW_FOCUS_ON_SHOW = $0002000C;
  245. GLFW_MOUSE_PASSTHROUGH = $0002000D;
  246. GLFW_POSITION_X = $0002000E;
  247. GLFW_POSITION_Y = $0002000F;
  248. GLFW_RED_BITS = $00021001;
  249. GLFW_GREEN_BITS = $00021002;
  250. GLFW_BLUE_BITS = $00021003;
  251. GLFW_ALPHA_BITS = $00021004;
  252. GLFW_DEPTH_BITS = $00021005;
  253. GLFW_STENCIL_BITS = $00021006;
  254. GLFW_ACCUM_RED_BITS = $00021007;
  255. GLFW_ACCUM_GREEN_BITS = $00021008;
  256. GLFW_ACCUM_BLUE_BITS = $00021009;
  257. GLFW_ACCUM_ALPHA_BITS = $0002100A;
  258. GLFW_AUX_BUFFERS = $0002100B;
  259. GLFW_STEREO = $0002100C;
  260. GLFW_SAMPLES = $0002100D;
  261. GLFW_SRGB_CAPABLE = $0002100E;
  262. GLFW_REFRESH_RATE = $0002100F;
  263. GLFW_DOUBLEBUFFER = $00021010;
  264. GLFW_CLIENT_API = $00022001;
  265. GLFW_CONTEXT_VERSION_MAJOR = $00022002;
  266. GLFW_CONTEXT_VERSION_MINOR = $00022003;
  267. GLFW_CONTEXT_REVISION = $00022004;
  268. GLFW_CONTEXT_ROBUSTNESS = $00022005;
  269. GLFW_OPENGL_FORWARD_COMPAT = $00022006;
  270. GLFW_CONTEXT_DEBUG = $00022007;
  271. GLFW_OPENGL_DEBUG_CONTEXT = GLFW_CONTEXT_DEBUG;
  272. GLFW_OPENGL_PROFILE = $00022008;
  273. GLFW_CONTEXT_RELEASE_BEHAVIOR = $00022009;
  274. GLFW_CONTEXT_NO_ERROR = $0002200A;
  275. GLFW_CONTEXT_CREATION_API = $0002200B;
  276. GLFW_SCALE_TO_MONITOR = $0002200C;
  277. GLFW_COCOA_RETINA_FRAMEBUFFER = $00023001;
  278. GLFW_COCOA_FRAME_NAME = $00023002;
  279. GLFW_COCOA_GRAPHICS_SWITCHING = $00023003;
  280. GLFW_X11_CLASS_NAME = $00024001;
  281. GLFW_X11_INSTANCE_NAME = $00024002;
  282. GLFW_WIN32_KEYBOARD_MENU = $00025001;
  283. GLFW_WAYLAND_APP_ID = $00026001;
  284. GLFW_NO_API = 0;
  285. GLFW_OPENGL_API = $00030001;
  286. GLFW_OPENGL_ES_API = $00030002;
  287. GLFW_NO_ROBUSTNESS = 0;
  288. GLFW_NO_RESET_NOTIFICATION = $00031001;
  289. GLFW_LOSE_CONTEXT_ON_RESET = $00031002;
  290. GLFW_OPENGL_ANY_PROFILE = 0;
  291. GLFW_OPENGL_CORE_PROFILE = $00032001;
  292. GLFW_OPENGL_COMPAT_PROFILE = $00032002;
  293. GLFW_CURSOR = $00033001;
  294. GLFW_STICKY_KEYS = $00033002;
  295. GLFW_STICKY_MOUSE_BUTTONS = $00033003;
  296. GLFW_LOCK_KEY_MODS = $00033004;
  297. GLFW_RAW_MOUSE_MOTION = $00033005;
  298. GLFW_CURSOR_NORMAL = $00034001;
  299. GLFW_CURSOR_HIDDEN = $00034002;
  300. GLFW_CURSOR_DISABLED = $00034003;
  301. GLFW_CURSOR_CAPTURED = $00034004;
  302. GLFW_ANY_RELEASE_BEHAVIOR = 0;
  303. GLFW_RELEASE_BEHAVIOR_FLUSH = $00035001;
  304. GLFW_RELEASE_BEHAVIOR_NONE = $00035002;
  305. GLFW_NATIVE_CONTEXT_API = $00036001;
  306. GLFW_EGL_CONTEXT_API = $00036002;
  307. GLFW_OSMESA_CONTEXT_API = $00036003;
  308. GLFW_ANGLE_PLATFORM_TYPE_NONE = $00037001;
  309. GLFW_ANGLE_PLATFORM_TYPE_OPENGL = $00037002;
  310. GLFW_ANGLE_PLATFORM_TYPE_OPENGLES = $00037003;
  311. GLFW_ANGLE_PLATFORM_TYPE_D3D9 = $00037004;
  312. GLFW_ANGLE_PLATFORM_TYPE_D3D11 = $00037005;
  313. GLFW_ANGLE_PLATFORM_TYPE_VULKAN = $00037007;
  314. GLFW_ANGLE_PLATFORM_TYPE_METAL = $00037008;
  315. GLFW_WAYLAND_PREFER_LIBDECOR = $00038001;
  316. GLFW_WAYLAND_DISABLE_LIBDECOR = $00038002;
  317. GLFW_ANY_POSITION = $80000000;
  318. GLFW_ARROW_CURSOR = $00036001;
  319. GLFW_IBEAM_CURSOR = $00036002;
  320. GLFW_CROSSHAIR_CURSOR = $00036003;
  321. GLFW_POINTING_HAND_CURSOR = $00036004;
  322. GLFW_RESIZE_EW_CURSOR = $00036005;
  323. GLFW_RESIZE_NS_CURSOR = $00036006;
  324. GLFW_RESIZE_NWSE_CURSOR = $00036007;
  325. GLFW_RESIZE_NESW_CURSOR = $00036008;
  326. GLFW_RESIZE_ALL_CURSOR = $00036009;
  327. GLFW_NOT_ALLOWED_CURSOR = $0003600A;
  328. GLFW_HRESIZE_CURSOR = GLFW_RESIZE_EW_CURSOR;
  329. GLFW_VRESIZE_CURSOR = GLFW_RESIZE_NS_CURSOR;
  330. GLFW_HAND_CURSOR = GLFW_POINTING_HAND_CURSOR;
  331. GLFW_CONNECTED = $00040001;
  332. GLFW_DISCONNECTED = $00040002;
  333. GLFW_JOYSTICK_HAT_BUTTONS = $00050001;
  334. GLFW_ANGLE_PLATFORM_TYPE = $00050002;
  335. GLFW_PLATFORM = $00050003;
  336. GLFW_COCOA_CHDIR_RESOURCES = $00051001;
  337. GLFW_COCOA_MENUBAR = $00051002;
  338. GLFW_X11_XCB_VULKAN_SURFACE = $00052001;
  339. GLFW_WAYLAND_LIBDECOR = $00053001;
  340. GLFW_ANY_PLATFORM = $00060000;
  341. GLFW_PLATFORM_WIN32 = $00060001;
  342. GLFW_PLATFORM_COCOA = $00060002;
  343. GLFW_PLATFORM_WAYLAND = $00060003;
  344. GLFW_PLATFORM_X11 = $00060004;
  345. GLFW_PLATFORM_NULL = $00060005;
  346. GLFW_DONT_CARE = -1;
  347. (* GLAPIENTRY APIENTRY *)
  348. type
  349. // Forward declarations
  350. PPAnsiChar = ^PAnsiChar;
  351. PUInt32 = ^UInt32;
  352. PGLFWvidmode = ^GLFWvidmode;
  353. PGLFWgammaramp = ^GLFWgammaramp;
  354. PGLFWimage = ^GLFWimage;
  355. PGLFWgamepadstate = ^GLFWgamepadstate;
  356. PGLFWallocator = ^GLFWallocator;
  357. (*! @brief Client API function pointer type.
  358. *
  359. * Generic function pointer used for returning client API function pointers
  360. * without forcing a cast from a regular pointer.
  361. *
  362. * @sa @ref context_glext
  363. * @sa @ref glfwGetProcAddress
  364. *
  365. * @since Added in version 3.0.
  366. *
  367. * @ingroup context
  368. *)
  369. GLFWglproc = procedure(); cdecl;
  370. (*! @brief Vulkan API function pointer type.
  371. *
  372. * Generic function pointer used for returning Vulkan API function pointers
  373. * without forcing a cast from a regular pointer.
  374. *
  375. * @sa @ref vulkan_proc
  376. * @sa @ref glfwGetInstanceProcAddress
  377. *
  378. * @since Added in version 3.2.
  379. *
  380. * @ingroup vulkan
  381. *)
  382. GLFWvkproc = procedure(); cdecl;
  383. PGLFWmonitor = Pointer;
  384. PPGLFWmonitor = ^PGLFWmonitor;
  385. PGLFWwindow = Pointer;
  386. PPGLFWwindow = ^PGLFWwindow;
  387. PGLFWcursor = Pointer;
  388. PPGLFWcursor = ^PGLFWcursor;
  389. (*! @brief The function pointer type for memory allocation callbacks.
  390. *
  391. * This is the function pointer type for memory allocation callbacks. A memory
  392. * allocation callback function has the following signature:
  393. * @code
  394. * void* function_name(size_t size, void* user)
  395. * @endcode
  396. *
  397. * This function must return either a memory block at least `size` bytes long,
  398. * or `NULL` if allocation failed. Note that not all parts of GLFW handle allocation
  399. * failures gracefully yet.
  400. *
  401. * This function may be called during @ref glfwInit but before the library is
  402. * flagged as initialized, as well as during @ref glfwTerminate after the
  403. * library is no longer flagged as initialized.
  404. *
  405. * Any memory allocated by this function will be deallocated during library
  406. * termination or earlier.
  407. *
  408. * The size will always be greater than zero. Allocations of size zero are filtered out
  409. * before reaching the custom allocator.
  410. *
  411. * @param[in] size The minimum size, in bytes, of the memory block.
  412. * @param[in] user The user-defined pointer from the allocator.
  413. * @return The address of the newly allocated memory block, or `NULL` if an
  414. * error occurred.
  415. *
  416. * @pointer_lifetime The returned memory block must be valid at least until it
  417. * is deallocated.
  418. *
  419. * @reentrancy This function should not call any GLFW function.
  420. *
  421. * @thread_safety This function may be called from any thread that calls GLFW functions.
  422. *
  423. * @sa @ref init_allocator
  424. * @sa @ref GLFWallocator
  425. *
  426. * @since Added in version 3.4.
  427. *
  428. * @ingroup init
  429. *)
  430. GLFWallocatefun = function(size: NativeUInt; user: Pointer): Pointer; cdecl;
  431. (*! @brief The function pointer type for memory reallocation callbacks.
  432. *
  433. * This is the function pointer type for memory reallocation callbacks.
  434. * A memory reallocation callback function has the following signature:
  435. * @code
  436. * void* function_name(void* block, size_t size, void* user)
  437. * @endcode
  438. *
  439. * This function must return a memory block at least `size` bytes long, or
  440. * `NULL` if allocation failed. Note that not all parts of GLFW handle allocation
  441. * failures gracefully yet.
  442. *
  443. * This function may be called during @ref glfwInit but before the library is
  444. * flagged as initialized, as well as during @ref glfwTerminate after the
  445. * library is no longer flagged as initialized.
  446. *
  447. * Any memory allocated by this function will be deallocated during library
  448. * termination or earlier.
  449. *
  450. * The block address will never be `NULL` and the size will always be greater than zero.
  451. * Reallocations of a block to size zero are converted into deallocations. Reallocations
  452. * of `NULL` to a non-zero size are converted into regular allocations.
  453. *
  454. * @param[in] block The address of the memory block to reallocate.
  455. * @param[in] size The new minimum size, in bytes, of the memory block.
  456. * @param[in] user The user-defined pointer from the allocator.
  457. * @return The address of the newly allocated or resized memory block, or
  458. * `NULL` if an error occurred.
  459. *
  460. * @pointer_lifetime The returned memory block must be valid at least until it
  461. * is deallocated.
  462. *
  463. * @reentrancy This function should not call any GLFW function.
  464. *
  465. * @thread_safety This function may be called from any thread that calls GLFW functions.
  466. *
  467. * @sa @ref init_allocator
  468. * @sa @ref GLFWallocator
  469. *
  470. * @since Added in version 3.4.
  471. *
  472. * @ingroup init
  473. *)
  474. GLFWreallocatefun = function(block: Pointer; size: NativeUInt; user: Pointer): Pointer; cdecl;
  475. (*! @brief The function pointer type for memory deallocation callbacks.
  476. *
  477. * This is the function pointer type for memory deallocation callbacks.
  478. * A memory deallocation callback function has the following signature:
  479. * @code
  480. * void function_name(void* block, void* user)
  481. * @endcode
  482. *
  483. * This function may deallocate the specified memory block. This memory block
  484. * will have been allocated with the same allocator.
  485. *
  486. * This function may be called during @ref glfwInit but before the library is
  487. * flagged as initialized, as well as during @ref glfwTerminate after the
  488. * library is no longer flagged as initialized.
  489. *
  490. * The block address will never be `NULL`. Deallocations of `NULL` are filtered out
  491. * before reaching the custom allocator.
  492. *
  493. * @param[in] block The address of the memory block to deallocate.
  494. * @param[in] user The user-defined pointer from the allocator.
  495. *
  496. * @pointer_lifetime The specified memory block will not be accessed by GLFW
  497. * after this function is called.
  498. *
  499. * @reentrancy This function should not call any GLFW function.
  500. *
  501. * @thread_safety This function may be called from any thread that calls GLFW functions.
  502. *
  503. * @sa @ref init_allocator
  504. * @sa @ref GLFWallocator
  505. *
  506. * @since Added in version 3.4.
  507. *
  508. * @ingroup init
  509. *)
  510. GLFWdeallocatefun = procedure(block: Pointer; user: Pointer); cdecl;
  511. (*! @brief The function pointer type for error callbacks.
  512. *
  513. * This is the function pointer type for error callbacks. An error callback
  514. * function has the following signature:
  515. * @code
  516. * void callback_name(int error_code, const char* description)
  517. * @endcode
  518. *
  519. * @param[in] error_code An [error code](@ref errors). Future releases may add
  520. * more error codes.
  521. * @param[in] description A UTF-8 encoded string describing the error.
  522. *
  523. * @pointer_lifetime The error description string is valid until the callback
  524. * function returns.
  525. *
  526. * @sa @ref error_handling
  527. * @sa @ref glfwSetErrorCallback
  528. *
  529. * @since Added in version 3.0.
  530. *
  531. * @ingroup init
  532. *)
  533. GLFWerrorfun = procedure(error_code: Integer; const description: PAnsiChar); cdecl;
  534. (*! @brief The function pointer type for window position callbacks.
  535. *
  536. * This is the function pointer type for window position callbacks. A window
  537. * position callback function has the following signature:
  538. * @code
  539. * void callback_name(GLFWwindow* window, int xpos, int ypos)
  540. * @endcode
  541. *
  542. * @param[in] window The window that was moved.
  543. * @param[in] xpos The new x-coordinate, in screen coordinates, of the
  544. * upper-left corner of the content area of the window.
  545. * @param[in] ypos The new y-coordinate, in screen coordinates, of the
  546. * upper-left corner of the content area of the window.
  547. *
  548. * @sa @ref window_pos
  549. * @sa @ref glfwSetWindowPosCallback
  550. *
  551. * @since Added in version 3.0.
  552. *
  553. * @ingroup window
  554. *)
  555. GLFWwindowposfun = procedure(window: PGLFWwindow; xpos: Integer; ypos: Integer); cdecl;
  556. (*! @brief The function pointer type for window size callbacks.
  557. *
  558. * This is the function pointer type for window size callbacks. A window size
  559. * callback function has the following signature:
  560. * @code
  561. * void callback_name(GLFWwindow* window, int width, int height)
  562. * @endcode
  563. *
  564. * @param[in] window The window that was resized.
  565. * @param[in] width The new width, in screen coordinates, of the window.
  566. * @param[in] height The new height, in screen coordinates, of the window.
  567. *
  568. * @sa @ref window_size
  569. * @sa @ref glfwSetWindowSizeCallback
  570. *
  571. * @since Added in version 1.0.
  572. * @glfw3 Added window handle parameter.
  573. *
  574. * @ingroup window
  575. *)
  576. GLFWwindowsizefun = procedure(window: PGLFWwindow; width: Integer; height: Integer); cdecl;
  577. (*! @brief The function pointer type for window close callbacks.
  578. *
  579. * This is the function pointer type for window close callbacks. A window
  580. * close callback function has the following signature:
  581. * @code
  582. * void function_name(GLFWwindow* window)
  583. * @endcode
  584. *
  585. * @param[in] window The window that the user attempted to close.
  586. *
  587. * @sa @ref window_close
  588. * @sa @ref glfwSetWindowCloseCallback
  589. *
  590. * @since Added in version 2.5.
  591. * @glfw3 Added window handle parameter.
  592. *
  593. * @ingroup window
  594. *)
  595. GLFWwindowclosefun = procedure(window: PGLFWwindow); cdecl;
  596. (*! @brief The function pointer type for window content refresh callbacks.
  597. *
  598. * This is the function pointer type for window content refresh callbacks.
  599. * A window content refresh callback function has the following signature:
  600. * @code
  601. * void function_name(GLFWwindow* window);
  602. * @endcode
  603. *
  604. * @param[in] window The window whose content needs to be refreshed.
  605. *
  606. * @sa @ref window_refresh
  607. * @sa @ref glfwSetWindowRefreshCallback
  608. *
  609. * @since Added in version 2.5.
  610. * @glfw3 Added window handle parameter.
  611. *
  612. * @ingroup window
  613. *)
  614. GLFWwindowrefreshfun = procedure(window: PGLFWwindow); cdecl;
  615. (*! @brief The function pointer type for window focus callbacks.
  616. *
  617. * This is the function pointer type for window focus callbacks. A window
  618. * focus callback function has the following signature:
  619. * @code
  620. * void function_name(GLFWwindow* window, int focused)
  621. * @endcode
  622. *
  623. * @param[in] window The window that gained or lost input focus.
  624. * @param[in] focused `GLFW_TRUE` if the window was given input focus, or
  625. * `GLFW_FALSE` if it lost it.
  626. *
  627. * @sa @ref window_focus
  628. * @sa @ref glfwSetWindowFocusCallback
  629. *
  630. * @since Added in version 3.0.
  631. *
  632. * @ingroup window
  633. *)
  634. GLFWwindowfocusfun = procedure(window: PGLFWwindow; focused: Integer); cdecl;
  635. (*! @brief The function pointer type for window iconify callbacks.
  636. *
  637. * This is the function pointer type for window iconify callbacks. A window
  638. * iconify callback function has the following signature:
  639. * @code
  640. * void function_name(GLFWwindow* window, int iconified)
  641. * @endcode
  642. *
  643. * @param[in] window The window that was iconified or restored.
  644. * @param[in] iconified `GLFW_TRUE` if the window was iconified, or
  645. * `GLFW_FALSE` if it was restored.
  646. *
  647. * @sa @ref window_iconify
  648. * @sa @ref glfwSetWindowIconifyCallback
  649. *
  650. * @since Added in version 3.0.
  651. *
  652. * @ingroup window
  653. *)
  654. GLFWwindowiconifyfun = procedure(window: PGLFWwindow; iconified: Integer); cdecl;
  655. (*! @brief The function pointer type for window maximize callbacks.
  656. *
  657. * This is the function pointer type for window maximize callbacks. A window
  658. * maximize callback function has the following signature:
  659. * @code
  660. * void function_name(GLFWwindow* window, int maximized)
  661. * @endcode
  662. *
  663. * @param[in] window The window that was maximized or restored.
  664. * @param[in] maximized `GLFW_TRUE` if the window was maximized, or
  665. * `GLFW_FALSE` if it was restored.
  666. *
  667. * @sa @ref window_maximize
  668. * @sa glfwSetWindowMaximizeCallback
  669. *
  670. * @since Added in version 3.3.
  671. *
  672. * @ingroup window
  673. *)
  674. GLFWwindowmaximizefun = procedure(window: PGLFWwindow; maximized: Integer); cdecl;
  675. (*! @brief The function pointer type for framebuffer size callbacks.
  676. *
  677. * This is the function pointer type for framebuffer size callbacks.
  678. * A framebuffer size callback function has the following signature:
  679. * @code
  680. * void function_name(GLFWwindow* window, int width, int height)
  681. * @endcode
  682. *
  683. * @param[in] window The window whose framebuffer was resized.
  684. * @param[in] width The new width, in pixels, of the framebuffer.
  685. * @param[in] height The new height, in pixels, of the framebuffer.
  686. *
  687. * @sa @ref window_fbsize
  688. * @sa @ref glfwSetFramebufferSizeCallback
  689. *
  690. * @since Added in version 3.0.
  691. *
  692. * @ingroup window
  693. *)
  694. GLFWframebuffersizefun = procedure(window: PGLFWwindow; width: Integer; height: Integer); cdecl;
  695. (*! @brief The function pointer type for window content scale callbacks.
  696. *
  697. * This is the function pointer type for window content scale callbacks.
  698. * A window content scale callback function has the following signature:
  699. * @code
  700. * void function_name(GLFWwindow* window, float xscale, float yscale)
  701. * @endcode
  702. *
  703. * @param[in] window The window whose content scale changed.
  704. * @param[in] xscale The new x-axis content scale of the window.
  705. * @param[in] yscale The new y-axis content scale of the window.
  706. *
  707. * @sa @ref window_scale
  708. * @sa @ref glfwSetWindowContentScaleCallback
  709. *
  710. * @since Added in version 3.3.
  711. *
  712. * @ingroup window
  713. *)
  714. GLFWwindowcontentscalefun = procedure(window: PGLFWwindow; xscale: Single; yscale: Single); cdecl;
  715. (*! @brief The function pointer type for mouse button callbacks.
  716. *
  717. * This is the function pointer type for mouse button callback functions.
  718. * A mouse button callback function has the following signature:
  719. * @code
  720. * void function_name(GLFWwindow* window, int button, int action, int mods)
  721. * @endcode
  722. *
  723. * @param[in] window The window that received the event.
  724. * @param[in] button The [mouse button](@ref buttons) that was pressed or
  725. * released.
  726. * @param[in] action One of `GLFW_PRESS` or `GLFW_RELEASE`. Future releases
  727. * may add more actions.
  728. * @param[in] mods Bit field describing which [modifier keys](@ref mods) were
  729. * held down.
  730. *
  731. * @sa @ref input_mouse_button
  732. * @sa @ref glfwSetMouseButtonCallback
  733. *
  734. * @since Added in version 1.0.
  735. * @glfw3 Added window handle and modifier mask parameters.
  736. *
  737. * @ingroup input
  738. *)
  739. GLFWmousebuttonfun = procedure(window: PGLFWwindow; button: Integer; action: Integer; mods: Integer); cdecl;
  740. (*! @brief The function pointer type for cursor position callbacks.
  741. *
  742. * This is the function pointer type for cursor position callbacks. A cursor
  743. * position callback function has the following signature:
  744. * @code
  745. * void function_name(GLFWwindow* window, double xpos, double ypos);
  746. * @endcode
  747. *
  748. * @param[in] window The window that received the event.
  749. * @param[in] xpos The new cursor x-coordinate, relative to the left edge of
  750. * the content area.
  751. * @param[in] ypos The new cursor y-coordinate, relative to the top edge of the
  752. * content area.
  753. *
  754. * @sa @ref cursor_pos
  755. * @sa @ref glfwSetCursorPosCallback
  756. *
  757. * @since Added in version 3.0. Replaces `GLFWmouseposfun`.
  758. *
  759. * @ingroup input
  760. *)
  761. GLFWcursorposfun = procedure(window: PGLFWwindow; xpos: Double; ypos: Double); cdecl;
  762. (*! @brief The function pointer type for cursor enter/leave callbacks.
  763. *
  764. * This is the function pointer type for cursor enter/leave callbacks.
  765. * A cursor enter/leave callback function has the following signature:
  766. * @code
  767. * void function_name(GLFWwindow* window, int entered)
  768. * @endcode
  769. *
  770. * @param[in] window The window that received the event.
  771. * @param[in] entered `GLFW_TRUE` if the cursor entered the window's content
  772. * area, or `GLFW_FALSE` if it left it.
  773. *
  774. * @sa @ref cursor_enter
  775. * @sa @ref glfwSetCursorEnterCallback
  776. *
  777. * @since Added in version 3.0.
  778. *
  779. * @ingroup input
  780. *)
  781. GLFWcursorenterfun = procedure(window: PGLFWwindow; entered: Integer); cdecl;
  782. (*! @brief The function pointer type for scroll callbacks.
  783. *
  784. * This is the function pointer type for scroll callbacks. A scroll callback
  785. * function has the following signature:
  786. * @code
  787. * void function_name(GLFWwindow* window, double xoffset, double yoffset)
  788. * @endcode
  789. *
  790. * @param[in] window The window that received the event.
  791. * @param[in] xoffset The scroll offset along the x-axis.
  792. * @param[in] yoffset The scroll offset along the y-axis.
  793. *
  794. * @sa @ref scrolling
  795. * @sa @ref glfwSetScrollCallback
  796. *
  797. * @since Added in version 3.0. Replaces `GLFWmousewheelfun`.
  798. *
  799. * @ingroup input
  800. *)
  801. GLFWscrollfun = procedure(window: PGLFWwindow; xoffset: Double; yoffset: Double); cdecl;
  802. (*! @brief The function pointer type for keyboard key callbacks.
  803. *
  804. * This is the function pointer type for keyboard key callbacks. A keyboard
  805. * key callback function has the following signature:
  806. * @code
  807. * void function_name(GLFWwindow* window, int key, int scancode, int action, int mods)
  808. * @endcode
  809. *
  810. * @param[in] window The window that received the event.
  811. * @param[in] key The [keyboard key](@ref keys) that was pressed or released.
  812. * @param[in] scancode The platform-specific scancode of the key.
  813. * @param[in] action `GLFW_PRESS`, `GLFW_RELEASE` or `GLFW_REPEAT`. Future
  814. * releases may add more actions.
  815. * @param[in] mods Bit field describing which [modifier keys](@ref mods) were
  816. * held down.
  817. *
  818. * @sa @ref input_key
  819. * @sa @ref glfwSetKeyCallback
  820. *
  821. * @since Added in version 1.0.
  822. * @glfw3 Added window handle, scancode and modifier mask parameters.
  823. *
  824. * @ingroup input
  825. *)
  826. GLFWkeyfun = procedure(window: PGLFWwindow; key: Integer; scancode: Integer; action: Integer; mods: Integer); cdecl;
  827. (*! @brief The function pointer type for Unicode character callbacks.
  828. *
  829. * This is the function pointer type for Unicode character callbacks.
  830. * A Unicode character callback function has the following signature:
  831. * @code
  832. * void function_name(GLFWwindow* window, unsigned int codepoint)
  833. * @endcode
  834. *
  835. * @param[in] window The window that received the event.
  836. * @param[in] codepoint The Unicode code point of the character.
  837. *
  838. * @sa @ref input_char
  839. * @sa @ref glfwSetCharCallback
  840. *
  841. * @since Added in version 2.4.
  842. * @glfw3 Added window handle parameter.
  843. *
  844. * @ingroup input
  845. *)
  846. GLFWcharfun = procedure(window: PGLFWwindow; codepoint: Cardinal); cdecl;
  847. (*! @brief The function pointer type for Unicode character with modifiers
  848. * callbacks.
  849. *
  850. * This is the function pointer type for Unicode character with modifiers
  851. * callbacks. It is called for each input character, regardless of what
  852. * modifier keys are held down. A Unicode character with modifiers callback
  853. * function has the following signature:
  854. * @code
  855. * void function_name(GLFWwindow* window, unsigned int codepoint, int mods)
  856. * @endcode
  857. *
  858. * @param[in] window The window that received the event.
  859. * @param[in] codepoint The Unicode code point of the character.
  860. * @param[in] mods Bit field describing which [modifier keys](@ref mods) were
  861. * held down.
  862. *
  863. * @sa @ref input_char
  864. * @sa @ref glfwSetCharModsCallback
  865. *
  866. * @deprecated Scheduled for removal in version 4.0.
  867. *
  868. * @since Added in version 3.1.
  869. *
  870. * @ingroup input
  871. *)
  872. GLFWcharmodsfun = procedure(window: PGLFWwindow; codepoint: Cardinal; mods: Integer); cdecl;
  873. (*! @brief The function pointer type for path drop callbacks.
  874. *
  875. * This is the function pointer type for path drop callbacks. A path drop
  876. * callback function has the following signature:
  877. * @code
  878. * void function_name(GLFWwindow* window, int path_count, const char* paths[])
  879. * @endcode
  880. *
  881. * @param[in] window The window that received the event.
  882. * @param[in] path_count The number of dropped paths.
  883. * @param[in] paths The UTF-8 encoded file and/or directory path names.
  884. *
  885. * @pointer_lifetime The path array and its strings are valid until the
  886. * callback function returns.
  887. *
  888. * @sa @ref path_drop
  889. * @sa @ref glfwSetDropCallback
  890. *
  891. * @since Added in version 3.1.
  892. *
  893. * @ingroup input
  894. *)
  895. GLFWdropfun = procedure(window: PGLFWwindow; path_count: Integer; paths: PPAnsiChar); cdecl;
  896. (*! @brief The function pointer type for monitor configuration callbacks.
  897. *
  898. * This is the function pointer type for monitor configuration callbacks.
  899. * A monitor callback function has the following signature:
  900. * @code
  901. * void function_name(GLFWmonitor* monitor, int event)
  902. * @endcode
  903. *
  904. * @param[in] monitor The monitor that was connected or disconnected.
  905. * @param[in] event One of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`. Future
  906. * releases may add more events.
  907. *
  908. * @sa @ref monitor_event
  909. * @sa @ref glfwSetMonitorCallback
  910. *
  911. * @since Added in version 3.0.
  912. *
  913. * @ingroup monitor
  914. *)
  915. GLFWmonitorfun = procedure(monitor: PGLFWmonitor; event: Integer); cdecl;
  916. (*! @brief The function pointer type for joystick configuration callbacks.
  917. *
  918. * This is the function pointer type for joystick configuration callbacks.
  919. * A joystick configuration callback function has the following signature:
  920. * @code
  921. * void function_name(int jid, int event)
  922. * @endcode
  923. *
  924. * @param[in] jid The joystick that was connected or disconnected.
  925. * @param[in] event One of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`. Future
  926. * releases may add more events.
  927. *
  928. * @sa @ref joystick_event
  929. * @sa @ref glfwSetJoystickCallback
  930. *
  931. * @since Added in version 3.2.
  932. *
  933. * @ingroup input
  934. *)
  935. GLFWjoystickfun = procedure(jid: Integer; event: Integer); cdecl;
  936. (*! @brief Video mode type.
  937. *
  938. * This describes a single video mode.
  939. *
  940. * @sa @ref monitor_modes
  941. * @sa @ref glfwGetVideoMode
  942. * @sa @ref glfwGetVideoModes
  943. *
  944. * @since Added in version 1.0.
  945. * @glfw3 Added refresh rate member.
  946. *
  947. * @ingroup monitor
  948. *)
  949. GLFWvidmode = record
  950. (*! The width, in screen coordinates, of the video mode.
  951. *)
  952. width: Integer;
  953. (*! The height, in screen coordinates, of the video mode.
  954. *)
  955. height: Integer;
  956. (*! The bit depth of the red channel of the video mode.
  957. *)
  958. redBits: Integer;
  959. (*! The bit depth of the green channel of the video mode.
  960. *)
  961. greenBits: Integer;
  962. (*! The bit depth of the blue channel of the video mode.
  963. *)
  964. blueBits: Integer;
  965. (*! The refresh rate, in Hz, of the video mode.
  966. *)
  967. refreshRate: Integer;
  968. end;
  969. (*! @brief Gamma ramp.
  970. *
  971. * This describes the gamma ramp for a monitor.
  972. *
  973. * @sa @ref monitor_gamma
  974. * @sa @ref glfwGetGammaRamp
  975. * @sa @ref glfwSetGammaRamp
  976. *
  977. * @since Added in version 3.0.
  978. *
  979. * @ingroup monitor
  980. *)
  981. GLFWgammaramp = record
  982. (*! An array of value describing the response of the red channel.
  983. *)
  984. red: PWord;
  985. (*! An array of value describing the response of the green channel.
  986. *)
  987. green: PWord;
  988. (*! An array of value describing the response of the blue channel.
  989. *)
  990. blue: PWord;
  991. (*! The number of elements in each array.
  992. *)
  993. size: Cardinal;
  994. end;
  995. (*! @brief Image data.
  996. *
  997. * This describes a single 2D image. See the documentation for each related
  998. * function what the expected pixel format is.
  999. *
  1000. * @sa @ref cursor_custom
  1001. * @sa @ref window_icon
  1002. *
  1003. * @since Added in version 2.1.
  1004. * @glfw3 Removed format and bytes-per-pixel members.
  1005. *
  1006. * @ingroup window
  1007. *)
  1008. GLFWimage = record
  1009. (*! The width, in pixels, of this image.
  1010. *)
  1011. width: Integer;
  1012. (*! The height, in pixels, of this image.
  1013. *)
  1014. height: Integer;
  1015. (*! The pixel data of this image, arranged left-to-right, top-to-bottom.
  1016. *)
  1017. pixels: PByte;
  1018. end;
  1019. (*! @brief Gamepad input state
  1020. *
  1021. * This describes the input state of a gamepad.
  1022. *
  1023. * @sa @ref gamepad
  1024. * @sa @ref glfwGetGamepadState
  1025. *
  1026. * @since Added in version 3.3.
  1027. *
  1028. * @ingroup input
  1029. *)
  1030. GLFWgamepadstate = record
  1031. (*! The states of each [gamepad button](@ref gamepad_buttons), `GLFW_PRESS`
  1032. * or `GLFW_RELEASE`.
  1033. *)
  1034. buttons: array [0..14] of Byte;
  1035. (*! The states of each [gamepad axis](@ref gamepad_axes), in the range -1.0
  1036. * to 1.0 inclusive.
  1037. *)
  1038. axes: array [0..5] of Single;
  1039. end;
  1040. (*! @brief
  1041. *
  1042. * @sa @ref init_allocator
  1043. * @sa @ref glfwInitAllocator
  1044. *
  1045. * @since Added in version 3.4.
  1046. *
  1047. * @ingroup init
  1048. *)
  1049. GLFWallocator = record
  1050. allocate: GLFWallocatefun;
  1051. reallocate: GLFWreallocatefun;
  1052. deallocate: GLFWdeallocatefun;
  1053. user: Pointer;
  1054. end;
  1055. (*! @brief Initializes the GLFW library.
  1056. *
  1057. * This function initializes the GLFW library. Before most GLFW functions can
  1058. * be used, GLFW must be initialized, and before an application terminates GLFW
  1059. * should be terminated in order to free any resources allocated during or
  1060. * after initialization.
  1061. *
  1062. * If this function fails, it calls @ref glfwTerminate before returning. If it
  1063. * succeeds, you should call @ref glfwTerminate before the application exits.
  1064. *
  1065. * Additional calls to this function after successful initialization but before
  1066. * termination will return `GLFW_TRUE` immediately.
  1067. *
  1068. * The @ref GLFW_PLATFORM init hint controls which platforms are considered during
  1069. * initialization. This also depends on which platforms the library was compiled to
  1070. * support.
  1071. *
  1072. * @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if an
  1073. * [error](@ref error_handling) occurred.
  1074. *
  1075. * @errors Possible errors include @ref GLFW_PLATFORM_UNAVAILABLE and @ref
  1076. * GLFW_PLATFORM_ERROR.
  1077. *
  1078. * @remark @macos This function will change the current directory of the
  1079. * application to the `Contents/Resources` subdirectory of the application's
  1080. * bundle, if present. This can be disabled with the @ref
  1081. * GLFW_COCOA_CHDIR_RESOURCES init hint.
  1082. *
  1083. * @remark @macos This function will create the main menu and dock icon for the
  1084. * application. If GLFW finds a `MainMenu.nib` it is loaded and assumed to
  1085. * contain a menu bar. Otherwise a minimal menu bar is created manually with
  1086. * common commands like Hide, Quit and About. The About entry opens a minimal
  1087. * about dialog with information from the application's bundle. The menu bar
  1088. * and dock icon can be disabled entirely with the @ref GLFW_COCOA_MENUBAR init
  1089. * hint.
  1090. *
  1091. * @remark @x11 This function will set the `LC_CTYPE` category of the
  1092. * application locale according to the current environment if that category is
  1093. * still "C". This is because the "C" locale breaks Unicode text input.
  1094. *
  1095. * @thread_safety This function must only be called from the main thread.
  1096. *
  1097. * @sa @ref intro_init
  1098. * @sa @ref glfwInitHint
  1099. * @sa @ref glfwInitAllocator
  1100. * @sa @ref glfwTerminate
  1101. *
  1102. * @since Added in version 1.0.
  1103. *
  1104. * @ingroup init
  1105. *)
  1106. function glfwInit(): Integer; cdecl;
  1107. external libglfw3 name _PU + 'glfwInit';
  1108. (*! @brief Terminates the GLFW library.
  1109. *
  1110. * This function destroys all remaining windows and cursors, restores any
  1111. * modified gamma ramps and frees any other allocated resources. Once this
  1112. * function is called, you must again call @ref glfwInit successfully before
  1113. * you will be able to use most GLFW functions.
  1114. *
  1115. * If GLFW has been successfully initialized, this function should be called
  1116. * before the application exits. If initialization fails, there is no need to
  1117. * call this function, as it is called by @ref glfwInit before it returns
  1118. * failure.
  1119. *
  1120. * This function has no effect if GLFW is not initialized.
  1121. *
  1122. * @errors Possible errors include @ref GLFW_PLATFORM_ERROR.
  1123. *
  1124. * @remark This function may be called before @ref glfwInit.
  1125. *
  1126. * @warning The contexts of any remaining windows must not be current on any
  1127. * other thread when this function is called.
  1128. *
  1129. * @reentrancy This function must not be called from a callback.
  1130. *
  1131. * @thread_safety This function must only be called from the main thread.
  1132. *
  1133. * @sa @ref intro_init
  1134. * @sa @ref glfwInit
  1135. *
  1136. * @since Added in version 1.0.
  1137. *
  1138. * @ingroup init
  1139. *)
  1140. procedure glfwTerminate(); cdecl;
  1141. external libglfw3 name _PU + 'glfwTerminate';
  1142. (*! @brief Sets the specified init hint to the desired value.
  1143. *
  1144. * This function sets hints for the next initialization of GLFW.
  1145. *
  1146. * The values you set hints to are never reset by GLFW, but they only take
  1147. * effect during initialization. Once GLFW has been initialized, any values
  1148. * you set will be ignored until the library is terminated and initialized
  1149. * again.
  1150. *
  1151. * Some hints are platform specific. These may be set on any platform but they
  1152. * will only affect their specific platform. Other platforms will ignore them.
  1153. * Setting these hints requires no platform specific headers or functions.
  1154. *
  1155. * @param[in] hint The [init hint](@ref init_hints) to set.
  1156. * @param[in] value The new value of the init hint.
  1157. *
  1158. * @errors Possible errors include @ref GLFW_INVALID_ENUM and @ref
  1159. * GLFW_INVALID_VALUE.
  1160. *
  1161. * @remarks This function may be called before @ref glfwInit.
  1162. *
  1163. * @thread_safety This function must only be called from the main thread.
  1164. *
  1165. * @sa init_hints
  1166. * @sa glfwInit
  1167. *
  1168. * @since Added in version 3.3.
  1169. *
  1170. * @ingroup init
  1171. *)
  1172. procedure glfwInitHint(hint: Integer; value: Integer); cdecl;
  1173. external libglfw3 name _PU + 'glfwInitHint';
  1174. (*! @brief Sets the init allocator to the desired value.
  1175. *
  1176. * To use the default allocator, call this function with a `NULL` argument.
  1177. *
  1178. * If you specify an allocator struct, every member must be a valid function
  1179. * pointer. If any member is `NULL`, this function emits @ref
  1180. * GLFW_INVALID_VALUE and the init allocator is unchanged.
  1181. *
  1182. * @param[in] allocator The allocator to use at the next initialization, or
  1183. * `NULL` to use the default one.
  1184. *
  1185. * @errors Possible errors include @ref GLFW_INVALID_VALUE.
  1186. *
  1187. * @pointer_lifetime The specified allocator is copied before this function
  1188. * returns.
  1189. *
  1190. * @thread_safety This function must only be called from the main thread.
  1191. *
  1192. * @sa @ref init_allocator
  1193. * @sa @ref glfwInit
  1194. *
  1195. * @since Added in version 3.4.
  1196. *
  1197. * @ingroup init
  1198. *)
  1199. procedure glfwInitAllocator(const allocator: PGLFWallocator); cdecl;
  1200. external libglfw3 name _PU + 'glfwInitAllocator';
  1201. (*! @brief Retrieves the version of the GLFW library.
  1202. *
  1203. * This function retrieves the major, minor and revision numbers of the GLFW
  1204. * library. It is intended for when you are using GLFW as a shared library and
  1205. * want to ensure that you are using the minimum required version.
  1206. *
  1207. * Any or all of the version arguments may be `NULL`.
  1208. *
  1209. * @param[out] major Where to store the major version number, or `NULL`.
  1210. * @param[out] minor Where to store the minor version number, or `NULL`.
  1211. * @param[out] rev Where to store the revision number, or `NULL`.
  1212. *
  1213. * @errors None.
  1214. *
  1215. * @remark This function may be called before @ref glfwInit.
  1216. *
  1217. * @thread_safety This function may be called from any thread.
  1218. *
  1219. * @sa @ref intro_version
  1220. * @sa @ref glfwGetVersionString
  1221. *
  1222. * @since Added in version 1.0.
  1223. *
  1224. * @ingroup init
  1225. *)
  1226. procedure glfwGetVersion(major: PInteger; minor: PInteger; rev: PInteger); cdecl;
  1227. external libglfw3 name _PU + 'glfwGetVersion';
  1228. (*! @brief Returns a string describing the compile-time configuration.
  1229. *
  1230. * This function returns the compile-time generated
  1231. * [version string](@ref intro_version_string) of the GLFW library binary. It describes
  1232. * the version, platforms, compiler and any platform or operating system specific
  1233. * compile-time options. It should not be confused with the OpenGL or OpenGL ES version
  1234. * string, queried with `glGetString`.
  1235. *
  1236. * __Do not use the version string__ to parse the GLFW library version. The
  1237. * @ref glfwGetVersion function provides the version of the running library
  1238. * binary in numerical format.
  1239. *
  1240. * __Do not use the version string__ to parse what platforms are supported. The @ref
  1241. * glfwPlatformSupported function lets you query platform support.
  1242. *
  1243. * @return The ASCII encoded GLFW version string.
  1244. *
  1245. * @errors None.
  1246. *
  1247. * @remark This function may be called before @ref glfwInit.
  1248. *
  1249. * @pointer_lifetime The returned string is static and compile-time generated.
  1250. *
  1251. * @thread_safety This function may be called from any thread.
  1252. *
  1253. * @sa @ref intro_version
  1254. * @sa @ref glfwGetVersion
  1255. *
  1256. * @since Added in version 3.0.
  1257. *
  1258. * @ingroup init
  1259. *)
  1260. function glfwGetVersionString(): PAnsiChar; cdecl;
  1261. external libglfw3 name _PU + 'glfwGetVersionString';
  1262. (*! @brief Returns and clears the last error for the calling thread.
  1263. *
  1264. * This function returns and clears the [error code](@ref errors) of the last
  1265. * error that occurred on the calling thread, and optionally a UTF-8 encoded
  1266. * human-readable description of it. If no error has occurred since the last
  1267. * call, it returns @ref GLFW_NO_ERROR (zero) and the description pointer is
  1268. * set to `NULL`.
  1269. *
  1270. * @param[in] description Where to store the error description pointer, or `NULL`.
  1271. * @return The last error code for the calling thread, or @ref GLFW_NO_ERROR
  1272. * (zero).
  1273. *
  1274. * @errors None.
  1275. *
  1276. * @pointer_lifetime The returned string is allocated and freed by GLFW. You
  1277. * should not free it yourself. It is guaranteed to be valid only until the
  1278. * next error occurs or the library is terminated.
  1279. *
  1280. * @remark This function may be called before @ref glfwInit.
  1281. *
  1282. * @thread_safety This function may be called from any thread.
  1283. *
  1284. * @sa @ref error_handling
  1285. * @sa @ref glfwSetErrorCallback
  1286. *
  1287. * @since Added in version 3.3.
  1288. *
  1289. * @ingroup init
  1290. *)
  1291. function glfwGetError(description: PPAnsiChar): Integer; cdecl;
  1292. external libglfw3 name _PU + 'glfwGetError';
  1293. (*! @brief Sets the error callback.
  1294. *
  1295. * This function sets the error callback, which is called with an error code
  1296. * and a human-readable description each time a GLFW error occurs.
  1297. *
  1298. * The error code is set before the callback is called. Calling @ref
  1299. * glfwGetError from the error callback will return the same value as the error
  1300. * code argument.
  1301. *
  1302. * The error callback is called on the thread where the error occurred. If you
  1303. * are using GLFW from multiple threads, your error callback needs to be
  1304. * written accordingly.
  1305. *
  1306. * Because the description string may have been generated specifically for that
  1307. * error, it is not guaranteed to be valid after the callback has returned. If
  1308. * you wish to use it after the callback returns, you need to make a copy.
  1309. *
  1310. * Once set, the error callback remains set even after the library has been
  1311. * terminated.
  1312. *
  1313. * @param[in] callback The new callback, or `NULL` to remove the currently set
  1314. * callback.
  1315. * @return The previously set callback, or `NULL` if no callback was set.
  1316. *
  1317. * @callback_signature
  1318. * @code
  1319. * void callback_name(int error_code, const char* description)
  1320. * @endcode
  1321. * For more information about the callback parameters, see the
  1322. * [callback pointer type](@ref GLFWerrorfun).
  1323. *
  1324. * @errors None.
  1325. *
  1326. * @remark This function may be called before @ref glfwInit.
  1327. *
  1328. * @thread_safety This function must only be called from the main thread.
  1329. *
  1330. * @sa @ref error_handling
  1331. * @sa @ref glfwGetError
  1332. *
  1333. * @since Added in version 3.0.
  1334. *
  1335. * @ingroup init
  1336. *)
  1337. function glfwSetErrorCallback(callback: GLFWerrorfun): GLFWerrorfun; cdecl;
  1338. external libglfw3 name _PU + 'glfwSetErrorCallback';
  1339. (*! @brief Returns the currently selected platform.
  1340. *
  1341. * This function returns the platform that was selected during initialization. The
  1342. * returned value will be one of `GLFW_PLATFORM_WIN32`, `GLFW_PLATFORM_COCOA`,
  1343. * `GLFW_PLATFORM_WAYLAND`, `GLFW_PLATFORM_X11` or `GLFW_PLATFORM_NULL`.
  1344. *
  1345. * @return The currently selected platform, or zero if an error occurred.
  1346. *
  1347. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  1348. *
  1349. * @thread_safety This function may be called from any thread.
  1350. *
  1351. * @sa @ref platform
  1352. * @sa @ref glfwPlatformSupported
  1353. *
  1354. * @since Added in version 3.4.
  1355. *
  1356. * @ingroup init
  1357. *)
  1358. function glfwGetPlatform(): Integer; cdecl;
  1359. external libglfw3 name _PU + 'glfwGetPlatform';
  1360. (*! @brief Returns whether the library includes support for the specified platform.
  1361. *
  1362. * This function returns whether the library was compiled with support for the specified
  1363. * platform. The platform must be one of `GLFW_PLATFORM_WIN32`, `GLFW_PLATFORM_COCOA`,
  1364. * `GLFW_PLATFORM_WAYLAND`, `GLFW_PLATFORM_X11` or `GLFW_PLATFORM_NULL`.
  1365. *
  1366. * @param[in] platform The platform to query.
  1367. * @return `GLFW_TRUE` if the platform is supported, or `GLFW_FALSE` otherwise.
  1368. *
  1369. * @errors Possible errors include @ref GLFW_INVALID_ENUM.
  1370. *
  1371. * @remark This function may be called before @ref glfwInit.
  1372. *
  1373. * @thread_safety This function may be called from any thread.
  1374. *
  1375. * @sa @ref platform
  1376. * @sa @ref glfwGetPlatform
  1377. *
  1378. * @since Added in version 3.4.
  1379. *
  1380. * @ingroup init
  1381. *)
  1382. function glfwPlatformSupported(platform_: Integer): Integer; cdecl;
  1383. external libglfw3 name _PU + 'glfwPlatformSupported';
  1384. (*! @brief Returns the currently connected monitors.
  1385. *
  1386. * This function returns an array of handles for all currently connected
  1387. * monitors. The primary monitor is always first in the returned array. If no
  1388. * monitors were found, this function returns `NULL`.
  1389. *
  1390. * @param[out] count Where to store the number of monitors in the returned
  1391. * array. This is set to zero if an error occurred.
  1392. * @return An array of monitor handles, or `NULL` if no monitors were found or
  1393. * if an [error](@ref error_handling) occurred.
  1394. *
  1395. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  1396. *
  1397. * @pointer_lifetime The returned array is allocated and freed by GLFW. You
  1398. * should not free it yourself. It is guaranteed to be valid only until the
  1399. * monitor configuration changes or the library is terminated.
  1400. *
  1401. * @thread_safety This function must only be called from the main thread.
  1402. *
  1403. * @sa @ref monitor_monitors
  1404. * @sa @ref monitor_event
  1405. * @sa @ref glfwGetPrimaryMonitor
  1406. *
  1407. * @since Added in version 3.0.
  1408. *
  1409. * @ingroup monitor
  1410. *)
  1411. function glfwGetMonitors(count: PInteger): PPGLFWmonitor; cdecl;
  1412. external libglfw3 name _PU + 'glfwGetMonitors';
  1413. (*! @brief Returns the primary monitor.
  1414. *
  1415. * This function returns the primary monitor. This is usually the monitor
  1416. * where elements like the task bar or global menu bar are located.
  1417. *
  1418. * @return The primary monitor, or `NULL` if no monitors were found or if an
  1419. * [error](@ref error_handling) occurred.
  1420. *
  1421. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  1422. *
  1423. * @thread_safety This function must only be called from the main thread.
  1424. *
  1425. * @remark The primary monitor is always first in the array returned by @ref
  1426. * glfwGetMonitors.
  1427. *
  1428. * @sa @ref monitor_monitors
  1429. * @sa @ref glfwGetMonitors
  1430. *
  1431. * @since Added in version 3.0.
  1432. *
  1433. * @ingroup monitor
  1434. *)
  1435. function glfwGetPrimaryMonitor(): PGLFWmonitor; cdecl;
  1436. external libglfw3 name _PU + 'glfwGetPrimaryMonitor';
  1437. (*! @brief Returns the position of the monitor's viewport on the virtual screen.
  1438. *
  1439. * This function returns the position, in screen coordinates, of the upper-left
  1440. * corner of the specified monitor.
  1441. *
  1442. * Any or all of the position arguments may be `NULL`. If an error occurs, all
  1443. * non-`NULL` position arguments will be set to zero.
  1444. *
  1445. * @param[in] monitor The monitor to query.
  1446. * @param[out] xpos Where to store the monitor x-coordinate, or `NULL`.
  1447. * @param[out] ypos Where to store the monitor y-coordinate, or `NULL`.
  1448. *
  1449. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
  1450. * GLFW_PLATFORM_ERROR.
  1451. *
  1452. * @thread_safety This function must only be called from the main thread.
  1453. *
  1454. * @sa @ref monitor_properties
  1455. *
  1456. * @since Added in version 3.0.
  1457. *
  1458. * @ingroup monitor
  1459. *)
  1460. procedure glfwGetMonitorPos(monitor: PGLFWmonitor; xpos: PInteger; ypos: PInteger); cdecl;
  1461. external libglfw3 name _PU + 'glfwGetMonitorPos';
  1462. (*! @brief Retrieves the work area of the monitor.
  1463. *
  1464. * This function returns the position, in screen coordinates, of the upper-left
  1465. * corner of the work area of the specified monitor along with the work area
  1466. * size in screen coordinates. The work area is defined as the area of the
  1467. * monitor not occluded by the window system task bar where present. If no
  1468. * task bar exists then the work area is the monitor resolution in screen
  1469. * coordinates.
  1470. *
  1471. * Any or all of the position and size arguments may be `NULL`. If an error
  1472. * occurs, all non-`NULL` position and size arguments will be set to zero.
  1473. *
  1474. * @param[in] monitor The monitor to query.
  1475. * @param[out] xpos Where to store the monitor x-coordinate, or `NULL`.
  1476. * @param[out] ypos Where to store the monitor y-coordinate, or `NULL`.
  1477. * @param[out] width Where to store the monitor width, or `NULL`.
  1478. * @param[out] height Where to store the monitor height, or `NULL`.
  1479. *
  1480. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
  1481. * GLFW_PLATFORM_ERROR.
  1482. *
  1483. * @thread_safety This function must only be called from the main thread.
  1484. *
  1485. * @sa @ref monitor_workarea
  1486. *
  1487. * @since Added in version 3.3.
  1488. *
  1489. * @ingroup monitor
  1490. *)
  1491. procedure glfwGetMonitorWorkarea(monitor: PGLFWmonitor; xpos: PInteger; ypos: PInteger; width: PInteger; height: PInteger); cdecl;
  1492. external libglfw3 name _PU + 'glfwGetMonitorWorkarea';
  1493. (*! @brief Returns the physical size of the monitor.
  1494. *
  1495. * This function returns the size, in millimetres, of the display area of the
  1496. * specified monitor.
  1497. *
  1498. * Some platforms do not provide accurate monitor size information, either
  1499. * because the monitor
  1500. * [EDID](https://en.wikipedia.org/wiki/Extended_display_identification_data)
  1501. * data is incorrect or because the driver does not report it accurately.
  1502. *
  1503. * Any or all of the size arguments may be `NULL`. If an error occurs, all
  1504. * non-`NULL` size arguments will be set to zero.
  1505. *
  1506. * @param[in] monitor The monitor to query.
  1507. * @param[out] widthMM Where to store the width, in millimetres, of the
  1508. * monitor's display area, or `NULL`.
  1509. * @param[out] heightMM Where to store the height, in millimetres, of the
  1510. * monitor's display area, or `NULL`.
  1511. *
  1512. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  1513. *
  1514. * @remark @win32 On Windows 8 and earlier the physical size is calculated from
  1515. * the current resolution and system DPI instead of querying the monitor EDID data.
  1516. *
  1517. * @thread_safety This function must only be called from the main thread.
  1518. *
  1519. * @sa @ref monitor_properties
  1520. *
  1521. * @since Added in version 3.0.
  1522. *
  1523. * @ingroup monitor
  1524. *)
  1525. procedure glfwGetMonitorPhysicalSize(monitor: PGLFWmonitor; widthMM: PInteger; heightMM: PInteger); cdecl;
  1526. external libglfw3 name _PU + 'glfwGetMonitorPhysicalSize';
  1527. (*! @brief Retrieves the content scale for the specified monitor.
  1528. *
  1529. * This function retrieves the content scale for the specified monitor. The
  1530. * content scale is the ratio between the current DPI and the platform's
  1531. * default DPI. This is especially important for text and any UI elements. If
  1532. * the pixel dimensions of your UI scaled by this look appropriate on your
  1533. * machine then it should appear at a reasonable size on other machines
  1534. * regardless of their DPI and scaling settings. This relies on the system DPI
  1535. * and scaling settings being somewhat correct.
  1536. *
  1537. * The content scale may depend on both the monitor resolution and pixel
  1538. * density and on user settings. It may be very different from the raw DPI
  1539. * calculated from the physical size and current resolution.
  1540. *
  1541. * @param[in] monitor The monitor to query.
  1542. * @param[out] xscale Where to store the x-axis content scale, or `NULL`.
  1543. * @param[out] yscale Where to store the y-axis content scale, or `NULL`.
  1544. *
  1545. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
  1546. * GLFW_PLATFORM_ERROR.
  1547. *
  1548. * @thread_safety This function must only be called from the main thread.
  1549. *
  1550. * @sa @ref monitor_scale
  1551. * @sa @ref glfwGetWindowContentScale
  1552. *
  1553. * @since Added in version 3.3.
  1554. *
  1555. * @ingroup monitor
  1556. *)
  1557. procedure glfwGetMonitorContentScale(monitor: PGLFWmonitor; xscale: PSingle; yscale: PSingle); cdecl;
  1558. external libglfw3 name _PU + 'glfwGetMonitorContentScale';
  1559. (*! @brief Returns the name of the specified monitor.
  1560. *
  1561. * This function returns a human-readable name, encoded as UTF-8, of the
  1562. * specified monitor. The name typically reflects the make and model of the
  1563. * monitor and is not guaranteed to be unique among the connected monitors.
  1564. *
  1565. * @param[in] monitor The monitor to query.
  1566. * @return The UTF-8 encoded name of the monitor, or `NULL` if an
  1567. * [error](@ref error_handling) occurred.
  1568. *
  1569. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  1570. *
  1571. * @pointer_lifetime The returned string is allocated and freed by GLFW. You
  1572. * should not free it yourself. It is valid until the specified monitor is
  1573. * disconnected or the library is terminated.
  1574. *
  1575. * @thread_safety This function must only be called from the main thread.
  1576. *
  1577. * @sa @ref monitor_properties
  1578. *
  1579. * @since Added in version 3.0.
  1580. *
  1581. * @ingroup monitor
  1582. *)
  1583. function glfwGetMonitorName(monitor: PGLFWmonitor): PAnsiChar; cdecl;
  1584. external libglfw3 name _PU + 'glfwGetMonitorName';
  1585. (*! @brief Sets the user pointer of the specified monitor.
  1586. *
  1587. * This function sets the user-defined pointer of the specified monitor. The
  1588. * current value is retained until the monitor is disconnected. The initial
  1589. * value is `NULL`.
  1590. *
  1591. * This function may be called from the monitor callback, even for a monitor
  1592. * that is being disconnected.
  1593. *
  1594. * @param[in] monitor The monitor whose pointer to set.
  1595. * @param[in] pointer The new value.
  1596. *
  1597. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  1598. *
  1599. * @thread_safety This function may be called from any thread. Access is not
  1600. * synchronized.
  1601. *
  1602. * @sa @ref monitor_userptr
  1603. * @sa @ref glfwGetMonitorUserPointer
  1604. *
  1605. * @since Added in version 3.3.
  1606. *
  1607. * @ingroup monitor
  1608. *)
  1609. procedure glfwSetMonitorUserPointer(monitor: PGLFWmonitor; pointer: Pointer); cdecl;
  1610. external libglfw3 name _PU + 'glfwSetMonitorUserPointer';
  1611. (*! @brief Returns the user pointer of the specified monitor.
  1612. *
  1613. * This function returns the current value of the user-defined pointer of the
  1614. * specified monitor. The initial value is `NULL`.
  1615. *
  1616. * This function may be called from the monitor callback, even for a monitor
  1617. * that is being disconnected.
  1618. *
  1619. * @param[in] monitor The monitor whose pointer to return.
  1620. *
  1621. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  1622. *
  1623. * @thread_safety This function may be called from any thread. Access is not
  1624. * synchronized.
  1625. *
  1626. * @sa @ref monitor_userptr
  1627. * @sa @ref glfwSetMonitorUserPointer
  1628. *
  1629. * @since Added in version 3.3.
  1630. *
  1631. * @ingroup monitor
  1632. *)
  1633. function glfwGetMonitorUserPointer(monitor: PGLFWmonitor): Pointer; cdecl;
  1634. external libglfw3 name _PU + 'glfwGetMonitorUserPointer';
  1635. (*! @brief Sets the monitor configuration callback.
  1636. *
  1637. * This function sets the monitor configuration callback, or removes the
  1638. * currently set callback. This is called when a monitor is connected to or
  1639. * disconnected from the system.
  1640. *
  1641. * @param[in] callback The new callback, or `NULL` to remove the currently set
  1642. * callback.
  1643. * @return The previously set callback, or `NULL` if no callback was set or the
  1644. * library had not been [initialized](@ref intro_init).
  1645. *
  1646. * @callback_signature
  1647. * @code
  1648. * void function_name(GLFWmonitor* monitor, int event)
  1649. * @endcode
  1650. * For more information about the callback parameters, see the
  1651. * [function pointer type](@ref GLFWmonitorfun).
  1652. *
  1653. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  1654. *
  1655. * @thread_safety This function must only be called from the main thread.
  1656. *
  1657. * @sa @ref monitor_event
  1658. *
  1659. * @since Added in version 3.0.
  1660. *
  1661. * @ingroup monitor
  1662. *)
  1663. function glfwSetMonitorCallback(callback: GLFWmonitorfun): GLFWmonitorfun; cdecl;
  1664. external libglfw3 name _PU + 'glfwSetMonitorCallback';
  1665. (*! @brief Returns the available video modes for the specified monitor.
  1666. *
  1667. * This function returns an array of all video modes supported by the specified
  1668. * monitor. The returned array is sorted in ascending order, first by color
  1669. * bit depth (the sum of all channel depths), then by resolution area (the
  1670. * product of width and height), then resolution width and finally by refresh
  1671. * rate.
  1672. *
  1673. * @param[in] monitor The monitor to query.
  1674. * @param[out] count Where to store the number of video modes in the returned
  1675. * array. This is set to zero if an error occurred.
  1676. * @return An array of video modes, or `NULL` if an
  1677. * [error](@ref error_handling) occurred.
  1678. *
  1679. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
  1680. * GLFW_PLATFORM_ERROR.
  1681. *
  1682. * @pointer_lifetime The returned array is allocated and freed by GLFW. You
  1683. * should not free it yourself. It is valid until the specified monitor is
  1684. * disconnected, this function is called again for that monitor or the library
  1685. * is terminated.
  1686. *
  1687. * @thread_safety This function must only be called from the main thread.
  1688. *
  1689. * @sa @ref monitor_modes
  1690. * @sa @ref glfwGetVideoMode
  1691. *
  1692. * @since Added in version 1.0.
  1693. * @glfw3 Changed to return an array of modes for a specific monitor.
  1694. *
  1695. * @ingroup monitor
  1696. *)
  1697. function glfwGetVideoModes(monitor: PGLFWmonitor; count: PInteger): PGLFWvidmode; cdecl;
  1698. external libglfw3 name _PU + 'glfwGetVideoModes';
  1699. (*! @brief Returns the current mode of the specified monitor.
  1700. *
  1701. * This function returns the current video mode of the specified monitor. If
  1702. * you have created a full screen window for that monitor, the return value
  1703. * will depend on whether that window is iconified.
  1704. *
  1705. * @param[in] monitor The monitor to query.
  1706. * @return The current mode of the monitor, or `NULL` if an
  1707. * [error](@ref error_handling) occurred.
  1708. *
  1709. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
  1710. * GLFW_PLATFORM_ERROR.
  1711. *
  1712. * @pointer_lifetime The returned array is allocated and freed by GLFW. You
  1713. * should not free it yourself. It is valid until the specified monitor is
  1714. * disconnected or the library is terminated.
  1715. *
  1716. * @thread_safety This function must only be called from the main thread.
  1717. *
  1718. * @sa @ref monitor_modes
  1719. * @sa @ref glfwGetVideoModes
  1720. *
  1721. * @since Added in version 3.0. Replaces `glfwGetDesktopMode`.
  1722. *
  1723. * @ingroup monitor
  1724. *)
  1725. function glfwGetVideoMode(monitor: PGLFWmonitor): PGLFWvidmode; cdecl;
  1726. external libglfw3 name _PU + 'glfwGetVideoMode';
  1727. (*! @brief Generates a gamma ramp and sets it for the specified monitor.
  1728. *
  1729. * This function generates an appropriately sized gamma ramp from the specified
  1730. * exponent and then calls @ref glfwSetGammaRamp with it. The value must be
  1731. * a finite number greater than zero.
  1732. *
  1733. * The software controlled gamma ramp is applied _in addition_ to the hardware
  1734. * gamma correction, which today is usually an approximation of sRGB gamma.
  1735. * This means that setting a perfectly linear ramp, or gamma 1.0, will produce
  1736. * the default (usually sRGB-like) behavior.
  1737. *
  1738. * For gamma correct rendering with OpenGL or OpenGL ES, see the @ref
  1739. * GLFW_SRGB_CAPABLE hint.
  1740. *
  1741. * @param[in] monitor The monitor whose gamma ramp to set.
  1742. * @param[in] gamma The desired exponent.
  1743. *
  1744. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref GLFW_INVALID_VALUE,
  1745. * @ref GLFW_PLATFORM_ERROR and @ref GLFW_FEATURE_UNAVAILABLE (see remarks).
  1746. *
  1747. * @remark @wayland Gamma handling is a privileged protocol, this function
  1748. * will thus never be implemented and emits @ref GLFW_FEATURE_UNAVAILABLE.
  1749. *
  1750. * @thread_safety This function must only be called from the main thread.
  1751. *
  1752. * @sa @ref monitor_gamma
  1753. *
  1754. * @since Added in version 3.0.
  1755. *
  1756. * @ingroup monitor
  1757. *)
  1758. procedure glfwSetGamma(monitor: PGLFWmonitor; gamma: Single); cdecl;
  1759. external libglfw3 name _PU + 'glfwSetGamma';
  1760. (*! @brief Returns the current gamma ramp for the specified monitor.
  1761. *
  1762. * This function returns the current gamma ramp of the specified monitor.
  1763. *
  1764. * @param[in] monitor The monitor to query.
  1765. * @return The current gamma ramp, or `NULL` if an
  1766. * [error](@ref error_handling) occurred.
  1767. *
  1768. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref GLFW_PLATFORM_ERROR
  1769. * and @ref GLFW_FEATURE_UNAVAILABLE (see remarks).
  1770. *
  1771. * @remark @wayland Gamma handling is a privileged protocol, this function
  1772. * will thus never be implemented and emits @ref GLFW_FEATURE_UNAVAILABLE while
  1773. * returning `NULL`.
  1774. *
  1775. * @pointer_lifetime The returned structure and its arrays are allocated and
  1776. * freed by GLFW. You should not free them yourself. They are valid until the
  1777. * specified monitor is disconnected, this function is called again for that
  1778. * monitor or the library is terminated.
  1779. *
  1780. * @thread_safety This function must only be called from the main thread.
  1781. *
  1782. * @sa @ref monitor_gamma
  1783. *
  1784. * @since Added in version 3.0.
  1785. *
  1786. * @ingroup monitor
  1787. *)
  1788. function glfwGetGammaRamp(monitor: PGLFWmonitor): PGLFWgammaramp; cdecl;
  1789. external libglfw3 name _PU + 'glfwGetGammaRamp';
  1790. (*! @brief Sets the current gamma ramp for the specified monitor.
  1791. *
  1792. * This function sets the current gamma ramp for the specified monitor. The
  1793. * original gamma ramp for that monitor is saved by GLFW the first time this
  1794. * function is called and is restored by @ref glfwTerminate.
  1795. *
  1796. * The software controlled gamma ramp is applied _in addition_ to the hardware
  1797. * gamma correction, which today is usually an approximation of sRGB gamma.
  1798. * This means that setting a perfectly linear ramp, or gamma 1.0, will produce
  1799. * the default (usually sRGB-like) behavior.
  1800. *
  1801. * For gamma correct rendering with OpenGL or OpenGL ES, see the @ref
  1802. * GLFW_SRGB_CAPABLE hint.
  1803. *
  1804. * @param[in] monitor The monitor whose gamma ramp to set.
  1805. * @param[in] ramp The gamma ramp to use.
  1806. *
  1807. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref GLFW_PLATFORM_ERROR
  1808. * and @ref GLFW_FEATURE_UNAVAILABLE (see remarks).
  1809. *
  1810. * @remark The size of the specified gamma ramp should match the size of the
  1811. * current ramp for that monitor.
  1812. *
  1813. * @remark @win32 The gamma ramp size must be 256.
  1814. *
  1815. * @remark @wayland Gamma handling is a privileged protocol, this function
  1816. * will thus never be implemented and emits @ref GLFW_FEATURE_UNAVAILABLE.
  1817. *
  1818. * @pointer_lifetime The specified gamma ramp is copied before this function
  1819. * returns.
  1820. *
  1821. * @thread_safety This function must only be called from the main thread.
  1822. *
  1823. * @sa @ref monitor_gamma
  1824. *
  1825. * @since Added in version 3.0.
  1826. *
  1827. * @ingroup monitor
  1828. *)
  1829. procedure glfwSetGammaRamp(monitor: PGLFWmonitor; const ramp: PGLFWgammaramp); cdecl;
  1830. external libglfw3 name _PU + 'glfwSetGammaRamp';
  1831. (*! @brief Resets all window hints to their default values.
  1832. *
  1833. * This function resets all window hints to their
  1834. * [default values](@ref window_hints_values).
  1835. *
  1836. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  1837. *
  1838. * @thread_safety This function must only be called from the main thread.
  1839. *
  1840. * @sa @ref window_hints
  1841. * @sa @ref glfwWindowHint
  1842. * @sa @ref glfwWindowHintString
  1843. *
  1844. * @since Added in version 3.0.
  1845. *
  1846. * @ingroup window
  1847. *)
  1848. procedure glfwDefaultWindowHints(); cdecl;
  1849. external libglfw3 name _PU + 'glfwDefaultWindowHints';
  1850. (*! @brief Sets the specified window hint to the desired value.
  1851. *
  1852. * This function sets hints for the next call to @ref glfwCreateWindow. The
  1853. * hints, once set, retain their values until changed by a call to this
  1854. * function or @ref glfwDefaultWindowHints, or until the library is terminated.
  1855. *
  1856. * Only integer value hints can be set with this function. String value hints
  1857. * are set with @ref glfwWindowHintString.
  1858. *
  1859. * This function does not check whether the specified hint values are valid.
  1860. * If you set hints to invalid values this will instead be reported by the next
  1861. * call to @ref glfwCreateWindow.
  1862. *
  1863. * Some hints are platform specific. These may be set on any platform but they
  1864. * will only affect their specific platform. Other platforms will ignore them.
  1865. * Setting these hints requires no platform specific headers or functions.
  1866. *
  1867. * @param[in] hint The [window hint](@ref window_hints) to set.
  1868. * @param[in] value The new value of the window hint.
  1869. *
  1870. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
  1871. * GLFW_INVALID_ENUM.
  1872. *
  1873. * @thread_safety This function must only be called from the main thread.
  1874. *
  1875. * @sa @ref window_hints
  1876. * @sa @ref glfwWindowHintString
  1877. * @sa @ref glfwDefaultWindowHints
  1878. *
  1879. * @since Added in version 3.0. Replaces `glfwOpenWindowHint`.
  1880. *
  1881. * @ingroup window
  1882. *)
  1883. procedure glfwWindowHint(hint: Integer; value: Integer); cdecl;
  1884. external libglfw3 name _PU + 'glfwWindowHint';
  1885. (*! @brief Sets the specified window hint to the desired value.
  1886. *
  1887. * This function sets hints for the next call to @ref glfwCreateWindow. The
  1888. * hints, once set, retain their values until changed by a call to this
  1889. * function or @ref glfwDefaultWindowHints, or until the library is terminated.
  1890. *
  1891. * Only string type hints can be set with this function. Integer value hints
  1892. * are set with @ref glfwWindowHint.
  1893. *
  1894. * This function does not check whether the specified hint values are valid.
  1895. * If you set hints to invalid values this will instead be reported by the next
  1896. * call to @ref glfwCreateWindow.
  1897. *
  1898. * Some hints are platform specific. These may be set on any platform but they
  1899. * will only affect their specific platform. Other platforms will ignore them.
  1900. * Setting these hints requires no platform specific headers or functions.
  1901. *
  1902. * @param[in] hint The [window hint](@ref window_hints) to set.
  1903. * @param[in] value The new value of the window hint.
  1904. *
  1905. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
  1906. * GLFW_INVALID_ENUM.
  1907. *
  1908. * @pointer_lifetime The specified string is copied before this function
  1909. * returns.
  1910. *
  1911. * @thread_safety This function must only be called from the main thread.
  1912. *
  1913. * @sa @ref window_hints
  1914. * @sa @ref glfwWindowHint
  1915. * @sa @ref glfwDefaultWindowHints
  1916. *
  1917. * @since Added in version 3.3.
  1918. *
  1919. * @ingroup window
  1920. *)
  1921. procedure glfwWindowHintString(hint: Integer; const value: PAnsiChar); cdecl;
  1922. external libglfw3 name _PU + 'glfwWindowHintString';
  1923. (*! @brief Creates a window and its associated context.
  1924. *
  1925. * This function creates a window and its associated OpenGL or OpenGL ES
  1926. * context. Most of the options controlling how the window and its context
  1927. * should be created are specified with [window hints](@ref window_hints).
  1928. *
  1929. * Successful creation does not change which context is current. Before you
  1930. * can use the newly created context, you need to
  1931. * [make it current](@ref context_current). For information about the `share`
  1932. * parameter, see @ref context_sharing.
  1933. *
  1934. * The created window, framebuffer and context may differ from what you
  1935. * requested, as not all parameters and hints are
  1936. * [hard constraints](@ref window_hints_hard). This includes the size of the
  1937. * window, especially for full screen windows. To query the actual attributes
  1938. * of the created window, framebuffer and context, see @ref
  1939. * glfwGetWindowAttrib, @ref glfwGetWindowSize and @ref glfwGetFramebufferSize.
  1940. *
  1941. * To create a full screen window, you need to specify the monitor the window
  1942. * will cover. If no monitor is specified, the window will be windowed mode.
  1943. * Unless you have a way for the user to choose a specific monitor, it is
  1944. * recommended that you pick the primary monitor. For more information on how
  1945. * to query connected monitors, see @ref monitor_monitors.
  1946. *
  1947. * For full screen windows, the specified size becomes the resolution of the
  1948. * window's _desired video mode_. As long as a full screen window is not
  1949. * iconified, the supported video mode most closely matching the desired video
  1950. * mode is set for the specified monitor. For more information about full
  1951. * screen windows, including the creation of so called _windowed full screen_
  1952. * or _borderless full screen_ windows, see @ref window_windowed_full_screen.
  1953. *
  1954. * Once you have created the window, you can switch it between windowed and
  1955. * full screen mode with @ref glfwSetWindowMonitor. This will not affect its
  1956. * OpenGL or OpenGL ES context.
  1957. *
  1958. * By default, newly created windows use the placement recommended by the
  1959. * window system. To create the window at a specific position, set the @ref
  1960. * GLFW_POSITION_X and @ref GLFW_POSITION_Y window hints before creation. To
  1961. * restore the default behavior, set either or both hints back to
  1962. * `GLFW_ANY_POSITION`.
  1963. *
  1964. * As long as at least one full screen window is not iconified, the screensaver
  1965. * is prohibited from starting.
  1966. *
  1967. * Window systems put limits on window sizes. Very large or very small window
  1968. * dimensions may be overridden by the window system on creation. Check the
  1969. * actual [size](@ref window_size) after creation.
  1970. *
  1971. * The [swap interval](@ref buffer_swap) is not set during window creation and
  1972. * the initial value may vary depending on driver settings and defaults.
  1973. *
  1974. * @param[in] width The desired width, in screen coordinates, of the window.
  1975. * This must be greater than zero.
  1976. * @param[in] height The desired height, in screen coordinates, of the window.
  1977. * This must be greater than zero.
  1978. * @param[in] title The initial, UTF-8 encoded window title.
  1979. * @param[in] monitor The monitor to use for full screen mode, or `NULL` for
  1980. * windowed mode.
  1981. * @param[in] share The window whose context to share resources with, or `NULL`
  1982. * to not share resources.
  1983. * @return The handle of the created window, or `NULL` if an
  1984. * [error](@ref error_handling) occurred.
  1985. *
  1986. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
  1987. * GLFW_INVALID_ENUM, @ref GLFW_INVALID_VALUE, @ref GLFW_API_UNAVAILABLE, @ref
  1988. * GLFW_VERSION_UNAVAILABLE, @ref GLFW_FORMAT_UNAVAILABLE and @ref
  1989. * GLFW_PLATFORM_ERROR.
  1990. *
  1991. * @remark @win32 Window creation will fail if the Microsoft GDI software
  1992. * OpenGL implementation is the only one available.
  1993. *
  1994. * @remark @win32 If the executable has an icon resource named `GLFW_ICON,` it
  1995. * will be set as the initial icon for the window. If no such icon is present,
  1996. * the `IDI_APPLICATION` icon will be used instead. To set a different icon,
  1997. * see @ref glfwSetWindowIcon.
  1998. *
  1999. * @remark @win32 The context to share resources with must not be current on
  2000. * any other thread.
  2001. *
  2002. * @remark @macos The OS only supports core profile contexts for OpenGL
  2003. * versions 3.2 and later. Before creating an OpenGL context of version 3.2 or
  2004. * later you must set the [GLFW_OPENGL_PROFILE](@ref GLFW_OPENGL_PROFILE_hint)
  2005. * hint accordingly. OpenGL 3.0 and 3.1 contexts are not supported at all
  2006. * on macOS.
  2007. *
  2008. * @remark @macos The GLFW window has no icon, as it is not a document
  2009. * window, but the dock icon will be the same as the application bundle's icon.
  2010. * For more information on bundles, see the
  2011. * [Bundle Programming Guide](https://developer.apple.com/library/mac/documentation/CoreFoundation/Conceptual/CFBundles/)
  2012. * in the Mac Developer Library.
  2013. *
  2014. * @remark @macos On OS X 10.10 and later the window frame will not be rendered
  2015. * at full resolution on Retina displays unless the
  2016. * [GLFW_COCOA_RETINA_FRAMEBUFFER](@ref GLFW_COCOA_RETINA_FRAMEBUFFER_hint)
  2017. * hint is `GLFW_TRUE` and the `NSHighResolutionCapable` key is enabled in the
  2018. * application bundle's `Info.plist`. For more information, see
  2019. * [High Resolution Guidelines for OS X](https://developer.apple.com/library/mac/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Explained/Explained.html)
  2020. * in the Mac Developer Library. The GLFW test and example programs use
  2021. * a custom `Info.plist` template for this, which can be found as
  2022. * `CMake/Info.plist.in` in the source tree.
  2023. *
  2024. * @remark @macos When activating frame autosaving with
  2025. * [GLFW_COCOA_FRAME_NAME](@ref GLFW_COCOA_FRAME_NAME_hint), the specified
  2026. * window size and position may be overridden by previously saved values.
  2027. *
  2028. * @remark @x11 Some window managers will not respect the placement of
  2029. * initially hidden windows.
  2030. *
  2031. * @remark @x11 Due to the asynchronous nature of X11, it may take a moment for
  2032. * a window to reach its requested state. This means you may not be able to
  2033. * query the final size, position or other attributes directly after window
  2034. * creation.
  2035. *
  2036. * @remark @x11 The class part of the `WM_CLASS` window property will by
  2037. * default be set to the window title passed to this function. The instance
  2038. * part will use the contents of the `RESOURCE_NAME` environment variable, if
  2039. * present and not empty, or fall back to the window title. Set the
  2040. * [GLFW_X11_CLASS_NAME](@ref GLFW_X11_CLASS_NAME_hint) and
  2041. * [GLFW_X11_INSTANCE_NAME](@ref GLFW_X11_INSTANCE_NAME_hint) window hints to
  2042. * override this.
  2043. *
  2044. * @remark @wayland Compositors should implement the xdg-decoration protocol
  2045. * for GLFW to decorate the window properly. If this protocol isn't
  2046. * supported, or if the compositor prefers client-side decorations, a very
  2047. * simple fallback frame will be drawn using the wp_viewporter protocol. A
  2048. * compositor can still emit close, maximize or fullscreen events, using for
  2049. * instance a keybind mechanism. If neither of these protocols is supported,
  2050. * the window won't be decorated.
  2051. *
  2052. * @remark @wayland A full screen window will not attempt to change the mode,
  2053. * no matter what the requested size or refresh rate.
  2054. *
  2055. * @remark @wayland Screensaver inhibition requires the idle-inhibit protocol
  2056. * to be implemented in the user's compositor.
  2057. *
  2058. * @thread_safety This function must only be called from the main thread.
  2059. *
  2060. * @sa @ref window_creation
  2061. * @sa @ref glfwDestroyWindow
  2062. *
  2063. * @since Added in version 3.0. Replaces `glfwOpenWindow`.
  2064. *
  2065. * @ingroup window
  2066. *)
  2067. function glfwCreateWindow(width: Integer; height: Integer; const title: PAnsiChar; monitor: PGLFWmonitor; share: PGLFWwindow): PGLFWwindow; cdecl;
  2068. external libglfw3 name _PU + 'glfwCreateWindow';
  2069. (*! @brief Destroys the specified window and its context.
  2070. *
  2071. * This function destroys the specified window and its context. On calling
  2072. * this function, no further callbacks will be called for that window.
  2073. *
  2074. * If the context of the specified window is current on the main thread, it is
  2075. * detached before being destroyed.
  2076. *
  2077. * @param[in] window The window to destroy.
  2078. *
  2079. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
  2080. * GLFW_PLATFORM_ERROR.
  2081. *
  2082. * @note The context of the specified window must not be current on any other
  2083. * thread when this function is called.
  2084. *
  2085. * @reentrancy This function must not be called from a callback.
  2086. *
  2087. * @thread_safety This function must only be called from the main thread.
  2088. *
  2089. * @sa @ref window_creation
  2090. * @sa @ref glfwCreateWindow
  2091. *
  2092. * @since Added in version 3.0. Replaces `glfwCloseWindow`.
  2093. *
  2094. * @ingroup window
  2095. *)
  2096. procedure glfwDestroyWindow(window: PGLFWwindow); cdecl;
  2097. external libglfw3 name _PU + 'glfwDestroyWindow';
  2098. (*! @brief Checks the close flag of the specified window.
  2099. *
  2100. * This function returns the value of the close flag of the specified window.
  2101. *
  2102. * @param[in] window The window to query.
  2103. * @return The value of the close flag.
  2104. *
  2105. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  2106. *
  2107. * @thread_safety This function may be called from any thread. Access is not
  2108. * synchronized.
  2109. *
  2110. * @sa @ref window_close
  2111. *
  2112. * @since Added in version 3.0.
  2113. *
  2114. * @ingroup window
  2115. *)
  2116. function glfwWindowShouldClose(window: PGLFWwindow): Integer; cdecl;
  2117. external libglfw3 name _PU + 'glfwWindowShouldClose';
  2118. (*! @brief Sets the close flag of the specified window.
  2119. *
  2120. * This function sets the value of the close flag of the specified window.
  2121. * This can be used to override the user's attempt to close the window, or
  2122. * to signal that it should be closed.
  2123. *
  2124. * @param[in] window The window whose flag to change.
  2125. * @param[in] value The new value.
  2126. *
  2127. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  2128. *
  2129. * @thread_safety This function may be called from any thread. Access is not
  2130. * synchronized.
  2131. *
  2132. * @sa @ref window_close
  2133. *
  2134. * @since Added in version 3.0.
  2135. *
  2136. * @ingroup window
  2137. *)
  2138. procedure glfwSetWindowShouldClose(window: PGLFWwindow; value: Integer); cdecl;
  2139. external libglfw3 name _PU + 'glfwSetWindowShouldClose';
  2140. (*! @brief Sets the title of the specified window.
  2141. *
  2142. * This function sets the window title, encoded as UTF-8, of the specified
  2143. * window.
  2144. *
  2145. * @param[in] window The window whose title to change.
  2146. * @param[in] title The UTF-8 encoded window title.
  2147. *
  2148. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
  2149. * GLFW_PLATFORM_ERROR.
  2150. *
  2151. * @remark @macos The window title will not be updated until the next time you
  2152. * process events.
  2153. *
  2154. * @thread_safety This function must only be called from the main thread.
  2155. *
  2156. * @sa @ref window_title
  2157. *
  2158. * @since Added in version 1.0.
  2159. * @glfw3 Added window handle parameter.
  2160. *
  2161. * @ingroup window
  2162. *)
  2163. procedure glfwSetWindowTitle(window: PGLFWwindow; const title: PAnsiChar); cdecl;
  2164. external libglfw3 name _PU + 'glfwSetWindowTitle';
  2165. (*! @brief Sets the icon for the specified window.
  2166. *
  2167. * This function sets the icon of the specified window. If passed an array of
  2168. * candidate images, those of or closest to the sizes desired by the system are
  2169. * selected. If no images are specified, the window reverts to its default
  2170. * icon.
  2171. *
  2172. * The pixels are 32-bit, little-endian, non-premultiplied RGBA, i.e. eight
  2173. * bits per channel with the red channel first. They are arranged canonically
  2174. * as packed sequential rows, starting from the top-left corner.
  2175. *
  2176. * The desired image sizes varies depending on platform and system settings.
  2177. * The selected images will be rescaled as needed. Good sizes include 16x16,
  2178. * 32x32 and 48x48.
  2179. *
  2180. * @param[in] window The window whose icon to set.
  2181. * @param[in] count The number of images in the specified array, or zero to
  2182. * revert to the default window icon.
  2183. * @param[in] images The images to create the icon from. This is ignored if
  2184. * count is zero.
  2185. *
  2186. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
  2187. * GLFW_INVALID_VALUE, @ref GLFW_PLATFORM_ERROR and @ref
  2188. * GLFW_FEATURE_UNAVAILABLE (see remarks).
  2189. *
  2190. * @pointer_lifetime The specified image data is copied before this function
  2191. * returns.
  2192. *
  2193. * @remark @macos Regular windows do not have icons on macOS. This function
  2194. * will emit @ref GLFW_FEATURE_UNAVAILABLE. The dock icon will be the same as
  2195. * the application bundle's icon. For more information on bundles, see the
  2196. * [Bundle Programming Guide](https://developer.apple.com/library/mac/documentation/CoreFoundation/Conceptual/CFBundles/)
  2197. * in the Mac Developer Library.
  2198. *
  2199. * @remark @wayland There is no existing protocol to change an icon, the
  2200. * window will thus inherit the one defined in the application's desktop file.
  2201. * This function will emit @ref GLFW_FEATURE_UNAVAILABLE.
  2202. *
  2203. * @thread_safety This function must only be called from the main thread.
  2204. *
  2205. * @sa @ref window_icon
  2206. *
  2207. * @since Added in version 3.2.
  2208. *
  2209. * @ingroup window
  2210. *)
  2211. procedure glfwSetWindowIcon(window: PGLFWwindow; count: Integer; const images: PGLFWimage); cdecl;
  2212. external libglfw3 name _PU + 'glfwSetWindowIcon';
  2213. (*! @brief Retrieves the position of the content area of the specified window.
  2214. *
  2215. * This function retrieves the position, in screen coordinates, of the
  2216. * upper-left corner of the content area of the specified window.
  2217. *
  2218. * Any or all of the position arguments may be `NULL`. If an error occurs, all
  2219. * non-`NULL` position arguments will be set to zero.
  2220. *
  2221. * @param[in] window The window to query.
  2222. * @param[out] xpos Where to store the x-coordinate of the upper-left corner of
  2223. * the content area, or `NULL`.
  2224. * @param[out] ypos Where to store the y-coordinate of the upper-left corner of
  2225. * the content area, or `NULL`.
  2226. *
  2227. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
  2228. * GLFW_PLATFORM_ERROR and @ref GLFW_FEATURE_UNAVAILABLE (see remarks).
  2229. *
  2230. * @remark @wayland There is no way for an application to retrieve the global
  2231. * position of its windows. This function will emit @ref
  2232. * GLFW_FEATURE_UNAVAILABLE.
  2233. *
  2234. * @thread_safety This function must only be called from the main thread.
  2235. *
  2236. * @sa @ref window_pos
  2237. * @sa @ref glfwSetWindowPos
  2238. *
  2239. * @since Added in version 3.0.
  2240. *
  2241. * @ingroup window
  2242. *)
  2243. procedure glfwGetWindowPos(window: PGLFWwindow; xpos: PInteger; ypos: PInteger); cdecl;
  2244. external libglfw3 name _PU + 'glfwGetWindowPos';
  2245. (*! @brief Sets the position of the content area of the specified window.
  2246. *
  2247. * This function sets the position, in screen coordinates, of the upper-left
  2248. * corner of the content area of the specified windowed mode window. If the
  2249. * window is a full screen window, this function does nothing.
  2250. *
  2251. * __Do not use this function__ to move an already visible window unless you
  2252. * have very good reasons for doing so, as it will confuse and annoy the user.
  2253. *
  2254. * The window manager may put limits on what positions are allowed. GLFW
  2255. * cannot and should not override these limits.
  2256. *
  2257. * @param[in] window The window to query.
  2258. * @param[in] xpos The x-coordinate of the upper-left corner of the content area.
  2259. * @param[in] ypos The y-coordinate of the upper-left corner of the content area.
  2260. *
  2261. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
  2262. * GLFW_PLATFORM_ERROR and @ref GLFW_FEATURE_UNAVAILABLE (see remarks).
  2263. *
  2264. * @remark @wayland There is no way for an application to set the global
  2265. * position of its windows. This function will emit @ref
  2266. * GLFW_FEATURE_UNAVAILABLE.
  2267. *
  2268. * @thread_safety This function must only be called from the main thread.
  2269. *
  2270. * @sa @ref window_pos
  2271. * @sa @ref glfwGetWindowPos
  2272. *
  2273. * @since Added in version 1.0.
  2274. * @glfw3 Added window handle parameter.
  2275. *
  2276. * @ingroup window
  2277. *)
  2278. procedure glfwSetWindowPos(window: PGLFWwindow; xpos: Integer; ypos: Integer); cdecl;
  2279. external libglfw3 name _PU + 'glfwSetWindowPos';
  2280. (*! @brief Retrieves the size of the content area of the specified window.
  2281. *
  2282. * This function retrieves the size, in screen coordinates, of the content area
  2283. * of the specified window. If you wish to retrieve the size of the
  2284. * framebuffer of the window in pixels, see @ref glfwGetFramebufferSize.
  2285. *
  2286. * Any or all of the size arguments may be `NULL`. If an error occurs, all
  2287. * non-`NULL` size arguments will be set to zero.
  2288. *
  2289. * @param[in] window The window whose size to retrieve.
  2290. * @param[out] width Where to store the width, in screen coordinates, of the
  2291. * content area, or `NULL`.
  2292. * @param[out] height Where to store the height, in screen coordinates, of the
  2293. * content area, or `NULL`.
  2294. *
  2295. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
  2296. * GLFW_PLATFORM_ERROR.
  2297. *
  2298. * @thread_safety This function must only be called from the main thread.
  2299. *
  2300. * @sa @ref window_size
  2301. * @sa @ref glfwSetWindowSize
  2302. *
  2303. * @since Added in version 1.0.
  2304. * @glfw3 Added window handle parameter.
  2305. *
  2306. * @ingroup window
  2307. *)
  2308. procedure glfwGetWindowSize(window: PGLFWwindow; width: PInteger; height: PInteger); cdecl;
  2309. external libglfw3 name _PU + 'glfwGetWindowSize';
  2310. (*! @brief Sets the size limits of the specified window.
  2311. *
  2312. * This function sets the size limits of the content area of the specified
  2313. * window. If the window is full screen, the size limits only take effect
  2314. * once it is made windowed. If the window is not resizable, this function
  2315. * does nothing.
  2316. *
  2317. * The size limits are applied immediately to a windowed mode window and may
  2318. * cause it to be resized.
  2319. *
  2320. * The maximum dimensions must be greater than or equal to the minimum
  2321. * dimensions and all must be greater than or equal to zero.
  2322. *
  2323. * @param[in] window The window to set limits for.
  2324. * @param[in] minwidth The minimum width, in screen coordinates, of the content
  2325. * area, or `GLFW_DONT_CARE`.
  2326. * @param[in] minheight The minimum height, in screen coordinates, of the
  2327. * content area, or `GLFW_DONT_CARE`.
  2328. * @param[in] maxwidth The maximum width, in screen coordinates, of the content
  2329. * area, or `GLFW_DONT_CARE`.
  2330. * @param[in] maxheight The maximum height, in screen coordinates, of the
  2331. * content area, or `GLFW_DONT_CARE`.
  2332. *
  2333. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
  2334. * GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR.
  2335. *
  2336. * @remark If you set size limits and an aspect ratio that conflict, the
  2337. * results are undefined.
  2338. *
  2339. * @remark @wayland The size limits will not be applied until the window is
  2340. * actually resized, either by the user or by the compositor.
  2341. *
  2342. * @thread_safety This function must only be called from the main thread.
  2343. *
  2344. * @sa @ref window_sizelimits
  2345. * @sa @ref glfwSetWindowAspectRatio
  2346. *
  2347. * @since Added in version 3.2.
  2348. *
  2349. * @ingroup window
  2350. *)
  2351. procedure glfwSetWindowSizeLimits(window: PGLFWwindow; minwidth: Integer; minheight: Integer; maxwidth: Integer; maxheight: Integer); cdecl;
  2352. external libglfw3 name _PU + 'glfwSetWindowSizeLimits';
  2353. (*! @brief Sets the aspect ratio of the specified window.
  2354. *
  2355. * This function sets the required aspect ratio of the content area of the
  2356. * specified window. If the window is full screen, the aspect ratio only takes
  2357. * effect once it is made windowed. If the window is not resizable, this
  2358. * function does nothing.
  2359. *
  2360. * The aspect ratio is specified as a numerator and a denominator and both
  2361. * values must be greater than zero. For example, the common 16:9 aspect ratio
  2362. * is specified as 16 and 9, respectively.
  2363. *
  2364. * If the numerator and denominator is set to `GLFW_DONT_CARE` then the aspect
  2365. * ratio limit is disabled.
  2366. *
  2367. * The aspect ratio is applied immediately to a windowed mode window and may
  2368. * cause it to be resized.
  2369. *
  2370. * @param[in] window The window to set limits for.
  2371. * @param[in] numer The numerator of the desired aspect ratio, or
  2372. * `GLFW_DONT_CARE`.
  2373. * @param[in] denom The denominator of the desired aspect ratio, or
  2374. * `GLFW_DONT_CARE`.
  2375. *
  2376. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
  2377. * GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR.
  2378. *
  2379. * @remark If you set size limits and an aspect ratio that conflict, the
  2380. * results are undefined.
  2381. *
  2382. * @remark @wayland The aspect ratio will not be applied until the window is
  2383. * actually resized, either by the user or by the compositor.
  2384. *
  2385. * @thread_safety This function must only be called from the main thread.
  2386. *
  2387. * @sa @ref window_sizelimits
  2388. * @sa @ref glfwSetWindowSizeLimits
  2389. *
  2390. * @since Added in version 3.2.
  2391. *
  2392. * @ingroup window
  2393. *)
  2394. procedure glfwSetWindowAspectRatio(window: PGLFWwindow; numer: Integer; denom: Integer); cdecl;
  2395. external libglfw3 name _PU + 'glfwSetWindowAspectRatio';
  2396. (*! @brief Sets the size of the content area of the specified window.
  2397. *
  2398. * This function sets the size, in screen coordinates, of the content area of
  2399. * the specified window.
  2400. *
  2401. * For full screen windows, this function updates the resolution of its desired
  2402. * video mode and switches to the video mode closest to it, without affecting
  2403. * the window's context. As the context is unaffected, the bit depths of the
  2404. * framebuffer remain unchanged.
  2405. *
  2406. * If you wish to update the refresh rate of the desired video mode in addition
  2407. * to its resolution, see @ref glfwSetWindowMonitor.
  2408. *
  2409. * The window manager may put limits on what sizes are allowed. GLFW cannot
  2410. * and should not override these limits.
  2411. *
  2412. * @param[in] window The window to resize.
  2413. * @param[in] width The desired width, in screen coordinates, of the window
  2414. * content area.
  2415. * @param[in] height The desired height, in screen coordinates, of the window
  2416. * content area.
  2417. *
  2418. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
  2419. * GLFW_PLATFORM_ERROR.
  2420. *
  2421. * @remark @wayland A full screen window will not attempt to change the mode,
  2422. * no matter what the requested size.
  2423. *
  2424. * @thread_safety This function must only be called from the main thread.
  2425. *
  2426. * @sa @ref window_size
  2427. * @sa @ref glfwGetWindowSize
  2428. * @sa @ref glfwSetWindowMonitor
  2429. *
  2430. * @since Added in version 1.0.
  2431. * @glfw3 Added window handle parameter.
  2432. *
  2433. * @ingroup window
  2434. *)
  2435. procedure glfwSetWindowSize(window: PGLFWwindow; width: Integer; height: Integer); cdecl;
  2436. external libglfw3 name _PU + 'glfwSetWindowSize';
  2437. (*! @brief Retrieves the size of the framebuffer of the specified window.
  2438. *
  2439. * This function retrieves the size, in pixels, of the framebuffer of the
  2440. * specified window. If you wish to retrieve the size of the window in screen
  2441. * coordinates, see @ref glfwGetWindowSize.
  2442. *
  2443. * Any or all of the size arguments may be `NULL`. If an error occurs, all
  2444. * non-`NULL` size arguments will be set to zero.
  2445. *
  2446. * @param[in] window The window whose framebuffer to query.
  2447. * @param[out] width Where to store the width, in pixels, of the framebuffer,
  2448. * or `NULL`.
  2449. * @param[out] height Where to store the height, in pixels, of the framebuffer,
  2450. * or `NULL`.
  2451. *
  2452. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
  2453. * GLFW_PLATFORM_ERROR.
  2454. *
  2455. * @thread_safety This function must only be called from the main thread.
  2456. *
  2457. * @sa @ref window_fbsize
  2458. * @sa @ref glfwSetFramebufferSizeCallback
  2459. *
  2460. * @since Added in version 3.0.
  2461. *
  2462. * @ingroup window
  2463. *)
  2464. procedure glfwGetFramebufferSize(window: PGLFWwindow; width: PInteger; height: PInteger); cdecl;
  2465. external libglfw3 name _PU + 'glfwGetFramebufferSize';
  2466. (*! @brief Retrieves the size of the frame of the window.
  2467. *
  2468. * This function retrieves the size, in screen coordinates, of each edge of the
  2469. * frame of the specified window. This size includes the title bar, if the
  2470. * window has one. The size of the frame may vary depending on the
  2471. * [window-related hints](@ref window_hints_wnd) used to create it.
  2472. *
  2473. * Because this function retrieves the size of each window frame edge and not
  2474. * the offset along a particular coordinate axis, the retrieved values will
  2475. * always be zero or positive.
  2476. *
  2477. * Any or all of the size arguments may be `NULL`. If an error occurs, all
  2478. * non-`NULL` size arguments will be set to zero.
  2479. *
  2480. * @param[in] window The window whose frame size to query.
  2481. * @param[out] left Where to store the size, in screen coordinates, of the left
  2482. * edge of the window frame, or `NULL`.
  2483. * @param[out] top Where to store the size, in screen coordinates, of the top
  2484. * edge of the window frame, or `NULL`.
  2485. * @param[out] right Where to store the size, in screen coordinates, of the
  2486. * right edge of the window frame, or `NULL`.
  2487. * @param[out] bottom Where to store the size, in screen coordinates, of the
  2488. * bottom edge of the window frame, or `NULL`.
  2489. *
  2490. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
  2491. * GLFW_PLATFORM_ERROR.
  2492. *
  2493. * @thread_safety This function must only be called from the main thread.
  2494. *
  2495. * @sa @ref window_size
  2496. *
  2497. * @since Added in version 3.1.
  2498. *
  2499. * @ingroup window
  2500. *)
  2501. procedure glfwGetWindowFrameSize(window: PGLFWwindow; left: PInteger; top: PInteger; right: PInteger; bottom: PInteger); cdecl;
  2502. external libglfw3 name _PU + 'glfwGetWindowFrameSize';
  2503. (*! @brief Retrieves the content scale for the specified window.
  2504. *
  2505. * This function retrieves the content scale for the specified window. The
  2506. * content scale is the ratio between the current DPI and the platform's
  2507. * default DPI. This is especially important for text and any UI elements. If
  2508. * the pixel dimensions of your UI scaled by this look appropriate on your
  2509. * machine then it should appear at a reasonable size on other machines
  2510. * regardless of their DPI and scaling settings. This relies on the system DPI
  2511. * and scaling settings being somewhat correct.
  2512. *
  2513. * On platforms where each monitors can have its own content scale, the window
  2514. * content scale will depend on which monitor the system considers the window
  2515. * to be on.
  2516. *
  2517. * @param[in] window The window to query.
  2518. * @param[out] xscale Where to store the x-axis content scale, or `NULL`.
  2519. * @param[out] yscale Where to store the y-axis content scale, or `NULL`.
  2520. *
  2521. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
  2522. * GLFW_PLATFORM_ERROR.
  2523. *
  2524. * @thread_safety This function must only be called from the main thread.
  2525. *
  2526. * @sa @ref window_scale
  2527. * @sa @ref glfwSetWindowContentScaleCallback
  2528. * @sa @ref glfwGetMonitorContentScale
  2529. *
  2530. * @since Added in version 3.3.
  2531. *
  2532. * @ingroup window
  2533. *)
  2534. procedure glfwGetWindowContentScale(window: PGLFWwindow; xscale: PSingle; yscale: PSingle); cdecl;
  2535. external libglfw3 name _PU + 'glfwGetWindowContentScale';
  2536. (*! @brief Returns the opacity of the whole window.
  2537. *
  2538. * This function returns the opacity of the window, including any decorations.
  2539. *
  2540. * The opacity (or alpha) value is a positive finite number between zero and
  2541. * one, where zero is fully transparent and one is fully opaque. If the system
  2542. * does not support whole window transparency, this function always returns one.
  2543. *
  2544. * The initial opacity value for newly created windows is one.
  2545. *
  2546. * @param[in] window The window to query.
  2547. * @return The opacity value of the specified window.
  2548. *
  2549. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
  2550. * GLFW_PLATFORM_ERROR.
  2551. *
  2552. * @thread_safety This function must only be called from the main thread.
  2553. *
  2554. * @sa @ref window_transparency
  2555. * @sa @ref glfwSetWindowOpacity
  2556. *
  2557. * @since Added in version 3.3.
  2558. *
  2559. * @ingroup window
  2560. *)
  2561. function glfwGetWindowOpacity(window: PGLFWwindow): Single; cdecl;
  2562. external libglfw3 name _PU + 'glfwGetWindowOpacity';
  2563. (*! @brief Sets the opacity of the whole window.
  2564. *
  2565. * This function sets the opacity of the window, including any decorations.
  2566. *
  2567. * The opacity (or alpha) value is a positive finite number between zero and
  2568. * one, where zero is fully transparent and one is fully opaque.
  2569. *
  2570. * The initial opacity value for newly created windows is one.
  2571. *
  2572. * A window created with framebuffer transparency may not use whole window
  2573. * transparency. The results of doing this are undefined.
  2574. *
  2575. * @param[in] window The window to set the opacity for.
  2576. * @param[in] opacity The desired opacity of the specified window.
  2577. *
  2578. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
  2579. * GLFW_PLATFORM_ERROR and @ref GLFW_FEATURE_UNAVAILABLE (see remarks).
  2580. *
  2581. * @remark @wayland There is no way to set an opacity factor for a window.
  2582. * This function will emit @ref GLFW_FEATURE_UNAVAILABLE.
  2583. *
  2584. * @thread_safety This function must only be called from the main thread.
  2585. *
  2586. * @sa @ref window_transparency
  2587. * @sa @ref glfwGetWindowOpacity
  2588. *
  2589. * @since Added in version 3.3.
  2590. *
  2591. * @ingroup window
  2592. *)
  2593. procedure glfwSetWindowOpacity(window: PGLFWwindow; opacity: Single); cdecl;
  2594. external libglfw3 name _PU + 'glfwSetWindowOpacity';
  2595. (*! @brief Iconifies the specified window.
  2596. *
  2597. * This function iconifies (minimizes) the specified window if it was
  2598. * previously restored. If the window is already iconified, this function does
  2599. * nothing.
  2600. *
  2601. * If the specified window is a full screen window, GLFW restores the original
  2602. * video mode of the monitor. The window's desired video mode is set again
  2603. * when the window is restored.
  2604. *
  2605. * @param[in] window The window to iconify.
  2606. *
  2607. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
  2608. * GLFW_PLATFORM_ERROR.
  2609. *
  2610. * @remark @wayland Once a window is iconified, @ref glfwRestoreWindow won’t
  2611. * be able to restore it. This is a design decision of the xdg-shell
  2612. * protocol.
  2613. *
  2614. * @thread_safety This function must only be called from the main thread.
  2615. *
  2616. * @sa @ref window_iconify
  2617. * @sa @ref glfwRestoreWindow
  2618. * @sa @ref glfwMaximizeWindow
  2619. *
  2620. * @since Added in version 2.1.
  2621. * @glfw3 Added window handle parameter.
  2622. *
  2623. * @ingroup window
  2624. *)
  2625. procedure glfwIconifyWindow(window: PGLFWwindow); cdecl;
  2626. external libglfw3 name _PU + 'glfwIconifyWindow';
  2627. (*! @brief Restores the specified window.
  2628. *
  2629. * This function restores the specified window if it was previously iconified
  2630. * (minimized) or maximized. If the window is already restored, this function
  2631. * does nothing.
  2632. *
  2633. * If the specified window is an iconified full screen window, its desired
  2634. * video mode is set again for its monitor when the window is restored.
  2635. *
  2636. * @param[in] window The window to restore.
  2637. *
  2638. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
  2639. * GLFW_PLATFORM_ERROR.
  2640. *
  2641. * @thread_safety This function must only be called from the main thread.
  2642. *
  2643. * @sa @ref window_iconify
  2644. * @sa @ref glfwIconifyWindow
  2645. * @sa @ref glfwMaximizeWindow
  2646. *
  2647. * @since Added in version 2.1.
  2648. * @glfw3 Added window handle parameter.
  2649. *
  2650. * @ingroup window
  2651. *)
  2652. procedure glfwRestoreWindow(window: PGLFWwindow); cdecl;
  2653. external libglfw3 name _PU + 'glfwRestoreWindow';
  2654. (*! @brief Maximizes the specified window.
  2655. *
  2656. * This function maximizes the specified window if it was previously not
  2657. * maximized. If the window is already maximized, this function does nothing.
  2658. *
  2659. * If the specified window is a full screen window, this function does nothing.
  2660. *
  2661. * @param[in] window The window to maximize.
  2662. *
  2663. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
  2664. * GLFW_PLATFORM_ERROR.
  2665. *
  2666. * @par Thread Safety
  2667. * This function may only be called from the main thread.
  2668. *
  2669. * @sa @ref window_iconify
  2670. * @sa @ref glfwIconifyWindow
  2671. * @sa @ref glfwRestoreWindow
  2672. *
  2673. * @since Added in GLFW 3.2.
  2674. *
  2675. * @ingroup window
  2676. *)
  2677. procedure glfwMaximizeWindow(window: PGLFWwindow); cdecl;
  2678. external libglfw3 name _PU + 'glfwMaximizeWindow';
  2679. (*! @brief Makes the specified window visible.
  2680. *
  2681. * This function makes the specified window visible if it was previously
  2682. * hidden. If the window is already visible or is in full screen mode, this
  2683. * function does nothing.
  2684. *
  2685. * By default, windowed mode windows are focused when shown
  2686. * Set the [GLFW_FOCUS_ON_SHOW](@ref GLFW_FOCUS_ON_SHOW_hint) window hint
  2687. * to change this behavior for all newly created windows, or change the
  2688. * behavior for an existing window with @ref glfwSetWindowAttrib.
  2689. *
  2690. * @param[in] window The window to make visible.
  2691. *
  2692. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
  2693. * GLFW_PLATFORM_ERROR.
  2694. *
  2695. * @remark @wayland Because Wayland wants every frame of the desktop to be
  2696. * complete, this function does not immediately make the window visible.
  2697. * Instead it will become visible the next time the window framebuffer is
  2698. * updated after this call.
  2699. *
  2700. * @thread_safety This function must only be called from the main thread.
  2701. *
  2702. * @sa @ref window_hide
  2703. * @sa @ref glfwHideWindow
  2704. *
  2705. * @since Added in version 3.0.
  2706. *
  2707. * @ingroup window
  2708. *)
  2709. procedure glfwShowWindow(window: PGLFWwindow); cdecl;
  2710. external libglfw3 name _PU + 'glfwShowWindow';
  2711. (*! @brief Hides the specified window.
  2712. *
  2713. * This function hides the specified window if it was previously visible. If
  2714. * the window is already hidden or is in full screen mode, this function does
  2715. * nothing.
  2716. *
  2717. * @param[in] window The window to hide.
  2718. *
  2719. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
  2720. * GLFW_PLATFORM_ERROR.
  2721. *
  2722. * @thread_safety This function must only be called from the main thread.
  2723. *
  2724. * @sa @ref window_hide
  2725. * @sa @ref glfwShowWindow
  2726. *
  2727. * @since Added in version 3.0.
  2728. *
  2729. * @ingroup window
  2730. *)
  2731. procedure glfwHideWindow(window: PGLFWwindow); cdecl;
  2732. external libglfw3 name _PU + 'glfwHideWindow';
  2733. (*! @brief Brings the specified window to front and sets input focus.
  2734. *
  2735. * This function brings the specified window to front and sets input focus.
  2736. * The window should already be visible and not iconified.
  2737. *
  2738. * By default, both windowed and full screen mode windows are focused when
  2739. * initially created. Set the [GLFW_FOCUSED](@ref GLFW_FOCUSED_hint) to
  2740. * disable this behavior.
  2741. *
  2742. * Also by default, windowed mode windows are focused when shown
  2743. * with @ref glfwShowWindow. Set the
  2744. * [GLFW_FOCUS_ON_SHOW](@ref GLFW_FOCUS_ON_SHOW_hint) to disable this behavior.
  2745. *
  2746. * __Do not use this function__ to steal focus from other applications unless
  2747. * you are certain that is what the user wants. Focus stealing can be
  2748. * extremely disruptive.
  2749. *
  2750. * For a less disruptive way of getting the user's attention, see
  2751. * [attention requests](@ref window_attention).
  2752. *
  2753. * @param[in] window The window to give input focus.
  2754. *
  2755. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
  2756. * GLFW_PLATFORM_ERROR and @ref GLFW_FEATURE_UNAVAILABLE (see remarks).
  2757. *
  2758. * @remark @wayland It is not possible for an application to set the input
  2759. * focus. This function will emit @ref GLFW_FEATURE_UNAVAILABLE.
  2760. *
  2761. * @thread_safety This function must only be called from the main thread.
  2762. *
  2763. * @sa @ref window_focus
  2764. * @sa @ref window_attention
  2765. *
  2766. * @since Added in version 3.2.
  2767. *
  2768. * @ingroup window
  2769. *)
  2770. procedure glfwFocusWindow(window: PGLFWwindow); cdecl;
  2771. external libglfw3 name _PU + 'glfwFocusWindow';
  2772. (*! @brief Requests user attention to the specified window.
  2773. *
  2774. * This function requests user attention to the specified window. On
  2775. * platforms where this is not supported, attention is requested to the
  2776. * application as a whole.
  2777. *
  2778. * Once the user has given attention, usually by focusing the window or
  2779. * application, the system will end the request automatically.
  2780. *
  2781. * @param[in] window The window to request attention to.
  2782. *
  2783. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
  2784. * GLFW_PLATFORM_ERROR.
  2785. *
  2786. * @remark @macos Attention is requested to the application as a whole, not the
  2787. * specific window.
  2788. *
  2789. * @thread_safety This function must only be called from the main thread.
  2790. *
  2791. * @sa @ref window_attention
  2792. *
  2793. * @since Added in version 3.3.
  2794. *
  2795. * @ingroup window
  2796. *)
  2797. procedure glfwRequestWindowAttention(window: PGLFWwindow); cdecl;
  2798. external libglfw3 name _PU + 'glfwRequestWindowAttention';
  2799. (*! @brief Returns the monitor that the window uses for full screen mode.
  2800. *
  2801. * This function returns the handle of the monitor that the specified window is
  2802. * in full screen on.
  2803. *
  2804. * @param[in] window The window to query.
  2805. * @return The monitor, or `NULL` if the window is in windowed mode or an
  2806. * [error](@ref error_handling) occurred.
  2807. *
  2808. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  2809. *
  2810. * @thread_safety This function must only be called from the main thread.
  2811. *
  2812. * @sa @ref window_monitor
  2813. * @sa @ref glfwSetWindowMonitor
  2814. *
  2815. * @since Added in version 3.0.
  2816. *
  2817. * @ingroup window
  2818. *)
  2819. function glfwGetWindowMonitor(window: PGLFWwindow): PGLFWmonitor; cdecl;
  2820. external libglfw3 name _PU + 'glfwGetWindowMonitor';
  2821. (*! @brief Sets the mode, monitor, video mode and placement of a window.
  2822. *
  2823. * This function sets the monitor that the window uses for full screen mode or,
  2824. * if the monitor is `NULL`, makes it windowed mode.
  2825. *
  2826. * When setting a monitor, this function updates the width, height and refresh
  2827. * rate of the desired video mode and switches to the video mode closest to it.
  2828. * The window position is ignored when setting a monitor.
  2829. *
  2830. * When the monitor is `NULL`, the position, width and height are used to
  2831. * place the window content area. The refresh rate is ignored when no monitor
  2832. * is specified.
  2833. *
  2834. * If you only wish to update the resolution of a full screen window or the
  2835. * size of a windowed mode window, see @ref glfwSetWindowSize.
  2836. *
  2837. * When a window transitions from full screen to windowed mode, this function
  2838. * restores any previous window settings such as whether it is decorated,
  2839. * floating, resizable, has size or aspect ratio limits, etc.
  2840. *
  2841. * @param[in] window The window whose monitor, size or video mode to set.
  2842. * @param[in] monitor The desired monitor, or `NULL` to set windowed mode.
  2843. * @param[in] xpos The desired x-coordinate of the upper-left corner of the
  2844. * content area.
  2845. * @param[in] ypos The desired y-coordinate of the upper-left corner of the
  2846. * content area.
  2847. * @param[in] width The desired with, in screen coordinates, of the content
  2848. * area or video mode.
  2849. * @param[in] height The desired height, in screen coordinates, of the content
  2850. * area or video mode.
  2851. * @param[in] refreshRate The desired refresh rate, in Hz, of the video mode,
  2852. * or `GLFW_DONT_CARE`.
  2853. *
  2854. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
  2855. * GLFW_PLATFORM_ERROR.
  2856. *
  2857. * @remark The OpenGL or OpenGL ES context will not be destroyed or otherwise
  2858. * affected by any resizing or mode switching, although you may need to update
  2859. * your viewport if the framebuffer size has changed.
  2860. *
  2861. * @remark @wayland The desired window position is ignored, as there is no way
  2862. * for an application to set this property.
  2863. *
  2864. * @remark @wayland Setting the window to full screen will not attempt to
  2865. * change the mode, no matter what the requested size or refresh rate.
  2866. *
  2867. * @thread_safety This function must only be called from the main thread.
  2868. *
  2869. * @sa @ref window_monitor
  2870. * @sa @ref window_full_screen
  2871. * @sa @ref glfwGetWindowMonitor
  2872. * @sa @ref glfwSetWindowSize
  2873. *
  2874. * @since Added in version 3.2.
  2875. *
  2876. * @ingroup window
  2877. *)
  2878. procedure glfwSetWindowMonitor(window: PGLFWwindow; monitor: PGLFWmonitor; xpos: Integer; ypos: Integer; width: Integer; height: Integer; refreshRate: Integer); cdecl;
  2879. external libglfw3 name _PU + 'glfwSetWindowMonitor';
  2880. (*! @brief Returns an attribute of the specified window.
  2881. *
  2882. * This function returns the value of an attribute of the specified window or
  2883. * its OpenGL or OpenGL ES context.
  2884. *
  2885. * @param[in] window The window to query.
  2886. * @param[in] attrib The [window attribute](@ref window_attribs) whose value to
  2887. * return.
  2888. * @return The value of the attribute, or zero if an
  2889. * [error](@ref error_handling) occurred.
  2890. *
  2891. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
  2892. * GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
  2893. *
  2894. * @remark Framebuffer related hints are not window attributes. See @ref
  2895. * window_attribs_fb for more information.
  2896. *
  2897. * @remark Zero is a valid value for many window and context related
  2898. * attributes so you cannot use a return value of zero as an indication of
  2899. * errors. However, this function should not fail as long as it is passed
  2900. * valid arguments and the library has been [initialized](@ref intro_init).
  2901. *
  2902. * @remark @wayland The Wayland protocol provides no way to check whether a
  2903. * window is iconfied, so @ref GLFW_ICONIFIED always returns `GLFW_FALSE`.
  2904. *
  2905. * @thread_safety This function must only be called from the main thread.
  2906. *
  2907. * @sa @ref window_attribs
  2908. * @sa @ref glfwSetWindowAttrib
  2909. *
  2910. * @since Added in version 3.0. Replaces `glfwGetWindowParam` and
  2911. * `glfwGetGLVersion`.
  2912. *
  2913. * @ingroup window
  2914. *)
  2915. function glfwGetWindowAttrib(window: PGLFWwindow; attrib: Integer): Integer; cdecl;
  2916. external libglfw3 name _PU + 'glfwGetWindowAttrib';
  2917. (*! @brief Sets an attribute of the specified window.
  2918. *
  2919. * This function sets the value of an attribute of the specified window.
  2920. *
  2921. * The supported attributes are [GLFW_DECORATED](@ref GLFW_DECORATED_attrib),
  2922. * [GLFW_RESIZABLE](@ref GLFW_RESIZABLE_attrib),
  2923. * [GLFW_FLOATING](@ref GLFW_FLOATING_attrib),
  2924. * [GLFW_AUTO_ICONIFY](@ref GLFW_AUTO_ICONIFY_attrib) and
  2925. * [GLFW_FOCUS_ON_SHOW](@ref GLFW_FOCUS_ON_SHOW_attrib).
  2926. * [GLFW_MOUSE_PASSTHROUGH](@ref GLFW_MOUSE_PASSTHROUGH_attrib)
  2927. *
  2928. * Some of these attributes are ignored for full screen windows. The new
  2929. * value will take effect if the window is later made windowed.
  2930. *
  2931. * Some of these attributes are ignored for windowed mode windows. The new
  2932. * value will take effect if the window is later made full screen.
  2933. *
  2934. * @param[in] window The window to set the attribute for.
  2935. * @param[in] attrib A supported window attribute.
  2936. * @param[in] value `GLFW_TRUE` or `GLFW_FALSE`.
  2937. *
  2938. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
  2939. * GLFW_INVALID_ENUM, @ref GLFW_INVALID_VALUE, @ref GLFW_PLATFORM_ERROR and @ref
  2940. * GLFW_FEATURE_UNAVAILABLE.
  2941. *
  2942. * @remark Calling @ref glfwGetWindowAttrib will always return the latest
  2943. * value, even if that value is ignored by the current mode of the window.
  2944. *
  2945. * @thread_safety This function must only be called from the main thread.
  2946. *
  2947. * @sa @ref window_attribs
  2948. * @sa @ref glfwGetWindowAttrib
  2949. *
  2950. * @since Added in version 3.3.
  2951. *
  2952. * @ingroup window
  2953. *)
  2954. procedure glfwSetWindowAttrib(window: PGLFWwindow; attrib: Integer; value: Integer); cdecl;
  2955. external libglfw3 name _PU + 'glfwSetWindowAttrib';
  2956. (*! @brief Sets the user pointer of the specified window.
  2957. *
  2958. * This function sets the user-defined pointer of the specified window. The
  2959. * current value is retained until the window is destroyed. The initial value
  2960. * is `NULL`.
  2961. *
  2962. * @param[in] window The window whose pointer to set.
  2963. * @param[in] pointer The new value.
  2964. *
  2965. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  2966. *
  2967. * @thread_safety This function may be called from any thread. Access is not
  2968. * synchronized.
  2969. *
  2970. * @sa @ref window_userptr
  2971. * @sa @ref glfwGetWindowUserPointer
  2972. *
  2973. * @since Added in version 3.0.
  2974. *
  2975. * @ingroup window
  2976. *)
  2977. procedure glfwSetWindowUserPointer(window: PGLFWwindow; pointer: Pointer); cdecl;
  2978. external libglfw3 name _PU + 'glfwSetWindowUserPointer';
  2979. (*! @brief Returns the user pointer of the specified window.
  2980. *
  2981. * This function returns the current value of the user-defined pointer of the
  2982. * specified window. The initial value is `NULL`.
  2983. *
  2984. * @param[in] window The window whose pointer to return.
  2985. *
  2986. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  2987. *
  2988. * @thread_safety This function may be called from any thread. Access is not
  2989. * synchronized.
  2990. *
  2991. * @sa @ref window_userptr
  2992. * @sa @ref glfwSetWindowUserPointer
  2993. *
  2994. * @since Added in version 3.0.
  2995. *
  2996. * @ingroup window
  2997. *)
  2998. function glfwGetWindowUserPointer(window: PGLFWwindow): Pointer; cdecl;
  2999. external libglfw3 name _PU + 'glfwGetWindowUserPointer';
  3000. (*! @brief Sets the position callback for the specified window.
  3001. *
  3002. * This function sets the position callback of the specified window, which is
  3003. * called when the window is moved. The callback is provided with the
  3004. * position, in screen coordinates, of the upper-left corner of the content
  3005. * area of the window.
  3006. *
  3007. * @param[in] window The window whose callback to set.
  3008. * @param[in] callback The new callback, or `NULL` to remove the currently set
  3009. * callback.
  3010. * @return The previously set callback, or `NULL` if no callback was set or the
  3011. * library had not been [initialized](@ref intro_init).
  3012. *
  3013. * @callback_signature
  3014. * @code
  3015. * void function_name(GLFWwindow* window, int xpos, int ypos)
  3016. * @endcode
  3017. * For more information about the callback parameters, see the
  3018. * [function pointer type](@ref GLFWwindowposfun).
  3019. *
  3020. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  3021. *
  3022. * @remark @wayland This callback will never be called, as there is no way for
  3023. * an application to know its global position.
  3024. *
  3025. * @thread_safety This function must only be called from the main thread.
  3026. *
  3027. * @sa @ref window_pos
  3028. *
  3029. * @since Added in version 3.0.
  3030. *
  3031. * @ingroup window
  3032. *)
  3033. function glfwSetWindowPosCallback(window: PGLFWwindow; callback: GLFWwindowposfun): GLFWwindowposfun; cdecl;
  3034. external libglfw3 name _PU + 'glfwSetWindowPosCallback';
  3035. (*! @brief Sets the size callback for the specified window.
  3036. *
  3037. * This function sets the size callback of the specified window, which is
  3038. * called when the window is resized. The callback is provided with the size,
  3039. * in screen coordinates, of the content area of the window.
  3040. *
  3041. * @param[in] window The window whose callback to set.
  3042. * @param[in] callback The new callback, or `NULL` to remove the currently set
  3043. * callback.
  3044. * @return The previously set callback, or `NULL` if no callback was set or the
  3045. * library had not been [initialized](@ref intro_init).
  3046. *
  3047. * @callback_signature
  3048. * @code
  3049. * void function_name(GLFWwindow* window, int width, int height)
  3050. * @endcode
  3051. * For more information about the callback parameters, see the
  3052. * [function pointer type](@ref GLFWwindowsizefun).
  3053. *
  3054. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  3055. *
  3056. * @thread_safety This function must only be called from the main thread.
  3057. *
  3058. * @sa @ref window_size
  3059. *
  3060. * @since Added in version 1.0.
  3061. * @glfw3 Added window handle parameter and return value.
  3062. *
  3063. * @ingroup window
  3064. *)
  3065. function glfwSetWindowSizeCallback(window: PGLFWwindow; callback: GLFWwindowsizefun): GLFWwindowsizefun; cdecl;
  3066. external libglfw3 name _PU + 'glfwSetWindowSizeCallback';
  3067. (*! @brief Sets the close callback for the specified window.
  3068. *
  3069. * This function sets the close callback of the specified window, which is
  3070. * called when the user attempts to close the window, for example by clicking
  3071. * the close widget in the title bar.
  3072. *
  3073. * The close flag is set before this callback is called, but you can modify it
  3074. * at any time with @ref glfwSetWindowShouldClose.
  3075. *
  3076. * The close callback is not triggered by @ref glfwDestroyWindow.
  3077. *
  3078. * @param[in] window The window whose callback to set.
  3079. * @param[in] callback The new callback, or `NULL` to remove the currently set
  3080. * callback.
  3081. * @return The previously set callback, or `NULL` if no callback was set or the
  3082. * library had not been [initialized](@ref intro_init).
  3083. *
  3084. * @callback_signature
  3085. * @code
  3086. * void function_name(GLFWwindow* window)
  3087. * @endcode
  3088. * For more information about the callback parameters, see the
  3089. * [function pointer type](@ref GLFWwindowclosefun).
  3090. *
  3091. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  3092. *
  3093. * @remark @macos Selecting Quit from the application menu will trigger the
  3094. * close callback for all windows.
  3095. *
  3096. * @thread_safety This function must only be called from the main thread.
  3097. *
  3098. * @sa @ref window_close
  3099. *
  3100. * @since Added in version 2.5.
  3101. * @glfw3 Added window handle parameter and return value.
  3102. *
  3103. * @ingroup window
  3104. *)
  3105. function glfwSetWindowCloseCallback(window: PGLFWwindow; callback: GLFWwindowclosefun): GLFWwindowclosefun; cdecl;
  3106. external libglfw3 name _PU + 'glfwSetWindowCloseCallback';
  3107. (*! @brief Sets the refresh callback for the specified window.
  3108. *
  3109. * This function sets the refresh callback of the specified window, which is
  3110. * called when the content area of the window needs to be redrawn, for example
  3111. * if the window has been exposed after having been covered by another window.
  3112. *
  3113. * On compositing window systems such as Aero, Compiz, Aqua or Wayland, where
  3114. * the window contents are saved off-screen, this callback may be called only
  3115. * very infrequently or never at all.
  3116. *
  3117. * @param[in] window The window whose callback to set.
  3118. * @param[in] callback The new callback, or `NULL` to remove the currently set
  3119. * callback.
  3120. * @return The previously set callback, or `NULL` if no callback was set or the
  3121. * library had not been [initialized](@ref intro_init).
  3122. *
  3123. * @callback_signature
  3124. * @code
  3125. * void function_name(GLFWwindow* window);
  3126. * @endcode
  3127. * For more information about the callback parameters, see the
  3128. * [function pointer type](@ref GLFWwindowrefreshfun).
  3129. *
  3130. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  3131. *
  3132. * @thread_safety This function must only be called from the main thread.
  3133. *
  3134. * @sa @ref window_refresh
  3135. *
  3136. * @since Added in version 2.5.
  3137. * @glfw3 Added window handle parameter and return value.
  3138. *
  3139. * @ingroup window
  3140. *)
  3141. function glfwSetWindowRefreshCallback(window: PGLFWwindow; callback: GLFWwindowrefreshfun): GLFWwindowrefreshfun; cdecl;
  3142. external libglfw3 name _PU + 'glfwSetWindowRefreshCallback';
  3143. (*! @brief Sets the focus callback for the specified window.
  3144. *
  3145. * This function sets the focus callback of the specified window, which is
  3146. * called when the window gains or loses input focus.
  3147. *
  3148. * After the focus callback is called for a window that lost input focus,
  3149. * synthetic key and mouse button release events will be generated for all such
  3150. * that had been pressed. For more information, see @ref glfwSetKeyCallback
  3151. * and @ref glfwSetMouseButtonCallback.
  3152. *
  3153. * @param[in] window The window whose callback to set.
  3154. * @param[in] callback The new callback, or `NULL` to remove the currently set
  3155. * callback.
  3156. * @return The previously set callback, or `NULL` if no callback was set or the
  3157. * library had not been [initialized](@ref intro_init).
  3158. *
  3159. * @callback_signature
  3160. * @code
  3161. * void function_name(GLFWwindow* window, int focused)
  3162. * @endcode
  3163. * For more information about the callback parameters, see the
  3164. * [function pointer type](@ref GLFWwindowfocusfun).
  3165. *
  3166. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  3167. *
  3168. * @thread_safety This function must only be called from the main thread.
  3169. *
  3170. * @sa @ref window_focus
  3171. *
  3172. * @since Added in version 3.0.
  3173. *
  3174. * @ingroup window
  3175. *)
  3176. function glfwSetWindowFocusCallback(window: PGLFWwindow; callback: GLFWwindowfocusfun): GLFWwindowfocusfun; cdecl;
  3177. external libglfw3 name _PU + 'glfwSetWindowFocusCallback';
  3178. (*! @brief Sets the iconify callback for the specified window.
  3179. *
  3180. * This function sets the iconification callback of the specified window, which
  3181. * is called when the window is iconified or restored.
  3182. *
  3183. * @param[in] window The window whose callback to set.
  3184. * @param[in] callback The new callback, or `NULL` to remove the currently set
  3185. * callback.
  3186. * @return The previously set callback, or `NULL` if no callback was set or the
  3187. * library had not been [initialized](@ref intro_init).
  3188. *
  3189. * @callback_signature
  3190. * @code
  3191. * void function_name(GLFWwindow* window, int iconified)
  3192. * @endcode
  3193. * For more information about the callback parameters, see the
  3194. * [function pointer type](@ref GLFWwindowiconifyfun).
  3195. *
  3196. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  3197. *
  3198. * @thread_safety This function must only be called from the main thread.
  3199. *
  3200. * @sa @ref window_iconify
  3201. *
  3202. * @since Added in version 3.0.
  3203. *
  3204. * @ingroup window
  3205. *)
  3206. function glfwSetWindowIconifyCallback(window: PGLFWwindow; callback: GLFWwindowiconifyfun): GLFWwindowiconifyfun; cdecl;
  3207. external libglfw3 name _PU + 'glfwSetWindowIconifyCallback';
  3208. (*! @brief Sets the maximize callback for the specified window.
  3209. *
  3210. * This function sets the maximization callback of the specified window, which
  3211. * is called when the window is maximized or restored.
  3212. *
  3213. * @param[in] window The window whose callback to set.
  3214. * @param[in] callback The new callback, or `NULL` to remove the currently set
  3215. * callback.
  3216. * @return The previously set callback, or `NULL` if no callback was set or the
  3217. * library had not been [initialized](@ref intro_init).
  3218. *
  3219. * @callback_signature
  3220. * @code
  3221. * void function_name(GLFWwindow* window, int maximized)
  3222. * @endcode
  3223. * For more information about the callback parameters, see the
  3224. * [function pointer type](@ref GLFWwindowmaximizefun).
  3225. *
  3226. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  3227. *
  3228. * @thread_safety This function must only be called from the main thread.
  3229. *
  3230. * @sa @ref window_maximize
  3231. *
  3232. * @since Added in version 3.3.
  3233. *
  3234. * @ingroup window
  3235. *)
  3236. function glfwSetWindowMaximizeCallback(window: PGLFWwindow; callback: GLFWwindowmaximizefun): GLFWwindowmaximizefun; cdecl;
  3237. external libglfw3 name _PU + 'glfwSetWindowMaximizeCallback';
  3238. (*! @brief Sets the framebuffer resize callback for the specified window.
  3239. *
  3240. * This function sets the framebuffer resize callback of the specified window,
  3241. * which is called when the framebuffer of the specified window is resized.
  3242. *
  3243. * @param[in] window The window whose callback to set.
  3244. * @param[in] callback The new callback, or `NULL` to remove the currently set
  3245. * callback.
  3246. * @return The previously set callback, or `NULL` if no callback was set or the
  3247. * library had not been [initialized](@ref intro_init).
  3248. *
  3249. * @callback_signature
  3250. * @code
  3251. * void function_name(GLFWwindow* window, int width, int height)
  3252. * @endcode
  3253. * For more information about the callback parameters, see the
  3254. * [function pointer type](@ref GLFWframebuffersizefun).
  3255. *
  3256. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  3257. *
  3258. * @thread_safety This function must only be called from the main thread.
  3259. *
  3260. * @sa @ref window_fbsize
  3261. *
  3262. * @since Added in version 3.0.
  3263. *
  3264. * @ingroup window
  3265. *)
  3266. function glfwSetFramebufferSizeCallback(window: PGLFWwindow; callback: GLFWframebuffersizefun): GLFWframebuffersizefun; cdecl;
  3267. external libglfw3 name _PU + 'glfwSetFramebufferSizeCallback';
  3268. (*! @brief Sets the window content scale callback for the specified window.
  3269. *
  3270. * This function sets the window content scale callback of the specified window,
  3271. * which is called when the content scale of the specified window changes.
  3272. *
  3273. * @param[in] window The window whose callback to set.
  3274. * @param[in] callback The new callback, or `NULL` to remove the currently set
  3275. * callback.
  3276. * @return The previously set callback, or `NULL` if no callback was set or the
  3277. * library had not been [initialized](@ref intro_init).
  3278. *
  3279. * @callback_signature
  3280. * @code
  3281. * void function_name(GLFWwindow* window, float xscale, float yscale)
  3282. * @endcode
  3283. * For more information about the callback parameters, see the
  3284. * [function pointer type](@ref GLFWwindowcontentscalefun).
  3285. *
  3286. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  3287. *
  3288. * @thread_safety This function must only be called from the main thread.
  3289. *
  3290. * @sa @ref window_scale
  3291. * @sa @ref glfwGetWindowContentScale
  3292. *
  3293. * @since Added in version 3.3.
  3294. *
  3295. * @ingroup window
  3296. *)
  3297. function glfwSetWindowContentScaleCallback(window: PGLFWwindow; callback: GLFWwindowcontentscalefun): GLFWwindowcontentscalefun; cdecl;
  3298. external libglfw3 name _PU + 'glfwSetWindowContentScaleCallback';
  3299. (*! @brief Processes all pending events.
  3300. *
  3301. * This function processes only those events that are already in the event
  3302. * queue and then returns immediately. Processing events will cause the window
  3303. * and input callbacks associated with those events to be called.
  3304. *
  3305. * On some platforms, a window move, resize or menu operation will cause event
  3306. * processing to block. This is due to how event processing is designed on
  3307. * those platforms. You can use the
  3308. * [window refresh callback](@ref window_refresh) to redraw the contents of
  3309. * your window when necessary during such operations.
  3310. *
  3311. * Do not assume that callbacks you set will _only_ be called in response to
  3312. * event processing functions like this one. While it is necessary to poll for
  3313. * events, window systems that require GLFW to register callbacks of its own
  3314. * can pass events to GLFW in response to many window system function calls.
  3315. * GLFW will pass those events on to the application callbacks before
  3316. * returning.
  3317. *
  3318. * Event processing is not required for joystick input to work.
  3319. *
  3320. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
  3321. * GLFW_PLATFORM_ERROR.
  3322. *
  3323. * @reentrancy This function must not be called from a callback.
  3324. *
  3325. * @thread_safety This function must only be called from the main thread.
  3326. *
  3327. * @sa @ref events
  3328. * @sa @ref glfwWaitEvents
  3329. * @sa @ref glfwWaitEventsTimeout
  3330. *
  3331. * @since Added in version 1.0.
  3332. *
  3333. * @ingroup window
  3334. *)
  3335. procedure glfwPollEvents(); cdecl;
  3336. external libglfw3 name _PU + 'glfwPollEvents';
  3337. (*! @brief Waits until events are queued and processes them.
  3338. *
  3339. * This function puts the calling thread to sleep until at least one event is
  3340. * available in the event queue. Once one or more events are available,
  3341. * it behaves exactly like @ref glfwPollEvents, i.e. the events in the queue
  3342. * are processed and the function then returns immediately. Processing events
  3343. * will cause the window and input callbacks associated with those events to be
  3344. * called.
  3345. *
  3346. * Since not all events are associated with callbacks, this function may return
  3347. * without a callback having been called even if you are monitoring all
  3348. * callbacks.
  3349. *
  3350. * On some platforms, a window move, resize or menu operation will cause event
  3351. * processing to block. This is due to how event processing is designed on
  3352. * those platforms. You can use the
  3353. * [window refresh callback](@ref window_refresh) to redraw the contents of
  3354. * your window when necessary during such operations.
  3355. *
  3356. * Do not assume that callbacks you set will _only_ be called in response to
  3357. * event processing functions like this one. While it is necessary to poll for
  3358. * events, window systems that require GLFW to register callbacks of its own
  3359. * can pass events to GLFW in response to many window system function calls.
  3360. * GLFW will pass those events on to the application callbacks before
  3361. * returning.
  3362. *
  3363. * Event processing is not required for joystick input to work.
  3364. *
  3365. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
  3366. * GLFW_PLATFORM_ERROR.
  3367. *
  3368. * @reentrancy This function must not be called from a callback.
  3369. *
  3370. * @thread_safety This function must only be called from the main thread.
  3371. *
  3372. * @sa @ref events
  3373. * @sa @ref glfwPollEvents
  3374. * @sa @ref glfwWaitEventsTimeout
  3375. *
  3376. * @since Added in version 2.5.
  3377. *
  3378. * @ingroup window
  3379. *)
  3380. procedure glfwWaitEvents(); cdecl;
  3381. external libglfw3 name _PU + 'glfwWaitEvents';
  3382. (*! @brief Waits with timeout until events are queued and processes them.
  3383. *
  3384. * This function puts the calling thread to sleep until at least one event is
  3385. * available in the event queue, or until the specified timeout is reached. If
  3386. * one or more events are available, it behaves exactly like @ref
  3387. * glfwPollEvents, i.e. the events in the queue are processed and the function
  3388. * then returns immediately. Processing events will cause the window and input
  3389. * callbacks associated with those events to be called.
  3390. *
  3391. * The timeout value must be a positive finite number.
  3392. *
  3393. * Since not all events are associated with callbacks, this function may return
  3394. * without a callback having been called even if you are monitoring all
  3395. * callbacks.
  3396. *
  3397. * On some platforms, a window move, resize or menu operation will cause event
  3398. * processing to block. This is due to how event processing is designed on
  3399. * those platforms. You can use the
  3400. * [window refresh callback](@ref window_refresh) to redraw the contents of
  3401. * your window when necessary during such operations.
  3402. *
  3403. * Do not assume that callbacks you set will _only_ be called in response to
  3404. * event processing functions like this one. While it is necessary to poll for
  3405. * events, window systems that require GLFW to register callbacks of its own
  3406. * can pass events to GLFW in response to many window system function calls.
  3407. * GLFW will pass those events on to the application callbacks before
  3408. * returning.
  3409. *
  3410. * Event processing is not required for joystick input to work.
  3411. *
  3412. * @param[in] timeout The maximum amount of time, in seconds, to wait.
  3413. *
  3414. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
  3415. * GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR.
  3416. *
  3417. * @reentrancy This function must not be called from a callback.
  3418. *
  3419. * @thread_safety This function must only be called from the main thread.
  3420. *
  3421. * @sa @ref events
  3422. * @sa @ref glfwPollEvents
  3423. * @sa @ref glfwWaitEvents
  3424. *
  3425. * @since Added in version 3.2.
  3426. *
  3427. * @ingroup window
  3428. *)
  3429. procedure glfwWaitEventsTimeout(timeout: Double); cdecl;
  3430. external libglfw3 name _PU + 'glfwWaitEventsTimeout';
  3431. (*! @brief Posts an empty event to the event queue.
  3432. *
  3433. * This function posts an empty event from the current thread to the event
  3434. * queue, causing @ref glfwWaitEvents or @ref glfwWaitEventsTimeout to return.
  3435. *
  3436. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
  3437. * GLFW_PLATFORM_ERROR.
  3438. *
  3439. * @thread_safety This function may be called from any thread.
  3440. *
  3441. * @sa @ref events
  3442. * @sa @ref glfwWaitEvents
  3443. * @sa @ref glfwWaitEventsTimeout
  3444. *
  3445. * @since Added in version 3.1.
  3446. *
  3447. * @ingroup window
  3448. *)
  3449. procedure glfwPostEmptyEvent(); cdecl;
  3450. external libglfw3 name _PU + 'glfwPostEmptyEvent';
  3451. (*! @brief Returns the value of an input option for the specified window.
  3452. *
  3453. * This function returns the value of an input option for the specified window.
  3454. * The mode must be one of @ref GLFW_CURSOR, @ref GLFW_STICKY_KEYS,
  3455. * @ref GLFW_STICKY_MOUSE_BUTTONS, @ref GLFW_LOCK_KEY_MODS or
  3456. * @ref GLFW_RAW_MOUSE_MOTION.
  3457. *
  3458. * @param[in] window The window to query.
  3459. * @param[in] mode One of `GLFW_CURSOR`, `GLFW_STICKY_KEYS`,
  3460. * `GLFW_STICKY_MOUSE_BUTTONS`, `GLFW_LOCK_KEY_MODS` or
  3461. * `GLFW_RAW_MOUSE_MOTION`.
  3462. *
  3463. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
  3464. * GLFW_INVALID_ENUM.
  3465. *
  3466. * @thread_safety This function must only be called from the main thread.
  3467. *
  3468. * @sa @ref glfwSetInputMode
  3469. *
  3470. * @since Added in version 3.0.
  3471. *
  3472. * @ingroup input
  3473. *)
  3474. function glfwGetInputMode(window: PGLFWwindow; mode: Integer): Integer; cdecl;
  3475. external libglfw3 name _PU + 'glfwGetInputMode';
  3476. (*! @brief Sets an input option for the specified window.
  3477. *
  3478. * This function sets an input mode option for the specified window. The mode
  3479. * must be one of @ref GLFW_CURSOR, @ref GLFW_STICKY_KEYS,
  3480. * @ref GLFW_STICKY_MOUSE_BUTTONS, @ref GLFW_LOCK_KEY_MODS or
  3481. * @ref GLFW_RAW_MOUSE_MOTION.
  3482. *
  3483. * If the mode is `GLFW_CURSOR`, the value must be one of the following cursor
  3484. * modes:
  3485. * - `GLFW_CURSOR_NORMAL` makes the cursor visible and behaving normally.
  3486. * - `GLFW_CURSOR_HIDDEN` makes the cursor invisible when it is over the
  3487. * content area of the window but does not restrict the cursor from leaving.
  3488. * - `GLFW_CURSOR_DISABLED` hides and grabs the cursor, providing virtual
  3489. * and unlimited cursor movement. This is useful for implementing for
  3490. * example 3D camera controls.
  3491. * - `GLFW_CURSOR_CAPTURED` makes the cursor visible and confines it to the
  3492. * content area of the window.
  3493. *
  3494. * If the mode is `GLFW_STICKY_KEYS`, the value must be either `GLFW_TRUE` to
  3495. * enable sticky keys, or `GLFW_FALSE` to disable it. If sticky keys are
  3496. * enabled, a key press will ensure that @ref glfwGetKey returns `GLFW_PRESS`
  3497. * the next time it is called even if the key had been released before the
  3498. * call. This is useful when you are only interested in whether keys have been
  3499. * pressed but not when or in which order.
  3500. *
  3501. * If the mode is `GLFW_STICKY_MOUSE_BUTTONS`, the value must be either
  3502. * `GLFW_TRUE` to enable sticky mouse buttons, or `GLFW_FALSE` to disable it.
  3503. * If sticky mouse buttons are enabled, a mouse button press will ensure that
  3504. * @ref glfwGetMouseButton returns `GLFW_PRESS` the next time it is called even
  3505. * if the mouse button had been released before the call. This is useful when
  3506. * you are only interested in whether mouse buttons have been pressed but not
  3507. * when or in which order.
  3508. *
  3509. * If the mode is `GLFW_LOCK_KEY_MODS`, the value must be either `GLFW_TRUE` to
  3510. * enable lock key modifier bits, or `GLFW_FALSE` to disable them. If enabled,
  3511. * callbacks that receive modifier bits will also have the @ref
  3512. * GLFW_MOD_CAPS_LOCK bit set when the event was generated with Caps Lock on,
  3513. * and the @ref GLFW_MOD_NUM_LOCK bit when Num Lock was on.
  3514. *
  3515. * If the mode is `GLFW_RAW_MOUSE_MOTION`, the value must be either `GLFW_TRUE`
  3516. * to enable raw (unscaled and unaccelerated) mouse motion when the cursor is
  3517. * disabled, or `GLFW_FALSE` to disable it. If raw motion is not supported,
  3518. * attempting to set this will emit @ref GLFW_FEATURE_UNAVAILABLE. Call @ref
  3519. * glfwRawMouseMotionSupported to check for support.
  3520. *
  3521. * @param[in] window The window whose input mode to set.
  3522. * @param[in] mode One of `GLFW_CURSOR`, `GLFW_STICKY_KEYS`,
  3523. * `GLFW_STICKY_MOUSE_BUTTONS`, `GLFW_LOCK_KEY_MODS` or
  3524. * `GLFW_RAW_MOUSE_MOTION`.
  3525. * @param[in] value The new value of the specified input mode.
  3526. *
  3527. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
  3528. * GLFW_INVALID_ENUM, @ref GLFW_PLATFORM_ERROR and @ref
  3529. * GLFW_FEATURE_UNAVAILABLE (see above).
  3530. *
  3531. * @thread_safety This function must only be called from the main thread.
  3532. *
  3533. * @sa @ref glfwGetInputMode
  3534. *
  3535. * @since Added in version 3.0. Replaces `glfwEnable` and `glfwDisable`.
  3536. *
  3537. * @ingroup input
  3538. *)
  3539. procedure glfwSetInputMode(window: PGLFWwindow; mode: Integer; value: Integer); cdecl;
  3540. external libglfw3 name _PU + 'glfwSetInputMode';
  3541. (*! @brief Returns whether raw mouse motion is supported.
  3542. *
  3543. * This function returns whether raw mouse motion is supported on the current
  3544. * system. This status does not change after GLFW has been initialized so you
  3545. * only need to check this once. If you attempt to enable raw motion on
  3546. * a system that does not support it, @ref GLFW_PLATFORM_ERROR will be emitted.
  3547. *
  3548. * Raw mouse motion is closer to the actual motion of the mouse across
  3549. * a surface. It is not affected by the scaling and acceleration applied to
  3550. * the motion of the desktop cursor. That processing is suitable for a cursor
  3551. * while raw motion is better for controlling for example a 3D camera. Because
  3552. * of this, raw mouse motion is only provided when the cursor is disabled.
  3553. *
  3554. * @return `GLFW_TRUE` if raw mouse motion is supported on the current machine,
  3555. * or `GLFW_FALSE` otherwise.
  3556. *
  3557. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  3558. *
  3559. * @thread_safety This function must only be called from the main thread.
  3560. *
  3561. * @sa @ref raw_mouse_motion
  3562. * @sa @ref glfwSetInputMode
  3563. *
  3564. * @since Added in version 3.3.
  3565. *
  3566. * @ingroup input
  3567. *)
  3568. function glfwRawMouseMotionSupported(): Integer; cdecl;
  3569. external libglfw3 name _PU + 'glfwRawMouseMotionSupported';
  3570. (*! @brief Returns the layout-specific name of the specified printable key.
  3571. *
  3572. * This function returns the name of the specified printable key, encoded as
  3573. * UTF-8. This is typically the character that key would produce without any
  3574. * modifier keys, intended for displaying key bindings to the user. For dead
  3575. * keys, it is typically the diacritic it would add to a character.
  3576. *
  3577. * __Do not use this function__ for [text input](@ref input_char). You will
  3578. * break text input for many languages even if it happens to work for yours.
  3579. *
  3580. * If the key is `GLFW_KEY_UNKNOWN`, the scancode is used to identify the key,
  3581. * otherwise the scancode is ignored. If you specify a non-printable key, or
  3582. * `GLFW_KEY_UNKNOWN` and a scancode that maps to a non-printable key, this
  3583. * function returns `NULL` but does not emit an error.
  3584. *
  3585. * This behavior allows you to always pass in the arguments in the
  3586. * [key callback](@ref input_key) without modification.
  3587. *
  3588. * The printable keys are:
  3589. * - `GLFW_KEY_APOSTROPHE`
  3590. * - `GLFW_KEY_COMMA`
  3591. * - `GLFW_KEY_MINUS`
  3592. * - `GLFW_KEY_PERIOD`
  3593. * - `GLFW_KEY_SLASH`
  3594. * - `GLFW_KEY_SEMICOLON`
  3595. * - `GLFW_KEY_EQUAL`
  3596. * - `GLFW_KEY_LEFT_BRACKET`
  3597. * - `GLFW_KEY_RIGHT_BRACKET`
  3598. * - `GLFW_KEY_BACKSLASH`
  3599. * - `GLFW_KEY_WORLD_1`
  3600. * - `GLFW_KEY_WORLD_2`
  3601. * - `GLFW_KEY_0` to `GLFW_KEY_9`
  3602. * - `GLFW_KEY_A` to `GLFW_KEY_Z`
  3603. * - `GLFW_KEY_KP_0` to `GLFW_KEY_KP_9`
  3604. * - `GLFW_KEY_KP_DECIMAL`
  3605. * - `GLFW_KEY_KP_DIVIDE`
  3606. * - `GLFW_KEY_KP_MULTIPLY`
  3607. * - `GLFW_KEY_KP_SUBTRACT`
  3608. * - `GLFW_KEY_KP_ADD`
  3609. * - `GLFW_KEY_KP_EQUAL`
  3610. *
  3611. * Names for printable keys depend on keyboard layout, while names for
  3612. * non-printable keys are the same across layouts but depend on the application
  3613. * language and should be localized along with other user interface text.
  3614. *
  3615. * @param[in] key The key to query, or `GLFW_KEY_UNKNOWN`.
  3616. * @param[in] scancode The scancode of the key to query.
  3617. * @return The UTF-8 encoded, layout-specific name of the key, or `NULL`.
  3618. *
  3619. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
  3620. * GLFW_PLATFORM_ERROR.
  3621. *
  3622. * @remark The contents of the returned string may change when a keyboard
  3623. * layout change event is received.
  3624. *
  3625. * @pointer_lifetime The returned string is allocated and freed by GLFW. You
  3626. * should not free it yourself. It is valid until the library is terminated.
  3627. *
  3628. * @thread_safety This function must only be called from the main thread.
  3629. *
  3630. * @sa @ref input_key_name
  3631. *
  3632. * @since Added in version 3.2.
  3633. *
  3634. * @ingroup input
  3635. *)
  3636. function glfwGetKeyName(key: Integer; scancode: Integer): PAnsiChar; cdecl;
  3637. external libglfw3 name _PU + 'glfwGetKeyName';
  3638. (*! @brief Returns the platform-specific scancode of the specified key.
  3639. *
  3640. * This function returns the platform-specific scancode of the specified key.
  3641. *
  3642. * If the key is `GLFW_KEY_UNKNOWN` or does not exist on the keyboard this
  3643. * method will return `-1`.
  3644. *
  3645. * @param[in] key Any [named key](@ref keys).
  3646. * @return The platform-specific scancode for the key, or `-1` if an
  3647. * [error](@ref error_handling) occurred.
  3648. *
  3649. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
  3650. * GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
  3651. *
  3652. * @thread_safety This function may be called from any thread.
  3653. *
  3654. * @sa @ref input_key
  3655. *
  3656. * @since Added in version 3.3.
  3657. *
  3658. * @ingroup input
  3659. *)
  3660. function glfwGetKeyScancode(key: Integer): Integer; cdecl;
  3661. external libglfw3 name _PU + 'glfwGetKeyScancode';
  3662. (*! @brief Returns the last reported state of a keyboard key for the specified
  3663. * window.
  3664. *
  3665. * This function returns the last state reported for the specified key to the
  3666. * specified window. The returned state is one of `GLFW_PRESS` or
  3667. * `GLFW_RELEASE`. The action `GLFW_REPEAT` is only reported to the key callback.
  3668. *
  3669. * If the @ref GLFW_STICKY_KEYS input mode is enabled, this function returns
  3670. * `GLFW_PRESS` the first time you call it for a key that was pressed, even if
  3671. * that key has already been released.
  3672. *
  3673. * The key functions deal with physical keys, with [key tokens](@ref keys)
  3674. * named after their use on the standard US keyboard layout. If you want to
  3675. * input text, use the Unicode character callback instead.
  3676. *
  3677. * The [modifier key bit masks](@ref mods) are not key tokens and cannot be
  3678. * used with this function.
  3679. *
  3680. * __Do not use this function__ to implement [text input](@ref input_char).
  3681. *
  3682. * @param[in] window The desired window.
  3683. * @param[in] key The desired [keyboard key](@ref keys). `GLFW_KEY_UNKNOWN` is
  3684. * not a valid key for this function.
  3685. * @return One of `GLFW_PRESS` or `GLFW_RELEASE`.
  3686. *
  3687. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
  3688. * GLFW_INVALID_ENUM.
  3689. *
  3690. * @thread_safety This function must only be called from the main thread.
  3691. *
  3692. * @sa @ref input_key
  3693. *
  3694. * @since Added in version 1.0.
  3695. * @glfw3 Added window handle parameter.
  3696. *
  3697. * @ingroup input
  3698. *)
  3699. function glfwGetKey(window: PGLFWwindow; key: Integer): Integer; cdecl;
  3700. external libglfw3 name _PU + 'glfwGetKey';
  3701. (*! @brief Returns the last reported state of a mouse button for the specified
  3702. * window.
  3703. *
  3704. * This function returns the last state reported for the specified mouse button
  3705. * to the specified window. The returned state is one of `GLFW_PRESS` or
  3706. * `GLFW_RELEASE`.
  3707. *
  3708. * If the @ref GLFW_STICKY_MOUSE_BUTTONS input mode is enabled, this function
  3709. * returns `GLFW_PRESS` the first time you call it for a mouse button that was
  3710. * pressed, even if that mouse button has already been released.
  3711. *
  3712. * @param[in] window The desired window.
  3713. * @param[in] button The desired [mouse button](@ref buttons).
  3714. * @return One of `GLFW_PRESS` or `GLFW_RELEASE`.
  3715. *
  3716. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
  3717. * GLFW_INVALID_ENUM.
  3718. *
  3719. * @thread_safety This function must only be called from the main thread.
  3720. *
  3721. * @sa @ref input_mouse_button
  3722. *
  3723. * @since Added in version 1.0.
  3724. * @glfw3 Added window handle parameter.
  3725. *
  3726. * @ingroup input
  3727. *)
  3728. function glfwGetMouseButton(window: PGLFWwindow; button: Integer): Integer; cdecl;
  3729. external libglfw3 name _PU + 'glfwGetMouseButton';
  3730. (*! @brief Retrieves the position of the cursor relative to the content area of
  3731. * the window.
  3732. *
  3733. * This function returns the position of the cursor, in screen coordinates,
  3734. * relative to the upper-left corner of the content area of the specified
  3735. * window.
  3736. *
  3737. * If the cursor is disabled (with `GLFW_CURSOR_DISABLED`) then the cursor
  3738. * position is unbounded and limited only by the minimum and maximum values of
  3739. * a `double`.
  3740. *
  3741. * The coordinate can be converted to their integer equivalents with the
  3742. * `floor` function. Casting directly to an integer type works for positive
  3743. * coordinates, but fails for negative ones.
  3744. *
  3745. * Any or all of the position arguments may be `NULL`. If an error occurs, all
  3746. * non-`NULL` position arguments will be set to zero.
  3747. *
  3748. * @param[in] window The desired window.
  3749. * @param[out] xpos Where to store the cursor x-coordinate, relative to the
  3750. * left edge of the content area, or `NULL`.
  3751. * @param[out] ypos Where to store the cursor y-coordinate, relative to the to
  3752. * top edge of the content area, or `NULL`.
  3753. *
  3754. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
  3755. * GLFW_PLATFORM_ERROR.
  3756. *
  3757. * @thread_safety This function must only be called from the main thread.
  3758. *
  3759. * @sa @ref cursor_pos
  3760. * @sa @ref glfwSetCursorPos
  3761. *
  3762. * @since Added in version 3.0. Replaces `glfwGetMousePos`.
  3763. *
  3764. * @ingroup input
  3765. *)
  3766. procedure glfwGetCursorPos(window: PGLFWwindow; xpos: PDouble; ypos: PDouble); cdecl;
  3767. external libglfw3 name _PU + 'glfwGetCursorPos';
  3768. (*! @brief Sets the position of the cursor, relative to the content area of the
  3769. * window.
  3770. *
  3771. * This function sets the position, in screen coordinates, of the cursor
  3772. * relative to the upper-left corner of the content area of the specified
  3773. * window. The window must have input focus. If the window does not have
  3774. * input focus when this function is called, it fails silently.
  3775. *
  3776. * __Do not use this function__ to implement things like camera controls. GLFW
  3777. * already provides the `GLFW_CURSOR_DISABLED` cursor mode that hides the
  3778. * cursor, transparently re-centers it and provides unconstrained cursor
  3779. * motion. See @ref glfwSetInputMode for more information.
  3780. *
  3781. * If the cursor mode is `GLFW_CURSOR_DISABLED` then the cursor position is
  3782. * unconstrained and limited only by the minimum and maximum values of
  3783. * a `double`.
  3784. *
  3785. * @param[in] window The desired window.
  3786. * @param[in] xpos The desired x-coordinate, relative to the left edge of the
  3787. * content area.
  3788. * @param[in] ypos The desired y-coordinate, relative to the top edge of the
  3789. * content area.
  3790. *
  3791. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
  3792. * GLFW_PLATFORM_ERROR and @ref GLFW_FEATURE_UNAVAILABLE (see remarks).
  3793. *
  3794. * @remark @wayland This function will only work when the cursor mode is
  3795. * `GLFW_CURSOR_DISABLED`, otherwise it will emit @ref GLFW_FEATURE_UNAVAILABLE.
  3796. *
  3797. * @thread_safety This function must only be called from the main thread.
  3798. *
  3799. * @sa @ref cursor_pos
  3800. * @sa @ref glfwGetCursorPos
  3801. *
  3802. * @since Added in version 3.0. Replaces `glfwSetMousePos`.
  3803. *
  3804. * @ingroup input
  3805. *)
  3806. procedure glfwSetCursorPos(window: PGLFWwindow; xpos: Double; ypos: Double); cdecl;
  3807. external libglfw3 name _PU + 'glfwSetCursorPos';
  3808. (*! @brief Creates a custom cursor.
  3809. *
  3810. * Creates a new custom cursor image that can be set for a window with @ref
  3811. * glfwSetCursor. The cursor can be destroyed with @ref glfwDestroyCursor.
  3812. * Any remaining cursors are destroyed by @ref glfwTerminate.
  3813. *
  3814. * The pixels are 32-bit, little-endian, non-premultiplied RGBA, i.e. eight
  3815. * bits per channel with the red channel first. They are arranged canonically
  3816. * as packed sequential rows, starting from the top-left corner.
  3817. *
  3818. * The cursor hotspot is specified in pixels, relative to the upper-left corner
  3819. * of the cursor image. Like all other coordinate systems in GLFW, the X-axis
  3820. * points to the right and the Y-axis points down.
  3821. *
  3822. * @param[in] image The desired cursor image.
  3823. * @param[in] xhot The desired x-coordinate, in pixels, of the cursor hotspot.
  3824. * @param[in] yhot The desired y-coordinate, in pixels, of the cursor hotspot.
  3825. * @return The handle of the created cursor, or `NULL` if an
  3826. * [error](@ref error_handling) occurred.
  3827. *
  3828. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
  3829. * GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR.
  3830. *
  3831. * @pointer_lifetime The specified image data is copied before this function
  3832. * returns.
  3833. *
  3834. * @thread_safety This function must only be called from the main thread.
  3835. *
  3836. * @sa @ref cursor_object
  3837. * @sa @ref glfwDestroyCursor
  3838. * @sa @ref glfwCreateStandardCursor
  3839. *
  3840. * @since Added in version 3.1.
  3841. *
  3842. * @ingroup input
  3843. *)
  3844. function glfwCreateCursor(const image: PGLFWimage; xhot: Integer; yhot: Integer): PGLFWcursor; cdecl;
  3845. external libglfw3 name _PU + 'glfwCreateCursor';
  3846. (*! @brief Creates a cursor with a standard shape.
  3847. *
  3848. * Returns a cursor with a standard shape, that can be set for a window with
  3849. * @ref glfwSetCursor. The images for these cursors come from the system
  3850. * cursor theme and their exact appearance will vary between platforms.
  3851. *
  3852. * Most of these shapes are guaranteed to exist on every supported platform but
  3853. * a few may not be present. See the table below for details.
  3854. *
  3855. * Cursor shape | Windows | macOS | X11 | Wayland
  3856. * ------------------------------ | ------- | ----- | ------ | -------
  3857. * @ref GLFW_ARROW_CURSOR | Yes | Yes | Yes | Yes
  3858. * @ref GLFW_IBEAM_CURSOR | Yes | Yes | Yes | Yes
  3859. * @ref GLFW_CROSSHAIR_CURSOR | Yes | Yes | Yes | Yes
  3860. * @ref GLFW_POINTING_HAND_CURSOR | Yes | Yes | Yes | Yes
  3861. * @ref GLFW_RESIZE_EW_CURSOR | Yes | Yes | Yes | Yes
  3862. * @ref GLFW_RESIZE_NS_CURSOR | Yes | Yes | Yes | Yes
  3863. * @ref GLFW_RESIZE_NWSE_CURSOR | Yes | Yes<sup>1</sup> | Maybe<sup>2</sup> | Maybe<sup>2</sup>
  3864. * @ref GLFW_RESIZE_NESW_CURSOR | Yes | Yes<sup>1</sup> | Maybe<sup>2</sup> | Maybe<sup>2</sup>
  3865. * @ref GLFW_RESIZE_ALL_CURSOR | Yes | Yes | Yes | Yes
  3866. * @ref GLFW_NOT_ALLOWED_CURSOR | Yes | Yes | Maybe<sup>2</sup> | Maybe<sup>2</sup>
  3867. *
  3868. * 1) This uses a private system API and may fail in the future.
  3869. *
  3870. * 2) This uses a newer standard that not all cursor themes support.
  3871. *
  3872. * If the requested shape is not available, this function emits a @ref
  3873. * GLFW_CURSOR_UNAVAILABLE error and returns `NULL`.
  3874. *
  3875. * @param[in] shape One of the [standard shapes](@ref shapes).
  3876. * @return A new cursor ready to use or `NULL` if an
  3877. * [error](@ref error_handling) occurred.
  3878. *
  3879. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
  3880. * GLFW_INVALID_ENUM, @ref GLFW_CURSOR_UNAVAILABLE and @ref
  3881. * GLFW_PLATFORM_ERROR.
  3882. *
  3883. * @thread_safety This function must only be called from the main thread.
  3884. *
  3885. * @sa @ref cursor_standard
  3886. * @sa @ref glfwCreateCursor
  3887. *
  3888. * @since Added in version 3.1.
  3889. *
  3890. * @ingroup input
  3891. *)
  3892. function glfwCreateStandardCursor(shape: Integer): PGLFWcursor; cdecl;
  3893. external libglfw3 name _PU + 'glfwCreateStandardCursor';
  3894. (*! @brief Destroys a cursor.
  3895. *
  3896. * This function destroys a cursor previously created with @ref
  3897. * glfwCreateCursor. Any remaining cursors will be destroyed by @ref
  3898. * glfwTerminate.
  3899. *
  3900. * If the specified cursor is current for any window, that window will be
  3901. * reverted to the default cursor. This does not affect the cursor mode.
  3902. *
  3903. * @param[in] cursor The cursor object to destroy.
  3904. *
  3905. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
  3906. * GLFW_PLATFORM_ERROR.
  3907. *
  3908. * @reentrancy This function must not be called from a callback.
  3909. *
  3910. * @thread_safety This function must only be called from the main thread.
  3911. *
  3912. * @sa @ref cursor_object
  3913. * @sa @ref glfwCreateCursor
  3914. *
  3915. * @since Added in version 3.1.
  3916. *
  3917. * @ingroup input
  3918. *)
  3919. procedure glfwDestroyCursor(cursor: PGLFWcursor); cdecl;
  3920. external libglfw3 name _PU + 'glfwDestroyCursor';
  3921. (*! @brief Sets the cursor for the window.
  3922. *
  3923. * This function sets the cursor image to be used when the cursor is over the
  3924. * content area of the specified window. The set cursor will only be visible
  3925. * when the [cursor mode](@ref cursor_mode) of the window is
  3926. * `GLFW_CURSOR_NORMAL`.
  3927. *
  3928. * On some platforms, the set cursor may not be visible unless the window also
  3929. * has input focus.
  3930. *
  3931. * @param[in] window The window to set the cursor for.
  3932. * @param[in] cursor The cursor to set, or `NULL` to switch back to the default
  3933. * arrow cursor.
  3934. *
  3935. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
  3936. * GLFW_PLATFORM_ERROR.
  3937. *
  3938. * @thread_safety This function must only be called from the main thread.
  3939. *
  3940. * @sa @ref cursor_object
  3941. *
  3942. * @since Added in version 3.1.
  3943. *
  3944. * @ingroup input
  3945. *)
  3946. procedure glfwSetCursor(window: PGLFWwindow; cursor: PGLFWcursor); cdecl;
  3947. external libglfw3 name _PU + 'glfwSetCursor';
  3948. (*! @brief Sets the key callback.
  3949. *
  3950. * This function sets the key callback of the specified window, which is called
  3951. * when a key is pressed, repeated or released.
  3952. *
  3953. * The key functions deal with physical keys, with layout independent
  3954. * [key tokens](@ref keys) named after their values in the standard US keyboard
  3955. * layout. If you want to input text, use the
  3956. * [character callback](@ref glfwSetCharCallback) instead.
  3957. *
  3958. * When a window loses input focus, it will generate synthetic key release
  3959. * events for all pressed named keys. You can tell these events from
  3960. * user-generated events by the fact that the synthetic ones are generated
  3961. * after the focus loss event has been processed, i.e. after the
  3962. * [window focus callback](@ref glfwSetWindowFocusCallback) has been called.
  3963. *
  3964. * The scancode of a key is specific to that platform or sometimes even to that
  3965. * machine. Scancodes are intended to allow users to bind keys that don't have
  3966. * a GLFW key token. Such keys have `key` set to `GLFW_KEY_UNKNOWN`, their
  3967. * state is not saved and so it cannot be queried with @ref glfwGetKey.
  3968. *
  3969. * Sometimes GLFW needs to generate synthetic key events, in which case the
  3970. * scancode may be zero.
  3971. *
  3972. * @param[in] window The window whose callback to set.
  3973. * @param[in] callback The new key callback, or `NULL` to remove the currently
  3974. * set callback.
  3975. * @return The previously set callback, or `NULL` if no callback was set or the
  3976. * library had not been [initialized](@ref intro_init).
  3977. *
  3978. * @callback_signature
  3979. * @code
  3980. * void function_name(GLFWwindow* window, int key, int scancode, int action, int mods)
  3981. * @endcode
  3982. * For more information about the callback parameters, see the
  3983. * [function pointer type](@ref GLFWkeyfun).
  3984. *
  3985. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  3986. *
  3987. * @thread_safety This function must only be called from the main thread.
  3988. *
  3989. * @sa @ref input_key
  3990. *
  3991. * @since Added in version 1.0.
  3992. * @glfw3 Added window handle parameter and return value.
  3993. *
  3994. * @ingroup input
  3995. *)
  3996. function glfwSetKeyCallback(window: PGLFWwindow; callback: GLFWkeyfun): GLFWkeyfun; cdecl;
  3997. external libglfw3 name _PU + 'glfwSetKeyCallback';
  3998. (*! @brief Sets the Unicode character callback.
  3999. *
  4000. * This function sets the character callback of the specified window, which is
  4001. * called when a Unicode character is input.
  4002. *
  4003. * The character callback is intended for Unicode text input. As it deals with
  4004. * characters, it is keyboard layout dependent, whereas the
  4005. * [key callback](@ref glfwSetKeyCallback) is not. Characters do not map 1:1
  4006. * to physical keys, as a key may produce zero, one or more characters. If you
  4007. * want to know whether a specific physical key was pressed or released, see
  4008. * the key callback instead.
  4009. *
  4010. * The character callback behaves as system text input normally does and will
  4011. * not be called if modifier keys are held down that would prevent normal text
  4012. * input on that platform, for example a Super (Command) key on macOS or Alt key
  4013. * on Windows.
  4014. *
  4015. * @param[in] window The window whose callback to set.
  4016. * @param[in] callback The new callback, or `NULL` to remove the currently set
  4017. * callback.
  4018. * @return The previously set callback, or `NULL` if no callback was set or the
  4019. * library had not been [initialized](@ref intro_init).
  4020. *
  4021. * @callback_signature
  4022. * @code
  4023. * void function_name(GLFWwindow* window, unsigned int codepoint)
  4024. * @endcode
  4025. * For more information about the callback parameters, see the
  4026. * [function pointer type](@ref GLFWcharfun).
  4027. *
  4028. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  4029. *
  4030. * @thread_safety This function must only be called from the main thread.
  4031. *
  4032. * @sa @ref input_char
  4033. *
  4034. * @since Added in version 2.4.
  4035. * @glfw3 Added window handle parameter and return value.
  4036. *
  4037. * @ingroup input
  4038. *)
  4039. function glfwSetCharCallback(window: PGLFWwindow; callback: GLFWcharfun): GLFWcharfun; cdecl;
  4040. external libglfw3 name _PU + 'glfwSetCharCallback';
  4041. (*! @brief Sets the Unicode character with modifiers callback.
  4042. *
  4043. * This function sets the character with modifiers callback of the specified
  4044. * window, which is called when a Unicode character is input regardless of what
  4045. * modifier keys are used.
  4046. *
  4047. * The character with modifiers callback is intended for implementing custom
  4048. * Unicode character input. For regular Unicode text input, see the
  4049. * [character callback](@ref glfwSetCharCallback). Like the character
  4050. * callback, the character with modifiers callback deals with characters and is
  4051. * keyboard layout dependent. Characters do not map 1:1 to physical keys, as
  4052. * a key may produce zero, one or more characters. If you want to know whether
  4053. * a specific physical key was pressed or released, see the
  4054. * [key callback](@ref glfwSetKeyCallback) instead.
  4055. *
  4056. * @param[in] window The window whose callback to set.
  4057. * @param[in] callback The new callback, or `NULL` to remove the currently set
  4058. * callback.
  4059. * @return The previously set callback, or `NULL` if no callback was set or an
  4060. * [error](@ref error_handling) occurred.
  4061. *
  4062. * @callback_signature
  4063. * @code
  4064. * void function_name(GLFWwindow* window, unsigned int codepoint, int mods)
  4065. * @endcode
  4066. * For more information about the callback parameters, see the
  4067. * [function pointer type](@ref GLFWcharmodsfun).
  4068. *
  4069. * @deprecated Scheduled for removal in version 4.0.
  4070. *
  4071. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  4072. *
  4073. * @thread_safety This function must only be called from the main thread.
  4074. *
  4075. * @sa @ref input_char
  4076. *
  4077. * @since Added in version 3.1.
  4078. *
  4079. * @ingroup input
  4080. *)
  4081. function glfwSetCharModsCallback(window: PGLFWwindow; callback: GLFWcharmodsfun): GLFWcharmodsfun; cdecl;
  4082. external libglfw3 name _PU + 'glfwSetCharModsCallback';
  4083. (*! @brief Sets the mouse button callback.
  4084. *
  4085. * This function sets the mouse button callback of the specified window, which
  4086. * is called when a mouse button is pressed or released.
  4087. *
  4088. * When a window loses input focus, it will generate synthetic mouse button
  4089. * release events for all pressed mouse buttons. You can tell these events
  4090. * from user-generated events by the fact that the synthetic ones are generated
  4091. * after the focus loss event has been processed, i.e. after the
  4092. * [window focus callback](@ref glfwSetWindowFocusCallback) has been called.
  4093. *
  4094. * @param[in] window The window whose callback to set.
  4095. * @param[in] callback The new callback, or `NULL` to remove the currently set
  4096. * callback.
  4097. * @return The previously set callback, or `NULL` if no callback was set or the
  4098. * library had not been [initialized](@ref intro_init).
  4099. *
  4100. * @callback_signature
  4101. * @code
  4102. * void function_name(GLFWwindow* window, int button, int action, int mods)
  4103. * @endcode
  4104. * For more information about the callback parameters, see the
  4105. * [function pointer type](@ref GLFWmousebuttonfun).
  4106. *
  4107. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  4108. *
  4109. * @thread_safety This function must only be called from the main thread.
  4110. *
  4111. * @sa @ref input_mouse_button
  4112. *
  4113. * @since Added in version 1.0.
  4114. * @glfw3 Added window handle parameter and return value.
  4115. *
  4116. * @ingroup input
  4117. *)
  4118. function glfwSetMouseButtonCallback(window: PGLFWwindow; callback: GLFWmousebuttonfun): GLFWmousebuttonfun; cdecl;
  4119. external libglfw3 name _PU + 'glfwSetMouseButtonCallback';
  4120. (*! @brief Sets the cursor position callback.
  4121. *
  4122. * This function sets the cursor position callback of the specified window,
  4123. * which is called when the cursor is moved. The callback is provided with the
  4124. * position, in screen coordinates, relative to the upper-left corner of the
  4125. * content area of the window.
  4126. *
  4127. * @param[in] window The window whose callback to set.
  4128. * @param[in] callback The new callback, or `NULL` to remove the currently set
  4129. * callback.
  4130. * @return The previously set callback, or `NULL` if no callback was set or the
  4131. * library had not been [initialized](@ref intro_init).
  4132. *
  4133. * @callback_signature
  4134. * @code
  4135. * void function_name(GLFWwindow* window, double xpos, double ypos);
  4136. * @endcode
  4137. * For more information about the callback parameters, see the
  4138. * [function pointer type](@ref GLFWcursorposfun).
  4139. *
  4140. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  4141. *
  4142. * @thread_safety This function must only be called from the main thread.
  4143. *
  4144. * @sa @ref cursor_pos
  4145. *
  4146. * @since Added in version 3.0. Replaces `glfwSetMousePosCallback`.
  4147. *
  4148. * @ingroup input
  4149. *)
  4150. function glfwSetCursorPosCallback(window: PGLFWwindow; callback: GLFWcursorposfun): GLFWcursorposfun; cdecl;
  4151. external libglfw3 name _PU + 'glfwSetCursorPosCallback';
  4152. (*! @brief Sets the cursor enter/leave callback.
  4153. *
  4154. * This function sets the cursor boundary crossing callback of the specified
  4155. * window, which is called when the cursor enters or leaves the content area of
  4156. * the window.
  4157. *
  4158. * @param[in] window The window whose callback to set.
  4159. * @param[in] callback The new callback, or `NULL` to remove the currently set
  4160. * callback.
  4161. * @return The previously set callback, or `NULL` if no callback was set or the
  4162. * library had not been [initialized](@ref intro_init).
  4163. *
  4164. * @callback_signature
  4165. * @code
  4166. * void function_name(GLFWwindow* window, int entered)
  4167. * @endcode
  4168. * For more information about the callback parameters, see the
  4169. * [function pointer type](@ref GLFWcursorenterfun).
  4170. *
  4171. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  4172. *
  4173. * @thread_safety This function must only be called from the main thread.
  4174. *
  4175. * @sa @ref cursor_enter
  4176. *
  4177. * @since Added in version 3.0.
  4178. *
  4179. * @ingroup input
  4180. *)
  4181. function glfwSetCursorEnterCallback(window: PGLFWwindow; callback: GLFWcursorenterfun): GLFWcursorenterfun; cdecl;
  4182. external libglfw3 name _PU + 'glfwSetCursorEnterCallback';
  4183. (*! @brief Sets the scroll callback.
  4184. *
  4185. * This function sets the scroll callback of the specified window, which is
  4186. * called when a scrolling device is used, such as a mouse wheel or scrolling
  4187. * area of a touchpad.
  4188. *
  4189. * The scroll callback receives all scrolling input, like that from a mouse
  4190. * wheel or a touchpad scrolling area.
  4191. *
  4192. * @param[in] window The window whose callback to set.
  4193. * @param[in] callback The new scroll callback, or `NULL` to remove the
  4194. * currently set callback.
  4195. * @return The previously set callback, or `NULL` if no callback was set or the
  4196. * library had not been [initialized](@ref intro_init).
  4197. *
  4198. * @callback_signature
  4199. * @code
  4200. * void function_name(GLFWwindow* window, double xoffset, double yoffset)
  4201. * @endcode
  4202. * For more information about the callback parameters, see the
  4203. * [function pointer type](@ref GLFWscrollfun).
  4204. *
  4205. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  4206. *
  4207. * @thread_safety This function must only be called from the main thread.
  4208. *
  4209. * @sa @ref scrolling
  4210. *
  4211. * @since Added in version 3.0. Replaces `glfwSetMouseWheelCallback`.
  4212. *
  4213. * @ingroup input
  4214. *)
  4215. function glfwSetScrollCallback(window: PGLFWwindow; callback: GLFWscrollfun): GLFWscrollfun; cdecl;
  4216. external libglfw3 name _PU + 'glfwSetScrollCallback';
  4217. (*! @brief Sets the path drop callback.
  4218. *
  4219. * This function sets the path drop callback of the specified window, which is
  4220. * called when one or more dragged paths are dropped on the window.
  4221. *
  4222. * Because the path array and its strings may have been generated specifically
  4223. * for that event, they are not guaranteed to be valid after the callback has
  4224. * returned. If you wish to use them after the callback returns, you need to
  4225. * make a deep copy.
  4226. *
  4227. * @param[in] window The window whose callback to set.
  4228. * @param[in] callback The new file drop callback, or `NULL` to remove the
  4229. * currently set callback.
  4230. * @return The previously set callback, or `NULL` if no callback was set or the
  4231. * library had not been [initialized](@ref intro_init).
  4232. *
  4233. * @callback_signature
  4234. * @code
  4235. * void function_name(GLFWwindow* window, int path_count, const char* paths[])
  4236. * @endcode
  4237. * For more information about the callback parameters, see the
  4238. * [function pointer type](@ref GLFWdropfun).
  4239. *
  4240. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  4241. *
  4242. * @remark @wayland File drop is currently unimplemented.
  4243. *
  4244. * @thread_safety This function must only be called from the main thread.
  4245. *
  4246. * @sa @ref path_drop
  4247. *
  4248. * @since Added in version 3.1.
  4249. *
  4250. * @ingroup input
  4251. *)
  4252. function glfwSetDropCallback(window: PGLFWwindow; callback: GLFWdropfun): GLFWdropfun; cdecl;
  4253. external libglfw3 name _PU + 'glfwSetDropCallback';
  4254. (*! @brief Returns whether the specified joystick is present.
  4255. *
  4256. * This function returns whether the specified joystick is present.
  4257. *
  4258. * There is no need to call this function before other functions that accept
  4259. * a joystick ID, as they all check for presence before performing any other
  4260. * work.
  4261. *
  4262. * @param[in] jid The [joystick](@ref joysticks) to query.
  4263. * @return `GLFW_TRUE` if the joystick is present, or `GLFW_FALSE` otherwise.
  4264. *
  4265. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
  4266. * GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
  4267. *
  4268. * @thread_safety This function must only be called from the main thread.
  4269. *
  4270. * @sa @ref joystick
  4271. *
  4272. * @since Added in version 3.0. Replaces `glfwGetJoystickParam`.
  4273. *
  4274. * @ingroup input
  4275. *)
  4276. function glfwJoystickPresent(jid: Integer): Integer; cdecl;
  4277. external libglfw3 name _PU + 'glfwJoystickPresent';
  4278. (*! @brief Returns the values of all axes of the specified joystick.
  4279. *
  4280. * This function returns the values of all axes of the specified joystick.
  4281. * Each element in the array is a value between -1.0 and 1.0.
  4282. *
  4283. * If the specified joystick is not present this function will return `NULL`
  4284. * but will not generate an error. This can be used instead of first calling
  4285. * @ref glfwJoystickPresent.
  4286. *
  4287. * @param[in] jid The [joystick](@ref joysticks) to query.
  4288. * @param[out] count Where to store the number of axis values in the returned
  4289. * array. This is set to zero if the joystick is not present or an error
  4290. * occurred.
  4291. * @return An array of axis values, or `NULL` if the joystick is not present or
  4292. * an [error](@ref error_handling) occurred.
  4293. *
  4294. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
  4295. * GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
  4296. *
  4297. * @pointer_lifetime The returned array is allocated and freed by GLFW. You
  4298. * should not free it yourself. It is valid until the specified joystick is
  4299. * disconnected or the library is terminated.
  4300. *
  4301. * @thread_safety This function must only be called from the main thread.
  4302. *
  4303. * @sa @ref joystick_axis
  4304. *
  4305. * @since Added in version 3.0. Replaces `glfwGetJoystickPos`.
  4306. *
  4307. * @ingroup input
  4308. *)
  4309. function glfwGetJoystickAxes(jid: Integer; count: PInteger): PSingle; cdecl;
  4310. external libglfw3 name _PU + 'glfwGetJoystickAxes';
  4311. (*! @brief Returns the state of all buttons of the specified joystick.
  4312. *
  4313. * This function returns the state of all buttons of the specified joystick.
  4314. * Each element in the array is either `GLFW_PRESS` or `GLFW_RELEASE`.
  4315. *
  4316. * For backward compatibility with earlier versions that did not have @ref
  4317. * glfwGetJoystickHats, the button array also includes all hats, each
  4318. * represented as four buttons. The hats are in the same order as returned by
  4319. * __glfwGetJoystickHats__ and are in the order _up_, _right_, _down_ and
  4320. * _left_. To disable these extra buttons, set the @ref
  4321. * GLFW_JOYSTICK_HAT_BUTTONS init hint before initialization.
  4322. *
  4323. * If the specified joystick is not present this function will return `NULL`
  4324. * but will not generate an error. This can be used instead of first calling
  4325. * @ref glfwJoystickPresent.
  4326. *
  4327. * @param[in] jid The [joystick](@ref joysticks) to query.
  4328. * @param[out] count Where to store the number of button states in the returned
  4329. * array. This is set to zero if the joystick is not present or an error
  4330. * occurred.
  4331. * @return An array of button states, or `NULL` if the joystick is not present
  4332. * or an [error](@ref error_handling) occurred.
  4333. *
  4334. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
  4335. * GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
  4336. *
  4337. * @pointer_lifetime The returned array is allocated and freed by GLFW. You
  4338. * should not free it yourself. It is valid until the specified joystick is
  4339. * disconnected or the library is terminated.
  4340. *
  4341. * @thread_safety This function must only be called from the main thread.
  4342. *
  4343. * @sa @ref joystick_button
  4344. *
  4345. * @since Added in version 2.2.
  4346. * @glfw3 Changed to return a dynamic array.
  4347. *
  4348. * @ingroup input
  4349. *)
  4350. function glfwGetJoystickButtons(jid: Integer; count: PInteger): PByte; cdecl;
  4351. external libglfw3 name _PU + 'glfwGetJoystickButtons';
  4352. (*! @brief Returns the state of all hats of the specified joystick.
  4353. *
  4354. * This function returns the state of all hats of the specified joystick.
  4355. * Each element in the array is one of the following values:
  4356. *
  4357. * Name | Value
  4358. * ---- | -----
  4359. * `GLFW_HAT_CENTERED` | 0
  4360. * `GLFW_HAT_UP` | 1
  4361. * `GLFW_HAT_RIGHT` | 2
  4362. * `GLFW_HAT_DOWN` | 4
  4363. * `GLFW_HAT_LEFT` | 8
  4364. * `GLFW_HAT_RIGHT_UP` | `GLFW_HAT_RIGHT` \| `GLFW_HAT_UP`
  4365. * `GLFW_HAT_RIGHT_DOWN` | `GLFW_HAT_RIGHT` \| `GLFW_HAT_DOWN`
  4366. * `GLFW_HAT_LEFT_UP` | `GLFW_HAT_LEFT` \| `GLFW_HAT_UP`
  4367. * `GLFW_HAT_LEFT_DOWN` | `GLFW_HAT_LEFT` \| `GLFW_HAT_DOWN`
  4368. *
  4369. * The diagonal directions are bitwise combinations of the primary (up, right,
  4370. * down and left) directions and you can test for these individually by ANDing
  4371. * it with the corresponding direction.
  4372. *
  4373. * @code
  4374. * if (hats[2] & GLFW_HAT_RIGHT)
  4375. * {
  4376. * // State of hat 2 could be right-up, right or right-down
  4377. * }
  4378. * @endcode
  4379. *
  4380. * If the specified joystick is not present this function will return `NULL`
  4381. * but will not generate an error. This can be used instead of first calling
  4382. * @ref glfwJoystickPresent.
  4383. *
  4384. * @param[in] jid The [joystick](@ref joysticks) to query.
  4385. * @param[out] count Where to store the number of hat states in the returned
  4386. * array. This is set to zero if the joystick is not present or an error
  4387. * occurred.
  4388. * @return An array of hat states, or `NULL` if the joystick is not present
  4389. * or an [error](@ref error_handling) occurred.
  4390. *
  4391. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
  4392. * GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
  4393. *
  4394. * @pointer_lifetime The returned array is allocated and freed by GLFW. You
  4395. * should not free it yourself. It is valid until the specified joystick is
  4396. * disconnected, this function is called again for that joystick or the library
  4397. * is terminated.
  4398. *
  4399. * @thread_safety This function must only be called from the main thread.
  4400. *
  4401. * @sa @ref joystick_hat
  4402. *
  4403. * @since Added in version 3.3.
  4404. *
  4405. * @ingroup input
  4406. *)
  4407. function glfwGetJoystickHats(jid: Integer; count: PInteger): PByte; cdecl;
  4408. external libglfw3 name _PU + 'glfwGetJoystickHats';
  4409. (*! @brief Returns the name of the specified joystick.
  4410. *
  4411. * This function returns the name, encoded as UTF-8, of the specified joystick.
  4412. * The returned string is allocated and freed by GLFW. You should not free it
  4413. * yourself.
  4414. *
  4415. * If the specified joystick is not present this function will return `NULL`
  4416. * but will not generate an error. This can be used instead of first calling
  4417. * @ref glfwJoystickPresent.
  4418. *
  4419. * @param[in] jid The [joystick](@ref joysticks) to query.
  4420. * @return The UTF-8 encoded name of the joystick, or `NULL` if the joystick
  4421. * is not present or an [error](@ref error_handling) occurred.
  4422. *
  4423. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
  4424. * GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
  4425. *
  4426. * @pointer_lifetime The returned string is allocated and freed by GLFW. You
  4427. * should not free it yourself. It is valid until the specified joystick is
  4428. * disconnected or the library is terminated.
  4429. *
  4430. * @thread_safety This function must only be called from the main thread.
  4431. *
  4432. * @sa @ref joystick_name
  4433. *
  4434. * @since Added in version 3.0.
  4435. *
  4436. * @ingroup input
  4437. *)
  4438. function glfwGetJoystickName(jid: Integer): PAnsiChar; cdecl;
  4439. external libglfw3 name _PU + 'glfwGetJoystickName';
  4440. (*! @brief Returns the SDL compatible GUID of the specified joystick.
  4441. *
  4442. * This function returns the SDL compatible GUID, as a UTF-8 encoded
  4443. * hexadecimal string, of the specified joystick. The returned string is
  4444. * allocated and freed by GLFW. You should not free it yourself.
  4445. *
  4446. * The GUID is what connects a joystick to a gamepad mapping. A connected
  4447. * joystick will always have a GUID even if there is no gamepad mapping
  4448. * assigned to it.
  4449. *
  4450. * If the specified joystick is not present this function will return `NULL`
  4451. * but will not generate an error. This can be used instead of first calling
  4452. * @ref glfwJoystickPresent.
  4453. *
  4454. * The GUID uses the format introduced in SDL 2.0.5. This GUID tries to
  4455. * uniquely identify the make and model of a joystick but does not identify
  4456. * a specific unit, e.g. all wired Xbox 360 controllers will have the same
  4457. * GUID on that platform. The GUID for a unit may vary between platforms
  4458. * depending on what hardware information the platform specific APIs provide.
  4459. *
  4460. * @param[in] jid The [joystick](@ref joysticks) to query.
  4461. * @return The UTF-8 encoded GUID of the joystick, or `NULL` if the joystick
  4462. * is not present or an [error](@ref error_handling) occurred.
  4463. *
  4464. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
  4465. * GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
  4466. *
  4467. * @pointer_lifetime The returned string is allocated and freed by GLFW. You
  4468. * should not free it yourself. It is valid until the specified joystick is
  4469. * disconnected or the library is terminated.
  4470. *
  4471. * @thread_safety This function must only be called from the main thread.
  4472. *
  4473. * @sa @ref gamepad
  4474. *
  4475. * @since Added in version 3.3.
  4476. *
  4477. * @ingroup input
  4478. *)
  4479. function glfwGetJoystickGUID(jid: Integer): PAnsiChar; cdecl;
  4480. external libglfw3 name _PU + 'glfwGetJoystickGUID';
  4481. (*! @brief Sets the user pointer of the specified joystick.
  4482. *
  4483. * This function sets the user-defined pointer of the specified joystick. The
  4484. * current value is retained until the joystick is disconnected. The initial
  4485. * value is `NULL`.
  4486. *
  4487. * This function may be called from the joystick callback, even for a joystick
  4488. * that is being disconnected.
  4489. *
  4490. * @param[in] jid The joystick whose pointer to set.
  4491. * @param[in] pointer The new value.
  4492. *
  4493. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  4494. *
  4495. * @thread_safety This function may be called from any thread. Access is not
  4496. * synchronized.
  4497. *
  4498. * @sa @ref joystick_userptr
  4499. * @sa @ref glfwGetJoystickUserPointer
  4500. *
  4501. * @since Added in version 3.3.
  4502. *
  4503. * @ingroup input
  4504. *)
  4505. procedure glfwSetJoystickUserPointer(jid: Integer; pointer: Pointer); cdecl;
  4506. external libglfw3 name _PU + 'glfwSetJoystickUserPointer';
  4507. (*! @brief Returns the user pointer of the specified joystick.
  4508. *
  4509. * This function returns the current value of the user-defined pointer of the
  4510. * specified joystick. The initial value is `NULL`.
  4511. *
  4512. * This function may be called from the joystick callback, even for a joystick
  4513. * that is being disconnected.
  4514. *
  4515. * @param[in] jid The joystick whose pointer to return.
  4516. *
  4517. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  4518. *
  4519. * @thread_safety This function may be called from any thread. Access is not
  4520. * synchronized.
  4521. *
  4522. * @sa @ref joystick_userptr
  4523. * @sa @ref glfwSetJoystickUserPointer
  4524. *
  4525. * @since Added in version 3.3.
  4526. *
  4527. * @ingroup input
  4528. *)
  4529. function glfwGetJoystickUserPointer(jid: Integer): Pointer; cdecl;
  4530. external libglfw3 name _PU + 'glfwGetJoystickUserPointer';
  4531. (*! @brief Returns whether the specified joystick has a gamepad mapping.
  4532. *
  4533. * This function returns whether the specified joystick is both present and has
  4534. * a gamepad mapping.
  4535. *
  4536. * If the specified joystick is present but does not have a gamepad mapping
  4537. * this function will return `GLFW_FALSE` but will not generate an error. Call
  4538. * @ref glfwJoystickPresent to check if a joystick is present regardless of
  4539. * whether it has a mapping.
  4540. *
  4541. * @param[in] jid The [joystick](@ref joysticks) to query.
  4542. * @return `GLFW_TRUE` if a joystick is both present and has a gamepad mapping,
  4543. * or `GLFW_FALSE` otherwise.
  4544. *
  4545. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
  4546. * GLFW_INVALID_ENUM.
  4547. *
  4548. * @thread_safety This function must only be called from the main thread.
  4549. *
  4550. * @sa @ref gamepad
  4551. * @sa @ref glfwGetGamepadState
  4552. *
  4553. * @since Added in version 3.3.
  4554. *
  4555. * @ingroup input
  4556. *)
  4557. function glfwJoystickIsGamepad(jid: Integer): Integer; cdecl;
  4558. external libglfw3 name _PU + 'glfwJoystickIsGamepad';
  4559. (*! @brief Sets the joystick configuration callback.
  4560. *
  4561. * This function sets the joystick configuration callback, or removes the
  4562. * currently set callback. This is called when a joystick is connected to or
  4563. * disconnected from the system.
  4564. *
  4565. * For joystick connection and disconnection events to be delivered on all
  4566. * platforms, you need to call one of the [event processing](@ref events)
  4567. * functions. Joystick disconnection may also be detected and the callback
  4568. * called by joystick functions. The function will then return whatever it
  4569. * returns if the joystick is not present.
  4570. *
  4571. * @param[in] callback The new callback, or `NULL` to remove the currently set
  4572. * callback.
  4573. * @return The previously set callback, or `NULL` if no callback was set or the
  4574. * library had not been [initialized](@ref intro_init).
  4575. *
  4576. * @callback_signature
  4577. * @code
  4578. * void function_name(int jid, int event)
  4579. * @endcode
  4580. * For more information about the callback parameters, see the
  4581. * [function pointer type](@ref GLFWjoystickfun).
  4582. *
  4583. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  4584. *
  4585. * @thread_safety This function must only be called from the main thread.
  4586. *
  4587. * @sa @ref joystick_event
  4588. *
  4589. * @since Added in version 3.2.
  4590. *
  4591. * @ingroup input
  4592. *)
  4593. function glfwSetJoystickCallback(callback: GLFWjoystickfun): GLFWjoystickfun; cdecl;
  4594. external libglfw3 name _PU + 'glfwSetJoystickCallback';
  4595. (*! @brief Adds the specified SDL_GameControllerDB gamepad mappings.
  4596. *
  4597. * This function parses the specified ASCII encoded string and updates the
  4598. * internal list with any gamepad mappings it finds. This string may
  4599. * contain either a single gamepad mapping or many mappings separated by
  4600. * newlines. The parser supports the full format of the `gamecontrollerdb.txt`
  4601. * source file including empty lines and comments.
  4602. *
  4603. * See @ref gamepad_mapping for a description of the format.
  4604. *
  4605. * If there is already a gamepad mapping for a given GUID in the internal list,
  4606. * it will be replaced by the one passed to this function. If the library is
  4607. * terminated and re-initialized the internal list will revert to the built-in
  4608. * default.
  4609. *
  4610. * @param[in] string The string containing the gamepad mappings.
  4611. * @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if an
  4612. * [error](@ref error_handling) occurred.
  4613. *
  4614. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
  4615. * GLFW_INVALID_VALUE.
  4616. *
  4617. * @thread_safety This function must only be called from the main thread.
  4618. *
  4619. * @sa @ref gamepad
  4620. * @sa @ref glfwJoystickIsGamepad
  4621. * @sa @ref glfwGetGamepadName
  4622. *
  4623. * @since Added in version 3.3.
  4624. *
  4625. * @ingroup input
  4626. *)
  4627. function glfwUpdateGamepadMappings(const string_: PAnsiChar): Integer; cdecl;
  4628. external libglfw3 name _PU + 'glfwUpdateGamepadMappings';
  4629. (*! @brief Returns the human-readable gamepad name for the specified joystick.
  4630. *
  4631. * This function returns the human-readable name of the gamepad from the
  4632. * gamepad mapping assigned to the specified joystick.
  4633. *
  4634. * If the specified joystick is not present or does not have a gamepad mapping
  4635. * this function will return `NULL` but will not generate an error. Call
  4636. * @ref glfwJoystickPresent to check whether it is present regardless of
  4637. * whether it has a mapping.
  4638. *
  4639. * @param[in] jid The [joystick](@ref joysticks) to query.
  4640. * @return The UTF-8 encoded name of the gamepad, or `NULL` if the
  4641. * joystick is not present, does not have a mapping or an
  4642. * [error](@ref error_handling) occurred.
  4643. *
  4644. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref GLFW_INVALID_ENUM.
  4645. *
  4646. * @pointer_lifetime The returned string is allocated and freed by GLFW. You
  4647. * should not free it yourself. It is valid until the specified joystick is
  4648. * disconnected, the gamepad mappings are updated or the library is terminated.
  4649. *
  4650. * @thread_safety This function must only be called from the main thread.
  4651. *
  4652. * @sa @ref gamepad
  4653. * @sa @ref glfwJoystickIsGamepad
  4654. *
  4655. * @since Added in version 3.3.
  4656. *
  4657. * @ingroup input
  4658. *)
  4659. function glfwGetGamepadName(jid: Integer): PAnsiChar; cdecl;
  4660. external libglfw3 name _PU + 'glfwGetGamepadName';
  4661. (*! @brief Retrieves the state of the specified joystick remapped as a gamepad.
  4662. *
  4663. * This function retrieves the state of the specified joystick remapped to
  4664. * an Xbox-like gamepad.
  4665. *
  4666. * If the specified joystick is not present or does not have a gamepad mapping
  4667. * this function will return `GLFW_FALSE` but will not generate an error. Call
  4668. * @ref glfwJoystickPresent to check whether it is present regardless of
  4669. * whether it has a mapping.
  4670. *
  4671. * The Guide button may not be available for input as it is often hooked by the
  4672. * system or the Steam client.
  4673. *
  4674. * Not all devices have all the buttons or axes provided by @ref
  4675. * GLFWgamepadstate. Unavailable buttons and axes will always report
  4676. * `GLFW_RELEASE` and 0.0 respectively.
  4677. *
  4678. * @param[in] jid The [joystick](@ref joysticks) to query.
  4679. * @param[out] state The gamepad input state of the joystick.
  4680. * @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if no joystick is
  4681. * connected, it has no gamepad mapping or an [error](@ref error_handling)
  4682. * occurred.
  4683. *
  4684. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
  4685. * GLFW_INVALID_ENUM.
  4686. *
  4687. * @thread_safety This function must only be called from the main thread.
  4688. *
  4689. * @sa @ref gamepad
  4690. * @sa @ref glfwUpdateGamepadMappings
  4691. * @sa @ref glfwJoystickIsGamepad
  4692. *
  4693. * @since Added in version 3.3.
  4694. *
  4695. * @ingroup input
  4696. *)
  4697. function glfwGetGamepadState(jid: Integer; state: PGLFWgamepadstate): Integer; cdecl;
  4698. external libglfw3 name _PU + 'glfwGetGamepadState';
  4699. (*! @brief Sets the clipboard to the specified string.
  4700. *
  4701. * This function sets the system clipboard to the specified, UTF-8 encoded
  4702. * string.
  4703. *
  4704. * @param[in] window Deprecated. Any valid window or `NULL`.
  4705. * @param[in] string A UTF-8 encoded string.
  4706. *
  4707. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
  4708. * GLFW_PLATFORM_ERROR.
  4709. *
  4710. * @pointer_lifetime The specified string is copied before this function
  4711. * returns.
  4712. *
  4713. * @thread_safety This function must only be called from the main thread.
  4714. *
  4715. * @sa @ref clipboard
  4716. * @sa @ref glfwGetClipboardString
  4717. *
  4718. * @since Added in version 3.0.
  4719. *
  4720. * @ingroup input
  4721. *)
  4722. procedure glfwSetClipboardString(window: PGLFWwindow; const string_: PAnsiChar); cdecl;
  4723. external libglfw3 name _PU + 'glfwSetClipboardString';
  4724. (*! @brief Returns the contents of the clipboard as a string.
  4725. *
  4726. * This function returns the contents of the system clipboard, if it contains
  4727. * or is convertible to a UTF-8 encoded string. If the clipboard is empty or
  4728. * if its contents cannot be converted, `NULL` is returned and a @ref
  4729. * GLFW_FORMAT_UNAVAILABLE error is generated.
  4730. *
  4731. * @param[in] window Deprecated. Any valid window or `NULL`.
  4732. * @return The contents of the clipboard as a UTF-8 encoded string, or `NULL`
  4733. * if an [error](@ref error_handling) occurred.
  4734. *
  4735. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
  4736. * GLFW_FORMAT_UNAVAILABLE and @ref GLFW_PLATFORM_ERROR.
  4737. *
  4738. * @pointer_lifetime The returned string is allocated and freed by GLFW. You
  4739. * should not free it yourself. It is valid until the next call to @ref
  4740. * glfwGetClipboardString or @ref glfwSetClipboardString, or until the library
  4741. * is terminated.
  4742. *
  4743. * @thread_safety This function must only be called from the main thread.
  4744. *
  4745. * @sa @ref clipboard
  4746. * @sa @ref glfwSetClipboardString
  4747. *
  4748. * @since Added in version 3.0.
  4749. *
  4750. * @ingroup input
  4751. *)
  4752. function glfwGetClipboardString(window: PGLFWwindow): PAnsiChar; cdecl;
  4753. external libglfw3 name _PU + 'glfwGetClipboardString';
  4754. (*! @brief Returns the GLFW time.
  4755. *
  4756. * This function returns the current GLFW time, in seconds. Unless the time
  4757. * has been set using @ref glfwSetTime it measures time elapsed since GLFW was
  4758. * initialized.
  4759. *
  4760. * This function and @ref glfwSetTime are helper functions on top of @ref
  4761. * glfwGetTimerFrequency and @ref glfwGetTimerValue.
  4762. *
  4763. * The resolution of the timer is system dependent, but is usually on the order
  4764. * of a few micro- or nanoseconds. It uses the highest-resolution monotonic
  4765. * time source on each operating system.
  4766. *
  4767. * @return The current time, in seconds, or zero if an
  4768. * [error](@ref error_handling) occurred.
  4769. *
  4770. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  4771. *
  4772. * @thread_safety This function may be called from any thread. Reading and
  4773. * writing of the internal base time is not atomic, so it needs to be
  4774. * externally synchronized with calls to @ref glfwSetTime.
  4775. *
  4776. * @sa @ref time
  4777. *
  4778. * @since Added in version 1.0.
  4779. *
  4780. * @ingroup input
  4781. *)
  4782. function glfwGetTime(): Double; cdecl;
  4783. external libglfw3 name _PU + 'glfwGetTime';
  4784. (*! @brief Sets the GLFW time.
  4785. *
  4786. * This function sets the current GLFW time, in seconds. The value must be
  4787. * a positive finite number less than or equal to 18446744073.0, which is
  4788. * approximately 584.5 years.
  4789. *
  4790. * This function and @ref glfwGetTime are helper functions on top of @ref
  4791. * glfwGetTimerFrequency and @ref glfwGetTimerValue.
  4792. *
  4793. * @param[in] time The new value, in seconds.
  4794. *
  4795. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
  4796. * GLFW_INVALID_VALUE.
  4797. *
  4798. * @remark The upper limit of GLFW time is calculated as
  4799. * floor((2<sup>64</sup> - 1) / 10<sup>9</sup>) and is due to implementations
  4800. * storing nanoseconds in 64 bits. The limit may be increased in the future.
  4801. *
  4802. * @thread_safety This function may be called from any thread. Reading and
  4803. * writing of the internal base time is not atomic, so it needs to be
  4804. * externally synchronized with calls to @ref glfwGetTime.
  4805. *
  4806. * @sa @ref time
  4807. *
  4808. * @since Added in version 2.2.
  4809. *
  4810. * @ingroup input
  4811. *)
  4812. procedure glfwSetTime(time: Double); cdecl;
  4813. external libglfw3 name _PU + 'glfwSetTime';
  4814. (*! @brief Returns the current value of the raw timer.
  4815. *
  4816. * This function returns the current value of the raw timer, measured in
  4817. * 1&nbsp;/&nbsp;frequency seconds. To get the frequency, call @ref
  4818. * glfwGetTimerFrequency.
  4819. *
  4820. * @return The value of the timer, or zero if an
  4821. * [error](@ref error_handling) occurred.
  4822. *
  4823. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  4824. *
  4825. * @thread_safety This function may be called from any thread.
  4826. *
  4827. * @sa @ref time
  4828. * @sa @ref glfwGetTimerFrequency
  4829. *
  4830. * @since Added in version 3.2.
  4831. *
  4832. * @ingroup input
  4833. *)
  4834. function glfwGetTimerValue(): UInt64; cdecl;
  4835. external libglfw3 name _PU + 'glfwGetTimerValue';
  4836. (*! @brief Returns the frequency, in Hz, of the raw timer.
  4837. *
  4838. * This function returns the frequency, in Hz, of the raw timer.
  4839. *
  4840. * @return The frequency of the timer, in Hz, or zero if an
  4841. * [error](@ref error_handling) occurred.
  4842. *
  4843. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  4844. *
  4845. * @thread_safety This function may be called from any thread.
  4846. *
  4847. * @sa @ref time
  4848. * @sa @ref glfwGetTimerValue
  4849. *
  4850. * @since Added in version 3.2.
  4851. *
  4852. * @ingroup input
  4853. *)
  4854. function glfwGetTimerFrequency(): UInt64; cdecl;
  4855. external libglfw3 name _PU + 'glfwGetTimerFrequency';
  4856. (*! @brief Makes the context of the specified window current for the calling
  4857. * thread.
  4858. *
  4859. * This function makes the OpenGL or OpenGL ES context of the specified window
  4860. * current on the calling thread. A context must only be made current on
  4861. * a single thread at a time and each thread can have only a single current
  4862. * context at a time.
  4863. *
  4864. * When moving a context between threads, you must make it non-current on the
  4865. * old thread before making it current on the new one.
  4866. *
  4867. * By default, making a context non-current implicitly forces a pipeline flush.
  4868. * On machines that support `GL_KHR_context_flush_control`, you can control
  4869. * whether a context performs this flush by setting the
  4870. * [GLFW_CONTEXT_RELEASE_BEHAVIOR](@ref GLFW_CONTEXT_RELEASE_BEHAVIOR_hint)
  4871. * hint.
  4872. *
  4873. * The specified window must have an OpenGL or OpenGL ES context. Specifying
  4874. * a window without a context will generate a @ref GLFW_NO_WINDOW_CONTEXT
  4875. * error.
  4876. *
  4877. * @param[in] window The window whose context to make current, or `NULL` to
  4878. * detach the current context.
  4879. *
  4880. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
  4881. * GLFW_NO_WINDOW_CONTEXT and @ref GLFW_PLATFORM_ERROR.
  4882. *
  4883. * @thread_safety This function may be called from any thread.
  4884. *
  4885. * @sa @ref context_current
  4886. * @sa @ref glfwGetCurrentContext
  4887. *
  4888. * @since Added in version 3.0.
  4889. *
  4890. * @ingroup context
  4891. *)
  4892. procedure glfwMakeContextCurrent(window: PGLFWwindow); cdecl;
  4893. external libglfw3 name _PU + 'glfwMakeContextCurrent';
  4894. (*! @brief Returns the window whose context is current on the calling thread.
  4895. *
  4896. * This function returns the window whose OpenGL or OpenGL ES context is
  4897. * current on the calling thread.
  4898. *
  4899. * @return The window whose context is current, or `NULL` if no window's
  4900. * context is current.
  4901. *
  4902. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  4903. *
  4904. * @thread_safety This function may be called from any thread.
  4905. *
  4906. * @sa @ref context_current
  4907. * @sa @ref glfwMakeContextCurrent
  4908. *
  4909. * @since Added in version 3.0.
  4910. *
  4911. * @ingroup context
  4912. *)
  4913. function glfwGetCurrentContext(): PGLFWwindow; cdecl;
  4914. external libglfw3 name _PU + 'glfwGetCurrentContext';
  4915. (*! @brief Swaps the front and back buffers of the specified window.
  4916. *
  4917. * This function swaps the front and back buffers of the specified window when
  4918. * rendering with OpenGL or OpenGL ES. If the swap interval is greater than
  4919. * zero, the GPU driver waits the specified number of screen updates before
  4920. * swapping the buffers.
  4921. *
  4922. * The specified window must have an OpenGL or OpenGL ES context. Specifying
  4923. * a window without a context will generate a @ref GLFW_NO_WINDOW_CONTEXT
  4924. * error.
  4925. *
  4926. * This function does not apply to Vulkan. If you are rendering with Vulkan,
  4927. * see `vkQueuePresentKHR` instead.
  4928. *
  4929. * @param[in] window The window whose buffers to swap.
  4930. *
  4931. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
  4932. * GLFW_NO_WINDOW_CONTEXT and @ref GLFW_PLATFORM_ERROR.
  4933. *
  4934. * @remark __EGL:__ The context of the specified window must be current on the
  4935. * calling thread.
  4936. *
  4937. * @thread_safety This function may be called from any thread.
  4938. *
  4939. * @sa @ref buffer_swap
  4940. * @sa @ref glfwSwapInterval
  4941. *
  4942. * @since Added in version 1.0.
  4943. * @glfw3 Added window handle parameter.
  4944. *
  4945. * @ingroup window
  4946. *)
  4947. procedure glfwSwapBuffers(window: PGLFWwindow); cdecl;
  4948. external libglfw3 name _PU + 'glfwSwapBuffers';
  4949. (*! @brief Sets the swap interval for the current context.
  4950. *
  4951. * This function sets the swap interval for the current OpenGL or OpenGL ES
  4952. * context, i.e. the number of screen updates to wait from the time @ref
  4953. * glfwSwapBuffers was called before swapping the buffers and returning. This
  4954. * is sometimes called _vertical synchronization_, _vertical retrace
  4955. * synchronization_ or just _vsync_.
  4956. *
  4957. * A context that supports either of the `WGL_EXT_swap_control_tear` and
  4958. * `GLX_EXT_swap_control_tear` extensions also accepts _negative_ swap
  4959. * intervals, which allows the driver to swap immediately even if a frame
  4960. * arrives a little bit late. You can check for these extensions with @ref
  4961. * glfwExtensionSupported.
  4962. *
  4963. * A context must be current on the calling thread. Calling this function
  4964. * without a current context will cause a @ref GLFW_NO_CURRENT_CONTEXT error.
  4965. *
  4966. * This function does not apply to Vulkan. If you are rendering with Vulkan,
  4967. * see the present mode of your swapchain instead.
  4968. *
  4969. * @param[in] interval The minimum number of screen updates to wait for
  4970. * until the buffers are swapped by @ref glfwSwapBuffers.
  4971. *
  4972. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
  4973. * GLFW_NO_CURRENT_CONTEXT and @ref GLFW_PLATFORM_ERROR.
  4974. *
  4975. * @remark This function is not called during context creation, leaving the
  4976. * swap interval set to whatever is the default for that API. This is done
  4977. * because some swap interval extensions used by GLFW do not allow the swap
  4978. * interval to be reset to zero once it has been set to a non-zero value.
  4979. *
  4980. * @remark Some GPU drivers do not honor the requested swap interval, either
  4981. * because of a user setting that overrides the application's request or due to
  4982. * bugs in the driver.
  4983. *
  4984. * @thread_safety This function may be called from any thread.
  4985. *
  4986. * @sa @ref buffer_swap
  4987. * @sa @ref glfwSwapBuffers
  4988. *
  4989. * @since Added in version 1.0.
  4990. *
  4991. * @ingroup context
  4992. *)
  4993. procedure glfwSwapInterval(interval: Integer); cdecl;
  4994. external libglfw3 name _PU + 'glfwSwapInterval';
  4995. (*! @brief Returns whether the specified extension is available.
  4996. *
  4997. * This function returns whether the specified
  4998. * [API extension](@ref context_glext) is supported by the current OpenGL or
  4999. * OpenGL ES context. It searches both for client API extension and context
  5000. * creation API extensions.
  5001. *
  5002. * A context must be current on the calling thread. Calling this function
  5003. * without a current context will cause a @ref GLFW_NO_CURRENT_CONTEXT error.
  5004. *
  5005. * As this functions retrieves and searches one or more extension strings each
  5006. * call, it is recommended that you cache its results if it is going to be used
  5007. * frequently. The extension strings will not change during the lifetime of
  5008. * a context, so there is no danger in doing this.
  5009. *
  5010. * This function does not apply to Vulkan. If you are using Vulkan, see @ref
  5011. * glfwGetRequiredInstanceExtensions, `vkEnumerateInstanceExtensionProperties`
  5012. * and `vkEnumerateDeviceExtensionProperties` instead.
  5013. *
  5014. * @param[in] extension The ASCII encoded name of the extension.
  5015. * @return `GLFW_TRUE` if the extension is available, or `GLFW_FALSE`
  5016. * otherwise.
  5017. *
  5018. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
  5019. * GLFW_NO_CURRENT_CONTEXT, @ref GLFW_INVALID_VALUE and @ref
  5020. * GLFW_PLATFORM_ERROR.
  5021. *
  5022. * @thread_safety This function may be called from any thread.
  5023. *
  5024. * @sa @ref context_glext
  5025. * @sa @ref glfwGetProcAddress
  5026. *
  5027. * @since Added in version 1.0.
  5028. *
  5029. * @ingroup context
  5030. *)
  5031. function glfwExtensionSupported(const extension: PAnsiChar): Integer; cdecl;
  5032. external libglfw3 name _PU + 'glfwExtensionSupported';
  5033. (*! @brief Returns the address of the specified function for the current
  5034. * context.
  5035. *
  5036. * This function returns the address of the specified OpenGL or OpenGL ES
  5037. * [core or extension function](@ref context_glext), if it is supported
  5038. * by the current context.
  5039. *
  5040. * A context must be current on the calling thread. Calling this function
  5041. * without a current context will cause a @ref GLFW_NO_CURRENT_CONTEXT error.
  5042. *
  5043. * This function does not apply to Vulkan. If you are rendering with Vulkan,
  5044. * see @ref glfwGetInstanceProcAddress, `vkGetInstanceProcAddr` and
  5045. * `vkGetDeviceProcAddr` instead.
  5046. *
  5047. * @param[in] procname The ASCII encoded name of the function.
  5048. * @return The address of the function, or `NULL` if an
  5049. * [error](@ref error_handling) occurred.
  5050. *
  5051. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
  5052. * GLFW_NO_CURRENT_CONTEXT and @ref GLFW_PLATFORM_ERROR.
  5053. *
  5054. * @remark The address of a given function is not guaranteed to be the same
  5055. * between contexts.
  5056. *
  5057. * @remark This function may return a non-`NULL` address despite the
  5058. * associated version or extension not being available. Always check the
  5059. * context version or extension string first.
  5060. *
  5061. * @pointer_lifetime The returned function pointer is valid until the context
  5062. * is destroyed or the library is terminated.
  5063. *
  5064. * @thread_safety This function may be called from any thread.
  5065. *
  5066. * @sa @ref context_glext
  5067. * @sa @ref glfwExtensionSupported
  5068. *
  5069. * @since Added in version 1.0.
  5070. *
  5071. * @ingroup context
  5072. *)
  5073. function glfwGetProcAddress(const procname: PAnsiChar): GLFWglproc; cdecl;
  5074. external libglfw3 name _PU + 'glfwGetProcAddress';
  5075. (*! @brief Returns whether the Vulkan loader and an ICD have been found.
  5076. *
  5077. * This function returns whether the Vulkan loader and any minimally functional
  5078. * ICD have been found.
  5079. *
  5080. * The availability of a Vulkan loader and even an ICD does not by itself guarantee that
  5081. * surface creation or even instance creation is possible. Call @ref
  5082. * glfwGetRequiredInstanceExtensions to check whether the extensions necessary for Vulkan
  5083. * surface creation are available and @ref glfwGetPhysicalDevicePresentationSupport to
  5084. * check whether a queue family of a physical device supports image presentation.
  5085. *
  5086. * @return `GLFW_TRUE` if Vulkan is minimally available, or `GLFW_FALSE`
  5087. * otherwise.
  5088. *
  5089. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
  5090. *
  5091. * @thread_safety This function may be called from any thread.
  5092. *
  5093. * @sa @ref vulkan_support
  5094. *
  5095. * @since Added in version 3.2.
  5096. *
  5097. * @ingroup vulkan
  5098. *)
  5099. function glfwVulkanSupported(): Integer; cdecl;
  5100. external libglfw3 name _PU + 'glfwVulkanSupported';
  5101. (*! @brief Returns the Vulkan instance extensions required by GLFW.
  5102. *
  5103. * This function returns an array of names of Vulkan instance extensions required
  5104. * by GLFW for creating Vulkan surfaces for GLFW windows. If successful, the
  5105. * list will always contain `VK_KHR_surface`, so if you don't require any
  5106. * additional extensions you can pass this list directly to the
  5107. * `VkInstanceCreateInfo` struct.
  5108. *
  5109. * If Vulkan is not available on the machine, this function returns `NULL` and
  5110. * generates a @ref GLFW_API_UNAVAILABLE error. Call @ref glfwVulkanSupported
  5111. * to check whether Vulkan is at least minimally available.
  5112. *
  5113. * If Vulkan is available but no set of extensions allowing window surface
  5114. * creation was found, this function returns `NULL`. You may still use Vulkan
  5115. * for off-screen rendering and compute work.
  5116. *
  5117. * @param[out] count Where to store the number of extensions in the returned
  5118. * array. This is set to zero if an error occurred.
  5119. * @return An array of ASCII encoded extension names, or `NULL` if an
  5120. * [error](@ref error_handling) occurred.
  5121. *
  5122. * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
  5123. * GLFW_API_UNAVAILABLE.
  5124. *
  5125. * @remark Additional extensions may be required by future versions of GLFW.
  5126. * You should check if any extensions you wish to enable are already in the
  5127. * returned array, as it is an error to specify an extension more than once in
  5128. * the `VkInstanceCreateInfo` struct.
  5129. *
  5130. * @pointer_lifetime The returned array is allocated and freed by GLFW. You
  5131. * should not free it yourself. It is guaranteed to be valid only until the
  5132. * library is terminated.
  5133. *
  5134. * @thread_safety This function may be called from any thread.
  5135. *
  5136. * @sa @ref vulkan_ext
  5137. * @sa @ref glfwCreateWindowSurface
  5138. *
  5139. * @since Added in version 3.2.
  5140. *
  5141. * @ingroup vulkan
  5142. *)
  5143. function glfwGetRequiredInstanceExtensions(count: PUInt32): PPAnsiChar; cdecl;
  5144. external libglfw3 name _PU + 'glfwGetRequiredInstanceExtensions';
  5145. implementation
  5146. end.