gl_w32s.tem 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. {
  2. Translation of the Mesa GL headers for FreePascal
  3. Copyright (C) 1999 Sebastian Guenther
  4. Template for static linking in Win32 environment by Alexander Stohr.
  5. Original copyright notice:
  6. Mesa 3-D graphics library
  7. Version: 3.0
  8. Copyright (C) 1995-1998 Brian Paul
  9. This library is free software; you can redistribute it and/or
  10. modify it under the terms of the GNU Library General Public
  11. License as published by the Free Software Foundation; either
  12. version 2 of the License, or (at your option) any later version.
  13. This library is distributed in the hope that it will be useful,
  14. but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. Library General Public License for more details.
  17. You should have received a copy of the GNU Library General Public
  18. License along with this library; if not, write to the Free
  19. Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. }
  21. {
  22. You have to enable Macros (compiler switch "-Sm") for compiling this unit!
  23. This is necessary for supporting different platforms with different calling
  24. conventions via a single unit.
  25. }
  26. unit GL;
  27. interface
  28. {$DEFINE GL1_0}
  29. {x$DEFINE GL1_1}
  30. {x$DEFINE GL1_2}
  31. {x$DEFINE MESA} {enable if you want to use some special mesa extensions}
  32. {x$DEFINE EXTENSIONS} {enable if you need one/all of extensions}
  33. {x$DEFINE SGI_EXTENSIONS} {enable if you need one/all of extensions}
  34. {
  35. *** Note: ***
  36. There is currently one importants side effect when doing static linking.
  37. If you include a function statically than its required to be present
  38. in the supplied DLLs of your OS and Hardware.
  39. This means if the DLL is not present your program will not run.
  40. In Win95 it appears that you will be informined you about
  41. the name of the first missing symbol while loading the executable.
  42. }
  43. {$IFDEF Win32}
  44. {$DEFINE ogl_dll := external 'opengl32.dll'}
  45. uses Windows;
  46. {$ELSE}
  47. {$MESSAGE Unsupported platform.}
  48. {$ENDIF}
  49. // =======================================================
  50. // Unit specific extensions
  51. // =======================================================
  52. // none - no special init required
  53. // =======================================================
  54. // GL consts, types and functions
  55. // =======================================================
  56. // -------------------------------------------------------
  57. // GL types
  58. // -------------------------------------------------------
  59. type
  60. PSingle = ^Single;
  61. PDouble = ^Double;
  62. GLvoid = Pointer;
  63. GLboolean = Byte;
  64. GLbyte = ShortInt; // 1-byte signed
  65. GLshort = Integer; // 2-byte signed
  66. GLint = LongInt; // 4-byte signed
  67. GLubyte = Byte; // 1-byte unsigned
  68. GLushort = Word; // 2-byte unsigned
  69. GLuint = DWord; // 4-byte signed
  70. GLsizei = LongInt; // 4-byte signed
  71. GLfloat = Single; // single precision float
  72. GLclampf = Single; // single precision float in [0,1]
  73. GLdouble = Double; // double precision float
  74. GLclampd = Double; // double precision float in [0,1]
  75. GLenum = DWord;
  76. type
  77. GLbitfield = DWord; { was an enum - no corresponding thing in pascal }
  78. const
  79. GL_CURRENT_BIT = $00000001;
  80. GL_POINT_BIT = $00000002;
  81. GL_LINE_BIT = $00000004;
  82. GL_POLYGON_BIT = $00000008;
  83. GL_POLYGON_STIPPLE_BIT= $00000010;
  84. GL_PIXEL_MODE_BIT = $00000020;
  85. GL_LIGHTING_BIT = $00000040;
  86. GL_FOG_BIT = $00000080;
  87. GL_DEPTH_BUFFER_BIT = $00000100;
  88. GL_ACCUM_BUFFER_BIT = $00000200;
  89. GL_STENCIL_BUFFER_BIT = $00000400;
  90. GL_VIEWPORT_BIT = $00000800;
  91. GL_TRANSFORM_BIT = $00001000;
  92. GL_ENABLE_BIT = $00002000;
  93. GL_COLOR_BUFFER_BIT = $00004000;
  94. GL_HINT_BIT = $00008000;
  95. GL_EVAL_BIT = $00010000;
  96. GL_LIST_BIT = $00020000;
  97. GL_TEXTURE_BIT = $00040000;
  98. GL_SCISSOR_BIT = $00080000;
  99. GL_ALL_ATTRIB_BITS = $000fffff;
  100. // -------------------------------------------------------
  101. // GL constants
  102. // -------------------------------------------------------
  103. {$IFDEF GL1_0}
  104. %GLDeclsIF10
  105. {$ENDIF GL1_0}
  106. {$IFDEF GL1_1}
  107. %GLDeclsIF11
  108. {$ENDIF GL1_1}
  109. {$IFDEF GL1_2}
  110. %GLDeclsIF12
  111. {$ENDIF GL1_2}
  112. const
  113. // Utility
  114. GL_VENDOR = $1F00;
  115. GL_RENDERER = $1F01;
  116. GL_VERSION = $1F02;
  117. GL_EXTENSIONS = $1F03;
  118. // Errors
  119. GL_INVALID_VALUE = $0501;
  120. GL_INVALID_ENUM = $0500;
  121. GL_INVALID_OPERATION = $0502;
  122. GL_STACK_OVERFLOW = $0503;
  123. GL_STACK_UNDERFLOW = $0504;
  124. GL_OUT_OF_MEMORY = $0505;
  125. // -------------------------------------------------------
  126. // GL extensions constants
  127. // -------------------------------------------------------
  128. {$IFDEF EXTENSIONS}
  129. %GLDeclsIF10Ext
  130. {$ENDIF EXTENSIONS}
  131. {$IFDEF SGI_EXTENSIONS}
  132. %GLDeclsIF10SGI
  133. {$ENDIF SGI_EXTENSIONS}
  134. {$IFDEF MESA}
  135. %GLDeclsIF10Mesa
  136. {$ENDIF MESA}
  137. // -------------------------------------------------------
  138. // GL procedures and functions
  139. // -------------------------------------------------------
  140. {$IFDEF GL1_0}
  141. %GLProcsPS10
  142. {$ENDIF GL1_0}
  143. {$IFDEF GL1_1}
  144. %GLProcsPS11
  145. {$ENDIF GL1_1}
  146. {$IFDEF GL1_2}
  147. %GLProcsPS12
  148. {$ENDIF GL1_2}
  149. // -------------------------------------------------------
  150. // GL Extensions
  151. // -------------------------------------------------------
  152. {$IFDEF EXTENSIONS}
  153. %GLProcsPS10Ext
  154. {$ENDIF EXTENSIONS}
  155. // library dependent extensions
  156. {$IFDEF SGI_EXTENSIONS}
  157. %GLProcsPS10SGI
  158. {$ENDIF SGI_EXTENSIONS}
  159. {$ifdef MESA}
  160. %GLProcsPS10Mesa
  161. {$endif MESA}
  162. // =======================================================
  163. // =======================================================
  164. implementation
  165. {BEGIN}{OF INIT}
  166. END.