indirect_dispatch.c 129 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128
  1. /* DO NOT EDIT - This file generated automatically by glX_proto_recv.py (from Mesa) script */
  2. /*
  3. * (C) Copyright IBM Corporation 2005
  4. * All Rights Reserved.
  5. *
  6. * Permission is hereby granted, free of charge, to any person obtaining a
  7. * copy of this software and associated documentation files (the "Software"),
  8. * to deal in the Software without restriction, including without limitation
  9. * the rights to use, copy, modify, merge, publish, distribute, sub license,
  10. * and/or sell copies of the Software, and to permit persons to whom the
  11. * Software is furnished to do so, subject to the following conditions:
  12. *
  13. * The above copyright notice and this permission notice (including the next
  14. * paragraph) shall be included in all copies or substantial portions of the
  15. * Software.
  16. *
  17. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19. * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
  20. * IBM,
  21. * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  22. * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
  23. * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  24. * SOFTWARE.
  25. */
  26. #include <inttypes.h>
  27. #include "glxserver.h"
  28. #include "indirect_size.h"
  29. #include "indirect_size_get.h"
  30. #include "indirect_dispatch.h"
  31. #include "glxbyteorder.h"
  32. #include "indirect_util.h"
  33. #include "singlesize.h"
  34. #define __GLX_PAD(x) (((x) + 3) & ~3)
  35. typedef struct {
  36. __GLX_PIXEL_3D_HDR;
  37. } __GLXpixel3DHeader;
  38. extern GLboolean __glXErrorOccured(void);
  39. extern void __glXClearErrorOccured(void);
  40. static const unsigned dummy_answer[2] = { 0, 0 };
  41. int
  42. __glXDisp_NewList(__GLXclientState * cl, GLbyte * pc)
  43. {
  44. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  45. int error;
  46. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  47. pc += __GLX_SINGLE_HDR_SIZE;
  48. if (cx != NULL) {
  49. glNewList(*(GLuint *) (pc + 0), *(GLenum *) (pc + 4));
  50. error = Success;
  51. }
  52. return error;
  53. }
  54. int
  55. __glXDisp_EndList(__GLXclientState * cl, GLbyte * pc)
  56. {
  57. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  58. int error;
  59. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  60. pc += __GLX_SINGLE_HDR_SIZE;
  61. if (cx != NULL) {
  62. glEndList();
  63. error = Success;
  64. }
  65. return error;
  66. }
  67. void
  68. __glXDisp_CallList(GLbyte * pc)
  69. {
  70. glCallList(*(GLuint *) (pc + 0));
  71. }
  72. void
  73. __glXDisp_CallLists(GLbyte * pc)
  74. {
  75. const GLsizei n = *(GLsizei *) (pc + 0);
  76. const GLenum type = *(GLenum *) (pc + 4);
  77. const GLvoid *lists = (const GLvoid *) (pc + 8);
  78. lists = (const GLvoid *) (pc + 8);
  79. glCallLists(n, type, lists);
  80. }
  81. int
  82. __glXDisp_DeleteLists(__GLXclientState * cl, GLbyte * pc)
  83. {
  84. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  85. int error;
  86. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  87. pc += __GLX_SINGLE_HDR_SIZE;
  88. if (cx != NULL) {
  89. glDeleteLists(*(GLuint *) (pc + 0), *(GLsizei *) (pc + 4));
  90. error = Success;
  91. }
  92. return error;
  93. }
  94. int
  95. __glXDisp_GenLists(__GLXclientState * cl, GLbyte * pc)
  96. {
  97. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  98. int error;
  99. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  100. pc += __GLX_SINGLE_HDR_SIZE;
  101. if (cx != NULL) {
  102. GLuint retval;
  103. retval = glGenLists(*(GLsizei *) (pc + 0));
  104. __glXSendReply(cl->client, dummy_answer, 0, 0, GL_FALSE, retval);
  105. error = Success;
  106. }
  107. return error;
  108. }
  109. void
  110. __glXDisp_ListBase(GLbyte * pc)
  111. {
  112. glListBase(*(GLuint *) (pc + 0));
  113. }
  114. void
  115. __glXDisp_Begin(GLbyte * pc)
  116. {
  117. glBegin(*(GLenum *) (pc + 0));
  118. }
  119. void
  120. __glXDisp_Bitmap(GLbyte * pc)
  121. {
  122. const GLubyte *const bitmap = (const GLubyte *) ((pc + 44));
  123. __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc);
  124. glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
  125. glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
  126. glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
  127. glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
  128. glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
  129. glBitmap(*(GLsizei *) (pc + 20),
  130. *(GLsizei *) (pc + 24),
  131. *(GLfloat *) (pc + 28),
  132. *(GLfloat *) (pc + 32),
  133. *(GLfloat *) (pc + 36), *(GLfloat *) (pc + 40), bitmap);
  134. }
  135. void
  136. __glXDisp_Color3bv(GLbyte * pc)
  137. {
  138. glColor3bv((const GLbyte *) (pc + 0));
  139. }
  140. void
  141. __glXDisp_Color3dv(GLbyte * pc)
  142. {
  143. #ifdef __GLX_ALIGN64
  144. if ((unsigned long) (pc) & 7) {
  145. (void) memmove(pc - 4, pc, 24);
  146. pc -= 4;
  147. }
  148. #endif
  149. glColor3dv((const GLdouble *) (pc + 0));
  150. }
  151. void
  152. __glXDisp_Color3fv(GLbyte * pc)
  153. {
  154. glColor3fv((const GLfloat *) (pc + 0));
  155. }
  156. void
  157. __glXDisp_Color3iv(GLbyte * pc)
  158. {
  159. glColor3iv((const GLint *) (pc + 0));
  160. }
  161. void
  162. __glXDisp_Color3sv(GLbyte * pc)
  163. {
  164. glColor3sv((const GLshort *) (pc + 0));
  165. }
  166. void
  167. __glXDisp_Color3ubv(GLbyte * pc)
  168. {
  169. glColor3ubv((const GLubyte *) (pc + 0));
  170. }
  171. void
  172. __glXDisp_Color3uiv(GLbyte * pc)
  173. {
  174. glColor3uiv((const GLuint *) (pc + 0));
  175. }
  176. void
  177. __glXDisp_Color3usv(GLbyte * pc)
  178. {
  179. glColor3usv((const GLushort *) (pc + 0));
  180. }
  181. void
  182. __glXDisp_Color4bv(GLbyte * pc)
  183. {
  184. glColor4bv((const GLbyte *) (pc + 0));
  185. }
  186. void
  187. __glXDisp_Color4dv(GLbyte * pc)
  188. {
  189. #ifdef __GLX_ALIGN64
  190. if ((unsigned long) (pc) & 7) {
  191. (void) memmove(pc - 4, pc, 32);
  192. pc -= 4;
  193. }
  194. #endif
  195. glColor4dv((const GLdouble *) (pc + 0));
  196. }
  197. void
  198. __glXDisp_Color4fv(GLbyte * pc)
  199. {
  200. glColor4fv((const GLfloat *) (pc + 0));
  201. }
  202. void
  203. __glXDisp_Color4iv(GLbyte * pc)
  204. {
  205. glColor4iv((const GLint *) (pc + 0));
  206. }
  207. void
  208. __glXDisp_Color4sv(GLbyte * pc)
  209. {
  210. glColor4sv((const GLshort *) (pc + 0));
  211. }
  212. void
  213. __glXDisp_Color4ubv(GLbyte * pc)
  214. {
  215. glColor4ubv((const GLubyte *) (pc + 0));
  216. }
  217. void
  218. __glXDisp_Color4uiv(GLbyte * pc)
  219. {
  220. glColor4uiv((const GLuint *) (pc + 0));
  221. }
  222. void
  223. __glXDisp_Color4usv(GLbyte * pc)
  224. {
  225. glColor4usv((const GLushort *) (pc + 0));
  226. }
  227. void
  228. __glXDisp_EdgeFlagv(GLbyte * pc)
  229. {
  230. glEdgeFlagv((const GLboolean *) (pc + 0));
  231. }
  232. void
  233. __glXDisp_End(GLbyte * pc)
  234. {
  235. glEnd();
  236. }
  237. void
  238. __glXDisp_Indexdv(GLbyte * pc)
  239. {
  240. #ifdef __GLX_ALIGN64
  241. if ((unsigned long) (pc) & 7) {
  242. (void) memmove(pc - 4, pc, 8);
  243. pc -= 4;
  244. }
  245. #endif
  246. glIndexdv((const GLdouble *) (pc + 0));
  247. }
  248. void
  249. __glXDisp_Indexfv(GLbyte * pc)
  250. {
  251. glIndexfv((const GLfloat *) (pc + 0));
  252. }
  253. void
  254. __glXDisp_Indexiv(GLbyte * pc)
  255. {
  256. glIndexiv((const GLint *) (pc + 0));
  257. }
  258. void
  259. __glXDisp_Indexsv(GLbyte * pc)
  260. {
  261. glIndexsv((const GLshort *) (pc + 0));
  262. }
  263. void
  264. __glXDisp_Normal3bv(GLbyte * pc)
  265. {
  266. glNormal3bv((const GLbyte *) (pc + 0));
  267. }
  268. void
  269. __glXDisp_Normal3dv(GLbyte * pc)
  270. {
  271. #ifdef __GLX_ALIGN64
  272. if ((unsigned long) (pc) & 7) {
  273. (void) memmove(pc - 4, pc, 24);
  274. pc -= 4;
  275. }
  276. #endif
  277. glNormal3dv((const GLdouble *) (pc + 0));
  278. }
  279. void
  280. __glXDisp_Normal3fv(GLbyte * pc)
  281. {
  282. glNormal3fv((const GLfloat *) (pc + 0));
  283. }
  284. void
  285. __glXDisp_Normal3iv(GLbyte * pc)
  286. {
  287. glNormal3iv((const GLint *) (pc + 0));
  288. }
  289. void
  290. __glXDisp_Normal3sv(GLbyte * pc)
  291. {
  292. glNormal3sv((const GLshort *) (pc + 0));
  293. }
  294. void
  295. __glXDisp_RasterPos2dv(GLbyte * pc)
  296. {
  297. #ifdef __GLX_ALIGN64
  298. if ((unsigned long) (pc) & 7) {
  299. (void) memmove(pc - 4, pc, 16);
  300. pc -= 4;
  301. }
  302. #endif
  303. glRasterPos2dv((const GLdouble *) (pc + 0));
  304. }
  305. void
  306. __glXDisp_RasterPos2fv(GLbyte * pc)
  307. {
  308. glRasterPos2fv((const GLfloat *) (pc + 0));
  309. }
  310. void
  311. __glXDisp_RasterPos2iv(GLbyte * pc)
  312. {
  313. glRasterPos2iv((const GLint *) (pc + 0));
  314. }
  315. void
  316. __glXDisp_RasterPos2sv(GLbyte * pc)
  317. {
  318. glRasterPos2sv((const GLshort *) (pc + 0));
  319. }
  320. void
  321. __glXDisp_RasterPos3dv(GLbyte * pc)
  322. {
  323. #ifdef __GLX_ALIGN64
  324. if ((unsigned long) (pc) & 7) {
  325. (void) memmove(pc - 4, pc, 24);
  326. pc -= 4;
  327. }
  328. #endif
  329. glRasterPos3dv((const GLdouble *) (pc + 0));
  330. }
  331. void
  332. __glXDisp_RasterPos3fv(GLbyte * pc)
  333. {
  334. glRasterPos3fv((const GLfloat *) (pc + 0));
  335. }
  336. void
  337. __glXDisp_RasterPos3iv(GLbyte * pc)
  338. {
  339. glRasterPos3iv((const GLint *) (pc + 0));
  340. }
  341. void
  342. __glXDisp_RasterPos3sv(GLbyte * pc)
  343. {
  344. glRasterPos3sv((const GLshort *) (pc + 0));
  345. }
  346. void
  347. __glXDisp_RasterPos4dv(GLbyte * pc)
  348. {
  349. #ifdef __GLX_ALIGN64
  350. if ((unsigned long) (pc) & 7) {
  351. (void) memmove(pc - 4, pc, 32);
  352. pc -= 4;
  353. }
  354. #endif
  355. glRasterPos4dv((const GLdouble *) (pc + 0));
  356. }
  357. void
  358. __glXDisp_RasterPos4fv(GLbyte * pc)
  359. {
  360. glRasterPos4fv((const GLfloat *) (pc + 0));
  361. }
  362. void
  363. __glXDisp_RasterPos4iv(GLbyte * pc)
  364. {
  365. glRasterPos4iv((const GLint *) (pc + 0));
  366. }
  367. void
  368. __glXDisp_RasterPos4sv(GLbyte * pc)
  369. {
  370. glRasterPos4sv((const GLshort *) (pc + 0));
  371. }
  372. void
  373. __glXDisp_Rectdv(GLbyte * pc)
  374. {
  375. #ifdef __GLX_ALIGN64
  376. if ((unsigned long) (pc) & 7) {
  377. (void) memmove(pc - 4, pc, 32);
  378. pc -= 4;
  379. }
  380. #endif
  381. glRectdv((const GLdouble *) (pc + 0), (const GLdouble *) (pc + 16));
  382. }
  383. void
  384. __glXDisp_Rectfv(GLbyte * pc)
  385. {
  386. glRectfv((const GLfloat *) (pc + 0), (const GLfloat *) (pc + 8));
  387. }
  388. void
  389. __glXDisp_Rectiv(GLbyte * pc)
  390. {
  391. glRectiv((const GLint *) (pc + 0), (const GLint *) (pc + 8));
  392. }
  393. void
  394. __glXDisp_Rectsv(GLbyte * pc)
  395. {
  396. glRectsv((const GLshort *) (pc + 0), (const GLshort *) (pc + 4));
  397. }
  398. void
  399. __glXDisp_TexCoord1dv(GLbyte * pc)
  400. {
  401. #ifdef __GLX_ALIGN64
  402. if ((unsigned long) (pc) & 7) {
  403. (void) memmove(pc - 4, pc, 8);
  404. pc -= 4;
  405. }
  406. #endif
  407. glTexCoord1dv((const GLdouble *) (pc + 0));
  408. }
  409. void
  410. __glXDisp_TexCoord1fv(GLbyte * pc)
  411. {
  412. glTexCoord1fv((const GLfloat *) (pc + 0));
  413. }
  414. void
  415. __glXDisp_TexCoord1iv(GLbyte * pc)
  416. {
  417. glTexCoord1iv((const GLint *) (pc + 0));
  418. }
  419. void
  420. __glXDisp_TexCoord1sv(GLbyte * pc)
  421. {
  422. glTexCoord1sv((const GLshort *) (pc + 0));
  423. }
  424. void
  425. __glXDisp_TexCoord2dv(GLbyte * pc)
  426. {
  427. #ifdef __GLX_ALIGN64
  428. if ((unsigned long) (pc) & 7) {
  429. (void) memmove(pc - 4, pc, 16);
  430. pc -= 4;
  431. }
  432. #endif
  433. glTexCoord2dv((const GLdouble *) (pc + 0));
  434. }
  435. void
  436. __glXDisp_TexCoord2fv(GLbyte * pc)
  437. {
  438. glTexCoord2fv((const GLfloat *) (pc + 0));
  439. }
  440. void
  441. __glXDisp_TexCoord2iv(GLbyte * pc)
  442. {
  443. glTexCoord2iv((const GLint *) (pc + 0));
  444. }
  445. void
  446. __glXDisp_TexCoord2sv(GLbyte * pc)
  447. {
  448. glTexCoord2sv((const GLshort *) (pc + 0));
  449. }
  450. void
  451. __glXDisp_TexCoord3dv(GLbyte * pc)
  452. {
  453. #ifdef __GLX_ALIGN64
  454. if ((unsigned long) (pc) & 7) {
  455. (void) memmove(pc - 4, pc, 24);
  456. pc -= 4;
  457. }
  458. #endif
  459. glTexCoord3dv((const GLdouble *) (pc + 0));
  460. }
  461. void
  462. __glXDisp_TexCoord3fv(GLbyte * pc)
  463. {
  464. glTexCoord3fv((const GLfloat *) (pc + 0));
  465. }
  466. void
  467. __glXDisp_TexCoord3iv(GLbyte * pc)
  468. {
  469. glTexCoord3iv((const GLint *) (pc + 0));
  470. }
  471. void
  472. __glXDisp_TexCoord3sv(GLbyte * pc)
  473. {
  474. glTexCoord3sv((const GLshort *) (pc + 0));
  475. }
  476. void
  477. __glXDisp_TexCoord4dv(GLbyte * pc)
  478. {
  479. #ifdef __GLX_ALIGN64
  480. if ((unsigned long) (pc) & 7) {
  481. (void) memmove(pc - 4, pc, 32);
  482. pc -= 4;
  483. }
  484. #endif
  485. glTexCoord4dv((const GLdouble *) (pc + 0));
  486. }
  487. void
  488. __glXDisp_TexCoord4fv(GLbyte * pc)
  489. {
  490. glTexCoord4fv((const GLfloat *) (pc + 0));
  491. }
  492. void
  493. __glXDisp_TexCoord4iv(GLbyte * pc)
  494. {
  495. glTexCoord4iv((const GLint *) (pc + 0));
  496. }
  497. void
  498. __glXDisp_TexCoord4sv(GLbyte * pc)
  499. {
  500. glTexCoord4sv((const GLshort *) (pc + 0));
  501. }
  502. void
  503. __glXDisp_Vertex2dv(GLbyte * pc)
  504. {
  505. #ifdef __GLX_ALIGN64
  506. if ((unsigned long) (pc) & 7) {
  507. (void) memmove(pc - 4, pc, 16);
  508. pc -= 4;
  509. }
  510. #endif
  511. glVertex2dv((const GLdouble *) (pc + 0));
  512. }
  513. void
  514. __glXDisp_Vertex2fv(GLbyte * pc)
  515. {
  516. glVertex2fv((const GLfloat *) (pc + 0));
  517. }
  518. void
  519. __glXDisp_Vertex2iv(GLbyte * pc)
  520. {
  521. glVertex2iv((const GLint *) (pc + 0));
  522. }
  523. void
  524. __glXDisp_Vertex2sv(GLbyte * pc)
  525. {
  526. glVertex2sv((const GLshort *) (pc + 0));
  527. }
  528. void
  529. __glXDisp_Vertex3dv(GLbyte * pc)
  530. {
  531. #ifdef __GLX_ALIGN64
  532. if ((unsigned long) (pc) & 7) {
  533. (void) memmove(pc - 4, pc, 24);
  534. pc -= 4;
  535. }
  536. #endif
  537. glVertex3dv((const GLdouble *) (pc + 0));
  538. }
  539. void
  540. __glXDisp_Vertex3fv(GLbyte * pc)
  541. {
  542. glVertex3fv((const GLfloat *) (pc + 0));
  543. }
  544. void
  545. __glXDisp_Vertex3iv(GLbyte * pc)
  546. {
  547. glVertex3iv((const GLint *) (pc + 0));
  548. }
  549. void
  550. __glXDisp_Vertex3sv(GLbyte * pc)
  551. {
  552. glVertex3sv((const GLshort *) (pc + 0));
  553. }
  554. void
  555. __glXDisp_Vertex4dv(GLbyte * pc)
  556. {
  557. #ifdef __GLX_ALIGN64
  558. if ((unsigned long) (pc) & 7) {
  559. (void) memmove(pc - 4, pc, 32);
  560. pc -= 4;
  561. }
  562. #endif
  563. glVertex4dv((const GLdouble *) (pc + 0));
  564. }
  565. void
  566. __glXDisp_Vertex4fv(GLbyte * pc)
  567. {
  568. glVertex4fv((const GLfloat *) (pc + 0));
  569. }
  570. void
  571. __glXDisp_Vertex4iv(GLbyte * pc)
  572. {
  573. glVertex4iv((const GLint *) (pc + 0));
  574. }
  575. void
  576. __glXDisp_Vertex4sv(GLbyte * pc)
  577. {
  578. glVertex4sv((const GLshort *) (pc + 0));
  579. }
  580. void
  581. __glXDisp_ClipPlane(GLbyte * pc)
  582. {
  583. #ifdef __GLX_ALIGN64
  584. if ((unsigned long) (pc) & 7) {
  585. (void) memmove(pc - 4, pc, 36);
  586. pc -= 4;
  587. }
  588. #endif
  589. glClipPlane(*(GLenum *) (pc + 32), (const GLdouble *) (pc + 0));
  590. }
  591. void
  592. __glXDisp_ColorMaterial(GLbyte * pc)
  593. {
  594. glColorMaterial(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4));
  595. }
  596. void
  597. __glXDisp_CullFace(GLbyte * pc)
  598. {
  599. glCullFace(*(GLenum *) (pc + 0));
  600. }
  601. void
  602. __glXDisp_Fogf(GLbyte * pc)
  603. {
  604. glFogf(*(GLenum *) (pc + 0), *(GLfloat *) (pc + 4));
  605. }
  606. void
  607. __glXDisp_Fogfv(GLbyte * pc)
  608. {
  609. const GLenum pname = *(GLenum *) (pc + 0);
  610. const GLfloat *params;
  611. params = (const GLfloat *) (pc + 4);
  612. glFogfv(pname, params);
  613. }
  614. void
  615. __glXDisp_Fogi(GLbyte * pc)
  616. {
  617. glFogi(*(GLenum *) (pc + 0), *(GLint *) (pc + 4));
  618. }
  619. void
  620. __glXDisp_Fogiv(GLbyte * pc)
  621. {
  622. const GLenum pname = *(GLenum *) (pc + 0);
  623. const GLint *params;
  624. params = (const GLint *) (pc + 4);
  625. glFogiv(pname, params);
  626. }
  627. void
  628. __glXDisp_FrontFace(GLbyte * pc)
  629. {
  630. glFrontFace(*(GLenum *) (pc + 0));
  631. }
  632. void
  633. __glXDisp_Hint(GLbyte * pc)
  634. {
  635. glHint(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4));
  636. }
  637. void
  638. __glXDisp_Lightf(GLbyte * pc)
  639. {
  640. glLightf(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), *(GLfloat *) (pc + 8));
  641. }
  642. void
  643. __glXDisp_Lightfv(GLbyte * pc)
  644. {
  645. const GLenum pname = *(GLenum *) (pc + 4);
  646. const GLfloat *params;
  647. params = (const GLfloat *) (pc + 8);
  648. glLightfv(*(GLenum *) (pc + 0), pname, params);
  649. }
  650. void
  651. __glXDisp_Lighti(GLbyte * pc)
  652. {
  653. glLighti(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), *(GLint *) (pc + 8));
  654. }
  655. void
  656. __glXDisp_Lightiv(GLbyte * pc)
  657. {
  658. const GLenum pname = *(GLenum *) (pc + 4);
  659. const GLint *params;
  660. params = (const GLint *) (pc + 8);
  661. glLightiv(*(GLenum *) (pc + 0), pname, params);
  662. }
  663. void
  664. __glXDisp_LightModelf(GLbyte * pc)
  665. {
  666. glLightModelf(*(GLenum *) (pc + 0), *(GLfloat *) (pc + 4));
  667. }
  668. void
  669. __glXDisp_LightModelfv(GLbyte * pc)
  670. {
  671. const GLenum pname = *(GLenum *) (pc + 0);
  672. const GLfloat *params;
  673. params = (const GLfloat *) (pc + 4);
  674. glLightModelfv(pname, params);
  675. }
  676. void
  677. __glXDisp_LightModeli(GLbyte * pc)
  678. {
  679. glLightModeli(*(GLenum *) (pc + 0), *(GLint *) (pc + 4));
  680. }
  681. void
  682. __glXDisp_LightModeliv(GLbyte * pc)
  683. {
  684. const GLenum pname = *(GLenum *) (pc + 0);
  685. const GLint *params;
  686. params = (const GLint *) (pc + 4);
  687. glLightModeliv(pname, params);
  688. }
  689. void
  690. __glXDisp_LineStipple(GLbyte * pc)
  691. {
  692. glLineStipple(*(GLint *) (pc + 0), *(GLushort *) (pc + 4));
  693. }
  694. void
  695. __glXDisp_LineWidth(GLbyte * pc)
  696. {
  697. glLineWidth(*(GLfloat *) (pc + 0));
  698. }
  699. void
  700. __glXDisp_Materialf(GLbyte * pc)
  701. {
  702. glMaterialf(*(GLenum *) (pc + 0),
  703. *(GLenum *) (pc + 4), *(GLfloat *) (pc + 8));
  704. }
  705. void
  706. __glXDisp_Materialfv(GLbyte * pc)
  707. {
  708. const GLenum pname = *(GLenum *) (pc + 4);
  709. const GLfloat *params;
  710. params = (const GLfloat *) (pc + 8);
  711. glMaterialfv(*(GLenum *) (pc + 0), pname, params);
  712. }
  713. void
  714. __glXDisp_Materiali(GLbyte * pc)
  715. {
  716. glMateriali(*(GLenum *) (pc + 0),
  717. *(GLenum *) (pc + 4), *(GLint *) (pc + 8));
  718. }
  719. void
  720. __glXDisp_Materialiv(GLbyte * pc)
  721. {
  722. const GLenum pname = *(GLenum *) (pc + 4);
  723. const GLint *params;
  724. params = (const GLint *) (pc + 8);
  725. glMaterialiv(*(GLenum *) (pc + 0), pname, params);
  726. }
  727. void
  728. __glXDisp_PointSize(GLbyte * pc)
  729. {
  730. glPointSize(*(GLfloat *) (pc + 0));
  731. }
  732. void
  733. __glXDisp_PolygonMode(GLbyte * pc)
  734. {
  735. glPolygonMode(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4));
  736. }
  737. void
  738. __glXDisp_PolygonStipple(GLbyte * pc)
  739. {
  740. const GLubyte *const mask = (const GLubyte *) ((pc + 20));
  741. __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc);
  742. glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
  743. glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
  744. glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
  745. glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
  746. glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
  747. glPolygonStipple(mask);
  748. }
  749. void
  750. __glXDisp_Scissor(GLbyte * pc)
  751. {
  752. glScissor(*(GLint *) (pc + 0),
  753. *(GLint *) (pc + 4),
  754. *(GLsizei *) (pc + 8), *(GLsizei *) (pc + 12));
  755. }
  756. void
  757. __glXDisp_ShadeModel(GLbyte * pc)
  758. {
  759. glShadeModel(*(GLenum *) (pc + 0));
  760. }
  761. void
  762. __glXDisp_TexParameterf(GLbyte * pc)
  763. {
  764. glTexParameterf(*(GLenum *) (pc + 0),
  765. *(GLenum *) (pc + 4), *(GLfloat *) (pc + 8));
  766. }
  767. void
  768. __glXDisp_TexParameterfv(GLbyte * pc)
  769. {
  770. const GLenum pname = *(GLenum *) (pc + 4);
  771. const GLfloat *params;
  772. params = (const GLfloat *) (pc + 8);
  773. glTexParameterfv(*(GLenum *) (pc + 0), pname, params);
  774. }
  775. void
  776. __glXDisp_TexParameteri(GLbyte * pc)
  777. {
  778. glTexParameteri(*(GLenum *) (pc + 0),
  779. *(GLenum *) (pc + 4), *(GLint *) (pc + 8));
  780. }
  781. void
  782. __glXDisp_TexParameteriv(GLbyte * pc)
  783. {
  784. const GLenum pname = *(GLenum *) (pc + 4);
  785. const GLint *params;
  786. params = (const GLint *) (pc + 8);
  787. glTexParameteriv(*(GLenum *) (pc + 0), pname, params);
  788. }
  789. void
  790. __glXDisp_TexImage1D(GLbyte * pc)
  791. {
  792. const GLvoid *const pixels = (const GLvoid *) ((pc + 52));
  793. __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc);
  794. glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
  795. glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
  796. glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
  797. glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
  798. glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
  799. glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
  800. glTexImage1D(*(GLenum *) (pc + 20),
  801. *(GLint *) (pc + 24),
  802. *(GLint *) (pc + 28),
  803. *(GLsizei *) (pc + 32),
  804. *(GLint *) (pc + 40),
  805. *(GLenum *) (pc + 44), *(GLenum *) (pc + 48), pixels);
  806. }
  807. void
  808. __glXDisp_TexImage2D(GLbyte * pc)
  809. {
  810. const GLvoid *const pixels = (const GLvoid *) ((pc + 52));
  811. __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc);
  812. glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
  813. glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
  814. glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
  815. glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
  816. glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
  817. glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
  818. glTexImage2D(*(GLenum *) (pc + 20),
  819. *(GLint *) (pc + 24),
  820. *(GLint *) (pc + 28),
  821. *(GLsizei *) (pc + 32),
  822. *(GLsizei *) (pc + 36),
  823. *(GLint *) (pc + 40),
  824. *(GLenum *) (pc + 44), *(GLenum *) (pc + 48), pixels);
  825. }
  826. void
  827. __glXDisp_TexEnvf(GLbyte * pc)
  828. {
  829. glTexEnvf(*(GLenum *) (pc + 0),
  830. *(GLenum *) (pc + 4), *(GLfloat *) (pc + 8));
  831. }
  832. void
  833. __glXDisp_TexEnvfv(GLbyte * pc)
  834. {
  835. const GLenum pname = *(GLenum *) (pc + 4);
  836. const GLfloat *params;
  837. params = (const GLfloat *) (pc + 8);
  838. glTexEnvfv(*(GLenum *) (pc + 0), pname, params);
  839. }
  840. void
  841. __glXDisp_TexEnvi(GLbyte * pc)
  842. {
  843. glTexEnvi(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), *(GLint *) (pc + 8));
  844. }
  845. void
  846. __glXDisp_TexEnviv(GLbyte * pc)
  847. {
  848. const GLenum pname = *(GLenum *) (pc + 4);
  849. const GLint *params;
  850. params = (const GLint *) (pc + 8);
  851. glTexEnviv(*(GLenum *) (pc + 0), pname, params);
  852. }
  853. void
  854. __glXDisp_TexGend(GLbyte * pc)
  855. {
  856. #ifdef __GLX_ALIGN64
  857. if ((unsigned long) (pc) & 7) {
  858. (void) memmove(pc - 4, pc, 16);
  859. pc -= 4;
  860. }
  861. #endif
  862. glTexGend(*(GLenum *) (pc + 8),
  863. *(GLenum *) (pc + 12), *(GLdouble *) (pc + 0));
  864. }
  865. void
  866. __glXDisp_TexGendv(GLbyte * pc)
  867. {
  868. const GLenum pname = *(GLenum *) (pc + 4);
  869. const GLdouble *params;
  870. #ifdef __GLX_ALIGN64
  871. const GLuint compsize = __glTexGendv_size(pname);
  872. const GLuint cmdlen = 12 + __GLX_PAD((compsize * 8)) - 4;
  873. if ((unsigned long) (pc) & 7) {
  874. (void) memmove(pc - 4, pc, cmdlen);
  875. pc -= 4;
  876. }
  877. #endif
  878. params = (const GLdouble *) (pc + 8);
  879. glTexGendv(*(GLenum *) (pc + 0), pname, params);
  880. }
  881. void
  882. __glXDisp_TexGenf(GLbyte * pc)
  883. {
  884. glTexGenf(*(GLenum *) (pc + 0),
  885. *(GLenum *) (pc + 4), *(GLfloat *) (pc + 8));
  886. }
  887. void
  888. __glXDisp_TexGenfv(GLbyte * pc)
  889. {
  890. const GLenum pname = *(GLenum *) (pc + 4);
  891. const GLfloat *params;
  892. params = (const GLfloat *) (pc + 8);
  893. glTexGenfv(*(GLenum *) (pc + 0), pname, params);
  894. }
  895. void
  896. __glXDisp_TexGeni(GLbyte * pc)
  897. {
  898. glTexGeni(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), *(GLint *) (pc + 8));
  899. }
  900. void
  901. __glXDisp_TexGeniv(GLbyte * pc)
  902. {
  903. const GLenum pname = *(GLenum *) (pc + 4);
  904. const GLint *params;
  905. params = (const GLint *) (pc + 8);
  906. glTexGeniv(*(GLenum *) (pc + 0), pname, params);
  907. }
  908. void
  909. __glXDisp_InitNames(GLbyte * pc)
  910. {
  911. glInitNames();
  912. }
  913. void
  914. __glXDisp_LoadName(GLbyte * pc)
  915. {
  916. glLoadName(*(GLuint *) (pc + 0));
  917. }
  918. void
  919. __glXDisp_PassThrough(GLbyte * pc)
  920. {
  921. glPassThrough(*(GLfloat *) (pc + 0));
  922. }
  923. void
  924. __glXDisp_PopName(GLbyte * pc)
  925. {
  926. glPopName();
  927. }
  928. void
  929. __glXDisp_PushName(GLbyte * pc)
  930. {
  931. glPushName(*(GLuint *) (pc + 0));
  932. }
  933. void
  934. __glXDisp_DrawBuffer(GLbyte * pc)
  935. {
  936. glDrawBuffer(*(GLenum *) (pc + 0));
  937. }
  938. void
  939. __glXDisp_Clear(GLbyte * pc)
  940. {
  941. glClear(*(GLbitfield *) (pc + 0));
  942. }
  943. void
  944. __glXDisp_ClearAccum(GLbyte * pc)
  945. {
  946. glClearAccum(*(GLfloat *) (pc + 0),
  947. *(GLfloat *) (pc + 4),
  948. *(GLfloat *) (pc + 8), *(GLfloat *) (pc + 12));
  949. }
  950. void
  951. __glXDisp_ClearIndex(GLbyte * pc)
  952. {
  953. glClearIndex(*(GLfloat *) (pc + 0));
  954. }
  955. void
  956. __glXDisp_ClearColor(GLbyte * pc)
  957. {
  958. glClearColor(*(GLclampf *) (pc + 0),
  959. *(GLclampf *) (pc + 4),
  960. *(GLclampf *) (pc + 8), *(GLclampf *) (pc + 12));
  961. }
  962. void
  963. __glXDisp_ClearStencil(GLbyte * pc)
  964. {
  965. glClearStencil(*(GLint *) (pc + 0));
  966. }
  967. void
  968. __glXDisp_ClearDepth(GLbyte * pc)
  969. {
  970. #ifdef __GLX_ALIGN64
  971. if ((unsigned long) (pc) & 7) {
  972. (void) memmove(pc - 4, pc, 8);
  973. pc -= 4;
  974. }
  975. #endif
  976. glClearDepth(*(GLclampd *) (pc + 0));
  977. }
  978. void
  979. __glXDisp_StencilMask(GLbyte * pc)
  980. {
  981. glStencilMask(*(GLuint *) (pc + 0));
  982. }
  983. void
  984. __glXDisp_ColorMask(GLbyte * pc)
  985. {
  986. glColorMask(*(GLboolean *) (pc + 0),
  987. *(GLboolean *) (pc + 1),
  988. *(GLboolean *) (pc + 2), *(GLboolean *) (pc + 3));
  989. }
  990. void
  991. __glXDisp_DepthMask(GLbyte * pc)
  992. {
  993. glDepthMask(*(GLboolean *) (pc + 0));
  994. }
  995. void
  996. __glXDisp_IndexMask(GLbyte * pc)
  997. {
  998. glIndexMask(*(GLuint *) (pc + 0));
  999. }
  1000. void
  1001. __glXDisp_Accum(GLbyte * pc)
  1002. {
  1003. glAccum(*(GLenum *) (pc + 0), *(GLfloat *) (pc + 4));
  1004. }
  1005. void
  1006. __glXDisp_Disable(GLbyte * pc)
  1007. {
  1008. glDisable(*(GLenum *) (pc + 0));
  1009. }
  1010. void
  1011. __glXDisp_Enable(GLbyte * pc)
  1012. {
  1013. glEnable(*(GLenum *) (pc + 0));
  1014. }
  1015. void
  1016. __glXDisp_PopAttrib(GLbyte * pc)
  1017. {
  1018. glPopAttrib();
  1019. }
  1020. void
  1021. __glXDisp_PushAttrib(GLbyte * pc)
  1022. {
  1023. glPushAttrib(*(GLbitfield *) (pc + 0));
  1024. }
  1025. void
  1026. __glXDisp_MapGrid1d(GLbyte * pc)
  1027. {
  1028. #ifdef __GLX_ALIGN64
  1029. if ((unsigned long) (pc) & 7) {
  1030. (void) memmove(pc - 4, pc, 20);
  1031. pc -= 4;
  1032. }
  1033. #endif
  1034. glMapGrid1d(*(GLint *) (pc + 16),
  1035. *(GLdouble *) (pc + 0), *(GLdouble *) (pc + 8));
  1036. }
  1037. void
  1038. __glXDisp_MapGrid1f(GLbyte * pc)
  1039. {
  1040. glMapGrid1f(*(GLint *) (pc + 0),
  1041. *(GLfloat *) (pc + 4), *(GLfloat *) (pc + 8));
  1042. }
  1043. void
  1044. __glXDisp_MapGrid2d(GLbyte * pc)
  1045. {
  1046. #ifdef __GLX_ALIGN64
  1047. if ((unsigned long) (pc) & 7) {
  1048. (void) memmove(pc - 4, pc, 40);
  1049. pc -= 4;
  1050. }
  1051. #endif
  1052. glMapGrid2d(*(GLint *) (pc + 32),
  1053. *(GLdouble *) (pc + 0),
  1054. *(GLdouble *) (pc + 8),
  1055. *(GLint *) (pc + 36),
  1056. *(GLdouble *) (pc + 16), *(GLdouble *) (pc + 24));
  1057. }
  1058. void
  1059. __glXDisp_MapGrid2f(GLbyte * pc)
  1060. {
  1061. glMapGrid2f(*(GLint *) (pc + 0),
  1062. *(GLfloat *) (pc + 4),
  1063. *(GLfloat *) (pc + 8),
  1064. *(GLint *) (pc + 12),
  1065. *(GLfloat *) (pc + 16), *(GLfloat *) (pc + 20));
  1066. }
  1067. void
  1068. __glXDisp_EvalCoord1dv(GLbyte * pc)
  1069. {
  1070. #ifdef __GLX_ALIGN64
  1071. if ((unsigned long) (pc) & 7) {
  1072. (void) memmove(pc - 4, pc, 8);
  1073. pc -= 4;
  1074. }
  1075. #endif
  1076. glEvalCoord1dv((const GLdouble *) (pc + 0));
  1077. }
  1078. void
  1079. __glXDisp_EvalCoord1fv(GLbyte * pc)
  1080. {
  1081. glEvalCoord1fv((const GLfloat *) (pc + 0));
  1082. }
  1083. void
  1084. __glXDisp_EvalCoord2dv(GLbyte * pc)
  1085. {
  1086. #ifdef __GLX_ALIGN64
  1087. if ((unsigned long) (pc) & 7) {
  1088. (void) memmove(pc - 4, pc, 16);
  1089. pc -= 4;
  1090. }
  1091. #endif
  1092. glEvalCoord2dv((const GLdouble *) (pc + 0));
  1093. }
  1094. void
  1095. __glXDisp_EvalCoord2fv(GLbyte * pc)
  1096. {
  1097. glEvalCoord2fv((const GLfloat *) (pc + 0));
  1098. }
  1099. void
  1100. __glXDisp_EvalMesh1(GLbyte * pc)
  1101. {
  1102. glEvalMesh1(*(GLenum *) (pc + 0), *(GLint *) (pc + 4), *(GLint *) (pc + 8));
  1103. }
  1104. void
  1105. __glXDisp_EvalPoint1(GLbyte * pc)
  1106. {
  1107. glEvalPoint1(*(GLint *) (pc + 0));
  1108. }
  1109. void
  1110. __glXDisp_EvalMesh2(GLbyte * pc)
  1111. {
  1112. glEvalMesh2(*(GLenum *) (pc + 0),
  1113. *(GLint *) (pc + 4),
  1114. *(GLint *) (pc + 8),
  1115. *(GLint *) (pc + 12), *(GLint *) (pc + 16));
  1116. }
  1117. void
  1118. __glXDisp_EvalPoint2(GLbyte * pc)
  1119. {
  1120. glEvalPoint2(*(GLint *) (pc + 0), *(GLint *) (pc + 4));
  1121. }
  1122. void
  1123. __glXDisp_AlphaFunc(GLbyte * pc)
  1124. {
  1125. glAlphaFunc(*(GLenum *) (pc + 0), *(GLclampf *) (pc + 4));
  1126. }
  1127. void
  1128. __glXDisp_BlendFunc(GLbyte * pc)
  1129. {
  1130. glBlendFunc(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4));
  1131. }
  1132. void
  1133. __glXDisp_LogicOp(GLbyte * pc)
  1134. {
  1135. glLogicOp(*(GLenum *) (pc + 0));
  1136. }
  1137. void
  1138. __glXDisp_StencilFunc(GLbyte * pc)
  1139. {
  1140. glStencilFunc(*(GLenum *) (pc + 0),
  1141. *(GLint *) (pc + 4), *(GLuint *) (pc + 8));
  1142. }
  1143. void
  1144. __glXDisp_StencilOp(GLbyte * pc)
  1145. {
  1146. glStencilOp(*(GLenum *) (pc + 0),
  1147. *(GLenum *) (pc + 4), *(GLenum *) (pc + 8));
  1148. }
  1149. void
  1150. __glXDisp_DepthFunc(GLbyte * pc)
  1151. {
  1152. glDepthFunc(*(GLenum *) (pc + 0));
  1153. }
  1154. void
  1155. __glXDisp_PixelZoom(GLbyte * pc)
  1156. {
  1157. glPixelZoom(*(GLfloat *) (pc + 0), *(GLfloat *) (pc + 4));
  1158. }
  1159. void
  1160. __glXDisp_PixelTransferf(GLbyte * pc)
  1161. {
  1162. glPixelTransferf(*(GLenum *) (pc + 0), *(GLfloat *) (pc + 4));
  1163. }
  1164. void
  1165. __glXDisp_PixelTransferi(GLbyte * pc)
  1166. {
  1167. glPixelTransferi(*(GLenum *) (pc + 0), *(GLint *) (pc + 4));
  1168. }
  1169. int
  1170. __glXDisp_PixelStoref(__GLXclientState * cl, GLbyte * pc)
  1171. {
  1172. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1173. int error;
  1174. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  1175. pc += __GLX_SINGLE_HDR_SIZE;
  1176. if (cx != NULL) {
  1177. glPixelStoref(*(GLenum *) (pc + 0), *(GLfloat *) (pc + 4));
  1178. error = Success;
  1179. }
  1180. return error;
  1181. }
  1182. int
  1183. __glXDisp_PixelStorei(__GLXclientState * cl, GLbyte * pc)
  1184. {
  1185. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1186. int error;
  1187. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  1188. pc += __GLX_SINGLE_HDR_SIZE;
  1189. if (cx != NULL) {
  1190. glPixelStorei(*(GLenum *) (pc + 0), *(GLint *) (pc + 4));
  1191. error = Success;
  1192. }
  1193. return error;
  1194. }
  1195. void
  1196. __glXDisp_PixelMapfv(GLbyte * pc)
  1197. {
  1198. const GLsizei mapsize = *(GLsizei *) (pc + 4);
  1199. glPixelMapfv(*(GLenum *) (pc + 0), mapsize, (const GLfloat *) (pc + 8));
  1200. }
  1201. void
  1202. __glXDisp_PixelMapuiv(GLbyte * pc)
  1203. {
  1204. const GLsizei mapsize = *(GLsizei *) (pc + 4);
  1205. glPixelMapuiv(*(GLenum *) (pc + 0), mapsize, (const GLuint *) (pc + 8));
  1206. }
  1207. void
  1208. __glXDisp_PixelMapusv(GLbyte * pc)
  1209. {
  1210. const GLsizei mapsize = *(GLsizei *) (pc + 4);
  1211. glPixelMapusv(*(GLenum *) (pc + 0), mapsize, (const GLushort *) (pc + 8));
  1212. }
  1213. void
  1214. __glXDisp_ReadBuffer(GLbyte * pc)
  1215. {
  1216. glReadBuffer(*(GLenum *) (pc + 0));
  1217. }
  1218. void
  1219. __glXDisp_CopyPixels(GLbyte * pc)
  1220. {
  1221. glCopyPixels(*(GLint *) (pc + 0),
  1222. *(GLint *) (pc + 4),
  1223. *(GLsizei *) (pc + 8),
  1224. *(GLsizei *) (pc + 12), *(GLenum *) (pc + 16));
  1225. }
  1226. void
  1227. __glXDisp_DrawPixels(GLbyte * pc)
  1228. {
  1229. const GLvoid *const pixels = (const GLvoid *) ((pc + 36));
  1230. __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc);
  1231. glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
  1232. glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
  1233. glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
  1234. glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
  1235. glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
  1236. glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
  1237. glDrawPixels(*(GLsizei *) (pc + 20),
  1238. *(GLsizei *) (pc + 24),
  1239. *(GLenum *) (pc + 28), *(GLenum *) (pc + 32), pixels);
  1240. }
  1241. int
  1242. __glXDisp_GetBooleanv(__GLXclientState * cl, GLbyte * pc)
  1243. {
  1244. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1245. int error;
  1246. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  1247. pc += __GLX_SINGLE_HDR_SIZE;
  1248. if (cx != NULL) {
  1249. const GLenum pname = *(GLenum *) (pc + 0);
  1250. const GLuint compsize = __glGetBooleanv_size(pname);
  1251. GLboolean answerBuffer[200];
  1252. GLboolean *params =
  1253. __glXGetAnswerBuffer(cl, compsize, answerBuffer,
  1254. sizeof(answerBuffer), 1);
  1255. if (params == NULL)
  1256. return BadAlloc;
  1257. __glXClearErrorOccured();
  1258. glGetBooleanv(pname, params);
  1259. __glXSendReply(cl->client, params, compsize, 1, GL_FALSE, 0);
  1260. error = Success;
  1261. }
  1262. return error;
  1263. }
  1264. int
  1265. __glXDisp_GetClipPlane(__GLXclientState * cl, GLbyte * pc)
  1266. {
  1267. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1268. int error;
  1269. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  1270. pc += __GLX_SINGLE_HDR_SIZE;
  1271. if (cx != NULL) {
  1272. GLdouble equation[4];
  1273. glGetClipPlane(*(GLenum *) (pc + 0), equation);
  1274. __glXSendReply(cl->client, equation, 4, 8, GL_TRUE, 0);
  1275. error = Success;
  1276. }
  1277. return error;
  1278. }
  1279. int
  1280. __glXDisp_GetDoublev(__GLXclientState * cl, GLbyte * pc)
  1281. {
  1282. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1283. int error;
  1284. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  1285. pc += __GLX_SINGLE_HDR_SIZE;
  1286. if (cx != NULL) {
  1287. const GLenum pname = *(GLenum *) (pc + 0);
  1288. const GLuint compsize = __glGetDoublev_size(pname);
  1289. GLdouble answerBuffer[200];
  1290. GLdouble *params =
  1291. __glXGetAnswerBuffer(cl, compsize * 8, answerBuffer,
  1292. sizeof(answerBuffer), 8);
  1293. if (params == NULL)
  1294. return BadAlloc;
  1295. __glXClearErrorOccured();
  1296. glGetDoublev(pname, params);
  1297. __glXSendReply(cl->client, params, compsize, 8, GL_FALSE, 0);
  1298. error = Success;
  1299. }
  1300. return error;
  1301. }
  1302. int
  1303. __glXDisp_GetError(__GLXclientState * cl, GLbyte * pc)
  1304. {
  1305. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1306. int error;
  1307. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  1308. pc += __GLX_SINGLE_HDR_SIZE;
  1309. if (cx != NULL) {
  1310. GLenum retval;
  1311. retval = glGetError();
  1312. __glXSendReply(cl->client, dummy_answer, 0, 0, GL_FALSE, retval);
  1313. error = Success;
  1314. }
  1315. return error;
  1316. }
  1317. int
  1318. __glXDisp_GetFloatv(__GLXclientState * cl, GLbyte * pc)
  1319. {
  1320. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1321. int error;
  1322. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  1323. pc += __GLX_SINGLE_HDR_SIZE;
  1324. if (cx != NULL) {
  1325. const GLenum pname = *(GLenum *) (pc + 0);
  1326. const GLuint compsize = __glGetFloatv_size(pname);
  1327. GLfloat answerBuffer[200];
  1328. GLfloat *params =
  1329. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  1330. sizeof(answerBuffer), 4);
  1331. if (params == NULL)
  1332. return BadAlloc;
  1333. __glXClearErrorOccured();
  1334. glGetFloatv(pname, params);
  1335. __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0);
  1336. error = Success;
  1337. }
  1338. return error;
  1339. }
  1340. int
  1341. __glXDisp_GetIntegerv(__GLXclientState * cl, GLbyte * pc)
  1342. {
  1343. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1344. int error;
  1345. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  1346. pc += __GLX_SINGLE_HDR_SIZE;
  1347. if (cx != NULL) {
  1348. const GLenum pname = *(GLenum *) (pc + 0);
  1349. const GLuint compsize = __glGetIntegerv_size(pname);
  1350. GLint answerBuffer[200];
  1351. GLint *params =
  1352. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  1353. sizeof(answerBuffer), 4);
  1354. if (params == NULL)
  1355. return BadAlloc;
  1356. __glXClearErrorOccured();
  1357. glGetIntegerv(pname, params);
  1358. __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0);
  1359. error = Success;
  1360. }
  1361. return error;
  1362. }
  1363. int
  1364. __glXDisp_GetLightfv(__GLXclientState * cl, GLbyte * pc)
  1365. {
  1366. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1367. int error;
  1368. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  1369. pc += __GLX_SINGLE_HDR_SIZE;
  1370. if (cx != NULL) {
  1371. const GLenum pname = *(GLenum *) (pc + 4);
  1372. const GLuint compsize = __glGetLightfv_size(pname);
  1373. GLfloat answerBuffer[200];
  1374. GLfloat *params =
  1375. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  1376. sizeof(answerBuffer), 4);
  1377. if (params == NULL)
  1378. return BadAlloc;
  1379. __glXClearErrorOccured();
  1380. glGetLightfv(*(GLenum *) (pc + 0), pname, params);
  1381. __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0);
  1382. error = Success;
  1383. }
  1384. return error;
  1385. }
  1386. int
  1387. __glXDisp_GetLightiv(__GLXclientState * cl, GLbyte * pc)
  1388. {
  1389. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1390. int error;
  1391. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  1392. pc += __GLX_SINGLE_HDR_SIZE;
  1393. if (cx != NULL) {
  1394. const GLenum pname = *(GLenum *) (pc + 4);
  1395. const GLuint compsize = __glGetLightiv_size(pname);
  1396. GLint answerBuffer[200];
  1397. GLint *params =
  1398. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  1399. sizeof(answerBuffer), 4);
  1400. if (params == NULL)
  1401. return BadAlloc;
  1402. __glXClearErrorOccured();
  1403. glGetLightiv(*(GLenum *) (pc + 0), pname, params);
  1404. __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0);
  1405. error = Success;
  1406. }
  1407. return error;
  1408. }
  1409. int
  1410. __glXDisp_GetMapdv(__GLXclientState * cl, GLbyte * pc)
  1411. {
  1412. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1413. int error;
  1414. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  1415. pc += __GLX_SINGLE_HDR_SIZE;
  1416. if (cx != NULL) {
  1417. const GLenum target = *(GLenum *) (pc + 0);
  1418. const GLenum query = *(GLenum *) (pc + 4);
  1419. const GLuint compsize = __glGetMapdv_size(target, query);
  1420. GLdouble answerBuffer[200];
  1421. GLdouble *v =
  1422. __glXGetAnswerBuffer(cl, compsize * 8, answerBuffer,
  1423. sizeof(answerBuffer), 8);
  1424. if (v == NULL)
  1425. return BadAlloc;
  1426. __glXClearErrorOccured();
  1427. glGetMapdv(target, query, v);
  1428. __glXSendReply(cl->client, v, compsize, 8, GL_FALSE, 0);
  1429. error = Success;
  1430. }
  1431. return error;
  1432. }
  1433. int
  1434. __glXDisp_GetMapfv(__GLXclientState * cl, GLbyte * pc)
  1435. {
  1436. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1437. int error;
  1438. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  1439. pc += __GLX_SINGLE_HDR_SIZE;
  1440. if (cx != NULL) {
  1441. const GLenum target = *(GLenum *) (pc + 0);
  1442. const GLenum query = *(GLenum *) (pc + 4);
  1443. const GLuint compsize = __glGetMapfv_size(target, query);
  1444. GLfloat answerBuffer[200];
  1445. GLfloat *v =
  1446. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  1447. sizeof(answerBuffer), 4);
  1448. if (v == NULL)
  1449. return BadAlloc;
  1450. __glXClearErrorOccured();
  1451. glGetMapfv(target, query, v);
  1452. __glXSendReply(cl->client, v, compsize, 4, GL_FALSE, 0);
  1453. error = Success;
  1454. }
  1455. return error;
  1456. }
  1457. int
  1458. __glXDisp_GetMapiv(__GLXclientState * cl, GLbyte * pc)
  1459. {
  1460. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1461. int error;
  1462. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  1463. pc += __GLX_SINGLE_HDR_SIZE;
  1464. if (cx != NULL) {
  1465. const GLenum target = *(GLenum *) (pc + 0);
  1466. const GLenum query = *(GLenum *) (pc + 4);
  1467. const GLuint compsize = __glGetMapiv_size(target, query);
  1468. GLint answerBuffer[200];
  1469. GLint *v =
  1470. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  1471. sizeof(answerBuffer), 4);
  1472. if (v == NULL)
  1473. return BadAlloc;
  1474. __glXClearErrorOccured();
  1475. glGetMapiv(target, query, v);
  1476. __glXSendReply(cl->client, v, compsize, 4, GL_FALSE, 0);
  1477. error = Success;
  1478. }
  1479. return error;
  1480. }
  1481. int
  1482. __glXDisp_GetMaterialfv(__GLXclientState * cl, GLbyte * pc)
  1483. {
  1484. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1485. int error;
  1486. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  1487. pc += __GLX_SINGLE_HDR_SIZE;
  1488. if (cx != NULL) {
  1489. const GLenum pname = *(GLenum *) (pc + 4);
  1490. const GLuint compsize = __glGetMaterialfv_size(pname);
  1491. GLfloat answerBuffer[200];
  1492. GLfloat *params =
  1493. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  1494. sizeof(answerBuffer), 4);
  1495. if (params == NULL)
  1496. return BadAlloc;
  1497. __glXClearErrorOccured();
  1498. glGetMaterialfv(*(GLenum *) (pc + 0), pname, params);
  1499. __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0);
  1500. error = Success;
  1501. }
  1502. return error;
  1503. }
  1504. int
  1505. __glXDisp_GetMaterialiv(__GLXclientState * cl, GLbyte * pc)
  1506. {
  1507. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1508. int error;
  1509. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  1510. pc += __GLX_SINGLE_HDR_SIZE;
  1511. if (cx != NULL) {
  1512. const GLenum pname = *(GLenum *) (pc + 4);
  1513. const GLuint compsize = __glGetMaterialiv_size(pname);
  1514. GLint answerBuffer[200];
  1515. GLint *params =
  1516. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  1517. sizeof(answerBuffer), 4);
  1518. if (params == NULL)
  1519. return BadAlloc;
  1520. __glXClearErrorOccured();
  1521. glGetMaterialiv(*(GLenum *) (pc + 0), pname, params);
  1522. __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0);
  1523. error = Success;
  1524. }
  1525. return error;
  1526. }
  1527. int
  1528. __glXDisp_GetPixelMapfv(__GLXclientState * cl, GLbyte * pc)
  1529. {
  1530. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1531. int error;
  1532. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  1533. pc += __GLX_SINGLE_HDR_SIZE;
  1534. if (cx != NULL) {
  1535. const GLenum map = *(GLenum *) (pc + 0);
  1536. const GLuint compsize = __glGetPixelMapfv_size(map);
  1537. GLfloat answerBuffer[200];
  1538. GLfloat *values =
  1539. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  1540. sizeof(answerBuffer), 4);
  1541. if (values == NULL)
  1542. return BadAlloc;
  1543. __glXClearErrorOccured();
  1544. glGetPixelMapfv(map, values);
  1545. __glXSendReply(cl->client, values, compsize, 4, GL_FALSE, 0);
  1546. error = Success;
  1547. }
  1548. return error;
  1549. }
  1550. int
  1551. __glXDisp_GetPixelMapuiv(__GLXclientState * cl, GLbyte * pc)
  1552. {
  1553. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1554. int error;
  1555. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  1556. pc += __GLX_SINGLE_HDR_SIZE;
  1557. if (cx != NULL) {
  1558. const GLenum map = *(GLenum *) (pc + 0);
  1559. const GLuint compsize = __glGetPixelMapuiv_size(map);
  1560. GLuint answerBuffer[200];
  1561. GLuint *values =
  1562. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  1563. sizeof(answerBuffer), 4);
  1564. if (values == NULL)
  1565. return BadAlloc;
  1566. __glXClearErrorOccured();
  1567. glGetPixelMapuiv(map, values);
  1568. __glXSendReply(cl->client, values, compsize, 4, GL_FALSE, 0);
  1569. error = Success;
  1570. }
  1571. return error;
  1572. }
  1573. int
  1574. __glXDisp_GetPixelMapusv(__GLXclientState * cl, GLbyte * pc)
  1575. {
  1576. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1577. int error;
  1578. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  1579. pc += __GLX_SINGLE_HDR_SIZE;
  1580. if (cx != NULL) {
  1581. const GLenum map = *(GLenum *) (pc + 0);
  1582. const GLuint compsize = __glGetPixelMapusv_size(map);
  1583. GLushort answerBuffer[200];
  1584. GLushort *values =
  1585. __glXGetAnswerBuffer(cl, compsize * 2, answerBuffer,
  1586. sizeof(answerBuffer), 2);
  1587. if (values == NULL)
  1588. return BadAlloc;
  1589. __glXClearErrorOccured();
  1590. glGetPixelMapusv(map, values);
  1591. __glXSendReply(cl->client, values, compsize, 2, GL_FALSE, 0);
  1592. error = Success;
  1593. }
  1594. return error;
  1595. }
  1596. int
  1597. __glXDisp_GetTexEnvfv(__GLXclientState * cl, GLbyte * pc)
  1598. {
  1599. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1600. int error;
  1601. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  1602. pc += __GLX_SINGLE_HDR_SIZE;
  1603. if (cx != NULL) {
  1604. const GLenum pname = *(GLenum *) (pc + 4);
  1605. const GLuint compsize = __glGetTexEnvfv_size(pname);
  1606. GLfloat answerBuffer[200];
  1607. GLfloat *params =
  1608. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  1609. sizeof(answerBuffer), 4);
  1610. if (params == NULL)
  1611. return BadAlloc;
  1612. __glXClearErrorOccured();
  1613. glGetTexEnvfv(*(GLenum *) (pc + 0), pname, params);
  1614. __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0);
  1615. error = Success;
  1616. }
  1617. return error;
  1618. }
  1619. int
  1620. __glXDisp_GetTexEnviv(__GLXclientState * cl, GLbyte * pc)
  1621. {
  1622. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1623. int error;
  1624. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  1625. pc += __GLX_SINGLE_HDR_SIZE;
  1626. if (cx != NULL) {
  1627. const GLenum pname = *(GLenum *) (pc + 4);
  1628. const GLuint compsize = __glGetTexEnviv_size(pname);
  1629. GLint answerBuffer[200];
  1630. GLint *params =
  1631. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  1632. sizeof(answerBuffer), 4);
  1633. if (params == NULL)
  1634. return BadAlloc;
  1635. __glXClearErrorOccured();
  1636. glGetTexEnviv(*(GLenum *) (pc + 0), pname, params);
  1637. __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0);
  1638. error = Success;
  1639. }
  1640. return error;
  1641. }
  1642. int
  1643. __glXDisp_GetTexGendv(__GLXclientState * cl, GLbyte * pc)
  1644. {
  1645. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1646. int error;
  1647. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  1648. pc += __GLX_SINGLE_HDR_SIZE;
  1649. if (cx != NULL) {
  1650. const GLenum pname = *(GLenum *) (pc + 4);
  1651. const GLuint compsize = __glGetTexGendv_size(pname);
  1652. GLdouble answerBuffer[200];
  1653. GLdouble *params =
  1654. __glXGetAnswerBuffer(cl, compsize * 8, answerBuffer,
  1655. sizeof(answerBuffer), 8);
  1656. if (params == NULL)
  1657. return BadAlloc;
  1658. __glXClearErrorOccured();
  1659. glGetTexGendv(*(GLenum *) (pc + 0), pname, params);
  1660. __glXSendReply(cl->client, params, compsize, 8, GL_FALSE, 0);
  1661. error = Success;
  1662. }
  1663. return error;
  1664. }
  1665. int
  1666. __glXDisp_GetTexGenfv(__GLXclientState * cl, GLbyte * pc)
  1667. {
  1668. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1669. int error;
  1670. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  1671. pc += __GLX_SINGLE_HDR_SIZE;
  1672. if (cx != NULL) {
  1673. const GLenum pname = *(GLenum *) (pc + 4);
  1674. const GLuint compsize = __glGetTexGenfv_size(pname);
  1675. GLfloat answerBuffer[200];
  1676. GLfloat *params =
  1677. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  1678. sizeof(answerBuffer), 4);
  1679. if (params == NULL)
  1680. return BadAlloc;
  1681. __glXClearErrorOccured();
  1682. glGetTexGenfv(*(GLenum *) (pc + 0), pname, params);
  1683. __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0);
  1684. error = Success;
  1685. }
  1686. return error;
  1687. }
  1688. int
  1689. __glXDisp_GetTexGeniv(__GLXclientState * cl, GLbyte * pc)
  1690. {
  1691. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1692. int error;
  1693. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  1694. pc += __GLX_SINGLE_HDR_SIZE;
  1695. if (cx != NULL) {
  1696. const GLenum pname = *(GLenum *) (pc + 4);
  1697. const GLuint compsize = __glGetTexGeniv_size(pname);
  1698. GLint answerBuffer[200];
  1699. GLint *params =
  1700. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  1701. sizeof(answerBuffer), 4);
  1702. if (params == NULL)
  1703. return BadAlloc;
  1704. __glXClearErrorOccured();
  1705. glGetTexGeniv(*(GLenum *) (pc + 0), pname, params);
  1706. __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0);
  1707. error = Success;
  1708. }
  1709. return error;
  1710. }
  1711. int
  1712. __glXDisp_GetTexParameterfv(__GLXclientState * cl, GLbyte * pc)
  1713. {
  1714. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1715. int error;
  1716. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  1717. pc += __GLX_SINGLE_HDR_SIZE;
  1718. if (cx != NULL) {
  1719. const GLenum pname = *(GLenum *) (pc + 4);
  1720. const GLuint compsize = __glGetTexParameterfv_size(pname);
  1721. GLfloat answerBuffer[200];
  1722. GLfloat *params =
  1723. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  1724. sizeof(answerBuffer), 4);
  1725. if (params == NULL)
  1726. return BadAlloc;
  1727. __glXClearErrorOccured();
  1728. glGetTexParameterfv(*(GLenum *) (pc + 0), pname, params);
  1729. __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0);
  1730. error = Success;
  1731. }
  1732. return error;
  1733. }
  1734. int
  1735. __glXDisp_GetTexParameteriv(__GLXclientState * cl, GLbyte * pc)
  1736. {
  1737. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1738. int error;
  1739. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  1740. pc += __GLX_SINGLE_HDR_SIZE;
  1741. if (cx != NULL) {
  1742. const GLenum pname = *(GLenum *) (pc + 4);
  1743. const GLuint compsize = __glGetTexParameteriv_size(pname);
  1744. GLint answerBuffer[200];
  1745. GLint *params =
  1746. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  1747. sizeof(answerBuffer), 4);
  1748. if (params == NULL)
  1749. return BadAlloc;
  1750. __glXClearErrorOccured();
  1751. glGetTexParameteriv(*(GLenum *) (pc + 0), pname, params);
  1752. __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0);
  1753. error = Success;
  1754. }
  1755. return error;
  1756. }
  1757. int
  1758. __glXDisp_GetTexLevelParameterfv(__GLXclientState * cl, GLbyte * pc)
  1759. {
  1760. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1761. int error;
  1762. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  1763. pc += __GLX_SINGLE_HDR_SIZE;
  1764. if (cx != NULL) {
  1765. const GLenum pname = *(GLenum *) (pc + 8);
  1766. const GLuint compsize = __glGetTexLevelParameterfv_size(pname);
  1767. GLfloat answerBuffer[200];
  1768. GLfloat *params =
  1769. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  1770. sizeof(answerBuffer), 4);
  1771. if (params == NULL)
  1772. return BadAlloc;
  1773. __glXClearErrorOccured();
  1774. glGetTexLevelParameterfv(*(GLenum *) (pc + 0),
  1775. *(GLint *) (pc + 4), pname, params);
  1776. __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0);
  1777. error = Success;
  1778. }
  1779. return error;
  1780. }
  1781. int
  1782. __glXDisp_GetTexLevelParameteriv(__GLXclientState * cl, GLbyte * pc)
  1783. {
  1784. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1785. int error;
  1786. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  1787. pc += __GLX_SINGLE_HDR_SIZE;
  1788. if (cx != NULL) {
  1789. const GLenum pname = *(GLenum *) (pc + 8);
  1790. const GLuint compsize = __glGetTexLevelParameteriv_size(pname);
  1791. GLint answerBuffer[200];
  1792. GLint *params =
  1793. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  1794. sizeof(answerBuffer), 4);
  1795. if (params == NULL)
  1796. return BadAlloc;
  1797. __glXClearErrorOccured();
  1798. glGetTexLevelParameteriv(*(GLenum *) (pc + 0),
  1799. *(GLint *) (pc + 4), pname, params);
  1800. __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0);
  1801. error = Success;
  1802. }
  1803. return error;
  1804. }
  1805. int
  1806. __glXDisp_IsEnabled(__GLXclientState * cl, GLbyte * pc)
  1807. {
  1808. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1809. int error;
  1810. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  1811. pc += __GLX_SINGLE_HDR_SIZE;
  1812. if (cx != NULL) {
  1813. GLboolean retval;
  1814. retval = glIsEnabled(*(GLenum *) (pc + 0));
  1815. __glXSendReply(cl->client, dummy_answer, 0, 0, GL_FALSE, retval);
  1816. error = Success;
  1817. }
  1818. return error;
  1819. }
  1820. int
  1821. __glXDisp_IsList(__GLXclientState * cl, GLbyte * pc)
  1822. {
  1823. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  1824. int error;
  1825. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  1826. pc += __GLX_SINGLE_HDR_SIZE;
  1827. if (cx != NULL) {
  1828. GLboolean retval;
  1829. retval = glIsList(*(GLuint *) (pc + 0));
  1830. __glXSendReply(cl->client, dummy_answer, 0, 0, GL_FALSE, retval);
  1831. error = Success;
  1832. }
  1833. return error;
  1834. }
  1835. void
  1836. __glXDisp_DepthRange(GLbyte * pc)
  1837. {
  1838. #ifdef __GLX_ALIGN64
  1839. if ((unsigned long) (pc) & 7) {
  1840. (void) memmove(pc - 4, pc, 16);
  1841. pc -= 4;
  1842. }
  1843. #endif
  1844. glDepthRange(*(GLclampd *) (pc + 0), *(GLclampd *) (pc + 8));
  1845. }
  1846. void
  1847. __glXDisp_Frustum(GLbyte * pc)
  1848. {
  1849. #ifdef __GLX_ALIGN64
  1850. if ((unsigned long) (pc) & 7) {
  1851. (void) memmove(pc - 4, pc, 48);
  1852. pc -= 4;
  1853. }
  1854. #endif
  1855. glFrustum(*(GLdouble *) (pc + 0),
  1856. *(GLdouble *) (pc + 8),
  1857. *(GLdouble *) (pc + 16),
  1858. *(GLdouble *) (pc + 24),
  1859. *(GLdouble *) (pc + 32), *(GLdouble *) (pc + 40));
  1860. }
  1861. void
  1862. __glXDisp_LoadIdentity(GLbyte * pc)
  1863. {
  1864. glLoadIdentity();
  1865. }
  1866. void
  1867. __glXDisp_LoadMatrixf(GLbyte * pc)
  1868. {
  1869. glLoadMatrixf((const GLfloat *) (pc + 0));
  1870. }
  1871. void
  1872. __glXDisp_LoadMatrixd(GLbyte * pc)
  1873. {
  1874. #ifdef __GLX_ALIGN64
  1875. if ((unsigned long) (pc) & 7) {
  1876. (void) memmove(pc - 4, pc, 128);
  1877. pc -= 4;
  1878. }
  1879. #endif
  1880. glLoadMatrixd((const GLdouble *) (pc + 0));
  1881. }
  1882. void
  1883. __glXDisp_MatrixMode(GLbyte * pc)
  1884. {
  1885. glMatrixMode(*(GLenum *) (pc + 0));
  1886. }
  1887. void
  1888. __glXDisp_MultMatrixf(GLbyte * pc)
  1889. {
  1890. glMultMatrixf((const GLfloat *) (pc + 0));
  1891. }
  1892. void
  1893. __glXDisp_MultMatrixd(GLbyte * pc)
  1894. {
  1895. #ifdef __GLX_ALIGN64
  1896. if ((unsigned long) (pc) & 7) {
  1897. (void) memmove(pc - 4, pc, 128);
  1898. pc -= 4;
  1899. }
  1900. #endif
  1901. glMultMatrixd((const GLdouble *) (pc + 0));
  1902. }
  1903. void
  1904. __glXDisp_Ortho(GLbyte * pc)
  1905. {
  1906. #ifdef __GLX_ALIGN64
  1907. if ((unsigned long) (pc) & 7) {
  1908. (void) memmove(pc - 4, pc, 48);
  1909. pc -= 4;
  1910. }
  1911. #endif
  1912. glOrtho(*(GLdouble *) (pc + 0),
  1913. *(GLdouble *) (pc + 8),
  1914. *(GLdouble *) (pc + 16),
  1915. *(GLdouble *) (pc + 24),
  1916. *(GLdouble *) (pc + 32), *(GLdouble *) (pc + 40));
  1917. }
  1918. void
  1919. __glXDisp_PopMatrix(GLbyte * pc)
  1920. {
  1921. glPopMatrix();
  1922. }
  1923. void
  1924. __glXDisp_PushMatrix(GLbyte * pc)
  1925. {
  1926. glPushMatrix();
  1927. }
  1928. void
  1929. __glXDisp_Rotated(GLbyte * pc)
  1930. {
  1931. #ifdef __GLX_ALIGN64
  1932. if ((unsigned long) (pc) & 7) {
  1933. (void) memmove(pc - 4, pc, 32);
  1934. pc -= 4;
  1935. }
  1936. #endif
  1937. glRotated(*(GLdouble *) (pc + 0),
  1938. *(GLdouble *) (pc + 8),
  1939. *(GLdouble *) (pc + 16), *(GLdouble *) (pc + 24));
  1940. }
  1941. void
  1942. __glXDisp_Rotatef(GLbyte * pc)
  1943. {
  1944. glRotatef(*(GLfloat *) (pc + 0),
  1945. *(GLfloat *) (pc + 4),
  1946. *(GLfloat *) (pc + 8), *(GLfloat *) (pc + 12));
  1947. }
  1948. void
  1949. __glXDisp_Scaled(GLbyte * pc)
  1950. {
  1951. #ifdef __GLX_ALIGN64
  1952. if ((unsigned long) (pc) & 7) {
  1953. (void) memmove(pc - 4, pc, 24);
  1954. pc -= 4;
  1955. }
  1956. #endif
  1957. glScaled(*(GLdouble *) (pc + 0),
  1958. *(GLdouble *) (pc + 8), *(GLdouble *) (pc + 16));
  1959. }
  1960. void
  1961. __glXDisp_Scalef(GLbyte * pc)
  1962. {
  1963. glScalef(*(GLfloat *) (pc + 0),
  1964. *(GLfloat *) (pc + 4), *(GLfloat *) (pc + 8));
  1965. }
  1966. void
  1967. __glXDisp_Translated(GLbyte * pc)
  1968. {
  1969. #ifdef __GLX_ALIGN64
  1970. if ((unsigned long) (pc) & 7) {
  1971. (void) memmove(pc - 4, pc, 24);
  1972. pc -= 4;
  1973. }
  1974. #endif
  1975. glTranslated(*(GLdouble *) (pc + 0),
  1976. *(GLdouble *) (pc + 8), *(GLdouble *) (pc + 16));
  1977. }
  1978. void
  1979. __glXDisp_Translatef(GLbyte * pc)
  1980. {
  1981. glTranslatef(*(GLfloat *) (pc + 0),
  1982. *(GLfloat *) (pc + 4), *(GLfloat *) (pc + 8));
  1983. }
  1984. void
  1985. __glXDisp_Viewport(GLbyte * pc)
  1986. {
  1987. glViewport(*(GLint *) (pc + 0),
  1988. *(GLint *) (pc + 4),
  1989. *(GLsizei *) (pc + 8), *(GLsizei *) (pc + 12));
  1990. }
  1991. void
  1992. __glXDisp_BindTexture(GLbyte * pc)
  1993. {
  1994. glBindTexture(*(GLenum *) (pc + 0), *(GLuint *) (pc + 4));
  1995. }
  1996. void
  1997. __glXDisp_Indexubv(GLbyte * pc)
  1998. {
  1999. glIndexubv((const GLubyte *) (pc + 0));
  2000. }
  2001. void
  2002. __glXDisp_PolygonOffset(GLbyte * pc)
  2003. {
  2004. glPolygonOffset(*(GLfloat *) (pc + 0), *(GLfloat *) (pc + 4));
  2005. }
  2006. int
  2007. __glXDisp_AreTexturesResident(__GLXclientState * cl, GLbyte * pc)
  2008. {
  2009. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  2010. int error;
  2011. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  2012. pc += __GLX_SINGLE_HDR_SIZE;
  2013. if (cx != NULL) {
  2014. const GLsizei n = *(GLsizei *) (pc + 0);
  2015. GLboolean retval;
  2016. GLboolean answerBuffer[200];
  2017. GLboolean *residences =
  2018. __glXGetAnswerBuffer(cl, n, answerBuffer, sizeof(answerBuffer), 1);
  2019. if (residences == NULL)
  2020. return BadAlloc;
  2021. retval =
  2022. glAreTexturesResident(n, (const GLuint *) (pc + 4), residences);
  2023. __glXSendReply(cl->client, residences, n, 1, GL_TRUE, retval);
  2024. error = Success;
  2025. }
  2026. return error;
  2027. }
  2028. int
  2029. __glXDisp_AreTexturesResidentEXT(__GLXclientState * cl, GLbyte * pc)
  2030. {
  2031. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  2032. int error;
  2033. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  2034. pc += __GLX_VENDPRIV_HDR_SIZE;
  2035. if (cx != NULL) {
  2036. const GLsizei n = *(GLsizei *) (pc + 0);
  2037. GLboolean retval;
  2038. GLboolean answerBuffer[200];
  2039. GLboolean *residences =
  2040. __glXGetAnswerBuffer(cl, n, answerBuffer, sizeof(answerBuffer), 1);
  2041. if (residences == NULL)
  2042. return BadAlloc;
  2043. retval =
  2044. glAreTexturesResident(n, (const GLuint *) (pc + 4), residences);
  2045. __glXSendReply(cl->client, residences, n, 1, GL_TRUE, retval);
  2046. error = Success;
  2047. }
  2048. return error;
  2049. }
  2050. void
  2051. __glXDisp_CopyTexImage1D(GLbyte * pc)
  2052. {
  2053. glCopyTexImage1D(*(GLenum *) (pc + 0),
  2054. *(GLint *) (pc + 4),
  2055. *(GLenum *) (pc + 8),
  2056. *(GLint *) (pc + 12),
  2057. *(GLint *) (pc + 16),
  2058. *(GLsizei *) (pc + 20), *(GLint *) (pc + 24));
  2059. }
  2060. void
  2061. __glXDisp_CopyTexImage2D(GLbyte * pc)
  2062. {
  2063. glCopyTexImage2D(*(GLenum *) (pc + 0),
  2064. *(GLint *) (pc + 4),
  2065. *(GLenum *) (pc + 8),
  2066. *(GLint *) (pc + 12),
  2067. *(GLint *) (pc + 16),
  2068. *(GLsizei *) (pc + 20),
  2069. *(GLsizei *) (pc + 24), *(GLint *) (pc + 28));
  2070. }
  2071. void
  2072. __glXDisp_CopyTexSubImage1D(GLbyte * pc)
  2073. {
  2074. glCopyTexSubImage1D(*(GLenum *) (pc + 0),
  2075. *(GLint *) (pc + 4),
  2076. *(GLint *) (pc + 8),
  2077. *(GLint *) (pc + 12),
  2078. *(GLint *) (pc + 16), *(GLsizei *) (pc + 20));
  2079. }
  2080. void
  2081. __glXDisp_CopyTexSubImage2D(GLbyte * pc)
  2082. {
  2083. glCopyTexSubImage2D(*(GLenum *) (pc + 0),
  2084. *(GLint *) (pc + 4),
  2085. *(GLint *) (pc + 8),
  2086. *(GLint *) (pc + 12),
  2087. *(GLint *) (pc + 16),
  2088. *(GLint *) (pc + 20),
  2089. *(GLsizei *) (pc + 24), *(GLsizei *) (pc + 28));
  2090. }
  2091. int
  2092. __glXDisp_DeleteTextures(__GLXclientState * cl, GLbyte * pc)
  2093. {
  2094. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  2095. int error;
  2096. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  2097. pc += __GLX_SINGLE_HDR_SIZE;
  2098. if (cx != NULL) {
  2099. const GLsizei n = *(GLsizei *) (pc + 0);
  2100. glDeleteTextures(n, (const GLuint *) (pc + 4));
  2101. error = Success;
  2102. }
  2103. return error;
  2104. }
  2105. int
  2106. __glXDisp_DeleteTexturesEXT(__GLXclientState * cl, GLbyte * pc)
  2107. {
  2108. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  2109. int error;
  2110. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  2111. pc += __GLX_VENDPRIV_HDR_SIZE;
  2112. if (cx != NULL) {
  2113. const GLsizei n = *(GLsizei *) (pc + 0);
  2114. glDeleteTextures(n, (const GLuint *) (pc + 4));
  2115. error = Success;
  2116. }
  2117. return error;
  2118. }
  2119. int
  2120. __glXDisp_GenTextures(__GLXclientState * cl, GLbyte * pc)
  2121. {
  2122. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  2123. int error;
  2124. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  2125. pc += __GLX_SINGLE_HDR_SIZE;
  2126. if (cx != NULL) {
  2127. const GLsizei n = *(GLsizei *) (pc + 0);
  2128. GLuint answerBuffer[200];
  2129. GLuint *textures =
  2130. __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
  2131. 4);
  2132. if (textures == NULL)
  2133. return BadAlloc;
  2134. glGenTextures(n, textures);
  2135. __glXSendReply(cl->client, textures, n, 4, GL_TRUE, 0);
  2136. error = Success;
  2137. }
  2138. return error;
  2139. }
  2140. int
  2141. __glXDisp_GenTexturesEXT(__GLXclientState * cl, GLbyte * pc)
  2142. {
  2143. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  2144. int error;
  2145. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  2146. pc += __GLX_VENDPRIV_HDR_SIZE;
  2147. if (cx != NULL) {
  2148. const GLsizei n = *(GLsizei *) (pc + 0);
  2149. GLuint answerBuffer[200];
  2150. GLuint *textures =
  2151. __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
  2152. 4);
  2153. if (textures == NULL)
  2154. return BadAlloc;
  2155. glGenTextures(n, textures);
  2156. __glXSendReply(cl->client, textures, n, 4, GL_TRUE, 0);
  2157. error = Success;
  2158. }
  2159. return error;
  2160. }
  2161. int
  2162. __glXDisp_IsTexture(__GLXclientState * cl, GLbyte * pc)
  2163. {
  2164. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  2165. int error;
  2166. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  2167. pc += __GLX_SINGLE_HDR_SIZE;
  2168. if (cx != NULL) {
  2169. GLboolean retval;
  2170. retval = glIsTexture(*(GLuint *) (pc + 0));
  2171. __glXSendReply(cl->client, dummy_answer, 0, 0, GL_FALSE, retval);
  2172. error = Success;
  2173. }
  2174. return error;
  2175. }
  2176. int
  2177. __glXDisp_IsTextureEXT(__GLXclientState * cl, GLbyte * pc)
  2178. {
  2179. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  2180. int error;
  2181. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  2182. pc += __GLX_VENDPRIV_HDR_SIZE;
  2183. if (cx != NULL) {
  2184. GLboolean retval;
  2185. retval = glIsTexture(*(GLuint *) (pc + 0));
  2186. __glXSendReply(cl->client, dummy_answer, 0, 0, GL_FALSE, retval);
  2187. error = Success;
  2188. }
  2189. return error;
  2190. }
  2191. void
  2192. __glXDisp_PrioritizeTextures(GLbyte * pc)
  2193. {
  2194. const GLsizei n = *(GLsizei *) (pc + 0);
  2195. glPrioritizeTextures(n,
  2196. (const GLuint *) (pc + 4),
  2197. (const GLclampf *) (pc + 4));
  2198. }
  2199. void
  2200. __glXDisp_TexSubImage1D(GLbyte * pc)
  2201. {
  2202. const GLvoid *const pixels = (const GLvoid *) ((pc + 56));
  2203. __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc);
  2204. glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
  2205. glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
  2206. glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
  2207. glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
  2208. glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
  2209. glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
  2210. glTexSubImage1D(*(GLenum *) (pc + 20),
  2211. *(GLint *) (pc + 24),
  2212. *(GLint *) (pc + 28),
  2213. *(GLsizei *) (pc + 36),
  2214. *(GLenum *) (pc + 44), *(GLenum *) (pc + 48), pixels);
  2215. }
  2216. void
  2217. __glXDisp_TexSubImage2D(GLbyte * pc)
  2218. {
  2219. const GLvoid *const pixels = (const GLvoid *) ((pc + 56));
  2220. __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc);
  2221. glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
  2222. glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
  2223. glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
  2224. glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
  2225. glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
  2226. glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
  2227. glTexSubImage2D(*(GLenum *) (pc + 20),
  2228. *(GLint *) (pc + 24),
  2229. *(GLint *) (pc + 28),
  2230. *(GLint *) (pc + 32),
  2231. *(GLsizei *) (pc + 36),
  2232. *(GLsizei *) (pc + 40),
  2233. *(GLenum *) (pc + 44), *(GLenum *) (pc + 48), pixels);
  2234. }
  2235. void
  2236. __glXDisp_BlendColor(GLbyte * pc)
  2237. {
  2238. glBlendColor(*(GLclampf *) (pc + 0),
  2239. *(GLclampf *) (pc + 4),
  2240. *(GLclampf *) (pc + 8), *(GLclampf *) (pc + 12));
  2241. }
  2242. void
  2243. __glXDisp_BlendEquation(GLbyte * pc)
  2244. {
  2245. glBlendEquation(*(GLenum *) (pc + 0));
  2246. }
  2247. void
  2248. __glXDisp_ColorTable(GLbyte * pc)
  2249. {
  2250. const GLvoid *const table = (const GLvoid *) ((pc + 40));
  2251. __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc);
  2252. glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
  2253. glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
  2254. glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
  2255. glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
  2256. glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
  2257. glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
  2258. glColorTable(*(GLenum *) (pc + 20),
  2259. *(GLenum *) (pc + 24),
  2260. *(GLsizei *) (pc + 28),
  2261. *(GLenum *) (pc + 32), *(GLenum *) (pc + 36), table);
  2262. }
  2263. void
  2264. __glXDisp_ColorTableParameterfv(GLbyte * pc)
  2265. {
  2266. const GLenum pname = *(GLenum *) (pc + 4);
  2267. const GLfloat *params;
  2268. params = (const GLfloat *) (pc + 8);
  2269. glColorTableParameterfv(*(GLenum *) (pc + 0), pname, params);
  2270. }
  2271. void
  2272. __glXDisp_ColorTableParameteriv(GLbyte * pc)
  2273. {
  2274. const GLenum pname = *(GLenum *) (pc + 4);
  2275. const GLint *params;
  2276. params = (const GLint *) (pc + 8);
  2277. glColorTableParameteriv(*(GLenum *) (pc + 0), pname, params);
  2278. }
  2279. void
  2280. __glXDisp_CopyColorTable(GLbyte * pc)
  2281. {
  2282. glCopyColorTable(*(GLenum *) (pc + 0),
  2283. *(GLenum *) (pc + 4),
  2284. *(GLint *) (pc + 8),
  2285. *(GLint *) (pc + 12), *(GLsizei *) (pc + 16));
  2286. }
  2287. int
  2288. __glXDisp_GetColorTableParameterfv(__GLXclientState * cl, GLbyte * pc)
  2289. {
  2290. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  2291. int error;
  2292. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  2293. pc += __GLX_SINGLE_HDR_SIZE;
  2294. if (cx != NULL) {
  2295. const GLenum pname = *(GLenum *) (pc + 4);
  2296. const GLuint compsize = __glGetColorTableParameterfv_size(pname);
  2297. GLfloat answerBuffer[200];
  2298. GLfloat *params =
  2299. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  2300. sizeof(answerBuffer), 4);
  2301. if (params == NULL)
  2302. return BadAlloc;
  2303. __glXClearErrorOccured();
  2304. glGetColorTableParameterfv(*(GLenum *) (pc + 0), pname, params);
  2305. __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0);
  2306. error = Success;
  2307. }
  2308. return error;
  2309. }
  2310. int
  2311. __glXDisp_GetColorTableParameterfvSGI(__GLXclientState * cl, GLbyte * pc)
  2312. {
  2313. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  2314. int error;
  2315. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  2316. pc += __GLX_VENDPRIV_HDR_SIZE;
  2317. if (cx != NULL) {
  2318. const GLenum pname = *(GLenum *) (pc + 4);
  2319. const GLuint compsize = __glGetColorTableParameterfv_size(pname);
  2320. GLfloat answerBuffer[200];
  2321. GLfloat *params =
  2322. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  2323. sizeof(answerBuffer), 4);
  2324. if (params == NULL)
  2325. return BadAlloc;
  2326. __glXClearErrorOccured();
  2327. glGetColorTableParameterfv(*(GLenum *) (pc + 0), pname, params);
  2328. __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0);
  2329. error = Success;
  2330. }
  2331. return error;
  2332. }
  2333. int
  2334. __glXDisp_GetColorTableParameteriv(__GLXclientState * cl, GLbyte * pc)
  2335. {
  2336. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  2337. int error;
  2338. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  2339. pc += __GLX_SINGLE_HDR_SIZE;
  2340. if (cx != NULL) {
  2341. const GLenum pname = *(GLenum *) (pc + 4);
  2342. const GLuint compsize = __glGetColorTableParameteriv_size(pname);
  2343. GLint answerBuffer[200];
  2344. GLint *params =
  2345. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  2346. sizeof(answerBuffer), 4);
  2347. if (params == NULL)
  2348. return BadAlloc;
  2349. __glXClearErrorOccured();
  2350. glGetColorTableParameteriv(*(GLenum *) (pc + 0), pname, params);
  2351. __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0);
  2352. error = Success;
  2353. }
  2354. return error;
  2355. }
  2356. int
  2357. __glXDisp_GetColorTableParameterivSGI(__GLXclientState * cl, GLbyte * pc)
  2358. {
  2359. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  2360. int error;
  2361. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  2362. pc += __GLX_VENDPRIV_HDR_SIZE;
  2363. if (cx != NULL) {
  2364. const GLenum pname = *(GLenum *) (pc + 4);
  2365. const GLuint compsize = __glGetColorTableParameteriv_size(pname);
  2366. GLint answerBuffer[200];
  2367. GLint *params =
  2368. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  2369. sizeof(answerBuffer), 4);
  2370. if (params == NULL)
  2371. return BadAlloc;
  2372. __glXClearErrorOccured();
  2373. glGetColorTableParameteriv(*(GLenum *) (pc + 0), pname, params);
  2374. __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0);
  2375. error = Success;
  2376. }
  2377. return error;
  2378. }
  2379. void
  2380. __glXDisp_ColorSubTable(GLbyte * pc)
  2381. {
  2382. const GLvoid *const data = (const GLvoid *) ((pc + 40));
  2383. __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc);
  2384. glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
  2385. glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
  2386. glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
  2387. glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
  2388. glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
  2389. glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
  2390. glColorSubTable(*(GLenum *) (pc + 20),
  2391. *(GLsizei *) (pc + 24),
  2392. *(GLsizei *) (pc + 28),
  2393. *(GLenum *) (pc + 32), *(GLenum *) (pc + 36), data);
  2394. }
  2395. void
  2396. __glXDisp_CopyColorSubTable(GLbyte * pc)
  2397. {
  2398. glCopyColorSubTable(*(GLenum *) (pc + 0),
  2399. *(GLsizei *) (pc + 4),
  2400. *(GLint *) (pc + 8),
  2401. *(GLint *) (pc + 12), *(GLsizei *) (pc + 16));
  2402. }
  2403. void
  2404. __glXDisp_ConvolutionFilter1D(GLbyte * pc)
  2405. {
  2406. const GLvoid *const image = (const GLvoid *) ((pc + 44));
  2407. __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc);
  2408. glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
  2409. glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
  2410. glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
  2411. glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
  2412. glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
  2413. glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
  2414. glConvolutionFilter1D(*(GLenum *) (pc + 20),
  2415. *(GLenum *) (pc + 24),
  2416. *(GLsizei *) (pc + 28),
  2417. *(GLenum *) (pc + 36), *(GLenum *) (pc + 40), image);
  2418. }
  2419. void
  2420. __glXDisp_ConvolutionFilter2D(GLbyte * pc)
  2421. {
  2422. const GLvoid *const image = (const GLvoid *) ((pc + 44));
  2423. __GLXpixelHeader *const hdr = (__GLXpixelHeader *) (pc);
  2424. glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
  2425. glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
  2426. glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
  2427. glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
  2428. glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
  2429. glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
  2430. glConvolutionFilter2D(*(GLenum *) (pc + 20),
  2431. *(GLenum *) (pc + 24),
  2432. *(GLsizei *) (pc + 28),
  2433. *(GLsizei *) (pc + 32),
  2434. *(GLenum *) (pc + 36), *(GLenum *) (pc + 40), image);
  2435. }
  2436. void
  2437. __glXDisp_ConvolutionParameterf(GLbyte * pc)
  2438. {
  2439. glConvolutionParameterf(*(GLenum *) (pc + 0),
  2440. *(GLenum *) (pc + 4), *(GLfloat *) (pc + 8));
  2441. }
  2442. void
  2443. __glXDisp_ConvolutionParameterfv(GLbyte * pc)
  2444. {
  2445. const GLenum pname = *(GLenum *) (pc + 4);
  2446. const GLfloat *params;
  2447. params = (const GLfloat *) (pc + 8);
  2448. glConvolutionParameterfv(*(GLenum *) (pc + 0), pname, params);
  2449. }
  2450. void
  2451. __glXDisp_ConvolutionParameteri(GLbyte * pc)
  2452. {
  2453. glConvolutionParameteri(*(GLenum *) (pc + 0),
  2454. *(GLenum *) (pc + 4), *(GLint *) (pc + 8));
  2455. }
  2456. void
  2457. __glXDisp_ConvolutionParameteriv(GLbyte * pc)
  2458. {
  2459. const GLenum pname = *(GLenum *) (pc + 4);
  2460. const GLint *params;
  2461. params = (const GLint *) (pc + 8);
  2462. glConvolutionParameteriv(*(GLenum *) (pc + 0), pname, params);
  2463. }
  2464. void
  2465. __glXDisp_CopyConvolutionFilter1D(GLbyte * pc)
  2466. {
  2467. glCopyConvolutionFilter1D(*(GLenum *) (pc + 0),
  2468. *(GLenum *) (pc + 4),
  2469. *(GLint *) (pc + 8),
  2470. *(GLint *) (pc + 12), *(GLsizei *) (pc + 16));
  2471. }
  2472. void
  2473. __glXDisp_CopyConvolutionFilter2D(GLbyte * pc)
  2474. {
  2475. glCopyConvolutionFilter2D(*(GLenum *) (pc + 0),
  2476. *(GLenum *) (pc + 4),
  2477. *(GLint *) (pc + 8),
  2478. *(GLint *) (pc + 12),
  2479. *(GLsizei *) (pc + 16), *(GLsizei *) (pc + 20));
  2480. }
  2481. int
  2482. __glXDisp_GetConvolutionParameterfv(__GLXclientState * cl, GLbyte * pc)
  2483. {
  2484. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  2485. int error;
  2486. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  2487. pc += __GLX_SINGLE_HDR_SIZE;
  2488. if (cx != NULL) {
  2489. const GLenum pname = *(GLenum *) (pc + 4);
  2490. const GLuint compsize = __glGetConvolutionParameterfv_size(pname);
  2491. GLfloat answerBuffer[200];
  2492. GLfloat *params =
  2493. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  2494. sizeof(answerBuffer), 4);
  2495. if (params == NULL)
  2496. return BadAlloc;
  2497. __glXClearErrorOccured();
  2498. glGetConvolutionParameterfv(*(GLenum *) (pc + 0), pname, params);
  2499. __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0);
  2500. error = Success;
  2501. }
  2502. return error;
  2503. }
  2504. int
  2505. __glXDisp_GetConvolutionParameterfvEXT(__GLXclientState * cl, GLbyte * pc)
  2506. {
  2507. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  2508. int error;
  2509. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  2510. pc += __GLX_VENDPRIV_HDR_SIZE;
  2511. if (cx != NULL) {
  2512. const GLenum pname = *(GLenum *) (pc + 4);
  2513. const GLuint compsize = __glGetConvolutionParameterfv_size(pname);
  2514. GLfloat answerBuffer[200];
  2515. GLfloat *params =
  2516. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  2517. sizeof(answerBuffer), 4);
  2518. if (params == NULL)
  2519. return BadAlloc;
  2520. __glXClearErrorOccured();
  2521. glGetConvolutionParameterfv(*(GLenum *) (pc + 0), pname, params);
  2522. __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0);
  2523. error = Success;
  2524. }
  2525. return error;
  2526. }
  2527. int
  2528. __glXDisp_GetConvolutionParameteriv(__GLXclientState * cl, GLbyte * pc)
  2529. {
  2530. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  2531. int error;
  2532. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  2533. pc += __GLX_SINGLE_HDR_SIZE;
  2534. if (cx != NULL) {
  2535. const GLenum pname = *(GLenum *) (pc + 4);
  2536. const GLuint compsize = __glGetConvolutionParameteriv_size(pname);
  2537. GLint answerBuffer[200];
  2538. GLint *params =
  2539. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  2540. sizeof(answerBuffer), 4);
  2541. if (params == NULL)
  2542. return BadAlloc;
  2543. __glXClearErrorOccured();
  2544. glGetConvolutionParameteriv(*(GLenum *) (pc + 0), pname, params);
  2545. __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0);
  2546. error = Success;
  2547. }
  2548. return error;
  2549. }
  2550. int
  2551. __glXDisp_GetConvolutionParameterivEXT(__GLXclientState * cl, GLbyte * pc)
  2552. {
  2553. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  2554. int error;
  2555. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  2556. pc += __GLX_VENDPRIV_HDR_SIZE;
  2557. if (cx != NULL) {
  2558. const GLenum pname = *(GLenum *) (pc + 4);
  2559. const GLuint compsize = __glGetConvolutionParameteriv_size(pname);
  2560. GLint answerBuffer[200];
  2561. GLint *params =
  2562. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  2563. sizeof(answerBuffer), 4);
  2564. if (params == NULL)
  2565. return BadAlloc;
  2566. __glXClearErrorOccured();
  2567. glGetConvolutionParameteriv(*(GLenum *) (pc + 0), pname, params);
  2568. __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0);
  2569. error = Success;
  2570. }
  2571. return error;
  2572. }
  2573. int
  2574. __glXDisp_GetHistogramParameterfv(__GLXclientState * cl, GLbyte * pc)
  2575. {
  2576. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  2577. int error;
  2578. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  2579. pc += __GLX_SINGLE_HDR_SIZE;
  2580. if (cx != NULL) {
  2581. const GLenum pname = *(GLenum *) (pc + 4);
  2582. const GLuint compsize = __glGetHistogramParameterfv_size(pname);
  2583. GLfloat answerBuffer[200];
  2584. GLfloat *params =
  2585. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  2586. sizeof(answerBuffer), 4);
  2587. if (params == NULL)
  2588. return BadAlloc;
  2589. __glXClearErrorOccured();
  2590. glGetHistogramParameterfv(*(GLenum *) (pc + 0), pname, params);
  2591. __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0);
  2592. error = Success;
  2593. }
  2594. return error;
  2595. }
  2596. int
  2597. __glXDisp_GetHistogramParameterfvEXT(__GLXclientState * cl, GLbyte * pc)
  2598. {
  2599. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  2600. int error;
  2601. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  2602. pc += __GLX_VENDPRIV_HDR_SIZE;
  2603. if (cx != NULL) {
  2604. const GLenum pname = *(GLenum *) (pc + 4);
  2605. const GLuint compsize = __glGetHistogramParameterfv_size(pname);
  2606. GLfloat answerBuffer[200];
  2607. GLfloat *params =
  2608. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  2609. sizeof(answerBuffer), 4);
  2610. if (params == NULL)
  2611. return BadAlloc;
  2612. __glXClearErrorOccured();
  2613. glGetHistogramParameterfv(*(GLenum *) (pc + 0), pname, params);
  2614. __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0);
  2615. error = Success;
  2616. }
  2617. return error;
  2618. }
  2619. int
  2620. __glXDisp_GetHistogramParameteriv(__GLXclientState * cl, GLbyte * pc)
  2621. {
  2622. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  2623. int error;
  2624. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  2625. pc += __GLX_SINGLE_HDR_SIZE;
  2626. if (cx != NULL) {
  2627. const GLenum pname = *(GLenum *) (pc + 4);
  2628. const GLuint compsize = __glGetHistogramParameteriv_size(pname);
  2629. GLint answerBuffer[200];
  2630. GLint *params =
  2631. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  2632. sizeof(answerBuffer), 4);
  2633. if (params == NULL)
  2634. return BadAlloc;
  2635. __glXClearErrorOccured();
  2636. glGetHistogramParameteriv(*(GLenum *) (pc + 0), pname, params);
  2637. __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0);
  2638. error = Success;
  2639. }
  2640. return error;
  2641. }
  2642. int
  2643. __glXDisp_GetHistogramParameterivEXT(__GLXclientState * cl, GLbyte * pc)
  2644. {
  2645. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  2646. int error;
  2647. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  2648. pc += __GLX_VENDPRIV_HDR_SIZE;
  2649. if (cx != NULL) {
  2650. const GLenum pname = *(GLenum *) (pc + 4);
  2651. const GLuint compsize = __glGetHistogramParameteriv_size(pname);
  2652. GLint answerBuffer[200];
  2653. GLint *params =
  2654. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  2655. sizeof(answerBuffer), 4);
  2656. if (params == NULL)
  2657. return BadAlloc;
  2658. __glXClearErrorOccured();
  2659. glGetHistogramParameteriv(*(GLenum *) (pc + 0), pname, params);
  2660. __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0);
  2661. error = Success;
  2662. }
  2663. return error;
  2664. }
  2665. int
  2666. __glXDisp_GetMinmaxParameterfv(__GLXclientState * cl, GLbyte * pc)
  2667. {
  2668. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  2669. int error;
  2670. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  2671. pc += __GLX_SINGLE_HDR_SIZE;
  2672. if (cx != NULL) {
  2673. const GLenum pname = *(GLenum *) (pc + 4);
  2674. const GLuint compsize = __glGetMinmaxParameterfv_size(pname);
  2675. GLfloat answerBuffer[200];
  2676. GLfloat *params =
  2677. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  2678. sizeof(answerBuffer), 4);
  2679. if (params == NULL)
  2680. return BadAlloc;
  2681. __glXClearErrorOccured();
  2682. glGetMinmaxParameterfv(*(GLenum *) (pc + 0), pname, params);
  2683. __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0);
  2684. error = Success;
  2685. }
  2686. return error;
  2687. }
  2688. int
  2689. __glXDisp_GetMinmaxParameterfvEXT(__GLXclientState * cl, GLbyte * pc)
  2690. {
  2691. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  2692. int error;
  2693. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  2694. pc += __GLX_VENDPRIV_HDR_SIZE;
  2695. if (cx != NULL) {
  2696. const GLenum pname = *(GLenum *) (pc + 4);
  2697. const GLuint compsize = __glGetMinmaxParameterfv_size(pname);
  2698. GLfloat answerBuffer[200];
  2699. GLfloat *params =
  2700. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  2701. sizeof(answerBuffer), 4);
  2702. if (params == NULL)
  2703. return BadAlloc;
  2704. __glXClearErrorOccured();
  2705. glGetMinmaxParameterfv(*(GLenum *) (pc + 0), pname, params);
  2706. __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0);
  2707. error = Success;
  2708. }
  2709. return error;
  2710. }
  2711. int
  2712. __glXDisp_GetMinmaxParameteriv(__GLXclientState * cl, GLbyte * pc)
  2713. {
  2714. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  2715. int error;
  2716. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  2717. pc += __GLX_SINGLE_HDR_SIZE;
  2718. if (cx != NULL) {
  2719. const GLenum pname = *(GLenum *) (pc + 4);
  2720. const GLuint compsize = __glGetMinmaxParameteriv_size(pname);
  2721. GLint answerBuffer[200];
  2722. GLint *params =
  2723. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  2724. sizeof(answerBuffer), 4);
  2725. if (params == NULL)
  2726. return BadAlloc;
  2727. __glXClearErrorOccured();
  2728. glGetMinmaxParameteriv(*(GLenum *) (pc + 0), pname, params);
  2729. __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0);
  2730. error = Success;
  2731. }
  2732. return error;
  2733. }
  2734. int
  2735. __glXDisp_GetMinmaxParameterivEXT(__GLXclientState * cl, GLbyte * pc)
  2736. {
  2737. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  2738. int error;
  2739. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  2740. pc += __GLX_VENDPRIV_HDR_SIZE;
  2741. if (cx != NULL) {
  2742. const GLenum pname = *(GLenum *) (pc + 4);
  2743. const GLuint compsize = __glGetMinmaxParameteriv_size(pname);
  2744. GLint answerBuffer[200];
  2745. GLint *params =
  2746. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  2747. sizeof(answerBuffer), 4);
  2748. if (params == NULL)
  2749. return BadAlloc;
  2750. __glXClearErrorOccured();
  2751. glGetMinmaxParameteriv(*(GLenum *) (pc + 0), pname, params);
  2752. __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0);
  2753. error = Success;
  2754. }
  2755. return error;
  2756. }
  2757. void
  2758. __glXDisp_Histogram(GLbyte * pc)
  2759. {
  2760. glHistogram(*(GLenum *) (pc + 0),
  2761. *(GLsizei *) (pc + 4),
  2762. *(GLenum *) (pc + 8), *(GLboolean *) (pc + 12));
  2763. }
  2764. void
  2765. __glXDisp_Minmax(GLbyte * pc)
  2766. {
  2767. glMinmax(*(GLenum *) (pc + 0),
  2768. *(GLenum *) (pc + 4), *(GLboolean *) (pc + 8));
  2769. }
  2770. void
  2771. __glXDisp_ResetHistogram(GLbyte * pc)
  2772. {
  2773. glResetHistogram(*(GLenum *) (pc + 0));
  2774. }
  2775. void
  2776. __glXDisp_ResetMinmax(GLbyte * pc)
  2777. {
  2778. glResetMinmax(*(GLenum *) (pc + 0));
  2779. }
  2780. void
  2781. __glXDisp_TexImage3D(GLbyte * pc)
  2782. {
  2783. const CARD32 ptr_is_null = *(CARD32 *) (pc + 76);
  2784. const GLvoid *const pixels =
  2785. (const GLvoid *) ((ptr_is_null != 0) ? NULL : (pc + 80));
  2786. __GLXpixel3DHeader *const hdr = (__GLXpixel3DHeader *) (pc);
  2787. glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
  2788. glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
  2789. glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
  2790. glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, (GLint) hdr->imageHeight);
  2791. glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
  2792. glPixelStorei(GL_UNPACK_SKIP_IMAGES, (GLint) hdr->skipImages);
  2793. glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
  2794. glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
  2795. glTexImage3D(*(GLenum *) (pc + 36),
  2796. *(GLint *) (pc + 40),
  2797. *(GLint *) (pc + 44),
  2798. *(GLsizei *) (pc + 48),
  2799. *(GLsizei *) (pc + 52),
  2800. *(GLsizei *) (pc + 56),
  2801. *(GLint *) (pc + 64),
  2802. *(GLenum *) (pc + 68), *(GLenum *) (pc + 72), pixels);
  2803. }
  2804. void
  2805. __glXDisp_TexSubImage3D(GLbyte * pc)
  2806. {
  2807. const GLvoid *const pixels = (const GLvoid *) ((pc + 88));
  2808. __GLXpixel3DHeader *const hdr = (__GLXpixel3DHeader *) (pc);
  2809. glPixelStorei(GL_UNPACK_SWAP_BYTES, hdr->swapBytes);
  2810. glPixelStorei(GL_UNPACK_LSB_FIRST, hdr->lsbFirst);
  2811. glPixelStorei(GL_UNPACK_ROW_LENGTH, (GLint) hdr->rowLength);
  2812. glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, (GLint) hdr->imageHeight);
  2813. glPixelStorei(GL_UNPACK_SKIP_ROWS, (GLint) hdr->skipRows);
  2814. glPixelStorei(GL_UNPACK_SKIP_IMAGES, (GLint) hdr->skipImages);
  2815. glPixelStorei(GL_UNPACK_SKIP_PIXELS, (GLint) hdr->skipPixels);
  2816. glPixelStorei(GL_UNPACK_ALIGNMENT, (GLint) hdr->alignment);
  2817. glTexSubImage3D(*(GLenum *) (pc + 36),
  2818. *(GLint *) (pc + 40),
  2819. *(GLint *) (pc + 44),
  2820. *(GLint *) (pc + 48),
  2821. *(GLint *) (pc + 52),
  2822. *(GLsizei *) (pc + 60),
  2823. *(GLsizei *) (pc + 64),
  2824. *(GLsizei *) (pc + 68),
  2825. *(GLenum *) (pc + 76), *(GLenum *) (pc + 80), pixels);
  2826. }
  2827. void
  2828. __glXDisp_CopyTexSubImage3D(GLbyte * pc)
  2829. {
  2830. glCopyTexSubImage3D(*(GLenum *) (pc + 0),
  2831. *(GLint *) (pc + 4),
  2832. *(GLint *) (pc + 8),
  2833. *(GLint *) (pc + 12),
  2834. *(GLint *) (pc + 16),
  2835. *(GLint *) (pc + 20),
  2836. *(GLint *) (pc + 24),
  2837. *(GLsizei *) (pc + 28), *(GLsizei *) (pc + 32));
  2838. }
  2839. void
  2840. __glXDisp_ActiveTexture(GLbyte * pc)
  2841. {
  2842. glActiveTextureARB(*(GLenum *) (pc + 0));
  2843. }
  2844. void
  2845. __glXDisp_MultiTexCoord1dv(GLbyte * pc)
  2846. {
  2847. #ifdef __GLX_ALIGN64
  2848. if ((unsigned long) (pc) & 7) {
  2849. (void) memmove(pc - 4, pc, 12);
  2850. pc -= 4;
  2851. }
  2852. #endif
  2853. glMultiTexCoord1dvARB(*(GLenum *) (pc + 8), (const GLdouble *) (pc + 0));
  2854. }
  2855. void
  2856. __glXDisp_MultiTexCoord1fvARB(GLbyte * pc)
  2857. {
  2858. glMultiTexCoord1fvARB(*(GLenum *) (pc + 0), (const GLfloat *) (pc + 4));
  2859. }
  2860. void
  2861. __glXDisp_MultiTexCoord1iv(GLbyte * pc)
  2862. {
  2863. glMultiTexCoord1ivARB(*(GLenum *) (pc + 0), (const GLint *) (pc + 4));
  2864. }
  2865. void
  2866. __glXDisp_MultiTexCoord1sv(GLbyte * pc)
  2867. {
  2868. glMultiTexCoord1svARB(*(GLenum *) (pc + 0), (const GLshort *) (pc + 4));
  2869. }
  2870. void
  2871. __glXDisp_MultiTexCoord2dv(GLbyte * pc)
  2872. {
  2873. #ifdef __GLX_ALIGN64
  2874. if ((unsigned long) (pc) & 7) {
  2875. (void) memmove(pc - 4, pc, 20);
  2876. pc -= 4;
  2877. }
  2878. #endif
  2879. glMultiTexCoord2dvARB(*(GLenum *) (pc + 16), (const GLdouble *) (pc + 0));
  2880. }
  2881. void
  2882. __glXDisp_MultiTexCoord2fvARB(GLbyte * pc)
  2883. {
  2884. glMultiTexCoord2fvARB(*(GLenum *) (pc + 0), (const GLfloat *) (pc + 4));
  2885. }
  2886. void
  2887. __glXDisp_MultiTexCoord2iv(GLbyte * pc)
  2888. {
  2889. glMultiTexCoord2ivARB(*(GLenum *) (pc + 0), (const GLint *) (pc + 4));
  2890. }
  2891. void
  2892. __glXDisp_MultiTexCoord2sv(GLbyte * pc)
  2893. {
  2894. glMultiTexCoord2svARB(*(GLenum *) (pc + 0), (const GLshort *) (pc + 4));
  2895. }
  2896. void
  2897. __glXDisp_MultiTexCoord3dv(GLbyte * pc)
  2898. {
  2899. #ifdef __GLX_ALIGN64
  2900. if ((unsigned long) (pc) & 7) {
  2901. (void) memmove(pc - 4, pc, 28);
  2902. pc -= 4;
  2903. }
  2904. #endif
  2905. glMultiTexCoord3dvARB(*(GLenum *) (pc + 24), (const GLdouble *) (pc + 0));
  2906. }
  2907. void
  2908. __glXDisp_MultiTexCoord3fvARB(GLbyte * pc)
  2909. {
  2910. glMultiTexCoord3fvARB(*(GLenum *) (pc + 0), (const GLfloat *) (pc + 4));
  2911. }
  2912. void
  2913. __glXDisp_MultiTexCoord3iv(GLbyte * pc)
  2914. {
  2915. glMultiTexCoord3ivARB(*(GLenum *) (pc + 0), (const GLint *) (pc + 4));
  2916. }
  2917. void
  2918. __glXDisp_MultiTexCoord3sv(GLbyte * pc)
  2919. {
  2920. glMultiTexCoord3svARB(*(GLenum *) (pc + 0), (const GLshort *) (pc + 4));
  2921. }
  2922. void
  2923. __glXDisp_MultiTexCoord4dv(GLbyte * pc)
  2924. {
  2925. #ifdef __GLX_ALIGN64
  2926. if ((unsigned long) (pc) & 7) {
  2927. (void) memmove(pc - 4, pc, 36);
  2928. pc -= 4;
  2929. }
  2930. #endif
  2931. glMultiTexCoord4dvARB(*(GLenum *) (pc + 32), (const GLdouble *) (pc + 0));
  2932. }
  2933. void
  2934. __glXDisp_MultiTexCoord4fvARB(GLbyte * pc)
  2935. {
  2936. glMultiTexCoord4fvARB(*(GLenum *) (pc + 0), (const GLfloat *) (pc + 4));
  2937. }
  2938. void
  2939. __glXDisp_MultiTexCoord4iv(GLbyte * pc)
  2940. {
  2941. glMultiTexCoord4ivARB(*(GLenum *) (pc + 0), (const GLint *) (pc + 4));
  2942. }
  2943. void
  2944. __glXDisp_MultiTexCoord4sv(GLbyte * pc)
  2945. {
  2946. glMultiTexCoord4svARB(*(GLenum *) (pc + 0), (const GLshort *) (pc + 4));
  2947. }
  2948. void
  2949. __glXDisp_CompressedTexImage1D(GLbyte * pc)
  2950. {
  2951. PFNGLCOMPRESSEDTEXIMAGE1DPROC CompressedTexImage1D =
  2952. __glGetProcAddress("glCompressedTexImage1D");
  2953. const GLsizei imageSize = *(GLsizei *) (pc + 20);
  2954. CompressedTexImage1D(*(GLenum *) (pc + 0),
  2955. *(GLint *) (pc + 4),
  2956. *(GLenum *) (pc + 8),
  2957. *(GLsizei *) (pc + 12),
  2958. *(GLint *) (pc + 16),
  2959. imageSize, (const GLvoid *) (pc + 24));
  2960. }
  2961. void
  2962. __glXDisp_CompressedTexImage2D(GLbyte * pc)
  2963. {
  2964. PFNGLCOMPRESSEDTEXIMAGE2DPROC CompressedTexImage2D =
  2965. __glGetProcAddress("glCompressedTexImage2D");
  2966. const GLsizei imageSize = *(GLsizei *) (pc + 24);
  2967. CompressedTexImage2D(*(GLenum *) (pc + 0),
  2968. *(GLint *) (pc + 4),
  2969. *(GLenum *) (pc + 8),
  2970. *(GLsizei *) (pc + 12),
  2971. *(GLsizei *) (pc + 16),
  2972. *(GLint *) (pc + 20),
  2973. imageSize, (const GLvoid *) (pc + 28));
  2974. }
  2975. void
  2976. __glXDisp_CompressedTexImage3D(GLbyte * pc)
  2977. {
  2978. PFNGLCOMPRESSEDTEXIMAGE3DPROC CompressedTexImage3D =
  2979. __glGetProcAddress("glCompressedTexImage3D");
  2980. const GLsizei imageSize = *(GLsizei *) (pc + 28);
  2981. CompressedTexImage3D(*(GLenum *) (pc + 0),
  2982. *(GLint *) (pc + 4),
  2983. *(GLenum *) (pc + 8),
  2984. *(GLsizei *) (pc + 12),
  2985. *(GLsizei *) (pc + 16),
  2986. *(GLsizei *) (pc + 20),
  2987. *(GLint *) (pc + 24),
  2988. imageSize, (const GLvoid *) (pc + 32));
  2989. }
  2990. void
  2991. __glXDisp_CompressedTexSubImage1D(GLbyte * pc)
  2992. {
  2993. PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC CompressedTexSubImage1D =
  2994. __glGetProcAddress("glCompressedTexSubImage1D");
  2995. const GLsizei imageSize = *(GLsizei *) (pc + 20);
  2996. CompressedTexSubImage1D(*(GLenum *) (pc + 0),
  2997. *(GLint *) (pc + 4),
  2998. *(GLint *) (pc + 8),
  2999. *(GLsizei *) (pc + 12),
  3000. *(GLenum *) (pc + 16),
  3001. imageSize, (const GLvoid *) (pc + 24));
  3002. }
  3003. void
  3004. __glXDisp_CompressedTexSubImage2D(GLbyte * pc)
  3005. {
  3006. PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC CompressedTexSubImage2D =
  3007. __glGetProcAddress("glCompressedTexSubImage2D");
  3008. const GLsizei imageSize = *(GLsizei *) (pc + 28);
  3009. CompressedTexSubImage2D(*(GLenum *) (pc + 0),
  3010. *(GLint *) (pc + 4),
  3011. *(GLint *) (pc + 8),
  3012. *(GLint *) (pc + 12),
  3013. *(GLsizei *) (pc + 16),
  3014. *(GLsizei *) (pc + 20),
  3015. *(GLenum *) (pc + 24),
  3016. imageSize, (const GLvoid *) (pc + 32));
  3017. }
  3018. void
  3019. __glXDisp_CompressedTexSubImage3D(GLbyte * pc)
  3020. {
  3021. PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC CompressedTexSubImage3D =
  3022. __glGetProcAddress("glCompressedTexSubImage3D");
  3023. const GLsizei imageSize = *(GLsizei *) (pc + 36);
  3024. CompressedTexSubImage3D(*(GLenum *) (pc + 0),
  3025. *(GLint *) (pc + 4),
  3026. *(GLint *) (pc + 8),
  3027. *(GLint *) (pc + 12),
  3028. *(GLint *) (pc + 16),
  3029. *(GLsizei *) (pc + 20),
  3030. *(GLsizei *) (pc + 24),
  3031. *(GLsizei *) (pc + 28),
  3032. *(GLenum *) (pc + 32),
  3033. imageSize, (const GLvoid *) (pc + 40));
  3034. }
  3035. void
  3036. __glXDisp_SampleCoverage(GLbyte * pc)
  3037. {
  3038. PFNGLSAMPLECOVERAGEPROC SampleCoverage =
  3039. __glGetProcAddress("glSampleCoverage");
  3040. SampleCoverage(*(GLclampf *) (pc + 0), *(GLboolean *) (pc + 4));
  3041. }
  3042. void
  3043. __glXDisp_BlendFuncSeparate(GLbyte * pc)
  3044. {
  3045. PFNGLBLENDFUNCSEPARATEPROC BlendFuncSeparate =
  3046. __glGetProcAddress("glBlendFuncSeparate");
  3047. BlendFuncSeparate(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4),
  3048. *(GLenum *) (pc + 8), *(GLenum *) (pc + 12));
  3049. }
  3050. void
  3051. __glXDisp_FogCoorddv(GLbyte * pc)
  3052. {
  3053. PFNGLFOGCOORDDVPROC FogCoorddv = __glGetProcAddress("glFogCoorddv");
  3054. #ifdef __GLX_ALIGN64
  3055. if ((unsigned long) (pc) & 7) {
  3056. (void) memmove(pc - 4, pc, 8);
  3057. pc -= 4;
  3058. }
  3059. #endif
  3060. FogCoorddv((const GLdouble *) (pc + 0));
  3061. }
  3062. void
  3063. __glXDisp_PointParameterf(GLbyte * pc)
  3064. {
  3065. PFNGLPOINTPARAMETERFPROC PointParameterf =
  3066. __glGetProcAddress("glPointParameterf");
  3067. PointParameterf(*(GLenum *) (pc + 0), *(GLfloat *) (pc + 4));
  3068. }
  3069. void
  3070. __glXDisp_PointParameterfv(GLbyte * pc)
  3071. {
  3072. PFNGLPOINTPARAMETERFVPROC PointParameterfv =
  3073. __glGetProcAddress("glPointParameterfv");
  3074. const GLenum pname = *(GLenum *) (pc + 0);
  3075. const GLfloat *params;
  3076. params = (const GLfloat *) (pc + 4);
  3077. PointParameterfv(pname, params);
  3078. }
  3079. void
  3080. __glXDisp_PointParameteri(GLbyte * pc)
  3081. {
  3082. PFNGLPOINTPARAMETERIPROC PointParameteri =
  3083. __glGetProcAddress("glPointParameteri");
  3084. PointParameteri(*(GLenum *) (pc + 0), *(GLint *) (pc + 4));
  3085. }
  3086. void
  3087. __glXDisp_PointParameteriv(GLbyte * pc)
  3088. {
  3089. PFNGLPOINTPARAMETERIVPROC PointParameteriv =
  3090. __glGetProcAddress("glPointParameteriv");
  3091. const GLenum pname = *(GLenum *) (pc + 0);
  3092. const GLint *params;
  3093. params = (const GLint *) (pc + 4);
  3094. PointParameteriv(pname, params);
  3095. }
  3096. void
  3097. __glXDisp_SecondaryColor3bv(GLbyte * pc)
  3098. {
  3099. PFNGLSECONDARYCOLOR3BVPROC SecondaryColor3bv =
  3100. __glGetProcAddress("glSecondaryColor3bv");
  3101. SecondaryColor3bv((const GLbyte *) (pc + 0));
  3102. }
  3103. void
  3104. __glXDisp_SecondaryColor3dv(GLbyte * pc)
  3105. {
  3106. PFNGLSECONDARYCOLOR3DVPROC SecondaryColor3dv =
  3107. __glGetProcAddress("glSecondaryColor3dv");
  3108. #ifdef __GLX_ALIGN64
  3109. if ((unsigned long) (pc) & 7) {
  3110. (void) memmove(pc - 4, pc, 24);
  3111. pc -= 4;
  3112. }
  3113. #endif
  3114. SecondaryColor3dv((const GLdouble *) (pc + 0));
  3115. }
  3116. void
  3117. __glXDisp_SecondaryColor3iv(GLbyte * pc)
  3118. {
  3119. PFNGLSECONDARYCOLOR3IVPROC SecondaryColor3iv =
  3120. __glGetProcAddress("glSecondaryColor3iv");
  3121. SecondaryColor3iv((const GLint *) (pc + 0));
  3122. }
  3123. void
  3124. __glXDisp_SecondaryColor3sv(GLbyte * pc)
  3125. {
  3126. PFNGLSECONDARYCOLOR3SVPROC SecondaryColor3sv =
  3127. __glGetProcAddress("glSecondaryColor3sv");
  3128. SecondaryColor3sv((const GLshort *) (pc + 0));
  3129. }
  3130. void
  3131. __glXDisp_SecondaryColor3ubv(GLbyte * pc)
  3132. {
  3133. PFNGLSECONDARYCOLOR3UBVPROC SecondaryColor3ubv =
  3134. __glGetProcAddress("glSecondaryColor3ubv");
  3135. SecondaryColor3ubv((const GLubyte *) (pc + 0));
  3136. }
  3137. void
  3138. __glXDisp_SecondaryColor3uiv(GLbyte * pc)
  3139. {
  3140. PFNGLSECONDARYCOLOR3UIVPROC SecondaryColor3uiv =
  3141. __glGetProcAddress("glSecondaryColor3uiv");
  3142. SecondaryColor3uiv((const GLuint *) (pc + 0));
  3143. }
  3144. void
  3145. __glXDisp_SecondaryColor3usv(GLbyte * pc)
  3146. {
  3147. PFNGLSECONDARYCOLOR3USVPROC SecondaryColor3usv =
  3148. __glGetProcAddress("glSecondaryColor3usv");
  3149. SecondaryColor3usv((const GLushort *) (pc + 0));
  3150. }
  3151. void
  3152. __glXDisp_WindowPos3fv(GLbyte * pc)
  3153. {
  3154. PFNGLWINDOWPOS3FVPROC WindowPos3fv = __glGetProcAddress("glWindowPos3fv");
  3155. WindowPos3fv((const GLfloat *) (pc + 0));
  3156. }
  3157. void
  3158. __glXDisp_BeginQuery(GLbyte * pc)
  3159. {
  3160. PFNGLBEGINQUERYPROC BeginQuery = __glGetProcAddress("glBeginQuery");
  3161. BeginQuery(*(GLenum *) (pc + 0), *(GLuint *) (pc + 4));
  3162. }
  3163. int
  3164. __glXDisp_DeleteQueries(__GLXclientState * cl, GLbyte * pc)
  3165. {
  3166. PFNGLDELETEQUERIESPROC DeleteQueries =
  3167. __glGetProcAddress("glDeleteQueries");
  3168. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  3169. int error;
  3170. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  3171. pc += __GLX_SINGLE_HDR_SIZE;
  3172. if (cx != NULL) {
  3173. const GLsizei n = *(GLsizei *) (pc + 0);
  3174. DeleteQueries(n, (const GLuint *) (pc + 4));
  3175. error = Success;
  3176. }
  3177. return error;
  3178. }
  3179. void
  3180. __glXDisp_EndQuery(GLbyte * pc)
  3181. {
  3182. PFNGLENDQUERYPROC EndQuery = __glGetProcAddress("glEndQuery");
  3183. EndQuery(*(GLenum *) (pc + 0));
  3184. }
  3185. int
  3186. __glXDisp_GenQueries(__GLXclientState * cl, GLbyte * pc)
  3187. {
  3188. PFNGLGENQUERIESPROC GenQueries = __glGetProcAddress("glGenQueries");
  3189. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  3190. int error;
  3191. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  3192. pc += __GLX_SINGLE_HDR_SIZE;
  3193. if (cx != NULL) {
  3194. const GLsizei n = *(GLsizei *) (pc + 0);
  3195. GLuint answerBuffer[200];
  3196. GLuint *ids =
  3197. __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
  3198. 4);
  3199. if (ids == NULL)
  3200. return BadAlloc;
  3201. GenQueries(n, ids);
  3202. __glXSendReply(cl->client, ids, n, 4, GL_TRUE, 0);
  3203. error = Success;
  3204. }
  3205. return error;
  3206. }
  3207. int
  3208. __glXDisp_GetQueryObjectiv(__GLXclientState * cl, GLbyte * pc)
  3209. {
  3210. PFNGLGETQUERYOBJECTIVPROC GetQueryObjectiv =
  3211. __glGetProcAddress("glGetQueryObjectiv");
  3212. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  3213. int error;
  3214. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  3215. pc += __GLX_SINGLE_HDR_SIZE;
  3216. if (cx != NULL) {
  3217. const GLenum pname = *(GLenum *) (pc + 4);
  3218. const GLuint compsize = __glGetQueryObjectiv_size(pname);
  3219. GLint answerBuffer[200];
  3220. GLint *params =
  3221. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  3222. sizeof(answerBuffer), 4);
  3223. if (params == NULL)
  3224. return BadAlloc;
  3225. __glXClearErrorOccured();
  3226. GetQueryObjectiv(*(GLuint *) (pc + 0), pname, params);
  3227. __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0);
  3228. error = Success;
  3229. }
  3230. return error;
  3231. }
  3232. int
  3233. __glXDisp_GetQueryObjectuiv(__GLXclientState * cl, GLbyte * pc)
  3234. {
  3235. PFNGLGETQUERYOBJECTUIVPROC GetQueryObjectuiv =
  3236. __glGetProcAddress("glGetQueryObjectuiv");
  3237. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  3238. int error;
  3239. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  3240. pc += __GLX_SINGLE_HDR_SIZE;
  3241. if (cx != NULL) {
  3242. const GLenum pname = *(GLenum *) (pc + 4);
  3243. const GLuint compsize = __glGetQueryObjectuiv_size(pname);
  3244. GLuint answerBuffer[200];
  3245. GLuint *params =
  3246. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  3247. sizeof(answerBuffer), 4);
  3248. if (params == NULL)
  3249. return BadAlloc;
  3250. __glXClearErrorOccured();
  3251. GetQueryObjectuiv(*(GLuint *) (pc + 0), pname, params);
  3252. __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0);
  3253. error = Success;
  3254. }
  3255. return error;
  3256. }
  3257. int
  3258. __glXDisp_GetQueryiv(__GLXclientState * cl, GLbyte * pc)
  3259. {
  3260. PFNGLGETQUERYIVPROC GetQueryiv = __glGetProcAddress("glGetQueryiv");
  3261. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  3262. int error;
  3263. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  3264. pc += __GLX_SINGLE_HDR_SIZE;
  3265. if (cx != NULL) {
  3266. const GLenum pname = *(GLenum *) (pc + 4);
  3267. const GLuint compsize = __glGetQueryiv_size(pname);
  3268. GLint answerBuffer[200];
  3269. GLint *params =
  3270. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  3271. sizeof(answerBuffer), 4);
  3272. if (params == NULL)
  3273. return BadAlloc;
  3274. __glXClearErrorOccured();
  3275. GetQueryiv(*(GLenum *) (pc + 0), pname, params);
  3276. __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0);
  3277. error = Success;
  3278. }
  3279. return error;
  3280. }
  3281. int
  3282. __glXDisp_IsQuery(__GLXclientState * cl, GLbyte * pc)
  3283. {
  3284. PFNGLISQUERYPROC IsQuery = __glGetProcAddress("glIsQuery");
  3285. xGLXSingleReq *const req = (xGLXSingleReq *) pc;
  3286. int error;
  3287. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  3288. pc += __GLX_SINGLE_HDR_SIZE;
  3289. if (cx != NULL) {
  3290. GLboolean retval;
  3291. retval = IsQuery(*(GLuint *) (pc + 0));
  3292. __glXSendReply(cl->client, dummy_answer, 0, 0, GL_FALSE, retval);
  3293. error = Success;
  3294. }
  3295. return error;
  3296. }
  3297. void
  3298. __glXDisp_BlendEquationSeparate(GLbyte * pc)
  3299. {
  3300. PFNGLBLENDEQUATIONSEPARATEPROC BlendEquationSeparate =
  3301. __glGetProcAddress("glBlendEquationSeparate");
  3302. BlendEquationSeparate(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4));
  3303. }
  3304. void
  3305. __glXDisp_DrawBuffers(GLbyte * pc)
  3306. {
  3307. PFNGLDRAWBUFFERSPROC DrawBuffers = __glGetProcAddress("glDrawBuffers");
  3308. const GLsizei n = *(GLsizei *) (pc + 0);
  3309. DrawBuffers(n, (const GLenum *) (pc + 4));
  3310. }
  3311. void
  3312. __glXDisp_VertexAttrib1dv(GLbyte * pc)
  3313. {
  3314. PFNGLVERTEXATTRIB1DVPROC VertexAttrib1dv =
  3315. __glGetProcAddress("glVertexAttrib1dv");
  3316. #ifdef __GLX_ALIGN64
  3317. if ((unsigned long) (pc) & 7) {
  3318. (void) memmove(pc - 4, pc, 12);
  3319. pc -= 4;
  3320. }
  3321. #endif
  3322. VertexAttrib1dv(*(GLuint *) (pc + 0), (const GLdouble *) (pc + 4));
  3323. }
  3324. void
  3325. __glXDisp_VertexAttrib1sv(GLbyte * pc)
  3326. {
  3327. PFNGLVERTEXATTRIB1SVPROC VertexAttrib1sv =
  3328. __glGetProcAddress("glVertexAttrib1sv");
  3329. VertexAttrib1sv(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4));
  3330. }
  3331. void
  3332. __glXDisp_VertexAttrib2dv(GLbyte * pc)
  3333. {
  3334. PFNGLVERTEXATTRIB2DVPROC VertexAttrib2dv =
  3335. __glGetProcAddress("glVertexAttrib2dv");
  3336. #ifdef __GLX_ALIGN64
  3337. if ((unsigned long) (pc) & 7) {
  3338. (void) memmove(pc - 4, pc, 20);
  3339. pc -= 4;
  3340. }
  3341. #endif
  3342. VertexAttrib2dv(*(GLuint *) (pc + 0), (const GLdouble *) (pc + 4));
  3343. }
  3344. void
  3345. __glXDisp_VertexAttrib2sv(GLbyte * pc)
  3346. {
  3347. PFNGLVERTEXATTRIB2SVPROC VertexAttrib2sv =
  3348. __glGetProcAddress("glVertexAttrib2sv");
  3349. VertexAttrib2sv(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4));
  3350. }
  3351. void
  3352. __glXDisp_VertexAttrib3dv(GLbyte * pc)
  3353. {
  3354. PFNGLVERTEXATTRIB3DVPROC VertexAttrib3dv =
  3355. __glGetProcAddress("glVertexAttrib3dv");
  3356. #ifdef __GLX_ALIGN64
  3357. if ((unsigned long) (pc) & 7) {
  3358. (void) memmove(pc - 4, pc, 28);
  3359. pc -= 4;
  3360. }
  3361. #endif
  3362. VertexAttrib3dv(*(GLuint *) (pc + 0), (const GLdouble *) (pc + 4));
  3363. }
  3364. void
  3365. __glXDisp_VertexAttrib3sv(GLbyte * pc)
  3366. {
  3367. PFNGLVERTEXATTRIB3SVPROC VertexAttrib3sv =
  3368. __glGetProcAddress("glVertexAttrib3sv");
  3369. VertexAttrib3sv(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4));
  3370. }
  3371. void
  3372. __glXDisp_VertexAttrib4Nbv(GLbyte * pc)
  3373. {
  3374. PFNGLVERTEXATTRIB4NBVPROC VertexAttrib4Nbv =
  3375. __glGetProcAddress("glVertexAttrib4Nbv");
  3376. VertexAttrib4Nbv(*(GLuint *) (pc + 0), (const GLbyte *) (pc + 4));
  3377. }
  3378. void
  3379. __glXDisp_VertexAttrib4Niv(GLbyte * pc)
  3380. {
  3381. PFNGLVERTEXATTRIB4NIVPROC VertexAttrib4Niv =
  3382. __glGetProcAddress("glVertexAttrib4Niv");
  3383. VertexAttrib4Niv(*(GLuint *) (pc + 0), (const GLint *) (pc + 4));
  3384. }
  3385. void
  3386. __glXDisp_VertexAttrib4Nsv(GLbyte * pc)
  3387. {
  3388. PFNGLVERTEXATTRIB4NSVPROC VertexAttrib4Nsv =
  3389. __glGetProcAddress("glVertexAttrib4Nsv");
  3390. VertexAttrib4Nsv(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4));
  3391. }
  3392. void
  3393. __glXDisp_VertexAttrib4Nubv(GLbyte * pc)
  3394. {
  3395. PFNGLVERTEXATTRIB4NUBVPROC VertexAttrib4Nubv =
  3396. __glGetProcAddress("glVertexAttrib4Nubv");
  3397. VertexAttrib4Nubv(*(GLuint *) (pc + 0), (const GLubyte *) (pc + 4));
  3398. }
  3399. void
  3400. __glXDisp_VertexAttrib4Nuiv(GLbyte * pc)
  3401. {
  3402. PFNGLVERTEXATTRIB4NUIVPROC VertexAttrib4Nuiv =
  3403. __glGetProcAddress("glVertexAttrib4Nuiv");
  3404. VertexAttrib4Nuiv(*(GLuint *) (pc + 0), (const GLuint *) (pc + 4));
  3405. }
  3406. void
  3407. __glXDisp_VertexAttrib4Nusv(GLbyte * pc)
  3408. {
  3409. PFNGLVERTEXATTRIB4NUSVPROC VertexAttrib4Nusv =
  3410. __glGetProcAddress("glVertexAttrib4Nusv");
  3411. VertexAttrib4Nusv(*(GLuint *) (pc + 0), (const GLushort *) (pc + 4));
  3412. }
  3413. void
  3414. __glXDisp_VertexAttrib4bv(GLbyte * pc)
  3415. {
  3416. PFNGLVERTEXATTRIB4BVPROC VertexAttrib4bv =
  3417. __glGetProcAddress("glVertexAttrib4bv");
  3418. VertexAttrib4bv(*(GLuint *) (pc + 0), (const GLbyte *) (pc + 4));
  3419. }
  3420. void
  3421. __glXDisp_VertexAttrib4dv(GLbyte * pc)
  3422. {
  3423. PFNGLVERTEXATTRIB4DVPROC VertexAttrib4dv =
  3424. __glGetProcAddress("glVertexAttrib4dv");
  3425. #ifdef __GLX_ALIGN64
  3426. if ((unsigned long) (pc) & 7) {
  3427. (void) memmove(pc - 4, pc, 36);
  3428. pc -= 4;
  3429. }
  3430. #endif
  3431. VertexAttrib4dv(*(GLuint *) (pc + 0), (const GLdouble *) (pc + 4));
  3432. }
  3433. void
  3434. __glXDisp_VertexAttrib4iv(GLbyte * pc)
  3435. {
  3436. PFNGLVERTEXATTRIB4IVPROC VertexAttrib4iv =
  3437. __glGetProcAddress("glVertexAttrib4iv");
  3438. VertexAttrib4iv(*(GLuint *) (pc + 0), (const GLint *) (pc + 4));
  3439. }
  3440. void
  3441. __glXDisp_VertexAttrib4sv(GLbyte * pc)
  3442. {
  3443. PFNGLVERTEXATTRIB4SVPROC VertexAttrib4sv =
  3444. __glGetProcAddress("glVertexAttrib4sv");
  3445. VertexAttrib4sv(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4));
  3446. }
  3447. void
  3448. __glXDisp_VertexAttrib4ubv(GLbyte * pc)
  3449. {
  3450. PFNGLVERTEXATTRIB4UBVPROC VertexAttrib4ubv =
  3451. __glGetProcAddress("glVertexAttrib4ubv");
  3452. VertexAttrib4ubv(*(GLuint *) (pc + 0), (const GLubyte *) (pc + 4));
  3453. }
  3454. void
  3455. __glXDisp_VertexAttrib4uiv(GLbyte * pc)
  3456. {
  3457. PFNGLVERTEXATTRIB4UIVPROC VertexAttrib4uiv =
  3458. __glGetProcAddress("glVertexAttrib4uiv");
  3459. VertexAttrib4uiv(*(GLuint *) (pc + 0), (const GLuint *) (pc + 4));
  3460. }
  3461. void
  3462. __glXDisp_VertexAttrib4usv(GLbyte * pc)
  3463. {
  3464. PFNGLVERTEXATTRIB4USVPROC VertexAttrib4usv =
  3465. __glGetProcAddress("glVertexAttrib4usv");
  3466. VertexAttrib4usv(*(GLuint *) (pc + 0), (const GLushort *) (pc + 4));
  3467. }
  3468. void
  3469. __glXDisp_ClampColor(GLbyte * pc)
  3470. {
  3471. PFNGLCLAMPCOLORPROC ClampColor = __glGetProcAddress("glClampColor");
  3472. ClampColor(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4));
  3473. }
  3474. void
  3475. __glXDisp_BindProgramARB(GLbyte * pc)
  3476. {
  3477. PFNGLBINDPROGRAMARBPROC BindProgramARB =
  3478. __glGetProcAddress("glBindProgramARB");
  3479. BindProgramARB(*(GLenum *) (pc + 0), *(GLuint *) (pc + 4));
  3480. }
  3481. int
  3482. __glXDisp_DeleteProgramsARB(__GLXclientState * cl, GLbyte * pc)
  3483. {
  3484. PFNGLDELETEPROGRAMSARBPROC DeleteProgramsARB =
  3485. __glGetProcAddress("glDeleteProgramsARB");
  3486. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  3487. int error;
  3488. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  3489. pc += __GLX_VENDPRIV_HDR_SIZE;
  3490. if (cx != NULL) {
  3491. const GLsizei n = *(GLsizei *) (pc + 0);
  3492. DeleteProgramsARB(n, (const GLuint *) (pc + 4));
  3493. error = Success;
  3494. }
  3495. return error;
  3496. }
  3497. int
  3498. __glXDisp_GenProgramsARB(__GLXclientState * cl, GLbyte * pc)
  3499. {
  3500. PFNGLGENPROGRAMSARBPROC GenProgramsARB =
  3501. __glGetProcAddress("glGenProgramsARB");
  3502. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  3503. int error;
  3504. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  3505. pc += __GLX_VENDPRIV_HDR_SIZE;
  3506. if (cx != NULL) {
  3507. const GLsizei n = *(GLsizei *) (pc + 0);
  3508. GLuint answerBuffer[200];
  3509. GLuint *programs =
  3510. __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
  3511. 4);
  3512. if (programs == NULL)
  3513. return BadAlloc;
  3514. GenProgramsARB(n, programs);
  3515. __glXSendReply(cl->client, programs, n, 4, GL_TRUE, 0);
  3516. error = Success;
  3517. }
  3518. return error;
  3519. }
  3520. int
  3521. __glXDisp_GetProgramEnvParameterdvARB(__GLXclientState * cl, GLbyte * pc)
  3522. {
  3523. PFNGLGETPROGRAMENVPARAMETERDVARBPROC GetProgramEnvParameterdvARB =
  3524. __glGetProcAddress("glGetProgramEnvParameterdvARB");
  3525. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  3526. int error;
  3527. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  3528. pc += __GLX_VENDPRIV_HDR_SIZE;
  3529. if (cx != NULL) {
  3530. GLdouble params[4];
  3531. GetProgramEnvParameterdvARB(*(GLenum *) (pc + 0),
  3532. *(GLuint *) (pc + 4), params);
  3533. __glXSendReply(cl->client, params, 4, 8, GL_FALSE, 0);
  3534. error = Success;
  3535. }
  3536. return error;
  3537. }
  3538. int
  3539. __glXDisp_GetProgramEnvParameterfvARB(__GLXclientState * cl, GLbyte * pc)
  3540. {
  3541. PFNGLGETPROGRAMENVPARAMETERFVARBPROC GetProgramEnvParameterfvARB =
  3542. __glGetProcAddress("glGetProgramEnvParameterfvARB");
  3543. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  3544. int error;
  3545. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  3546. pc += __GLX_VENDPRIV_HDR_SIZE;
  3547. if (cx != NULL) {
  3548. GLfloat params[4];
  3549. GetProgramEnvParameterfvARB(*(GLenum *) (pc + 0),
  3550. *(GLuint *) (pc + 4), params);
  3551. __glXSendReply(cl->client, params, 4, 4, GL_FALSE, 0);
  3552. error = Success;
  3553. }
  3554. return error;
  3555. }
  3556. int
  3557. __glXDisp_GetProgramLocalParameterdvARB(__GLXclientState * cl, GLbyte * pc)
  3558. {
  3559. PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC GetProgramLocalParameterdvARB =
  3560. __glGetProcAddress("glGetProgramLocalParameterdvARB");
  3561. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  3562. int error;
  3563. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  3564. pc += __GLX_VENDPRIV_HDR_SIZE;
  3565. if (cx != NULL) {
  3566. GLdouble params[4];
  3567. GetProgramLocalParameterdvARB(*(GLenum *) (pc + 0),
  3568. *(GLuint *) (pc + 4), params);
  3569. __glXSendReply(cl->client, params, 4, 8, GL_FALSE, 0);
  3570. error = Success;
  3571. }
  3572. return error;
  3573. }
  3574. int
  3575. __glXDisp_GetProgramLocalParameterfvARB(__GLXclientState * cl, GLbyte * pc)
  3576. {
  3577. PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC GetProgramLocalParameterfvARB =
  3578. __glGetProcAddress("glGetProgramLocalParameterfvARB");
  3579. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  3580. int error;
  3581. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  3582. pc += __GLX_VENDPRIV_HDR_SIZE;
  3583. if (cx != NULL) {
  3584. GLfloat params[4];
  3585. GetProgramLocalParameterfvARB(*(GLenum *) (pc + 0),
  3586. *(GLuint *) (pc + 4), params);
  3587. __glXSendReply(cl->client, params, 4, 4, GL_FALSE, 0);
  3588. error = Success;
  3589. }
  3590. return error;
  3591. }
  3592. int
  3593. __glXDisp_GetProgramivARB(__GLXclientState * cl, GLbyte * pc)
  3594. {
  3595. PFNGLGETPROGRAMIVARBPROC GetProgramivARB =
  3596. __glGetProcAddress("glGetProgramivARB");
  3597. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  3598. int error;
  3599. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  3600. pc += __GLX_VENDPRIV_HDR_SIZE;
  3601. if (cx != NULL) {
  3602. const GLenum pname = *(GLenum *) (pc + 4);
  3603. const GLuint compsize = __glGetProgramivARB_size(pname);
  3604. GLint answerBuffer[200];
  3605. GLint *params =
  3606. __glXGetAnswerBuffer(cl, compsize * 4, answerBuffer,
  3607. sizeof(answerBuffer), 4);
  3608. if (params == NULL)
  3609. return BadAlloc;
  3610. __glXClearErrorOccured();
  3611. GetProgramivARB(*(GLenum *) (pc + 0), pname, params);
  3612. __glXSendReply(cl->client, params, compsize, 4, GL_FALSE, 0);
  3613. error = Success;
  3614. }
  3615. return error;
  3616. }
  3617. int
  3618. __glXDisp_IsProgramARB(__GLXclientState * cl, GLbyte * pc)
  3619. {
  3620. PFNGLISPROGRAMARBPROC IsProgramARB = __glGetProcAddress("glIsProgramARB");
  3621. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  3622. int error;
  3623. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  3624. pc += __GLX_VENDPRIV_HDR_SIZE;
  3625. if (cx != NULL) {
  3626. GLboolean retval;
  3627. retval = IsProgramARB(*(GLuint *) (pc + 0));
  3628. __glXSendReply(cl->client, dummy_answer, 0, 0, GL_FALSE, retval);
  3629. error = Success;
  3630. }
  3631. return error;
  3632. }
  3633. void
  3634. __glXDisp_ProgramEnvParameter4dvARB(GLbyte * pc)
  3635. {
  3636. PFNGLPROGRAMENVPARAMETER4DVARBPROC ProgramEnvParameter4dvARB =
  3637. __glGetProcAddress("glProgramEnvParameter4dvARB");
  3638. #ifdef __GLX_ALIGN64
  3639. if ((unsigned long) (pc) & 7) {
  3640. (void) memmove(pc - 4, pc, 40);
  3641. pc -= 4;
  3642. }
  3643. #endif
  3644. ProgramEnvParameter4dvARB(*(GLenum *) (pc + 0),
  3645. *(GLuint *) (pc + 4),
  3646. (const GLdouble *) (pc + 8));
  3647. }
  3648. void
  3649. __glXDisp_ProgramEnvParameter4fvARB(GLbyte * pc)
  3650. {
  3651. PFNGLPROGRAMENVPARAMETER4FVARBPROC ProgramEnvParameter4fvARB =
  3652. __glGetProcAddress("glProgramEnvParameter4fvARB");
  3653. ProgramEnvParameter4fvARB(*(GLenum *) (pc + 0), *(GLuint *) (pc + 4),
  3654. (const GLfloat *) (pc + 8));
  3655. }
  3656. void
  3657. __glXDisp_ProgramLocalParameter4dvARB(GLbyte * pc)
  3658. {
  3659. PFNGLPROGRAMLOCALPARAMETER4DVARBPROC ProgramLocalParameter4dvARB =
  3660. __glGetProcAddress("glProgramLocalParameter4dvARB");
  3661. #ifdef __GLX_ALIGN64
  3662. if ((unsigned long) (pc) & 7) {
  3663. (void) memmove(pc - 4, pc, 40);
  3664. pc -= 4;
  3665. }
  3666. #endif
  3667. ProgramLocalParameter4dvARB(*(GLenum *) (pc + 0),
  3668. *(GLuint *) (pc + 4),
  3669. (const GLdouble *) (pc + 8));
  3670. }
  3671. void
  3672. __glXDisp_ProgramLocalParameter4fvARB(GLbyte * pc)
  3673. {
  3674. PFNGLPROGRAMLOCALPARAMETER4FVARBPROC ProgramLocalParameter4fvARB =
  3675. __glGetProcAddress("glProgramLocalParameter4fvARB");
  3676. ProgramLocalParameter4fvARB(*(GLenum *) (pc + 0), *(GLuint *) (pc + 4),
  3677. (const GLfloat *) (pc + 8));
  3678. }
  3679. void
  3680. __glXDisp_ProgramStringARB(GLbyte * pc)
  3681. {
  3682. PFNGLPROGRAMSTRINGARBPROC ProgramStringARB =
  3683. __glGetProcAddress("glProgramStringARB");
  3684. const GLsizei len = *(GLsizei *) (pc + 8);
  3685. ProgramStringARB(*(GLenum *) (pc + 0),
  3686. *(GLenum *) (pc + 4), len, (const GLvoid *) (pc + 12));
  3687. }
  3688. void
  3689. __glXDisp_VertexAttrib1fvARB(GLbyte * pc)
  3690. {
  3691. PFNGLVERTEXATTRIB1FVARBPROC VertexAttrib1fvARB =
  3692. __glGetProcAddress("glVertexAttrib1fvARB");
  3693. VertexAttrib1fvARB(*(GLuint *) (pc + 0), (const GLfloat *) (pc + 4));
  3694. }
  3695. void
  3696. __glXDisp_VertexAttrib2fvARB(GLbyte * pc)
  3697. {
  3698. PFNGLVERTEXATTRIB2FVARBPROC VertexAttrib2fvARB =
  3699. __glGetProcAddress("glVertexAttrib2fvARB");
  3700. VertexAttrib2fvARB(*(GLuint *) (pc + 0), (const GLfloat *) (pc + 4));
  3701. }
  3702. void
  3703. __glXDisp_VertexAttrib3fvARB(GLbyte * pc)
  3704. {
  3705. PFNGLVERTEXATTRIB3FVARBPROC VertexAttrib3fvARB =
  3706. __glGetProcAddress("glVertexAttrib3fvARB");
  3707. VertexAttrib3fvARB(*(GLuint *) (pc + 0), (const GLfloat *) (pc + 4));
  3708. }
  3709. void
  3710. __glXDisp_VertexAttrib4fvARB(GLbyte * pc)
  3711. {
  3712. PFNGLVERTEXATTRIB4FVARBPROC VertexAttrib4fvARB =
  3713. __glGetProcAddress("glVertexAttrib4fvARB");
  3714. VertexAttrib4fvARB(*(GLuint *) (pc + 0), (const GLfloat *) (pc + 4));
  3715. }
  3716. void
  3717. __glXDisp_BindFramebuffer(GLbyte * pc)
  3718. {
  3719. PFNGLBINDFRAMEBUFFERPROC BindFramebuffer =
  3720. __glGetProcAddress("glBindFramebuffer");
  3721. BindFramebuffer(*(GLenum *) (pc + 0), *(GLuint *) (pc + 4));
  3722. }
  3723. void
  3724. __glXDisp_BindRenderbuffer(GLbyte * pc)
  3725. {
  3726. PFNGLBINDRENDERBUFFERPROC BindRenderbuffer =
  3727. __glGetProcAddress("glBindRenderbuffer");
  3728. BindRenderbuffer(*(GLenum *) (pc + 0), *(GLuint *) (pc + 4));
  3729. }
  3730. void
  3731. __glXDisp_BlitFramebuffer(GLbyte * pc)
  3732. {
  3733. PFNGLBLITFRAMEBUFFERPROC BlitFramebuffer =
  3734. __glGetProcAddress("glBlitFramebuffer");
  3735. BlitFramebuffer(*(GLint *) (pc + 0), *(GLint *) (pc + 4),
  3736. *(GLint *) (pc + 8), *(GLint *) (pc + 12),
  3737. *(GLint *) (pc + 16), *(GLint *) (pc + 20),
  3738. *(GLint *) (pc + 24), *(GLint *) (pc + 28),
  3739. *(GLbitfield *) (pc + 32), *(GLenum *) (pc + 36));
  3740. }
  3741. int
  3742. __glXDisp_CheckFramebufferStatus(__GLXclientState * cl, GLbyte * pc)
  3743. {
  3744. PFNGLCHECKFRAMEBUFFERSTATUSPROC CheckFramebufferStatus =
  3745. __glGetProcAddress("glCheckFramebufferStatus");
  3746. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  3747. int error;
  3748. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  3749. pc += __GLX_VENDPRIV_HDR_SIZE;
  3750. if (cx != NULL) {
  3751. GLenum retval;
  3752. retval = CheckFramebufferStatus(*(GLenum *) (pc + 0));
  3753. __glXSendReply(cl->client, dummy_answer, 0, 0, GL_FALSE, retval);
  3754. error = Success;
  3755. }
  3756. return error;
  3757. }
  3758. void
  3759. __glXDisp_DeleteFramebuffers(GLbyte * pc)
  3760. {
  3761. PFNGLDELETEFRAMEBUFFERSPROC DeleteFramebuffers =
  3762. __glGetProcAddress("glDeleteFramebuffers");
  3763. const GLsizei n = *(GLsizei *) (pc + 0);
  3764. DeleteFramebuffers(n, (const GLuint *) (pc + 4));
  3765. }
  3766. void
  3767. __glXDisp_DeleteRenderbuffers(GLbyte * pc)
  3768. {
  3769. PFNGLDELETERENDERBUFFERSPROC DeleteRenderbuffers =
  3770. __glGetProcAddress("glDeleteRenderbuffers");
  3771. const GLsizei n = *(GLsizei *) (pc + 0);
  3772. DeleteRenderbuffers(n, (const GLuint *) (pc + 4));
  3773. }
  3774. void
  3775. __glXDisp_FramebufferRenderbuffer(GLbyte * pc)
  3776. {
  3777. PFNGLFRAMEBUFFERRENDERBUFFERPROC FramebufferRenderbuffer =
  3778. __glGetProcAddress("glFramebufferRenderbuffer");
  3779. FramebufferRenderbuffer(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4),
  3780. *(GLenum *) (pc + 8), *(GLuint *) (pc + 12));
  3781. }
  3782. void
  3783. __glXDisp_FramebufferTexture1D(GLbyte * pc)
  3784. {
  3785. PFNGLFRAMEBUFFERTEXTURE1DPROC FramebufferTexture1D =
  3786. __glGetProcAddress("glFramebufferTexture1D");
  3787. FramebufferTexture1D(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4),
  3788. *(GLenum *) (pc + 8), *(GLuint *) (pc + 12),
  3789. *(GLint *) (pc + 16));
  3790. }
  3791. void
  3792. __glXDisp_FramebufferTexture2D(GLbyte * pc)
  3793. {
  3794. PFNGLFRAMEBUFFERTEXTURE2DPROC FramebufferTexture2D =
  3795. __glGetProcAddress("glFramebufferTexture2D");
  3796. FramebufferTexture2D(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4),
  3797. *(GLenum *) (pc + 8), *(GLuint *) (pc + 12),
  3798. *(GLint *) (pc + 16));
  3799. }
  3800. void
  3801. __glXDisp_FramebufferTexture3D(GLbyte * pc)
  3802. {
  3803. PFNGLFRAMEBUFFERTEXTURE3DPROC FramebufferTexture3D =
  3804. __glGetProcAddress("glFramebufferTexture3D");
  3805. FramebufferTexture3D(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4),
  3806. *(GLenum *) (pc + 8), *(GLuint *) (pc + 12),
  3807. *(GLint *) (pc + 16), *(GLint *) (pc + 20));
  3808. }
  3809. void
  3810. __glXDisp_FramebufferTextureLayer(GLbyte * pc)
  3811. {
  3812. PFNGLFRAMEBUFFERTEXTURELAYERPROC FramebufferTextureLayer =
  3813. __glGetProcAddress("glFramebufferTextureLayer");
  3814. FramebufferTextureLayer(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4),
  3815. *(GLuint *) (pc + 8), *(GLint *) (pc + 12),
  3816. *(GLint *) (pc + 16));
  3817. }
  3818. int
  3819. __glXDisp_GenFramebuffers(__GLXclientState * cl, GLbyte * pc)
  3820. {
  3821. PFNGLGENFRAMEBUFFERSPROC GenFramebuffers =
  3822. __glGetProcAddress("glGenFramebuffers");
  3823. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  3824. int error;
  3825. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  3826. pc += __GLX_VENDPRIV_HDR_SIZE;
  3827. if (cx != NULL) {
  3828. const GLsizei n = *(GLsizei *) (pc + 0);
  3829. GLuint answerBuffer[200];
  3830. GLuint *framebuffers =
  3831. __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
  3832. 4);
  3833. if (framebuffers == NULL)
  3834. return BadAlloc;
  3835. GenFramebuffers(n, framebuffers);
  3836. __glXSendReply(cl->client, framebuffers, n, 4, GL_TRUE, 0);
  3837. error = Success;
  3838. }
  3839. return error;
  3840. }
  3841. int
  3842. __glXDisp_GenRenderbuffers(__GLXclientState * cl, GLbyte * pc)
  3843. {
  3844. PFNGLGENRENDERBUFFERSPROC GenRenderbuffers =
  3845. __glGetProcAddress("glGenRenderbuffers");
  3846. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  3847. int error;
  3848. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  3849. pc += __GLX_VENDPRIV_HDR_SIZE;
  3850. if (cx != NULL) {
  3851. const GLsizei n = *(GLsizei *) (pc + 0);
  3852. GLuint answerBuffer[200];
  3853. GLuint *renderbuffers =
  3854. __glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
  3855. 4);
  3856. if (renderbuffers == NULL)
  3857. return BadAlloc;
  3858. GenRenderbuffers(n, renderbuffers);
  3859. __glXSendReply(cl->client, renderbuffers, n, 4, GL_TRUE, 0);
  3860. error = Success;
  3861. }
  3862. return error;
  3863. }
  3864. void
  3865. __glXDisp_GenerateMipmap(GLbyte * pc)
  3866. {
  3867. PFNGLGENERATEMIPMAPPROC GenerateMipmap =
  3868. __glGetProcAddress("glGenerateMipmap");
  3869. GenerateMipmap(*(GLenum *) (pc + 0));
  3870. }
  3871. int
  3872. __glXDisp_GetFramebufferAttachmentParameteriv(__GLXclientState * cl,
  3873. GLbyte * pc)
  3874. {
  3875. PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC
  3876. GetFramebufferAttachmentParameteriv =
  3877. __glGetProcAddress("glGetFramebufferAttachmentParameteriv");
  3878. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  3879. int error;
  3880. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  3881. pc += __GLX_VENDPRIV_HDR_SIZE;
  3882. if (cx != NULL) {
  3883. GLint params[1];
  3884. GetFramebufferAttachmentParameteriv(*(GLenum *) (pc + 0),
  3885. *(GLenum *) (pc + 4),
  3886. *(GLenum *) (pc + 8), params);
  3887. __glXSendReply(cl->client, params, 1, 4, GL_FALSE, 0);
  3888. error = Success;
  3889. }
  3890. return error;
  3891. }
  3892. int
  3893. __glXDisp_GetRenderbufferParameteriv(__GLXclientState * cl, GLbyte * pc)
  3894. {
  3895. PFNGLGETRENDERBUFFERPARAMETERIVPROC GetRenderbufferParameteriv =
  3896. __glGetProcAddress("glGetRenderbufferParameteriv");
  3897. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  3898. int error;
  3899. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  3900. pc += __GLX_VENDPRIV_HDR_SIZE;
  3901. if (cx != NULL) {
  3902. GLint params[1];
  3903. GetRenderbufferParameteriv(*(GLenum *) (pc + 0),
  3904. *(GLenum *) (pc + 4), params);
  3905. __glXSendReply(cl->client, params, 1, 4, GL_FALSE, 0);
  3906. error = Success;
  3907. }
  3908. return error;
  3909. }
  3910. int
  3911. __glXDisp_IsFramebuffer(__GLXclientState * cl, GLbyte * pc)
  3912. {
  3913. PFNGLISFRAMEBUFFERPROC IsFramebuffer =
  3914. __glGetProcAddress("glIsFramebuffer");
  3915. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  3916. int error;
  3917. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  3918. pc += __GLX_VENDPRIV_HDR_SIZE;
  3919. if (cx != NULL) {
  3920. GLboolean retval;
  3921. retval = IsFramebuffer(*(GLuint *) (pc + 0));
  3922. __glXSendReply(cl->client, dummy_answer, 0, 0, GL_FALSE, retval);
  3923. error = Success;
  3924. }
  3925. return error;
  3926. }
  3927. int
  3928. __glXDisp_IsRenderbuffer(__GLXclientState * cl, GLbyte * pc)
  3929. {
  3930. PFNGLISRENDERBUFFERPROC IsRenderbuffer =
  3931. __glGetProcAddress("glIsRenderbuffer");
  3932. xGLXVendorPrivateReq *const req = (xGLXVendorPrivateReq *) pc;
  3933. int error;
  3934. __GLXcontext *const cx = __glXForceCurrent(cl, req->contextTag, &error);
  3935. pc += __GLX_VENDPRIV_HDR_SIZE;
  3936. if (cx != NULL) {
  3937. GLboolean retval;
  3938. retval = IsRenderbuffer(*(GLuint *) (pc + 0));
  3939. __glXSendReply(cl->client, dummy_answer, 0, 0, GL_FALSE, retval);
  3940. error = Success;
  3941. }
  3942. return error;
  3943. }
  3944. void
  3945. __glXDisp_RenderbufferStorage(GLbyte * pc)
  3946. {
  3947. PFNGLRENDERBUFFERSTORAGEPROC RenderbufferStorage =
  3948. __glGetProcAddress("glRenderbufferStorage");
  3949. RenderbufferStorage(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4),
  3950. *(GLsizei *) (pc + 8), *(GLsizei *) (pc + 12));
  3951. }
  3952. void
  3953. __glXDisp_RenderbufferStorageMultisample(GLbyte * pc)
  3954. {
  3955. PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC RenderbufferStorageMultisample =
  3956. __glGetProcAddress("glRenderbufferStorageMultisample");
  3957. RenderbufferStorageMultisample(*(GLenum *) (pc + 0), *(GLsizei *) (pc + 4),
  3958. *(GLenum *) (pc + 8), *(GLsizei *) (pc + 12),
  3959. *(GLsizei *) (pc + 16));
  3960. }
  3961. void
  3962. __glXDisp_SecondaryColor3fvEXT(GLbyte * pc)
  3963. {
  3964. PFNGLSECONDARYCOLOR3FVEXTPROC SecondaryColor3fvEXT =
  3965. __glGetProcAddress("glSecondaryColor3fvEXT");
  3966. SecondaryColor3fvEXT((const GLfloat *) (pc + 0));
  3967. }
  3968. void
  3969. __glXDisp_FogCoordfvEXT(GLbyte * pc)
  3970. {
  3971. PFNGLFOGCOORDFVEXTPROC FogCoordfvEXT =
  3972. __glGetProcAddress("glFogCoordfvEXT");
  3973. FogCoordfvEXT((const GLfloat *) (pc + 0));
  3974. }
  3975. void
  3976. __glXDisp_VertexAttrib1dvNV(GLbyte * pc)
  3977. {
  3978. PFNGLVERTEXATTRIB1DVNVPROC VertexAttrib1dvNV =
  3979. __glGetProcAddress("glVertexAttrib1dvNV");
  3980. #ifdef __GLX_ALIGN64
  3981. if ((unsigned long) (pc) & 7) {
  3982. (void) memmove(pc - 4, pc, 12);
  3983. pc -= 4;
  3984. }
  3985. #endif
  3986. VertexAttrib1dvNV(*(GLuint *) (pc + 0), (const GLdouble *) (pc + 4));
  3987. }
  3988. void
  3989. __glXDisp_VertexAttrib1fvNV(GLbyte * pc)
  3990. {
  3991. PFNGLVERTEXATTRIB1FVNVPROC VertexAttrib1fvNV =
  3992. __glGetProcAddress("glVertexAttrib1fvNV");
  3993. VertexAttrib1fvNV(*(GLuint *) (pc + 0), (const GLfloat *) (pc + 4));
  3994. }
  3995. void
  3996. __glXDisp_VertexAttrib1svNV(GLbyte * pc)
  3997. {
  3998. PFNGLVERTEXATTRIB1SVNVPROC VertexAttrib1svNV =
  3999. __glGetProcAddress("glVertexAttrib1svNV");
  4000. VertexAttrib1svNV(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4));
  4001. }
  4002. void
  4003. __glXDisp_VertexAttrib2dvNV(GLbyte * pc)
  4004. {
  4005. PFNGLVERTEXATTRIB2DVNVPROC VertexAttrib2dvNV =
  4006. __glGetProcAddress("glVertexAttrib2dvNV");
  4007. #ifdef __GLX_ALIGN64
  4008. if ((unsigned long) (pc) & 7) {
  4009. (void) memmove(pc - 4, pc, 20);
  4010. pc -= 4;
  4011. }
  4012. #endif
  4013. VertexAttrib2dvNV(*(GLuint *) (pc + 0), (const GLdouble *) (pc + 4));
  4014. }
  4015. void
  4016. __glXDisp_VertexAttrib2fvNV(GLbyte * pc)
  4017. {
  4018. PFNGLVERTEXATTRIB2FVNVPROC VertexAttrib2fvNV =
  4019. __glGetProcAddress("glVertexAttrib2fvNV");
  4020. VertexAttrib2fvNV(*(GLuint *) (pc + 0), (const GLfloat *) (pc + 4));
  4021. }
  4022. void
  4023. __glXDisp_VertexAttrib2svNV(GLbyte * pc)
  4024. {
  4025. PFNGLVERTEXATTRIB2SVNVPROC VertexAttrib2svNV =
  4026. __glGetProcAddress("glVertexAttrib2svNV");
  4027. VertexAttrib2svNV(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4));
  4028. }
  4029. void
  4030. __glXDisp_VertexAttrib3dvNV(GLbyte * pc)
  4031. {
  4032. PFNGLVERTEXATTRIB3DVNVPROC VertexAttrib3dvNV =
  4033. __glGetProcAddress("glVertexAttrib3dvNV");
  4034. #ifdef __GLX_ALIGN64
  4035. if ((unsigned long) (pc) & 7) {
  4036. (void) memmove(pc - 4, pc, 28);
  4037. pc -= 4;
  4038. }
  4039. #endif
  4040. VertexAttrib3dvNV(*(GLuint *) (pc + 0), (const GLdouble *) (pc + 4));
  4041. }
  4042. void
  4043. __glXDisp_VertexAttrib3fvNV(GLbyte * pc)
  4044. {
  4045. PFNGLVERTEXATTRIB3FVNVPROC VertexAttrib3fvNV =
  4046. __glGetProcAddress("glVertexAttrib3fvNV");
  4047. VertexAttrib3fvNV(*(GLuint *) (pc + 0), (const GLfloat *) (pc + 4));
  4048. }
  4049. void
  4050. __glXDisp_VertexAttrib3svNV(GLbyte * pc)
  4051. {
  4052. PFNGLVERTEXATTRIB3SVNVPROC VertexAttrib3svNV =
  4053. __glGetProcAddress("glVertexAttrib3svNV");
  4054. VertexAttrib3svNV(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4));
  4055. }
  4056. void
  4057. __glXDisp_VertexAttrib4dvNV(GLbyte * pc)
  4058. {
  4059. PFNGLVERTEXATTRIB4DVNVPROC VertexAttrib4dvNV =
  4060. __glGetProcAddress("glVertexAttrib4dvNV");
  4061. #ifdef __GLX_ALIGN64
  4062. if ((unsigned long) (pc) & 7) {
  4063. (void) memmove(pc - 4, pc, 36);
  4064. pc -= 4;
  4065. }
  4066. #endif
  4067. VertexAttrib4dvNV(*(GLuint *) (pc + 0), (const GLdouble *) (pc + 4));
  4068. }
  4069. void
  4070. __glXDisp_VertexAttrib4fvNV(GLbyte * pc)
  4071. {
  4072. PFNGLVERTEXATTRIB4FVNVPROC VertexAttrib4fvNV =
  4073. __glGetProcAddress("glVertexAttrib4fvNV");
  4074. VertexAttrib4fvNV(*(GLuint *) (pc + 0), (const GLfloat *) (pc + 4));
  4075. }
  4076. void
  4077. __glXDisp_VertexAttrib4svNV(GLbyte * pc)
  4078. {
  4079. PFNGLVERTEXATTRIB4SVNVPROC VertexAttrib4svNV =
  4080. __glGetProcAddress("glVertexAttrib4svNV");
  4081. VertexAttrib4svNV(*(GLuint *) (pc + 0), (const GLshort *) (pc + 4));
  4082. }
  4083. void
  4084. __glXDisp_VertexAttrib4ubvNV(GLbyte * pc)
  4085. {
  4086. PFNGLVERTEXATTRIB4UBVNVPROC VertexAttrib4ubvNV =
  4087. __glGetProcAddress("glVertexAttrib4ubvNV");
  4088. VertexAttrib4ubvNV(*(GLuint *) (pc + 0), (const GLubyte *) (pc + 4));
  4089. }
  4090. void
  4091. __glXDisp_VertexAttribs1dvNV(GLbyte * pc)
  4092. {
  4093. PFNGLVERTEXATTRIBS1DVNVPROC VertexAttribs1dvNV =
  4094. __glGetProcAddress("glVertexAttribs1dvNV");
  4095. const GLsizei n = *(GLsizei *) (pc + 4);
  4096. #ifdef __GLX_ALIGN64
  4097. const GLuint cmdlen = 12 + __GLX_PAD((n * 8)) - 4;
  4098. if ((unsigned long) (pc) & 7) {
  4099. (void) memmove(pc - 4, pc, cmdlen);
  4100. pc -= 4;
  4101. }
  4102. #endif
  4103. VertexAttribs1dvNV(*(GLuint *) (pc + 0), n, (const GLdouble *) (pc + 8));
  4104. }
  4105. void
  4106. __glXDisp_VertexAttribs1fvNV(GLbyte * pc)
  4107. {
  4108. PFNGLVERTEXATTRIBS1FVNVPROC VertexAttribs1fvNV =
  4109. __glGetProcAddress("glVertexAttribs1fvNV");
  4110. const GLsizei n = *(GLsizei *) (pc + 4);
  4111. VertexAttribs1fvNV(*(GLuint *) (pc + 0), n, (const GLfloat *) (pc + 8));
  4112. }
  4113. void
  4114. __glXDisp_VertexAttribs1svNV(GLbyte * pc)
  4115. {
  4116. PFNGLVERTEXATTRIBS1SVNVPROC VertexAttribs1svNV =
  4117. __glGetProcAddress("glVertexAttribs1svNV");
  4118. const GLsizei n = *(GLsizei *) (pc + 4);
  4119. VertexAttribs1svNV(*(GLuint *) (pc + 0), n, (const GLshort *) (pc + 8));
  4120. }
  4121. void
  4122. __glXDisp_VertexAttribs2dvNV(GLbyte * pc)
  4123. {
  4124. PFNGLVERTEXATTRIBS2DVNVPROC VertexAttribs2dvNV =
  4125. __glGetProcAddress("glVertexAttribs2dvNV");
  4126. const GLsizei n = *(GLsizei *) (pc + 4);
  4127. #ifdef __GLX_ALIGN64
  4128. const GLuint cmdlen = 12 + __GLX_PAD((n * 16)) - 4;
  4129. if ((unsigned long) (pc) & 7) {
  4130. (void) memmove(pc - 4, pc, cmdlen);
  4131. pc -= 4;
  4132. }
  4133. #endif
  4134. VertexAttribs2dvNV(*(GLuint *) (pc + 0), n, (const GLdouble *) (pc + 8));
  4135. }
  4136. void
  4137. __glXDisp_VertexAttribs2fvNV(GLbyte * pc)
  4138. {
  4139. PFNGLVERTEXATTRIBS2FVNVPROC VertexAttribs2fvNV =
  4140. __glGetProcAddress("glVertexAttribs2fvNV");
  4141. const GLsizei n = *(GLsizei *) (pc + 4);
  4142. VertexAttribs2fvNV(*(GLuint *) (pc + 0), n, (const GLfloat *) (pc + 8));
  4143. }
  4144. void
  4145. __glXDisp_VertexAttribs2svNV(GLbyte * pc)
  4146. {
  4147. PFNGLVERTEXATTRIBS2SVNVPROC VertexAttribs2svNV =
  4148. __glGetProcAddress("glVertexAttribs2svNV");
  4149. const GLsizei n = *(GLsizei *) (pc + 4);
  4150. VertexAttribs2svNV(*(GLuint *) (pc + 0), n, (const GLshort *) (pc + 8));
  4151. }
  4152. void
  4153. __glXDisp_VertexAttribs3dvNV(GLbyte * pc)
  4154. {
  4155. PFNGLVERTEXATTRIBS3DVNVPROC VertexAttribs3dvNV =
  4156. __glGetProcAddress("glVertexAttribs3dvNV");
  4157. const GLsizei n = *(GLsizei *) (pc + 4);
  4158. #ifdef __GLX_ALIGN64
  4159. const GLuint cmdlen = 12 + __GLX_PAD((n * 24)) - 4;
  4160. if ((unsigned long) (pc) & 7) {
  4161. (void) memmove(pc - 4, pc, cmdlen);
  4162. pc -= 4;
  4163. }
  4164. #endif
  4165. VertexAttribs3dvNV(*(GLuint *) (pc + 0), n, (const GLdouble *) (pc + 8));
  4166. }
  4167. void
  4168. __glXDisp_VertexAttribs3fvNV(GLbyte * pc)
  4169. {
  4170. PFNGLVERTEXATTRIBS3FVNVPROC VertexAttribs3fvNV =
  4171. __glGetProcAddress("glVertexAttribs3fvNV");
  4172. const GLsizei n = *(GLsizei *) (pc + 4);
  4173. VertexAttribs3fvNV(*(GLuint *) (pc + 0), n, (const GLfloat *) (pc + 8));
  4174. }
  4175. void
  4176. __glXDisp_VertexAttribs3svNV(GLbyte * pc)
  4177. {
  4178. PFNGLVERTEXATTRIBS3SVNVPROC VertexAttribs3svNV =
  4179. __glGetProcAddress("glVertexAttribs3svNV");
  4180. const GLsizei n = *(GLsizei *) (pc + 4);
  4181. VertexAttribs3svNV(*(GLuint *) (pc + 0), n, (const GLshort *) (pc + 8));
  4182. }
  4183. void
  4184. __glXDisp_VertexAttribs4dvNV(GLbyte * pc)
  4185. {
  4186. PFNGLVERTEXATTRIBS4DVNVPROC VertexAttribs4dvNV =
  4187. __glGetProcAddress("glVertexAttribs4dvNV");
  4188. const GLsizei n = *(GLsizei *) (pc + 4);
  4189. #ifdef __GLX_ALIGN64
  4190. const GLuint cmdlen = 12 + __GLX_PAD((n * 32)) - 4;
  4191. if ((unsigned long) (pc) & 7) {
  4192. (void) memmove(pc - 4, pc, cmdlen);
  4193. pc -= 4;
  4194. }
  4195. #endif
  4196. VertexAttribs4dvNV(*(GLuint *) (pc + 0), n, (const GLdouble *) (pc + 8));
  4197. }
  4198. void
  4199. __glXDisp_VertexAttribs4fvNV(GLbyte * pc)
  4200. {
  4201. PFNGLVERTEXATTRIBS4FVNVPROC VertexAttribs4fvNV =
  4202. __glGetProcAddress("glVertexAttribs4fvNV");
  4203. const GLsizei n = *(GLsizei *) (pc + 4);
  4204. VertexAttribs4fvNV(*(GLuint *) (pc + 0), n, (const GLfloat *) (pc + 8));
  4205. }
  4206. void
  4207. __glXDisp_VertexAttribs4svNV(GLbyte * pc)
  4208. {
  4209. PFNGLVERTEXATTRIBS4SVNVPROC VertexAttribs4svNV =
  4210. __glGetProcAddress("glVertexAttribs4svNV");
  4211. const GLsizei n = *(GLsizei *) (pc + 4);
  4212. VertexAttribs4svNV(*(GLuint *) (pc + 0), n, (const GLshort *) (pc + 8));
  4213. }
  4214. void
  4215. __glXDisp_VertexAttribs4ubvNV(GLbyte * pc)
  4216. {
  4217. PFNGLVERTEXATTRIBS4UBVNVPROC VertexAttribs4ubvNV =
  4218. __glGetProcAddress("glVertexAttribs4ubvNV");
  4219. const GLsizei n = *(GLsizei *) (pc + 4);
  4220. VertexAttribs4ubvNV(*(GLuint *) (pc + 0), n, (const GLubyte *) (pc + 8));
  4221. }
  4222. void
  4223. __glXDisp_ActiveStencilFaceEXT(GLbyte * pc)
  4224. {
  4225. PFNGLACTIVESTENCILFACEEXTPROC ActiveStencilFaceEXT =
  4226. __glGetProcAddress("glActiveStencilFaceEXT");
  4227. ActiveStencilFaceEXT(*(GLenum *) (pc + 0));
  4228. }