freeglut_user_interface.html 103 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956
  1. <!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  5. <meta name="Author" content="John F. Fay">
  6. <meta name="GENERATOR" content="Mozilla/4.77 [en] (Windows NT 5.0; U) [Netscape]">
  7. <title>FREEGLUT Application Program Interface</title>
  8. </head>
  9. <body>
  10. <dl>
  11. <center>
  12. <h1> The Open-Source</h1>
  13. </center>
  14. <center>
  15. <h1> OpenGL Utility Toolkit</h1>
  16. </center>
  17. <center>
  18. <h1> (<i>freeglut</i> 2.0.0)</h1>
  19. </center>
  20. <center>
  21. <h1> Application Programming Interface</h1>
  22. </center>
  23. </dl>
  24. <center>
  25. <h1> Version 4.0</h1>
  26. </center>
  27. <center>
  28. <h2> The <i>freeglut</i> Programming Consortium</h2>
  29. </center>
  30. <center>
  31. <h2> July, 2003</h2>
  32. </center>
  33. <p><br>
  34. OpenGL is a trademark of Silicon Graphics, Inc. X Window System is a trademark
  35. of X Consortium, Inc.&nbsp; Spaceball is a registered trademark of Spatial
  36. Systems Inc. <br>
  37. The authors have taken care in preparation of this documentation but make
  38. no expressed or implied warranty of any kind and assumes no responsibility
  39. for errors or omissions. No liability is assumed for incidental or consequential
  40. damages in connection with or arising from the use of information or programs
  41. contained herein. <br>
  42. &nbsp; </p>
  43. <h1> 1.0&nbsp;<a name="Contents"></a>
  44. Contents</h1>
  45. 1.0&nbsp; <a href="#Contents">Contents</a>
  46. <p>2.0&nbsp; <a href="#Introduction">Introduction</a>
  47. </p>
  48. <p>3.0&nbsp; <a href="#Background">Background</a>
  49. </p>
  50. <blockquote>3.1&nbsp; Design Philosophy <br>
  51. 3.2&nbsp; Conventions <br>
  52. 3.3&nbsp; Terminology <br>
  53. 3.4&nbsp; Differences from GLUT 3.7</blockquote>
  54. <p><br>
  55. 4.0&nbsp; <a href="#Initialization">Initialization Functions</a>
  56. </p>
  57. <blockquote>4.1&nbsp; glutInit <br>
  58. 4.2&nbsp; glutInitWindowPosition, glutInitWindowSize <br>
  59. 4.3&nbsp; glutInitDisplayMode <br>
  60. 4.4&nbsp; glutInitDisplayString</blockquote>
  61. <p><br>
  62. 5.0&nbsp; <a href="#EventProcessing">Event Processing Functions</a>
  63. </p>
  64. <blockquote>5.1&nbsp; glutMainLoop <br>
  65. 5.2&nbsp; glutMainLoopEvent <br>
  66. 5.3&nbsp; glutLeaveMainLoop</blockquote>
  67. <p><br>
  68. 6.0&nbsp; <a href="#Window">Window Functions</a>
  69. </p>
  70. <blockquote>6.1&nbsp; glutCreateWindow <br>
  71. 6.2&nbsp; glutCreateSubwindow <br>
  72. 6.3&nbsp; glutDestroyWindow <br>
  73. 6.4&nbsp; glutSetWindow, glutGetWindow <br>
  74. 6.5&nbsp; glutSetWindowTitle, glutSetIconTitle <br>
  75. 6.6&nbsp; glutReshapeWindow <br>
  76. 6.7&nbsp; glutPositionWindow <br>
  77. 6.8&nbsp; glutShowWindow, glutHideWindow, glutIconifyWindow <br>
  78. 6.9&nbsp; glutPushWindow, glutPopWindow <br>
  79. 6.10&nbsp; glutFullScreen</blockquote>
  80. <p><br>
  81. 7.0&nbsp; <a href="#Display">Display Functions</a>
  82. </p>
  83. <blockquote>7.1&nbsp; glutPostRedisplay <br>
  84. 7.2&nbsp; glutPostWindowRedisplay <br>
  85. 7.3&nbsp; glutSwapBuffers</blockquote>
  86. <p><br>
  87. 8.0&nbsp; <a href="#MouseCursor">Mouse Cursor Functions</a>
  88. </p>
  89. <blockquote>8.1&nbsp; glutSetCursor <br>
  90. 8.2&nbsp; glutWarpPointer</blockquote>
  91. <p><br>
  92. 9.0&nbsp; <a href="#Overlay">Overlay Functions</a>
  93. </p>
  94. <blockquote>9.1&nbsp; glutEstablishOverlay <br>
  95. 9.2&nbsp; glutRemoveOverlay <br>
  96. 9.3&nbsp; glutUseLayer <br>
  97. 9.4&nbsp; glutPostOverlayRedisplay <br>
  98. 9.5&nbsp; glutPostWindowOverlayRedisplay <br>
  99. 9.6&nbsp; glutShowOverlay, glutHideOverlay</blockquote>
  100. <p><br>
  101. 10.0&nbsp; <a href="#Menu">Menu Functions</a>
  102. </p>
  103. <blockquote>10.1&nbsp; glutCreateMenu <br>
  104. 10.2&nbsp; glutDestroyMenu <br>
  105. 10.3&nbsp; glutGetMenu, glutSetMenu <br>
  106. 10.4&nbsp; glutAddMenuEntry <br>
  107. 10.5&nbsp; glutAddSubMenu <br>
  108. 10.6&nbsp; glutChangeToMenuEntry <br>
  109. 10.7&nbsp; glutChangeToSubMenu <br>
  110. 10.8&nbsp; glutRemoveMenuItem <br>
  111. 10.9&nbsp; glutAttachMenu, glutDetachMenu</blockquote>
  112. <p><br>
  113. 11.0&nbsp; <a href="#GlobalCallback">Global Callback Registration Functions</a>
  114. </p>
  115. <blockquote>11.1&nbsp; glutTimerFunc <br>
  116. 11.2&nbsp; glutIdleFunc</blockquote>
  117. <p><br>
  118. 12.0&nbsp; <a href="#WindowCallback">Window-Specific Callback Registration
  119. Functions</a>
  120. </p>
  121. <blockquote>12.1&nbsp; glutDisplayFunc <br>
  122. 12.2&nbsp; glutOverlayDisplayFunc <br>
  123. 12.3&nbsp; glutReshapeFunc <br>
  124. 12.4&nbsp; glutCloseFunc <br>
  125. 12.5&nbsp; glutKeyboardFunc <br>
  126. 12.6&nbsp; glutSpecialFunc <br>
  127. 12.7&nbsp; glutKeyboardUpFunc <br>
  128. 12.8&nbsp; glutSpecialUpFunc <br>
  129. 12.9&nbsp; glutMouseFunc <br>
  130. 12.10&nbsp; glutMotionFunc, glutPassiveMotionFunc <br>
  131. 12.11&nbsp; glutVisibilityFunc <br>
  132. 12.12&nbsp; glutEntryFunc <br>
  133. 12.13&nbsp; glutJoystickFunc <br>
  134. 12.14&nbsp; glutSpaceballMotionFunc <br>
  135. 12.15&nbsp; glutSpaceballRotateFunc <br>
  136. 12.16&nbsp; glutSpaceballButtonFunc <br>
  137. 12.17&nbsp; glutButtonBoxFunc <br>
  138. 12.18&nbsp; glutDialsFunc <br>
  139. 12.19&nbsp; glutTabletMotionFunc <br>
  140. 12.20&nbsp; glutTabletButtonFunc
  141. <p>12.21&nbsp; glutMenuStatusFunc <br>
  142. 12.22&nbsp; glutWindowStatusFunc</p>
  143. </blockquote>
  144. <p><br>
  145. 13.0&nbsp; <a href="#StateSetting">State Setting and Retrieval Functions</a>
  146. </p>
  147. <blockquote>13.1&nbsp; glutSetOption <br>
  148. 13.2&nbsp; glutGet <br>
  149. 13.3&nbsp; glutDeviceGet <br>
  150. 13.4&nbsp; glutGetModifiers <br>
  151. 13.5&nbsp; glutLayerGet <br>
  152. 13.6&nbsp; glutExtensionSupported<br>
  153. 13.7 &nbsp;glutGetProcAddress<br>
  154. </blockquote>
  155. <p><br>
  156. 14.0&nbsp; <a href="#FontRendering">Font Rendering Functions</a>
  157. </p>
  158. <blockquote>14.1&nbsp; glutBitmapCharacter <br>
  159. 14.2&nbsp; glutBitmapString <br>
  160. 14.3&nbsp; glutBitmapWidth <br>
  161. 14.4&nbsp; glutBitmapLength <br>
  162. 14.5&nbsp; glutBitmapHeight <br>
  163. 14.6&nbsp; glutStrokeCharacter <br>
  164. 14.7&nbsp; glutStrokeString <br>
  165. 14.8&nbsp; glutStrokeWidth <br>
  166. 14.9&nbsp; glutStrokeLength <br>
  167. 14.10&nbsp; glutStrokeHeight</blockquote>
  168. <p><br>
  169. 15.0&nbsp; <a href="#GeometricObject">Geometric Object Rendering Functions</a>
  170. </p>
  171. <blockquote>15.1&nbsp; glutWireSphere, glutSolidSphere
  172. <br>
  173. 15.2&nbsp; glutWireTorus, glutSolidTorus <br>
  174. 15.3&nbsp; glutWireCone, glutSolidCone <br>
  175. 15.4&nbsp; glutWireCube, glutSolidCube <br>
  176. 15.5&nbsp; glutWireTetrahedron, glutSolidTetrahedron <br>
  177. 15.6&nbsp; glutWireOctahedron, glutSolidOctahedron <br>
  178. 15.7&nbsp; glutWireDodecahedron, glutSolidDodecahedron <br>
  179. 15.8&nbsp; glutWireIcosahedron, glutSolidIcosahedron <br>
  180. 15.9&nbsp; glutWireRhombicDodecahedron, glutSolidRhombicDodecahedron <br>
  181. 15.10&nbsp; glutWireTeapot, glutSolidTeapot</blockquote>
  182. <p><br>
  183. 16.0&nbsp; <a href="#GameMode">Game Mode Functions</a>
  184. </p>
  185. <blockquote>16.1&nbsp; glutGameModeString <br>
  186. 16.2&nbsp; glutEnterGameMode, glutLeaveGameMode <br>
  187. 16.3&nbsp; glutGameModeGet</blockquote>
  188. <p><br>
  189. 17.0&nbsp; <a href="#VideoResize">Video Resize Functions</a>
  190. </p>
  191. <blockquote>17.1&nbsp; glutVideoResizeGet <br>
  192. 17.2&nbsp; glutSetupVideoResizing, glutStopVideoResizing <br>
  193. 17.3&nbsp; glutVideoResize <br>
  194. 17.4&nbsp; glutVideoPan</blockquote>
  195. <p><br>
  196. 18.0&nbsp; <a href="#ColorMap">Color Map Functions</a>
  197. </p>
  198. <blockquote>18.1&nbsp; glutSetColor, glutGetColor
  199. <br>
  200. 18.2&nbsp; glutCopyColormap</blockquote>
  201. <p><br>
  202. 19.0&nbsp; <a href="#Miscellaneous">Miscellaneous Functions</a>
  203. </p>
  204. <blockquote>19.1&nbsp; glutIgnoreKeyRepeat,
  205. glutSetKeyRepeat <br>
  206. 19.2&nbsp; glutForceJoystickFunc <br>
  207. 19.3&nbsp; glutReportErrors</blockquote>
  208. <p><br>
  209. 20.0&nbsp; <a href="#UsageNotes">Usage Notes</a>
  210. </p>
  211. <p>21.0&nbsp; <a href="#ImplementationNotes">
  212. Implementation Notes</a>
  213. </p>
  214. <p>22.0&nbsp; <a href="#GLUT_State">GLUT
  215. State</a>
  216. </p>
  217. <p>23.0&nbsp; <a href="#Freeglut.h_Header">
  218. "freeglut.h" Header File</a>
  219. </p>
  220. <p>24.0&nbsp; <a href="#References">References</a>
  221. </p>
  222. <p>25.0&nbsp; <a href="#Index">Index</a>
  223. <br>
  224. &nbsp; <br>
  225. &nbsp; </p>
  226. <h1> 2.0&nbsp;<a name="Introduction"></a>
  227. Introduction</h1>
  228. &nbsp;
  229. <h1> 3.0&nbsp;<a name="Background"></a>
  230. Background</h1>
  231. The OpenGL programming world owes a tremendous debt to Mr. Mark J. Kilgard
  232. for writing the OpenGL Utility Toolkit, or GLUT.&nbsp; The GLUT library
  233. of functions allows an application programmer to create, control, and manipulate
  234. windows independent of what operating system the program is running on.&nbsp;
  235. By hiding the dependency on the operating system from the application programmer,
  236. he allowed people to write truly portable OpenGL applications.
  237. <p>&nbsp;&nbsp;&nbsp; Mr. Kilgard copyrighted
  238. his library and gave it a rather unusual license.&nbsp; Under his license,
  239. people are allowed freely to copy and distribute the libraries and the source
  240. code, but they are not allowed to modify it.&nbsp; For a long time this did
  241. not matter because the GLUT library worked so well and because Mr. Kilgard
  242. was releasing updates on a regular basis.&nbsp; But with the passage of time,
  243. people started wanting some slightly different behaviours in their windowing
  244. system.&nbsp; When Mr. Kilgard stopped supporting the GLUT library in 1999,
  245. having moved on to bigger and better things, this started to become a problem.
  246. </p>
  247. <p>&nbsp;&nbsp;&nbsp; In December 1999,
  248. Mr. Pawel Olzsta started work on an open-source clone of the GLUT library.&nbsp;
  249. This open-source clone, which does not use any of the GLUT source code, has
  250. evolved into the present <i>freeglut</i> library.&nbsp; This documentation
  251. specifies the application program interface to the <i>freeglut</i> library.
  252. </p>
  253. <h2> 3.1&nbsp; Design Philosophy</h2>
  254. <h2> 3.2&nbsp; Conventions</h2>
  255. <h2> 3.3&nbsp; Terminology</h2>
  256. <h2> 3.4&nbsp; Differences from GLUT 3.7</h2>
  257. Since the <i>freeglut</i> library was developed in order to update GLUT,
  258. it is natural that there will be some differences between the two.&nbsp;
  259. Each function in the API notes any differences between the GLUT and the <i>
  260. freeglut</i> function behaviours.&nbsp; The important ones are summarized
  261. here.
  262. <h3> 3.4.1&nbsp; glutMainLoop Behaviour</h3>
  263. One of the commonest complaints about the GLUT library was that once an
  264. application called "<tt>glutMainLoop</tt>", it never got control back.&nbsp;
  265. There was no way for an application to loop in GLUT for a while, possibly
  266. as a subloop while a specific window was open, and then return to the calling
  267. function.&nbsp; A new function, "<tt>glutMainLoopEvent</tt>", has been added
  268. to allow this functionality.&nbsp; Another function, "<tt>glutLeaveMainLoop</tt>
  269. ", has also been added to allow the application to tell <i>freeglut</i> to clean
  270. up and close down.
  271. <h3> 3.4.2&nbsp; Action on Window Closure</h3>
  272. Another difficulty with GLUT, especially with multiple-window programs,
  273. is that if the user clicks on the "x" in the window header the application
  274. exits immediately.&nbsp; The application programmer can now set an option,
  275. "<tt> GLUT_ACTION_ON_WINDOW_CLOSE</tt>", to specify whether execution should
  276. continue, whether GLUT should return control to the main program, or whether
  277. GLUT should simply exit (the default).
  278. <h3>3.4.3&nbsp; Changes to Callbacks<br>
  279. </h3>
  280. Several new callbacks have been added and several callbacks which were specific
  281. to Silicon Graphics hardware have not been implemented.&nbsp; Most or all
  282. of the new callbacks are listed in the GLUT Version 4 "glut.h" header file
  283. but did not make it into the documentation.&nbsp; The new callbacks consist
  284. of regular and special key release callbacks, a joystick callback, a window
  285. status callback, window closure callbacks, a menu closure callback, and a
  286. mouse wheel callback.&nbsp; Unsupported callbacks are the three Spaceball
  287. callbacks, the ButtonBox callback, and the two Tablet
  288. callbacks.&nbsp; If the user has a need for an unsupported callback he should
  289. contact the <i>freeglut</i> development team.<br>
  290. <h3>3.4.4&nbsp; String Rendering<br>
  291. </h3>
  292. New functions have been added to render full character strings (including
  293. carriage returns) rather than rendering one character at a time.&nbsp; More
  294. functions return the widths of character strings and the font heights, in
  295. pixels for bitmapped fonts and in OpenGL units for the stroke fonts.<br>
  296. <h3>3.4.5&nbsp; Geometry Rendering<br>
  297. </h3>
  298. Functions have been added to render a wireframe and a solid rhombic
  299. dodecahedron, a cylinder, and a Sierpinski sponge.
  300. <h3> 3.4.5&nbsp; Extension Function Queries</h3>
  301. glutGetProcAddress is a wrapper for the glXGetProcAddressARB and wglGetProcAddress
  302. functions.
  303. <h1> 4.0&nbsp;<a name="Initialization"></a>
  304. Initialization Functions</h1>
  305. <h2> 4.1&nbsp; glutInit</h2>
  306. <h2> 4.2&nbsp; glutInitWindowPosition, glutInitWindowSize</h2>
  307. The "<tt>glutInitWindowPosition</tt> " and "<tt>glutInitWindowSize</tt>
  308. " functions specify a desired position and size for windows that <i>freeglut</i>
  309. will create in the future.
  310. <p><b>Usage</b> </p>
  311. <p><tt>void glutInitWindowPosition ( int
  312. x, int y ) ;</tt> <br>
  313. <tt>void glutInitWindowSize ( int width,
  314. int height ) ;</tt> </p>
  315. <p><b>Description</b> </p>
  316. <p>The "<tt>glutInitWindowPosition</tt>
  317. " and "<tt>glutInitWindowSize</tt>" functions specify a desired position
  318. and size for windows that <i>freeglut</i> will create in the future.&nbsp;
  319. The position is measured in pixels from the upper left hand corner of the
  320. screen, with "x" increasing to the right and "y" increasing towards the bottom
  321. of the screen.&nbsp; The size is measured in pixels.&nbsp; <i>Freeglut</i>
  322. does not promise to follow these specifications in creating its windows,
  323. it certainly makes an attempt to. </p>
  324. <p>The position and size of a window are
  325. a matter of some subtlety.&nbsp; Most windows have a usable area surrounded
  326. by a border and with a title bar on the top.&nbsp; The border and title bar
  327. are commonly called "decorations."&nbsp; The position of the window unfortunately
  328. varies with the operating system.&nbsp; On Linux, it is the coordinates of
  329. the upper left-hand corner of its decorations.&nbsp; On Windows, it is the
  330. coordinates of the upper left hand corner of its usable interior.&nbsp; For
  331. both operating systems, the size of the window is the size of the usable interior.
  332. </p>
  333. <p>Windows has some additional quirks which
  334. the application programmer should know about.&nbsp; First, the minimum y-coordinate
  335. of a window decoration is zero.&nbsp; (This is a feature of <i>freeglut</i>
  336. and can be adjusted if so desired.)&nbsp; Second, there appears to be a
  337. minimum window width on Windows which is 104 pixels.&nbsp; The user may specify
  338. a smaller width, but the Windows system calls ignore it.&nbsp; It is also
  339. impossible to make a window narrower than this by dragging on its corner.
  340. </p>
  341. <p><b>Changes From GLUT</b> </p>
  342. <p>For some reason, GLUT is not affected
  343. by the 104-pixel minimum window width.&nbsp; If the user clicks on the corner
  344. of a window which is narrower than this amount, the window will immediately
  345. snap out to this width, but the application can call "<tt>glutReshapeWindow</tt>
  346. " and make a window narrower again. </p>
  347. <h2> 4.3&nbsp; glutInitDisplayMode</h2>
  348. <h2> 4.4&nbsp; glutInitDisplayString</h2>
  349. <h1> 5.0&nbsp;<a name="EventProcessing"></a>
  350. Event Processing Functions</h1>
  351. After an application has finished initializing its windows and menus, it
  352. enters an event loop.&nbsp; Within this loop, <i>freeglut</i> polls the
  353. data entry devices (keyboard, mouse, etc.) and calls the application's appropriate
  354. callbacks.
  355. <p>In GLUT, control never returned from
  356. the event loop (as invoked by the "<tt>glutMainLoop</tt>" function) to the
  357. calling function.&nbsp; This prevented an application from having re-entrant
  358. code, in which GLUT could be invoked from within a callback, and it prevented
  359. the application from doing any post-processing (such as freeing allocated
  360. memory) after GLUT had closed down.&nbsp; <i>Freeglut</i> allows the application
  361. programmer to specify more direct control over the event loop by means of
  362. two new functions.&nbsp; The first, "<tt>glutMainLoopEvent</tt>", processes
  363. a single iteration of the event loop and allows the application to use a different
  364. event loop controller or to contain re-entrant code.&nbsp; The second, "<tt>
  365. glutLeaveMainLoop</tt>", causes the event loop to exit nicely; this is preferable
  366. to the application's calling "<tt>exit</tt>" from within a GLUT callback.
  367. </p>
  368. <h2> 5.1&nbsp; glutMainLoop</h2>
  369. The "<tt>glutMainLoop</tt>" function enters the event loop.
  370. <p><b>Usage</b> </p>
  371. <p><tt>void glutMainLoop ( void ) ;</tt>
  372. </p>
  373. <p><b>Description</b> </p>
  374. <p>The&nbsp; "<tt>glutMainLoop</tt>" function
  375. causes the program to enter the window event loop.&nbsp; An application should
  376. call this function at most once.&nbsp; It will call any application callback
  377. functions as required to process mouse clicks, mouse motion, key presses,
  378. and so on. </p>
  379. <p><b>Changes From GLUT</b> </p>
  380. <p>In GLUT, there was absolutely no way
  381. for the application programmer to have control return from the "<tt>glutMainLoop</tt>
  382. " function to the calling function.&nbsp; <i>Freeglut</i> allows the programmer
  383. to force this by setting the "<tt>GLUT_ACTION_ON_WINDOW_CLOSE</tt>" option
  384. and invoking the "<tt>glutLeaveMainLoop</tt>" function from one of the callbacks.&nbsp;
  385. Stopping the program this way is preferable to simply calling "<tt>exit</tt>
  386. " from within a callback because this allows <i>freeglut</i> to free allocated
  387. memory and otherwise clean up after itself.&nbsp; (I know I just said this,
  388. but I think it is important enough that it bears repeating.) </p>
  389. <h2> 5.2&nbsp; glutMainLoopEvent</h2>
  390. The "<tt>glutMainLoopEvent</tt>" function processes a single iteration
  391. in the <i>freeglut</i> event loop.
  392. <p><b>Usage</b> </p>
  393. <p><tt>void glutMainLoopEvent ( void ) ;</tt>
  394. </p>
  395. <p><b>Description</b> </p>
  396. <p>The&nbsp; "<tt>glutMainLoopEvent</tt>
  397. " function causes <i>freeglut</i> to process one iteration's worth of events
  398. in its event loop.&nbsp; This allows the application to control its own event
  399. loop and still use the <i>freeglut</i> windowing system. </p>
  400. <p><b>Changes From GLUT</b> </p>
  401. <p>GLUT does not include this function.
  402. </p>
  403. <h2> 5.3&nbsp; glutLeaveMainLoop</h2>
  404. The "<tt>glutLeaveMainLoop</tt>" function causes <i>freeglut</i> to stop
  405. its event loop.
  406. <p><b>Usage</b> </p>
  407. <p><tt>void glutLeaveMainLoop ( void ) ;</tt>
  408. </p>
  409. <p><b>Description</b> </p>
  410. <p>The&nbsp; "<tt>glutLeaveMainLoop</tt>
  411. " function causes <i>freeglut</i> to stop the event loop.&nbsp; If the
  412. "<tt> GLUT_ACTION_ON_WINDOW_CLOSE</tt>" option has been set to "<tt>GLUT_ACTION_CONTINUE_EXECUTION</tt>
  413. ", control will return to the function which called "<tt>glutMainLoop</tt>
  414. "; otherwise the application will exit. </p>
  415. <p>If the application has two nested calls
  416. to "<tt>glutMainLoop</tt>" and calls "<tt>glutLeaveMainLoop</tt>", the behaviour
  417. of <i>freeglut</i> is undefined.&nbsp; It may leave only the inner nested
  418. loop or it may leave both loops.&nbsp; If the reader has a strong preference
  419. for one behaviour over the other he should contact the <i>freeglut</i> Programming
  420. Consortium and ask for the code to be fixed. </p>
  421. <p><b>Changes From GLUT</b> </p>
  422. <p>GLUT does not include this function.
  423. </p>
  424. <h1> 6.0&nbsp;<a name="Window"></a>
  425. Window Functions</h1>
  426. <h2> 6.1&nbsp; glutCreateWindow</h2>
  427. <h2> 6.2&nbsp; glutCreateSubwindow</h2>
  428. <h2> 6.3&nbsp; glutDestroyWindow</h2>
  429. <h2> 6.4&nbsp; glutSetWindow, glutGetWindow</h2>
  430. <h2> 6.5&nbsp; glutSetWindowTitle, glutSetIconTitle</h2>
  431. <h2> 6.6&nbsp; glutReshapeWindow</h2>
  432. <h2> 6.7&nbsp; glutPositionWindow</h2>
  433. <h2> 6.8&nbsp; glutShowWindow, glutHideWindow,
  434. glutIconifyWindow</h2>
  435. <h2> 6.9&nbsp; glutPushWindow, glutPopWindow</h2>
  436. <h2> 6.10&nbsp; glutFullScreen</h2>
  437. <h1> 7.0&nbsp;<a name="Display"></a>
  438. Display Functions</h1>
  439. <h2> 7.1&nbsp; glutPostRedisplay</h2>
  440. <h2> 7.2&nbsp; glutPostWindowRedisplay</h2>
  441. <h2> 7.3&nbsp; glutSwapBuffers</h2>
  442. <h1> 8.0&nbsp;<a name="MouseCursor"></a>
  443. Mouse Cursor Functions</h1>
  444. <h2> 8.1&nbsp; glutSetCursor</h2>
  445. <h2> 8.2&nbsp; glutWarpPointer</h2>
  446. <h1> 9.0&nbsp;<a name="Overlay"></a>
  447. Overlay Functions</h1>
  448. <i>Freeglut</i> does not allow overlays, although it does "answer the mail"
  449. with function stubs so that GLUT-based programs can compile and link against
  450. <i>freeglut</i> without modification.&nbsp;
  451. If the reader needs overlays, he should contact the <i>freeglut</i> Programming
  452. Consortium and ask for them to be implemented.&nbsp; He should also be prepared
  453. to assist in the implementation.
  454. <h2> 9.1&nbsp; glutEstablishOverlay</h2>
  455. The "<tt>glutEstablishOverlay</tt>" function is not implemented in <i>freeglut</i>
  456. .
  457. <p><b>Usage</b> </p>
  458. <p><tt>void glutEstablishOverlay ( void
  459. ) ;</tt> </p>
  460. <p><b>Description</b> </p>
  461. <p>The "<tt>glutEstablishOverlay</tt>" function
  462. is not implemented in <i>freeglut</i>. </p>
  463. <p><b>Changes From GLUT</b> </p>
  464. <p>GLUT implements this function. </p>
  465. <h2> 9.2&nbsp; glutRemoveOverlay</h2>
  466. The "<tt>glutRemoveOverlay</tt>" function is not implemented in <i>freeglut</i>
  467. .
  468. <p><b>Usage</b> </p>
  469. <p><tt>void glutRemoveOverlay ( void ) ;</tt>
  470. </p>
  471. <p><b>Description</b> </p>
  472. <p>The "<tt>glutRemoveOverlay</tt>" function
  473. is not implemented in <i>freeglut</i>. </p>
  474. <p><b>Changes From GLUT</b> </p>
  475. <p>GLUT implements this function. </p>
  476. <h2> 9.3&nbsp; glutUseLayer</h2>
  477. The "<tt>glutUseLayer</tt>" function is not implemented in <i>freeglut</i>
  478. .
  479. <p><b>Usage</b> </p>
  480. <p><tt>void glutUseLayer (&nbsp; GLenum
  481. layer ) ;</tt> </p>
  482. <p><b>Description</b> </p>
  483. <p>The "<tt>glutUseLayer</tt>" function
  484. is not implemented in <i>freeglut</i>. </p>
  485. <p><b>Changes From GLUT</b> </p>
  486. <p>GLUT implements this function. </p>
  487. <h2> 9.4&nbsp; glutPostOverlayRedisplay</h2>
  488. The "<tt>glutPostOverlayRedisplay</tt> " function is not implemented in
  489. <i> freeglut</i>.
  490. <p><b>Usage</b> </p>
  491. <p><tt>void glutPostOverlayRedisplay ( void
  492. ) ;</tt> </p>
  493. <p><b>Description</b> </p>
  494. <p>The "<tt>glutPostOverlayRedisplay</tt>
  495. " function is not implemented in <i>freeglut</i>. </p>
  496. <p><b>Changes From GLUT</b> </p>
  497. <p>GLUT implements this function. </p>
  498. <h2> 9.5&nbsp; glutPostWindowOverlayRedisplay</h2>
  499. The "<tt>glutPostWindowOverlayRedisplay</tt> " function is not implemented
  500. in <i>freeglut</i>.
  501. <p><b>Usage</b> </p>
  502. <p><tt>void glutPostWindowOverlayRedisplay
  503. ( int window ) ;</tt> </p>
  504. <p><b>Description</b> </p>
  505. <p>The "<tt>glutPostWindowOverlayRedisplay</tt>
  506. " function is not implemented in <i>freeglut</i>. </p>
  507. <p><b>Changes From GLUT</b> </p>
  508. <p>GLUT implements this function. </p>
  509. <h2> 9.6&nbsp; glutShowOverlay, glutHideOverlay</h2>
  510. The "<tt>glutShowOverlay</tt>" and "<tt>glutHideOverlay</tt>" functions
  511. are not implemented in <i>freeglut</i> .
  512. <p><b>Usage</b> </p>
  513. <p><tt>void glutShowOverlay( void ) ;</tt>
  514. <br>
  515. <tt>void glutHideOverlay( void ) ;</tt>
  516. </p>
  517. <p><b>Description</b> </p>
  518. <p>The "<tt>glutShowOverlay</tt>" and "<tt>
  519. glutHideOverlay</tt>" functions are not implemented in <i>freeglut</i> .
  520. </p>
  521. <p><b>Changes From GLUT</b> </p>
  522. <p>GLUT implements these functions. </p>
  523. <h1> 10.0&nbsp;<a name="Menu"></a>
  524. Menu Functions</h1>
  525. <h2> 10.1&nbsp; glutCreateMenu</h2>
  526. <h2> 10.2&nbsp; glutDestroyMenu</h2>
  527. <h2> 10.3&nbsp; glutGetMenu, glutSetMenu</h2>
  528. <h2> 10.4&nbsp; glutAddMenuEntry</h2>
  529. <h2> 10.5&nbsp; glutAddSubMenu</h2>
  530. <h2> 10.6&nbsp; glutChangeToMenuEntry</h2>
  531. <h2> 10.7&nbsp; glutChangeToSubMenu</h2>
  532. <h2> 10.8&nbsp; glutRemoveMenuItem</h2>
  533. <h2> 10.9&nbsp; glutAttachMenu, glutDetachMenu</h2>
  534. <h1> 11.0&nbsp;<a name="GlobalCallback"></a>
  535. Global Callback Registration Functions</h1>
  536. <h2> 11.1&nbsp; glutTimerFunc</h2>
  537. <h2> 11.2&nbsp; glutIdleFunc</h2>
  538. The "<tt>glutIdleFunc</tt>" function sets the global idle callback. <i>
  539. Freeglut</i> calls the idle callback when there are no inputs from the user.
  540. <p><b>Usage</b> </p>
  541. <p><tt>void glutIdleFunc ( void (*func)
  542. ( void ) ) ;</tt> </p>
  543. <p><tt>func&nbsp;&nbsp;&nbsp; </tt>The new
  544. global idle callback function </p>
  545. <p><b>Description</b> </p>
  546. <p>The&nbsp; "<tt>glutIdleFunc</tt>" function
  547. specifies the function that <i>freeglut</i> will call to perform background
  548. processing tasks such as continuous animation when window system events are
  549. not being received.&nbsp; If enabled, this function is called continuously
  550. from <i>freeglut</i> while no events are received.&nbsp; The callback function
  551. has no parameters and returns no value.&nbsp; <i>Freeglut</i> does not change
  552. the <i>current window</i> or the <i>current menu</i> before invoking the idle
  553. callback; programs with multiple windows or menus must explicitly set the
  554. <i>current window</i> and <i>current menu</i>
  555. and not rely on its current setting. <br>
  556. &nbsp;&nbsp;&nbsp; The amount of computation and rendering done in an idle
  557. callback should be minimized to avoid affecting the program's interactive
  558. response.&nbsp; In general, no more than a single frame of rendering should
  559. be done in a single invocation of an idle callback. <br>
  560. &nbsp;&nbsp;&nbsp; Calling "<tt>glutIdleFunc</tt>" with a NULL argument
  561. disables the call to an idle callback. </p>
  562. <p><b>Changes From GLUT</b> </p>
  563. <p>Application programmers should note that
  564. if they have specified the "continue execution" action on window closure,
  565. <i>freeglut</i> will continue to call the
  566. idle callback after the user has closed a window by clicking on the "x" in
  567. the window header bar.&nbsp; If the idle callback renders a particular window
  568. (this is considered bad form but is frequently done anyway), the programmer
  569. should supply a window closure callback for that window which changes or disables
  570. the idle callback. </p>
  571. <h1> 12.0&nbsp;<a name="WindowCallback"></a>
  572. Window-Specific Callback Registration Functions</h1>
  573. <h2> 12.1&nbsp; glutDisplayFunc</h2>
  574. <h2> 12.2&nbsp; glutOverlayDisplayFunc</h2>
  575. <h2> 12.3&nbsp; glutReshapeFunc</h2>
  576. <h2> 12.4&nbsp; glutCloseFunc</h2>
  577. <h2> 12.5&nbsp; glutKeyboardFunc</h2>
  578. <h2> 12.6&nbsp; glutSpecialFunc</h2>
  579. The "<tt>glutSpecialFunc</tt>" function sets the window's special key press
  580. callback. <i>Freeglut</i> calls the special key press callback when the
  581. user presses a special key.
  582. <p><b>Usage</b> </p>
  583. <p><tt>void glutSpecialFunc ( void (*func)
  584. ( int key, int x, int y ) ) ;</tt> </p>
  585. <p><tt>func&nbsp;&nbsp;&nbsp; </tt>The window's
  586. new special key press callback function <br>
  587. <tt>key&nbsp;&nbsp;&nbsp;&nbsp; </tt>The
  588. key whose press triggers the callback <br>
  589. <tt>x&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  590. </tt>The x-coordinate of the mouse relative
  591. to the window at the time the key is pressed <br>
  592. <tt>y&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  593. </tt>The y-coordinate of the mouse relative
  594. to the window at the time the key is pressed </p>
  595. <p><b>Description</b> </p>
  596. <p>The&nbsp; "<tt>glutSpecialFunc</tt>"
  597. function specifies the function that <i>freeglut</i> will call when the user
  598. presses a special key on the keyboard.&nbsp; The callback function has one
  599. argument:&nbsp; the name of the function to be invoked ("called back") at
  600. the time at which the special key is pressed.&nbsp; The function returns no
  601. value.&nbsp; <i>Freeglut</i> sets the <i>current window</i> to the window
  602. which is active when the callback is invoked.&nbsp; "Special keys" are the
  603. function keys, the arrow keys, the Page Up and Page Down keys, and the Insert
  604. key.&nbsp; The Delete key is considered to be a regular key. <br>
  605. &nbsp;&nbsp;&nbsp; Calling "<tt>glutSpecialUpFunc</tt>" with a NULL argument
  606. disables the call to the window's special key press callback. </p>
  607. <p>&nbsp;&nbsp;&nbsp; The "<tt>key</tt>
  608. " argument may take one of the following defined constant values: </p>
  609. <ul>
  610. <li> <tt>GLUT_KEY_F1, GLUT_KEY_F2, ..., GLUT_KEY_F12</tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  611. - F1 through F12 keys</li>
  612. <li> <tt>GLUT_KEY_PAGE_UP, GLUT_KEY_PAGE_DOWN</tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  613. - Page Up and Page Down keys</li>
  614. <li> <tt>GLUT_KEY_HOME, GLUT_KEY_END</tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  615. - Home and End keys</li>
  616. <li> <tt>GLUT_KEY_LEFT, GLUT_KEY_RIGHT, GLUT_KEY_UP, GLUT_KEY_DOWN</tt>
  617. - arrow keys</li>
  618. <li> <tt>GLUT_KEY_INSERT</tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  619. - Insert key</li>
  620. </ul>
  621. <b>Changes From GLUT</b>
  622. <p>None. </p>
  623. <h2> 12.7&nbsp; glutKeyboardUpFunc</h2>
  624. The "<tt>glutKeyboardUpFunc</tt>" function sets the window's key release
  625. callback. <i>Freeglut</i> calls the key release callback when the user releases
  626. a key.
  627. <p><b>Usage</b> </p>
  628. <p><tt>void glutKeyboardUpFunc ( void (*func)
  629. ( unsigned char key, int x, int y ) ) ;</tt> </p>
  630. <p><tt>func&nbsp;&nbsp;&nbsp; </tt>The window's
  631. new key release callback function <br>
  632. <tt>key&nbsp;&nbsp;&nbsp;&nbsp; </tt>The
  633. key whose release triggers the callback <br>
  634. <tt>x&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  635. </tt>The x-coordinate of the mouse relative
  636. to the window at the time the key is released <br>
  637. <tt>y&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  638. </tt>The y-coordinate of the mouse relative
  639. to the window at the time the key is released </p>
  640. <p><b>Description</b> </p>
  641. <p>The&nbsp; "<tt>glutKeyboardUpFunc</tt>
  642. " function specifies the function that <i>freeglut</i> will call when the
  643. user releases a key from the keyboard.&nbsp; The callback function has one
  644. argument:&nbsp; the name of the function to be invoked ("called back") at
  645. the time at which the key is released.&nbsp; The function returns no value.&nbsp;
  646. <i>Freeglut</i> sets the <i>current window</i>
  647. to the window which is active when the callback is invoked. <br>
  648. &nbsp;&nbsp;&nbsp; While <i>freeglut</i> checks for upper or lower case
  649. letters, it does not do so for non-alphabetical characters.&nbsp; Nor does
  650. it account for the Caps-Lock key being on.&nbsp; The operating system may
  651. send some unexpected characters to <i>freeglut</i>, such as "8" when the
  652. user is pressing the Shift key.&nbsp; <i>Freeglut</i> also invokes the callback
  653. when the user releases the Control, Alt, or Shift keys, among others.&nbsp;
  654. Releasing the Delete key causes this function to be invoked with a value
  655. of 127 for "<tt>key</tt>". <br>
  656. &nbsp;&nbsp;&nbsp; Calling "<tt>glutKeyboardUpFunc</tt>" with a NULL argument
  657. disables the call to the window's key release callback. </p>
  658. <p><b>Changes From GLUT</b> </p>
  659. <p>This function is not implemented in GLUT
  660. versions before Version 4.&nbsp; It has been designed to be as close to GLUT
  661. as possible.&nbsp; Users who find differences should contact the
  662. <i>freeglut</i>&nbsp;Programming Consortium to
  663. have them fixed. </p>
  664. <h2> 12.8&nbsp; glutSpecialUpFunc</h2>
  665. The "<tt>glutSpecialUpFunc</tt>" function sets the window's special key
  666. release callback. <i>Freeglut</i> calls the special key release callback
  667. when the user releases a special key.
  668. <p><b>Usage</b> </p>
  669. <p><tt>void glutSpecialUpFunc ( void (*func)
  670. ( int key, int x, int y ) ) ;</tt> </p>
  671. <p><tt>func&nbsp;&nbsp;&nbsp; </tt>The window's
  672. new special key release callback function <br>
  673. <tt>key&nbsp;&nbsp;&nbsp;&nbsp; </tt>The
  674. key whose release triggers the callback <br>
  675. <tt>x&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  676. </tt>The x-coordinate of the mouse relative
  677. to the window at the time the key is released <br>
  678. <tt>y&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  679. </tt>The y-coordinate of the mouse relative
  680. to the window at the time the key is released </p>
  681. <p><b>Description</b> </p>
  682. <p>The&nbsp; "<tt>glutSpecialUpFunc</tt>
  683. " function specifies the function that <i>freeglut</i> will call when the
  684. user releases a special key from the keyboard.&nbsp; The callback function
  685. has one argument:&nbsp; the name of the function to be invoked ("called back")
  686. at the time at which the special key is released.&nbsp; The function returns
  687. no value.&nbsp; <i>Freeglut</i> sets the <i>current window</i> to the window
  688. which is active when the callback is invoked.&nbsp; "Special keys" are the
  689. function keys, the arrow keys, the Page Up and Page Down keys, and the Insert
  690. key.&nbsp; The Delete key is considered to be a regular key. <br>
  691. &nbsp;&nbsp;&nbsp; Calling "<tt>glutSpecialUpFunc</tt>" with a NULL argument
  692. disables the call to the window's special key release callback. </p>
  693. <p>&nbsp;&nbsp;&nbsp; The "<tt>key</tt>
  694. " argument may take one of the following defined constant values: </p>
  695. <ul>
  696. <li> <tt>GLUT_KEY_F1, GLUT_KEY_F2, ..., GLUT_KEY_F12</tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  697. - F1 through F12 keys</li>
  698. <li> <tt>GLUT_KEY_PAGE_UP, GLUT_KEY_PAGE_DOWN</tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  699. - Page Up and Page Down keys</li>
  700. <li> <tt>GLUT_KEY_HOME, GLUT_KEY_END</tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  701. - Home and End keys</li>
  702. <li> <tt>GLUT_KEY_LEFT, GLUT_KEY_RIGHT, GLUT_KEY_UP, GLUT_KEY_DOWN</tt>
  703. - arrow keys</li>
  704. <li> <tt>GLUT_KEY_INSERT</tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  705. - Insert key</li>
  706. </ul>
  707. <b>Changes From GLUT</b>
  708. <p>This function is not implemented in GLUT
  709. versions before Version 4.&nbsp; It has been designed to be as close to GLUT
  710. as possible.&nbsp; Users who find differences should contact the
  711. <i>freeglut</i>&nbsp;Programming Consortium to
  712. have them fixed. </p>
  713. <h2> 12.9&nbsp; glutMouseFunc</h2>
  714. <h2> 12.10&nbsp; glutMotionFunc, glutPassiveMotionFunc</h2>
  715. <h2> 12.11&nbsp; glutVisibilityFunc</h2>
  716. <h2> 12.12&nbsp; glutEntryFunc</h2>
  717. <h2> 12.13&nbsp; glutJoystickFunc</h2>
  718. <h2> 12.14&nbsp; glutSpaceballMotionFunc</h2>
  719. The "<tt>glutSpaceballMotionFunc</tt>" function is not implemented in
  720. <i>freeglut</i>, although the library does
  721. "answer the mail" to the extent that a call to the function will not produce
  722. an error..
  723. <p><b>Usage</b></p>
  724. <p><tt>void glutSpaceballMotionFunc ( void
  725. (* callback)( int x, int y, int z )</tt><tt> ) ;</tt></p>
  726. <p><b>Description</b></p>
  727. <p>The "<tt>glutSpaceballMotionFunc</tt>
  728. " function is not implemented in <i>freeglut</i>. </p>
  729. <p><b>Changes From GLUT</b></p>
  730. <p>GLUT implements this function. </p>
  731. <h2> 12.15&nbsp; glutSpaceballRotateFunc</h2>
  732. The "<tt>glutSpaceballRotateFunc</tt>" function is not implemented in
  733. <i>freeglut</i>, although the library does
  734. "answer the mail" to the extent that a call to the function will not produce
  735. an error..
  736. <p><b>Usage</b></p>
  737. <p><tt>void glutSpaceballRotateFunc ( void
  738. (* callback)( int x, int y, int z )</tt><tt> ) ;</tt></p>
  739. <p><b>Description</b></p>
  740. <p>The "<tt>glutSpaceballRotateFunc</tt>
  741. " function is not implemented in <i>freeglut</i>. </p>
  742. <p><b>Changes From GLUT</b></p>
  743. <p>GLUT implements this function. </p>
  744. <h2> 12.16&nbsp; glutSpaceballButtonFunc</h2>
  745. The "<tt>glutSpaceballButtonFunc</tt>" function is not implemented in
  746. <i>freeglut</i>, although the library does
  747. "answer the mail" to the extent that a call to the function will not produce
  748. an error..
  749. <p><b>Usage</b></p>
  750. <p><tt>void glutSpaceballButtonFunc ( void
  751. (* callback)( int button, int updown )</tt><tt> ) ;</tt></p>
  752. <p><b>Description</b></p>
  753. <p>The "<tt>glutSpaceballButtonFunc</tt>
  754. " function is not implemented in <i>freeglut</i>. </p>
  755. <p><b>Changes From GLUT</b></p>
  756. <p>GLUT implements this function. </p>
  757. <h2> 12.17&nbsp; glutButtonBoxFunc</h2>
  758. The "<tt>glutSpaceballButtonBoxFunc</tt>" function is not implemented
  759. in <i>freeglut</i>, although the library does "answer the mail" to the extent
  760. that a call to the function will not produce an error..
  761. <p><b>Usage</b></p>
  762. <p><tt>void glutSpaceballButtonBoxFunc (
  763. void (* callback)( int button, int updown )</tt><tt> ) ;</tt></p>
  764. <p><b>Description</b></p>
  765. <p>The "<tt>glutSpaceballButtonBoxFunc</tt>
  766. " function is not implemented in <i>freeglut</i>. </p>
  767. <p><b>Changes From GLUT</b></p>
  768. <p>GLUT implements this function. </p>
  769. <h2> 12.18&nbsp; glutDialsFunc</h2>
  770. The "<tt>glutDialsFunc</tt>" function is not implemented in <i>freeglut</i>
  771. , although the library does "answer the mail" to the extent that a call
  772. to the function will not produce an error..
  773. <p><b>Usage</b></p>
  774. <p><tt>void glutDialsFunc ( void (* callback)(
  775. int dial, int value )</tt><tt> ) ;</tt></p>
  776. <p><b>Description</b></p>
  777. <p>The "<tt>glutDialsFunc</tt>" function
  778. is not implemented in <i>freeglut</i>. </p>
  779. <p><b>Changes From GLUT</b></p>
  780. <p>GLUT implements this function. </p>
  781. <h2> 12.19&nbsp; glutTabletMotionFunc</h2>
  782. The "<tt>glutTabletMotionFunc</tt>" function is not implemented in <i>
  783. freeglut</i>, although the library does "answer the mail" to the extent
  784. that a call to the function will not produce an error..
  785. <p><b>Usage</b></p>
  786. <p><tt>void glutTabletMotionFunc ( void
  787. (* callback)( int x, int y )</tt><tt> ) ;</tt></p>
  788. <p><b>Description</b></p>
  789. <p>The "<tt>glutTabletMotionFunc</tt>" function
  790. is not implemented in <i>freeglut</i>. </p>
  791. <p><b>Changes From GLUT</b></p>
  792. <p>GLUT implements this function. </p>
  793. <h2> 12.20&nbsp; glutTabletButtonFunc</h2>
  794. The "<tt>glutTabletButtonFunc</tt>" function is not implemented in <i>
  795. freeglut</i>, although the library does "answer the mail" to the extent
  796. that a call to the function will not produce an error..
  797. <p><b>Usage</b></p>
  798. <p><tt>void glutTabletButtonFunc ( void
  799. (* callback)( int button, int updown, int x, int y )</tt><tt> ) ;</tt></p>
  800. <p><b>Description</b></p>
  801. <p>The "<tt>glutTabletButtonFunc</tt>" function
  802. is not implemented in <i>freeglut</i>. </p>
  803. <p><b>Changes From GLUT</b></p>
  804. <p>GLUT implements this function. </p>
  805. <h2> 12.21&nbsp; glutMenuStatusFunc</h2>
  806. <h2> 12.22&nbsp; glutWindowStatusFunc</h2>
  807. <h1> 13.0&nbsp;<a name="StateSetting"></a>
  808. State Setting and Retrieval Functions</h1>
  809. <h2> 13.1&nbsp; glutSetOption</h2>
  810. <h2> 13.2&nbsp; glutGet</h2>
  811. <p>
  812. The following state variables may be queried with "<tt>glutGet</tt>".
  813. The returned value is an integer.
  814. </p>
  815. <p>
  816. These queries are with respect to the current window:
  817. </p>
  818. <ul>
  819. <li>GLUT_WINDOW_X - window X position
  820. <li>GLUT_WINDOW_Y - window Y position
  821. <li>GLUT_WINDOW_WIDTH - window width
  822. <li>GLUT_WINDOW_HEIGHT - window height
  823. <li>GLUT_WINDOW_BUFFER_SIZE - number of color or color index bits per pixel
  824. <li>GLUT_WINDOW_STENCIL_SIZE - number of bits per stencil value
  825. <li>GLUT_WINDOW_DEPTH_SIZE - number of bits per depth value
  826. <li>GLUT_WINDOW_RED_SIZE - number of bits per red value
  827. <li>GLUT_WINDOW_GREEN_SIZE - number of bits per green value
  828. <li>GLUT_WINDOW_BLUE_SIZE - number of bits per blue value
  829. <li>GLUT_WINDOW_ALPHA_SIZE - number of bits per alpha value
  830. <li>GLUT_WINDOW_ACCUM_RED_SIZE - number of red bits in the accumulation buffer
  831. <li>GLUT_WINDOW_ACCUM_GREEN_SIZE - number of green bits in the accumulation buffer
  832. <li>GLUT_WINDOW_ACCUM_BLUE_SIZE - number of blue bits in the accumulation buffer
  833. <li>GLUT_WINDOW_ACCUM_ALPHA_SIZE - number of alpha bits in the accumulation buffer
  834. <li>GLUT_WINDOW_DOUBLEBUFFER - 1 if the color buffer is double buffered, 0 otherwise
  835. <li>GLUT_WINDOW_RGBA - 1 if the color buffers are RGB[A], 0 for color index
  836. <li>GLUT_WINDOW_PARENT - parent window ID
  837. <li>GLUT_WINDOW_NUM_CHILDREN - number of child windows
  838. <li>GLUT_WINDOW_COLORMAP_SIZE - number of entries in the window's colormap
  839. <li>GLUT_WINDOW_NUM_SAMPLES - number of samples per pixel if using multisampling
  840. <li>GLUT_WINDOW_STEREO - 1 if the window supports stereo, 0 otherwise
  841. <li>GLUT_WINDOW_CURSOR - current cursor
  842. <li>GLUT_WINDOW_FORMAT_ID - on Windows, return the pixel format number of the current window
  843. </ul>
  844. <p>
  845. These queries do not depend on the current window.
  846. </p>
  847. <ul>
  848. <li>GLUT_SCREEN_WIDTH - width of the screen in pixels
  849. <li>GLUT_SCREEN_HEIGHT - height of the screen in pixels
  850. <li>GLUT_SCREEN_WIDTH_MM - width of the screen in millimeters
  851. <li>GLUT_SCREEN_HEIGHT_MM - height of the screen in millimeters
  852. <li>GLUT_MENU_NUM_ITEMS - number of items in the current menu
  853. <li>GLUT_DISPLAY_MODE_POSSIBLE - return 1 if the current display mode is supported, 0 otherwise
  854. <li>GLUT_INIT_WINDOW_X - X position last set by glutInitWindowPosition
  855. <li>GLUT_INIT_WINDOW_Y - Y position last set by glutInitWindowPosition
  856. <li>GLUT_INIT_WINDOW_WIDTH - width last set by glutInitWindowSize
  857. <li>GLUT_INIT_WINDOW_HEIGHT - height last set by glutInitWindowSize
  858. <li>GLUT_INIT_DISPLAY_MODE - display mode last set by glutInitDisplayMode
  859. <li>GLUT_ELAPSED_TIME - time (in milliseconds) elapsed since glutInit or glutGet(GLUT_ELAPSED_TIME) was first called
  860. <li>GLUT_INIT_STATE - ?
  861. <li>GLUT_VERSION - Return value will be X*10000+Y*100+Z where X is the
  862. major version, Y is the minor version and Z is the patch level.
  863. This query is only supported in <i>freeglut</i> (version 2.0.0 or later).
  864. </ul>
  865. <h2> 13.3&nbsp; glutDeviceGet</h2>
  866. <h2> 13.4&nbsp; glutGetModifiers</h2>
  867. <h2> 13.5&nbsp; glutLayerGet</h2>
  868. <h2> 13.6&nbsp; glutExtensionSupported</h2>
  869. <h2> 13.7&nbsp; glutGetProcAddress</h2>
  870. <p><tt>glutGetProcAddress</tt> returns
  871. a pointer to a named GL or <i>freeglut</i> function. </p>
  872. <p><b>Usage</b></p>
  873. <p><tt>void *glutGetProcAddress ( const
  874. char *procName ) ;</tt></p>
  875. <p><tt>procName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  876. </tt>Name of an OpenGL or GLUT function.
  877. </p>
  878. <p><b>Description</b></p>
  879. <p><tt>glutGetProcAddress</tt> is useful
  880. for dealing with OpenGL extensions. If an application calls OpenGL extension
  881. functions directly, that application will only link/run with an OpenGL library
  882. that supports the extension. By using a function pointer returned from glutGetProcAddress(),
  883. the application will avoid this hard dependency and be more portable and interoperate
  884. better with various implementations of OpenGL. </p>
  885. <p> Both OpenGL functions and <i>freeglut</i>
  886. functions can be queried with this function. </p>
  887. <p><b>Changes From GLUT</b> </p>
  888. <p>GLUT does not include this function.
  889. </p>
  890. <h1> 14.0&nbsp;<a name="FontRendering"></a>
  891. Font Rendering Functions</h1>
  892. <i>Freeglut</i> supports two types of font rendering:&nbsp; bitmap fonts,
  893. which are rendered using the "<tt>glBitmap</tt>" function call, and stroke
  894. fonts, which are rendered as sequences of OpenGL line segments.&nbsp; Because
  895. they are rendered as bitmaps, the bitmap fonts tend to render more quickly
  896. than stroke fonts, but they are less flexible in terms of scaling and rendering.&nbsp;
  897. Bitmap font characters are positioned with calls to the "<tt>glRasterPos*</tt>
  898. " functions while stroke font characters use the OpenGL transformations
  899. to position characters.
  900. <p>&nbsp;&nbsp;&nbsp; It should be noted
  901. that <i>freeglut</i> fonts are similar but not identical to GLUT fonts.&nbsp;
  902. At the moment, <i>freeglut</i> fonts do not support the "`" (backquote) and
  903. "|" (vertical line) characters; in their place it renders asterisks. </p>
  904. <p>&nbsp;&nbsp;&nbsp; <i>Freeglut</i> supports
  905. the following bitmap fonts: </p>
  906. <ul>
  907. <li> <tt>GLUT_BITMAP_8_BY_13</tt> - A variable-width font with every character
  908. fitting in a rectangle of 13 pixels high by at most 8 pixels wide.</li>
  909. <li> <tt>GLUT_BITMAP_9_BY_15</tt> - A variable-width font with every character
  910. fitting in a rectangle of 15 pixels high by at most 9 pixels wide.</li>
  911. <li> <tt>GLUT_BITMAP_TIMES_ROMAN_10</tt> - A 10-point variable-width Times
  912. Roman font.</li>
  913. <li> <tt>GLUT_BITMAP_TIMES_ROMAN_24</tt> - A 24-point variable-width Times
  914. Roman font.</li>
  915. <li> <tt>GLUT_BITMAP_HELVETICA_10</tt> - A 10-point variable-width Helvetica
  916. font.</li>
  917. <li> <tt>GLUT_BITMAP_HELVETICA_12</tt> - A 12-point variable-width Helvetica
  918. font.</li>
  919. <li> <tt>GLUT_BITMAP_HELVETICA_18</tt> - A 18-point variable-width Helvetica
  920. font.</li>
  921. </ul>
  922. <i>Freeglut</i> calls "<tt>glRasterPos4v</tt>" to advance the cursor by
  923. the width of a character and to render carriage returns when appropriate.&nbsp;
  924. It does not use any display lists in it rendering in bitmap fonts.
  925. <p>&nbsp;&nbsp;&nbsp; <i>Freeglut</i> supports
  926. the following stroke fonts: </p>
  927. <ul>
  928. <li> <tt>GLUT_STROKE_ROMAN</tt> - A proportionally-spaced Roman Simplex
  929. font</li>
  930. <li> <tt>GLUT_STROKE_MONO_ROMAN</tt> - A fixed-width Roman Simplex font</li>
  931. </ul>
  932. <i>Freeglut</i> does not use any display lists in its rendering of stroke
  933. fonts.&nbsp; It calls "<tt>glTranslatef</tt>" to advance the cursor by the
  934. width of a character and to render carriage returns when appropriate.
  935. <h2> 14.1&nbsp; glutBitmapCharacter</h2>
  936. The "<tt>glutBitmapCharacter</tt>" function renders a single bitmapped
  937. character in the <i>current window</i> using the specified font.
  938. <p><b>Usage</b> </p>
  939. <p><tt>void glutBitmapCharacter ( void *font,
  940. int character ) ;</tt> </p>
  941. <p><tt>font&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  942. </tt>The bitmapped font to use in rendering
  943. the character <br>
  944. <tt>character&nbsp;&nbsp; </tt>The ASCII
  945. code of the character to be rendered </p>
  946. <p><b>Description</b> </p>
  947. <p>The&nbsp; "<tt>glutBitmapCharacter</tt>
  948. " function renders the given character in the specified bitmap font.&nbsp;
  949. <i>Freeglut</i> automatically sets the necessary
  950. pixel unpack storage modes and restores the existing modes when it has finished.&nbsp;
  951. Before the first call to "<tt>glutBitMapCharacter</tt> " the application
  952. program should call "<tt>glRasterPos*</tt>" to set the position of the character
  953. in the window.&nbsp; The "<tt>glutBitmapCharacter</tt> " function advances
  954. the cursor position as part of its call to "<tt>glBitmap</tt> " and so the
  955. application does not need to call "<tt>glRasterPos*</tt>" again for successive
  956. characters on the same line. </p>
  957. <p><b>Changes From GLUT</b> </p>
  958. <p>Nonexistent characters are rendered as
  959. asterisks.&nbsp; The rendering position in <i>freeglut</i> is apparently off
  960. from GLUT's position by a few pixels vertically and one or two pixels horizontally.
  961. </p>
  962. <h2> 14.2&nbsp; glutBitmapString</h2>
  963. The "<tt>glutBitmapString</tt>" function renders a string of bitmapped
  964. characters in the <i>current window</i> using the specified font.
  965. <p><b>Usage</b> </p>
  966. <p><tt>void glutBitmapString ( void *font,
  967. char *string ) ;</tt> </p>
  968. <p><tt>font&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  969. </tt>The bitmapped font to use in rendering
  970. the character string <br>
  971. <tt>string&nbsp;&nbsp;&nbsp; </tt>String
  972. of characters to be rendered </p>
  973. <p><b>Description</b> </p>
  974. <p>The&nbsp; "<tt>glutBitmapString</tt>
  975. " function renders the given character string in the specified bitmap font.&nbsp;
  976. <i>Freeglut</i> automatically sets the necessary
  977. pixel unpack storage modes and restores the existing modes when it has finished.&nbsp;
  978. Before calling "<tt>glutBitMapString</tt>" the application program should
  979. call "<tt>glRasterPos*</tt>" to set the position of the string in the window.&nbsp;
  980. The "<tt>glutBitmapString</tt>" function handles carriage returns.&nbsp;
  981. Nonexistent characters are rendered as asterisks. </p>
  982. <p><b>Changes From GLUT</b> </p>
  983. <p>GLUT does not include this function.
  984. </p>
  985. <h2> 14.3&nbsp; glutBitmapWidth</h2>
  986. The "<tt>glutBitmapWidth</tt>" function returns the width in pixels of
  987. a single bitmapped character in the specified font.
  988. <p><b>Usage</b> </p>
  989. <p><tt>int glutBitmapWidth ( void *font,
  990. int character ) ;</tt> </p>
  991. <p><tt>font&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  992. </tt>The bitmapped font to use in calculating
  993. the character width <br>
  994. <tt>character&nbsp;&nbsp; </tt>The ASCII
  995. code of the character </p>
  996. <p><b>Description</b> </p>
  997. <p>The&nbsp; "<tt>glutBitmapWidth</tt>"
  998. function returns the width of the given character in the specified bitmap
  999. font.&nbsp; Because the font is bitmapped, the width is an exact integer.
  1000. </p>
  1001. <p><b>Changes From GLUT</b> </p>
  1002. <p>Nonexistent characters return the width
  1003. of an asterisk. </p>
  1004. <h2> 14.4&nbsp; glutBitmapLength</h2>
  1005. The "<tt>glutBitmapLength</tt>" function returns the width in pixels of
  1006. a string of bitmapped characters in the specified font.
  1007. <p><b>Usage</b> </p>
  1008. <p><tt>int glutBitmapLength ( void *font,
  1009. char *string ) ;</tt> </p>
  1010. <p><tt>font&nbsp;&nbsp;&nbsp; </tt>The bitmapped
  1011. font to use in calculating the character width <br>
  1012. <tt>string&nbsp; </tt>String of characters
  1013. whose width is to be calculated </p>
  1014. <p><b>Description</b> </p>
  1015. <p>The&nbsp; "<tt>glutBitmapLength</tt>
  1016. " function returns the width in pixels of the given character string in
  1017. the specified bitmap font.&nbsp; Because the font is bitmapped, the width
  1018. is an exact integer:&nbsp; the return value is identical to the sum of the
  1019. character widths returned by a series of calls to "<tt>glutBitmapWidth</tt>
  1020. ".&nbsp; The width of nonexistent characters is counted to be the width of
  1021. an asterisk. </p>
  1022. <p>&nbsp;&nbsp;&nbsp; If the string contains
  1023. one or more carriage returns, <i>freeglut</i> calculates the widths in pixels
  1024. of the lines separately and returns the largest width. </p>
  1025. <p><b>Changes From GLUT</b> </p>
  1026. <p>GLUT does not include this function.
  1027. </p>
  1028. <h2> 14.5&nbsp; glutBitmapHeight</h2>
  1029. The "<tt>glutBitmapHeight</tt>" function returns the height in pixels of
  1030. the specified font.
  1031. <p><b>Usage</b> </p>
  1032. <p><tt>int glutBitmapHeight ( void *font
  1033. ) ;</tt> </p>
  1034. <p><tt>font&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1035. </tt>The bitmapped font to use in calculating
  1036. the character height </p>
  1037. <p><b>Description</b> </p>
  1038. <p>The&nbsp; "<tt>glutBitmapHeight</tt>
  1039. " function returns the height of a character in the specified bitmap font.&nbsp;
  1040. Because the font is bitmapped, the height is an exact integer.&nbsp; The fonts
  1041. are designed such that all characters have (nominally) the same height.
  1042. </p>
  1043. <p><b>Changes From GLUT</b> </p>
  1044. <p>GLUT does not include this function.
  1045. </p>
  1046. <h2> 14.6&nbsp; glutStrokeCharacter</h2>
  1047. The "<tt>glutStrokeCharacter</tt>" function renders a single stroke character
  1048. in the <i>current window</i> using the specified font.
  1049. <p><b>Usage</b> </p>
  1050. <p><tt>void glutStrokeCharacter ( void *font,
  1051. int character ) ;</tt> </p>
  1052. <p><tt>font&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1053. </tt>The stroke font to use in rendering
  1054. the character <br>
  1055. <tt>character&nbsp;&nbsp; </tt>The ASCII
  1056. code of the character to be rendered </p>
  1057. <p><b>Description</b> </p>
  1058. <p>The&nbsp; "<tt>glutStrokeCharacter</tt>
  1059. " function renders the given character in the specified stroke font.&nbsp;
  1060. Before the first call to "<tt>glutStrokeCharacter</tt>" the application program
  1061. should call the OpenGL transformation (positioning and scaling) functions
  1062. to set the position of the character in the window.&nbsp; The "<tt>glutStrokeCharacter</tt>
  1063. " function advances the cursor position by a call to "<tt>glTranslatef</tt>
  1064. " and so the application does not need to call the OpenGL positioning functions
  1065. again for successive characters on the same line. </p>
  1066. <p><b>Changes From GLUT</b> </p>
  1067. <p>Nonexistent characters are rendered as
  1068. asterisks. </p>
  1069. <h2> 14.7&nbsp; glutStrokeString</h2>
  1070. The "<tt>glutStrokeString</tt>" function renders a string of characters
  1071. in the <i>current window</i> using the specified stroke font.
  1072. <p><b>Usage</b> </p>
  1073. <p><tt>void glutStrokeString ( void *font,
  1074. char *string ) ;</tt> </p>
  1075. <p><tt>font&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1076. </tt>The stroke font to use in rendering
  1077. the character string <br>
  1078. <tt>string&nbsp;&nbsp;&nbsp; </tt>String
  1079. of characters to be rendered </p>
  1080. <p><b>Description</b> </p>
  1081. <p>The&nbsp; "<tt>glutStrokeString</tt>
  1082. " function renders the given character string in the specified stroke font.&nbsp;
  1083. Before calling "<tt>glutStrokeString</tt>" the application program should
  1084. call the OpenGL transformation (positioning and scaling) functions to set
  1085. the position of the string in the window.&nbsp; The "<tt>glutStrokeString</tt>
  1086. " function handles carriage returns.&nbsp; Nonexistent characters are rendered
  1087. as asterisks. </p>
  1088. <p><b>Changes From GLUT</b> </p>
  1089. <p>GLUT does not include this function.
  1090. </p>
  1091. <h2> 14.8&nbsp; glutStrokeWidth</h2>
  1092. The "<tt>glutStrokeWidth</tt>" function returns the width in pixels of
  1093. a single character in the specified stroke font.
  1094. <p><b>Usage</b> </p>
  1095. <p><tt>int glutStrokeWidth ( void *font,
  1096. int character ) ;</tt> </p>
  1097. <p><tt>font&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1098. </tt>The stroke font to use in calculating
  1099. the character width <br>
  1100. <tt>character&nbsp;&nbsp; </tt>The ASCII
  1101. code of the character </p>
  1102. <p><b>Description</b> </p>
  1103. <p>The&nbsp; "<tt>glutStrokeWidth</tt>"
  1104. function returns the width of the given character in the specified stroke
  1105. font.&nbsp; Because the font is a stroke font, the width is actually a floating-point
  1106. number; the function rounds it to the nearest integer for the return value.
  1107. </p>
  1108. <p><b>Changes From GLUT</b> </p>
  1109. <p>Nonexistent characters return the width
  1110. of an asterisk. </p>
  1111. <h2> 14.9&nbsp; glutStrokeLength</h2>
  1112. The "<tt>glutStrokeLength</tt>" function returns the width in pixels of
  1113. a string of characters in the specified stroke font.
  1114. <p><b>Usage</b> </p>
  1115. <p><tt>int glutStrokeLength ( void *font,
  1116. char *string ) ;</tt> </p>
  1117. <p><tt>font&nbsp;&nbsp;&nbsp; </tt>The stroke
  1118. font to use in calculating the character width <br>
  1119. <tt>string&nbsp; </tt>String of characters
  1120. whose width is to be calculated </p>
  1121. <p><b>Description</b> </p>
  1122. <p>The&nbsp; "<tt>glutStrokeLength</tt>
  1123. " function returns the width in pixels of the given character string in
  1124. the specified stroke font.&nbsp; Because the font is a stroke font, the width
  1125. of an individual character is a floating-point number.&nbsp; <i>Freeglut</i>
  1126. adds the floating-point widths and rounds the funal result to return the
  1127. integer value.&nbsp; Thus the return value may differ from the sum of the
  1128. character widths returned by a series of calls to "<tt>glutStrokeWidth</tt>
  1129. ".&nbsp; The width of nonexistent characters is counted to be the width
  1130. of an asterisk. </p>
  1131. <p>&nbsp;&nbsp;&nbsp; If the string contains
  1132. one or more carriage returns, <i>freeglut</i> calculates the widths in pixels
  1133. of the lines separately and returns the largest width. </p>
  1134. <p><b>Changes From GLUT</b> </p>
  1135. <p>GLUT does not include this function.
  1136. </p>
  1137. <h2> 14.10&nbsp; glutStrokeHeight</h2>
  1138. The "<tt>glutStrokeHeight</tt>" function returns the height in pixels of
  1139. the specified font.
  1140. <p><b>Usage</b> </p>
  1141. <p><tt>GLfloat glutStrokeHeight ( void *font
  1142. ) ;</tt> </p>
  1143. <p><tt>font&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1144. </tt>The stroke font to use in calculating
  1145. the character height </p>
  1146. <p><b>Description</b> </p>
  1147. <p>The&nbsp; "<tt>glutStrokeHeight</tt>
  1148. " function returns the height of a character in the specified stroke font.&nbsp;
  1149. The application programmer should note that, unlike the other <i>freeglut</i>
  1150. font functions, this one returns a floating-point number.&nbsp; The fonts
  1151. are designed such that all characters have (nominally) the same height. </p>
  1152. <p><b>Changes From GLUT</b> </p>
  1153. <p>GLUT does not include this function.
  1154. </p>
  1155. <h1> 15.0&nbsp;<a name="GeometricObject"></a>
  1156. Geometric Object Rendering Functions</h1>
  1157. <i>Freeglut</i> includes eighteen routines for generating easily-recognizable
  1158. 3-d geometric objects.&nbsp; These routines are effectively the same ones
  1159. that are included in the GLUT library, and reflect the functionality available
  1160. in the <i>aux</i> toolkit described in the <i>OpenGL Programmer's Guide</i>
  1161. .&nbsp; They are included to allow programmers to create with a single
  1162. line of code a three-dimensional object which can be used to test a variety
  1163. of OpenGL functionality.&nbsp; None of the routines generates a display list
  1164. for the object which it draws.&nbsp; The functions generate normals appropriate
  1165. for lighting but, except for the teapon functions, do not generate texture
  1166. coordinates.
  1167. <h2> 15.1&nbsp; glutWireSphere, glutSolidSphere</h2>
  1168. The "<tt>glutWireSphere</tt>" and "<tt>glutSolidSphere</tt>" functions
  1169. draw a wireframe and solid sphere respectively.
  1170. <p><b>Usage</b> </p>
  1171. <p><tt>void glutWireSphere ( GLdouble dRadius,
  1172. GLint slices, GLint stacks ) ;</tt> </p>
  1173. <p><tt>void glutSolidSphere ( GLdouble dRadius,
  1174. GLint slices, GLint stacks ) ;</tt> </p>
  1175. <p><tt>dRadius&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1176. </tt>The desired radius of the sphere </p>
  1177. <p><tt>slices&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1178. </tt>The desired number of slices (divisions
  1179. in the longitudinal direction) in the sphere </p>
  1180. <p><tt>stacks&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1181. </tt>The desired number of stacks (divisions
  1182. in the latitudinal direction) in the sphere.&nbsp; The number of points in
  1183. this direction, including the north and south poles, is <tt>stacks+1</tt>
  1184. </p>
  1185. <p><b>Description</b> </p>
  1186. <p>The "<tt>glutWireSphere</tt>" and "<tt>
  1187. glutSolidSphere</tt>" functions render a sphere centered at the origin
  1188. of the modeling coordinate system.&nbsp; The north and south poles of the
  1189. sphere are on the positive and negative Z-axes respectively and the prime
  1190. meridian crosses the positive X-axis. </p>
  1191. <p><b>Changes From GLUT</b> </p>
  1192. <p>None that we know of. </p>
  1193. <h2> 15.2&nbsp; glutWireTorus, glutSolidTorus</h2>
  1194. The "<tt>glutWireTorus</tt>" and "<tt>glutSolidTorus</tt>" functions draw
  1195. a wireframe and solid torus (donut shape) respectively.
  1196. <p><b>Usage</b> </p>
  1197. <p><tt>void glutWireTorus ( GLdouble dInnerRadius,
  1198. GLdouble dOuterRadius, GLint nSides, GLint nRings ) ;</tt> </p>
  1199. <p><tt>void glutSolidTorus ( GLdouble dInnerRadius,
  1200. GLdouble dOuterRadius, GLint nSides, GLint nRings ) ;</tt> </p>
  1201. <p><tt>dInnerRadius&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1202. </tt>The desired inner radius of the torus,
  1203. from the origin to the circle defining the centers of the outer circles </p>
  1204. <p><tt>dOuterRadius&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1205. </tt>The desired outer radius of the torus,
  1206. from the center of the outer circle to the actual surface of the torus </p>
  1207. <p><tt>nSides&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1208. </tt>The desired number of segments in a
  1209. single outer circle of the torus </p>
  1210. <p><tt>nRings&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1211. </tt>The desired number of outer circles
  1212. around the origin of the torus </p>
  1213. <p><b>Description</b> </p>
  1214. <p>The "<tt>glutWireTorus</tt>" and "<tt>
  1215. glutSolidTorus</tt>" functions render a torus centered at the origin of
  1216. the modeling coordinate system.&nbsp; The torus is circularly symmetric about
  1217. the Z-axis and starts at the positive X-axis. </p>
  1218. <p><b>Changes From GLUT</b> </p>
  1219. <p>None that we know of. </p>
  1220. <h2> 15.3&nbsp; glutWireCone, glutSolidCone</h2>
  1221. The "<tt>glutWireCone</tt>" and "<tt>glutSolidCone</tt>" functions draw
  1222. a wireframe and solid cone respectively.
  1223. <p><b>Usage</b> </p>
  1224. <p><tt>void glutWireCone ( GLdouble base,
  1225. GLdouble height, GLint slices, GLint stacks ) ;</tt> </p>
  1226. <p><tt>void glutSolidCone ( GLdouble base,
  1227. GLdouble height, GLint slices, GLint stacks ) ;</tt> </p>
  1228. <p><tt>base&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1229. </tt>The desired radius of the base of the
  1230. cone </p>
  1231. <p><tt>height&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1232. </tt>The desired height of the cone </p>
  1233. <p><tt>slices&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1234. </tt>The desired number of slices around
  1235. the base of the cone </p>
  1236. <p><tt>stacks&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1237. </tt>The desired number of segments between
  1238. the base and the tip of the cone (the number of points, including the tip,
  1239. is <tt>stacks + 1</tt>) </p>
  1240. <p><b>Description</b> </p>
  1241. <p>The "<tt>glutWireCone</tt>" and "<tt>
  1242. glutSolidCone</tt>" functions render a right circular cone with a base
  1243. centered at the origin and in the X-Y plane and its tip on the positive Z-axis.&nbsp;
  1244. The wire cone is rendered with triangular elements. </p>
  1245. <p><b>Changes From GLUT</b> </p>
  1246. <p>None that we know of. </p>
  1247. <h2> 15.4&nbsp; glutWireCube, glutSolidCube</h2>
  1248. The "<tt>glutWireCube</tt>" and "<tt>glutSolidCube</tt>" functions draw
  1249. a wireframe and solid cube respectively.
  1250. <p><b>Usage</b> </p>
  1251. <p><tt>void glutWireCube ( GLdouble dSize
  1252. ) ;</tt> </p>
  1253. <p><tt>void glutSolidCube ( GLdouble dSize
  1254. ) ;</tt> </p>
  1255. <p><tt>dSize&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1256. </tt>The desired length of an edge of the
  1257. cube </p>
  1258. <p><b>Description</b> </p>
  1259. <p>The "<tt>glutWireCube</tt>" and "<tt>
  1260. glutSolidCube</tt>" functions render a cube of the desired size, centered
  1261. at the origin.&nbsp; Its faces are normal to the coordinate directions. </p>
  1262. <p><b>Changes From GLUT</b> </p>
  1263. <p>None that we know of. </p>
  1264. <h2> 15.5&nbsp; glutWireTetrahedron, glutSolidTetrahedron</h2>
  1265. The "<tt>glutWireTetrahedron</tt>" and "<tt>glutSolidTetrahedron</tt>"
  1266. functions draw a wireframe and solid tetrahedron (four-sided Platonic solid)
  1267. respectively.
  1268. <p><b>Usage</b> </p>
  1269. <p><tt>void glutWireTetrahedron ( void )
  1270. ;</tt> </p>
  1271. <p><tt>void glutSolidTetrahedron ( void
  1272. ) ;</tt> </p>
  1273. <p><b>Description</b> </p>
  1274. <p>The "<tt>glutWireTetrahedron</tt>" and
  1275. "<tt>glutSolidTetrahedron</tt>" functions render a tetrahedron whose corners
  1276. are each a distance of one from the origin.&nbsp; The length of each side
  1277. is 2/3 sqrt(6).&nbsp; One corner is on the positive X-axis and another is
  1278. in the X-Y plane with a positive Y-coordinate. </p>
  1279. <p><b>Changes From GLUT</b> </p>
  1280. <p>None that we know of. </p>
  1281. <h2> 15.6&nbsp; glutWireOctahedron, glutSolidOctahedron</h2>
  1282. The "<tt>glutWireOctahedron</tt>" and "<tt>glutSolidOctahedron</tt>" functions
  1283. draw a wireframe and solid octahedron (eight-sided Platonic solid) respectively.
  1284. <p><b>Usage</b> </p>
  1285. <p><tt>void glutWireOctahedron ( void )
  1286. ;</tt> </p>
  1287. <p><tt>void glutSolidOctahedron ( void )
  1288. ;</tt> </p>
  1289. <p><b>Description</b> </p>
  1290. <p>The "<tt>glutWireOctahedron</tt>" and
  1291. "<tt>glutSolidOctahedron</tt>" functions render an octahedron whose corners
  1292. are each a distance of one from the origin.&nbsp; The length of each side
  1293. is sqrt(2).&nbsp; The corners are on the positive and negative coordinate
  1294. axes. </p>
  1295. <p><b>Changes From GLUT</b> </p>
  1296. <p>None that we know of. </p>
  1297. <h2> 15.7&nbsp; glutWireDodecahedron, glutSolidDodecahedron</h2>
  1298. The "<tt>glutWireDodecahedron</tt>" and "<tt>glutSolidDodecahedron</tt>
  1299. " functions draw a wireframe and solid dodecahedron (twelve-sided Platonic
  1300. solid) respectively.
  1301. <p><b>Usage</b> </p>
  1302. <p><tt>void glutWireDodecahedron ( void
  1303. ) ;</tt> </p>
  1304. <p><tt>void glutSolidDodecahedron ( void
  1305. ) ;</tt> </p>
  1306. <p><b>Description</b> </p>
  1307. <p>The "<tt>glutWireDodecahedron</tt>" and
  1308. "<tt>glutSolidDodecahedron</tt>" functions render a dodecahedron whose corners
  1309. are each a distance of sqrt(3) from the origin.&nbsp; The length of each
  1310. side is sqrt(5)-1.&nbsp; There are twenty corners; interestingly enough,
  1311. eight of them coincide with the corners of a cube with sizes of length 2.
  1312. </p>
  1313. <p><b>Changes From GLUT</b> </p>
  1314. <p>None that we know of. </p>
  1315. <h2> 15.8&nbsp; glutWireIcosahedron, glutSolidIcosahedron</h2>
  1316. The "<tt>glutWireIcosahedron</tt>" and "<tt>glutSolidIcosahedron</tt>"
  1317. functions draw a wireframe and solid icosahedron (twenty-sided Platonic solid)
  1318. respectively.
  1319. <p><b>Usage</b> </p>
  1320. <p><tt>void glutWireIcosahedron ( void )
  1321. ;</tt> </p>
  1322. <p><tt>void glutSolidIcosahedron ( void
  1323. ) ;</tt> </p>
  1324. <p><b>Description</b> </p>
  1325. <p>The "<tt>glutWireIcosahedron</tt>" and
  1326. "<tt>glutSolidIcosahedron</tt>" functions render an icosahedron whose corners
  1327. are each a unit distance from the origin.&nbsp; The length of each side is
  1328. slightly greater than one.&nbsp; Two of the corners lie on the positive and
  1329. negative X-axes. </p>
  1330. <p><b>Changes From GLUT</b> </p>
  1331. <p>None that we know of. </p>
  1332. <h2> 15.7&nbsp; glutWireRhombicDodecahedron,
  1333. glutSolidRhombicDodecahedron</h2>
  1334. The "<tt>glutWireRhombicDodecahedron</tt>" and "<tt>glutSolidRhombicDodecahedron</tt>
  1335. " functions draw a wireframe and solid rhombic dodecahedron (twelve-sided
  1336. semi-regular solid) respectively.
  1337. <p><b>Usage</b> </p>
  1338. <p><tt>void glutWireRhombicDodecahedron
  1339. ( void ) ;</tt> </p>
  1340. <p><tt>void glutSolidRhombicDodecahedron
  1341. ( void ) ;</tt> </p>
  1342. <p><b>Description</b> </p>
  1343. <p>The "<tt>glutWireRhombicDodecahedron</tt>
  1344. " and "<tt>glutSolidRhombicDodecahedron</tt>" functions render a rhombic
  1345. dodecahedron whose corners are at most a distance of one from the origin.&nbsp;
  1346. The rhombic dodecahedron has faces which are identical rhombuses (rhombi?)
  1347. but which have some vertices at which three faces meet and some vertices at
  1348. which four faces meet.&nbsp; The length of each side is sqrt(3)/2.&nbsp; Vertices
  1349. at which four faces meet are found at (0, 0, <u>+</u>1) and (<u> +</u>sqrt(2)/2,
  1350. <u>+</u>sqrt(2)/2, 0). </p>
  1351. <p><b>Changes From GLUT</b> </p>
  1352. <p>GLUT does not include these functions.
  1353. </p>
  1354. <h2> 15.10&nbsp; glutWireTeapot, glutSolidTeapot</h2>
  1355. The "<tt>glutWireTeapot</tt>" and "<tt>glutSolidTeapot</tt>" functions
  1356. draw a wireframe and solid teapot respectively.
  1357. <p><b>Usage</b> </p>
  1358. <p><tt>void glutWireTeapot ( GLdouble dSize
  1359. ) ;</tt> </p>
  1360. <p><tt>void glutSolidTeapot ( GLdouble dSize
  1361. ) ;</tt> </p>
  1362. <p><tt>dSize&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  1363. </tt>The desired size of the teapot </p>
  1364. <p><b>Description</b> </p>
  1365. <p>The "<tt>glutWireTeapot</tt>" and "<tt>
  1366. glutSolidTeapot</tt>" functions render a teapot of the desired size, centered
  1367. at the origin.&nbsp; This is the famous OpenGL teapot [add reference]. </p>
  1368. <p><b>Changes From GLUT</b> </p>
  1369. <p>None that we know of. </p>
  1370. <h1> 16.0&nbsp;<a name="GameMode"></a>
  1371. Game Mode Functions</h1>
  1372. <h2> 16.1&nbsp; glutGameModeString</h2>
  1373. <h2> 16.2&nbsp; glutEnterGameMode, glutLeaveGameMode</h2>
  1374. <h2> 16.3&nbsp; glutGameModeGet</h2>
  1375. <h1> 17.0&nbsp;<a name="VideoResize"></a>
  1376. Video Resize Functions</h1>
  1377. <h2> 17.1&nbsp; glutVideoResizeGet</h2>
  1378. <h2> 17.2&nbsp; glutSetupVideoResizing,
  1379. glutStopVideoResizing</h2>
  1380. <h2> 17.3&nbsp; glutVideoResize</h2>
  1381. <h2> 17.4&nbsp; glutVideoPan</h2>
  1382. <h1> 18.0&nbsp;<a name="ColorMap"></a>
  1383. Color Map Functions</h1>
  1384. <h2> 18.1&nbsp; glutSetColor, glutGetColor</h2>
  1385. <h2> 18.2&nbsp; glutCopyColormap</h2>
  1386. <h1> 19.0&nbsp;<a name="Miscellaneous"></a>
  1387. Miscellaneous Functions</h1>
  1388. <h2> 19.1&nbsp; glutIgnoreKeyRepeat, glutSetKeyRepeat</h2>
  1389. <h2> 19.2&nbsp; glutForceJoystickFunc</h2>
  1390. <h2> 19.3&nbsp; glutReportErrors</h2>
  1391. <h1> 20.0&nbsp;<a name="UsageNotes"></a>
  1392. Usage Notes</h1>
  1393. <p> The following environment variables
  1394. are recognized by <i>freeglut</i>: </p>
  1395. <ul>
  1396. <li>DISPLAY - specifies a display name.<br>
  1397. </li>
  1398. <li>GLUT_FPS - specifies a time interval
  1399. (in milliseconds) for reporting framerate messages to stderr. For example,
  1400. if FREEGLUT_FPS is set to 5000, every 5 seconds a message will be printed
  1401. to stderr showing the current frame rate. The frame rate is measured by counting
  1402. the number of times glutSwapBuffers() is called over the time interval.</li>
  1403. <li>GLUT_ICON - specifies the icon that
  1404. goes in the upper left-hand corner of the <i>freeglut</i><i> </i>windows </li>
  1405. </ul>
  1406. <h1> 21.0&nbsp;<a name="ImplementationNotes"></a>
  1407. Implementation Notes</h1>
  1408. <h1> 22.0&nbsp;<a name="GLUT_State"></a>
  1409. GLUT State</h1>
  1410. <h1> 23.0&nbsp;<a name="Freeglut.h_Header"></a>
  1411. "freeglut.h" Header File</h1>
  1412. <p>
  1413. Application programmers who are porting their GLUT programs to <i>freeglut</i> may continue
  1414. to include <tt>&lt;GL/glut.h&gt;</tt> in their programs.
  1415. Programs which use the <i>freeglut</i>-specific extensions to GLUT should include
  1416. <tt>&lt;GL/freeglut.h&gt;</tt>. One possible arrangement is as follows:
  1417. </p>
  1418. <pre>
  1419. #ifdef FREEGLUT
  1420. #include &lt;GL/freeglut_ext.h&gt;
  1421. #else
  1422. #include &lt;GL/glut.h&gt;
  1423. #endif
  1424. </pre>
  1425. <p>
  1426. Compile-time <i>freeglut</i> version testing can be done as follows:
  1427. </p>
  1428. <pre>
  1429. #ifdef FREEGLUT_VERSION_2_0
  1430. code specific to freeglut 2.0 or later here
  1431. #endif
  1432. </pre>
  1433. <p>
  1434. In future releases, FREEGLUT_VERSION_2_1, FREEGLUT_VERSION_2_2, etc will
  1435. be defined. This scheme mimics OpenGL conventions.
  1436. </p>
  1437. <p>
  1438. The <i>freeglut</i> version can be queried at runtime by calling
  1439. glutGet(GLUT_VERSION).
  1440. The result will be X*10000+Y*100+Z where X is the major version, Y is the
  1441. minor version and Z is the patch level.
  1442. </p>
  1443. <p>
  1444. This may be used as follows:
  1445. </p>
  1446. <pre>
  1447. if (glutGet(GLUT_VERSION) < 20001) {
  1448. printf("Sorry, you need freeglut version 2.0.1 or later to run this program.\n");
  1449. exit(1);
  1450. }
  1451. </pre>
  1452. <h1> 24.0&nbsp;<a name="References"></a>
  1453. References</h1>
  1454. <h1> 25.0&nbsp;<a name="Index"></a>
  1455. Index</h1>
  1456. &nbsp;
  1457. <p>&nbsp; <br>
  1458. &nbsp; <br>
  1459. &nbsp; <br>
  1460. &nbsp; <br>
  1461. &nbsp; <br>
  1462. &nbsp; <br>
  1463. &nbsp; <br>
  1464. &nbsp; <br>
  1465. &nbsp; <br>
  1466. &nbsp; <br>
  1467. &nbsp; <br>
  1468. &nbsp; <br>
  1469. &nbsp; <br>
  1470. &nbsp; <br>
  1471. &nbsp; <br>
  1472. &nbsp; <br>
  1473. &nbsp; <br>
  1474. &nbsp; <br>
  1475. &nbsp; <br>
  1476. &nbsp; <br>
  1477. &nbsp; <br>
  1478. &nbsp; <br>
  1479. &nbsp; </p>
  1480. </body>
  1481. </html>