gl_w32s.tem 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  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_SL;
  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. {$MACRO ON}
  44. {$IFDEF Win32}
  45. {$DEFINE ogl_dll := external 'opengl32.dll'}
  46. uses Windows;
  47. {$ELSE}
  48. {$MESSAGE Unsupported platform.}
  49. {$ENDIF}
  50. // =======================================================
  51. // Unit specific extensions
  52. // =======================================================
  53. // none - no special init required
  54. // =======================================================
  55. // GL consts, types and functions
  56. // =======================================================
  57. // -------------------------------------------------------
  58. // GL types
  59. // -------------------------------------------------------
  60. type
  61. PSingle = ^Single;
  62. PDouble = ^Double;
  63. GLvoid = Pointer;
  64. GLboolean = Byte;
  65. GLbyte = ShortInt; // 1-byte signed
  66. GLshort = Integer; // 2-byte signed
  67. GLint = LongInt; // 4-byte signed
  68. GLubyte = Byte; // 1-byte unsigned
  69. GLushort = Word; // 2-byte unsigned
  70. GLuint = DWord; // 4-byte signed
  71. GLsizei = LongInt; // 4-byte signed
  72. GLfloat = Single; // single precision float
  73. GLclampf = Single; // single precision float in [0,1]
  74. GLdouble = Double; // double precision float
  75. GLclampd = Double; // double precision float in [0,1]
  76. GLenum = DWord;
  77. PGLBoolean = ^GLBoolean;
  78. PGLFloat = ^GLfloat;
  79. PGLDouble = ^GLDouble;
  80. type
  81. GLbitfield = DWord; { was an enum - no corresponding thing in pascal }
  82. const
  83. GL_CURRENT_BIT = $00000001;
  84. GL_POINT_BIT = $00000002;
  85. GL_LINE_BIT = $00000004;
  86. GL_POLYGON_BIT = $00000008;
  87. GL_POLYGON_STIPPLE_BIT= $00000010;
  88. GL_PIXEL_MODE_BIT = $00000020;
  89. GL_LIGHTING_BIT = $00000040;
  90. GL_FOG_BIT = $00000080;
  91. GL_DEPTH_BUFFER_BIT = $00000100;
  92. GL_ACCUM_BUFFER_BIT = $00000200;
  93. GL_STENCIL_BUFFER_BIT = $00000400;
  94. GL_VIEWPORT_BIT = $00000800;
  95. GL_TRANSFORM_BIT = $00001000;
  96. GL_ENABLE_BIT = $00002000;
  97. GL_COLOR_BUFFER_BIT = $00004000;
  98. GL_HINT_BIT = $00008000;
  99. GL_EVAL_BIT = $00010000;
  100. GL_LIST_BIT = $00020000;
  101. GL_TEXTURE_BIT = $00040000;
  102. GL_SCISSOR_BIT = $00080000;
  103. GL_ALL_ATTRIB_BITS = $000fffff;
  104. // -------------------------------------------------------
  105. // GL constants
  106. // -------------------------------------------------------
  107. {$IFDEF GL1_0}
  108. %GLDeclsIF10
  109. {$ENDIF GL1_0}
  110. {$IFDEF GL1_1}
  111. %GLDeclsIF11
  112. {$ENDIF GL1_1}
  113. {$IFDEF GL1_2}
  114. %GLDeclsIF12
  115. {$ENDIF GL1_2}
  116. const
  117. // Utility
  118. GL_VENDOR = $1F00;
  119. GL_RENDERER = $1F01;
  120. GL_VERSION = $1F02;
  121. GL_EXTENSIONS = $1F03;
  122. // Errors
  123. GL_INVALID_VALUE = $0501;
  124. GL_INVALID_ENUM = $0500;
  125. GL_INVALID_OPERATION = $0502;
  126. GL_STACK_OVERFLOW = $0503;
  127. GL_STACK_UNDERFLOW = $0504;
  128. GL_OUT_OF_MEMORY = $0505;
  129. // -------------------------------------------------------
  130. // GL extensions constants
  131. // -------------------------------------------------------
  132. {$IFDEF EXTENSIONS}
  133. %GLDeclsIF10Ext
  134. {$ENDIF EXTENSIONS}
  135. {$IFDEF SGI_EXTENSIONS}
  136. %GLDeclsIF10SGI
  137. {$ENDIF SGI_EXTENSIONS}
  138. {$IFDEF MESA}
  139. %GLDeclsIF10Mesa
  140. {$ENDIF MESA}
  141. // -------------------------------------------------------
  142. // GL procedures and functions
  143. // -------------------------------------------------------
  144. {$IFDEF GL1_0}
  145. %GLProcsPS10
  146. {$ENDIF GL1_0}
  147. {$IFDEF GL1_1}
  148. %GLProcsPS11
  149. {$ENDIF GL1_1}
  150. {$IFDEF GL1_2}
  151. %GLProcsPS12
  152. {$ENDIF GL1_2}
  153. // -------------------------------------------------------
  154. // GL Extensions
  155. // -------------------------------------------------------
  156. {$IFDEF EXTENSIONS}
  157. %GLProcsPS10Ext
  158. {$ENDIF EXTENSIONS}
  159. // library dependent extensions
  160. {$IFDEF SGI_EXTENSIONS}
  161. %GLProcsPS10SGI
  162. {$ENDIF SGI_EXTENSIONS}
  163. {$ifdef MESA}
  164. %GLProcsPS10Mesa
  165. {$endif MESA}
  166. // =======================================================
  167. // =======================================================
  168. implementation
  169. {BEGIN}{OF INIT}
  170. END.