gl.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648
  1. /*
  2. * Copyright (c) 2021, Jesse Buhagiar <jooster669@gmail.com>
  3. * Copyright (c) 2021, Stephan Unverwerth <s.unverwerth@serenityos.org>
  4. * Copyright (c) 2021-2024, Jelle Raaijmakers <jelle@gmta.nl>
  5. *
  6. * SPDX-License-Identifier: BSD-2-Clause
  7. */
  8. #pragma once
  9. #include <LibGL/GL/glapi.h>
  10. #include <LibGL/GL/glplatform.h>
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. #define GL_VERSION_1_0 1
  15. #define GL_VERSION_1_1 1
  16. #define GL_VERSION_1_2 1
  17. #define GL_VERSION_1_3 1
  18. #define GL_VERSION_1_4 1
  19. #define GL_VERSION_1_5 1
  20. #define GL_ES_VERSION_2_0 1
  21. // OpenGL related `defines`
  22. #define GL_TRUE 1
  23. #define GL_FALSE 0
  24. #define GL_NONE 0
  25. // Matrix Modes
  26. #define GL_MODELVIEW 0x1700
  27. #define GL_PROJECTION 0x1701
  28. #define GL_TEXTURE 0x1702
  29. // glBegin/glEnd primitive types
  30. #define GL_POINTS 0x0000
  31. #define GL_LINES 0x0001
  32. #define GL_LINE_LOOP 0x0002
  33. #define GL_LINE_STRIP 0x0003
  34. #define GL_TRIANGLES 0x0004
  35. #define GL_TRIANGLE_STRIP 0x0005
  36. #define GL_TRIANGLE_FAN 0x0006
  37. #define GL_QUADS 0x0007
  38. #define GL_QUAD_STRIP 0x0008
  39. #define GL_POLYGON 0x0009
  40. // Depth buffer and alpha test compare functions
  41. #define GL_NEVER 0x0200
  42. #define GL_LESS 0x0201
  43. #define GL_EQUAL 0x0202
  44. #define GL_LEQUAL 0x0203
  45. #define GL_GREATER 0x0204
  46. #define GL_NOTEQUAL 0x0205
  47. #define GL_GEQUAL 0x0206
  48. #define GL_ALWAYS 0x0207
  49. // Buffer bits
  50. #define GL_DEPTH_BUFFER_BIT 0x00000100
  51. #define GL_STENCIL_BUFFER_BIT 0x00000400
  52. #define GL_COLOR_BUFFER_BIT 0x00004000
  53. // Enable capabilities
  54. #define GL_LINE_SMOOTH 0x0B20
  55. #define GL_POLYGON_MODE 0x0B40
  56. #define GL_POLYGON_SMOOTH 0x0B41
  57. #define GL_POLYGON_STIPPLE 0x0B42
  58. #define GL_EDGE_FLAG 0x0B43
  59. #define GL_CULL_FACE 0x0B44
  60. #define GL_FOG 0x0B60
  61. #define GL_DEPTH_TEST 0x0B71
  62. #define GL_STENCIL_TEST 0x0B90
  63. #define GL_DITHER 0x0BD0
  64. #define GL_POLYGON_OFFSET_FILL 0x8037
  65. // Alpha testing
  66. #define GL_ALPHA_TEST 0x0BC0
  67. #define GL_ALPHA_TEST_REF 0x0BC2
  68. #define GL_ALPHA_TEST_FUNC 0x0BC1
  69. // Alpha blending
  70. #define GL_BLEND 0x0BE2
  71. #define GL_BLEND_SRC_ALPHA 0x80CB
  72. #define GL_BLEND_SRC_ALPHA_EXT 0x80CB
  73. #define GL_BLEND_DST_ALPHA 0x80CA
  74. #define GL_BLEND_DST_ALPHA_EXT 0x80CA
  75. // Attribute bit flags
  76. #define GL_CURRENT_BIT 0x00000001
  77. #define GL_POINT_BIT 0x00000002
  78. #define GL_LINE_BIT 0x00000004
  79. #define GL_POLYGON_BIT 0x00000008
  80. #define GL_POLYGON_STIPPLE_BIT 0x00000010
  81. #define GL_PIXEL_MODE_BIT 0x00000020
  82. #define GL_LIGHTING_BIT 0x00000040
  83. #define GL_FOG_BIT 0x00000080
  84. #define GL_DEPTH_BUFFER_BIT 0x00000100
  85. #define GL_ACCUM_BUFFER_BIT 0x00000200
  86. #define GL_STENCIL_BUFFER_BIT 0x00000400
  87. #define GL_VIEWPORT_BIT 0x00000800
  88. #define GL_TRANSFORM_BIT 0x00001000
  89. #define GL_ENABLE_BIT 0x00002000
  90. #define GL_COLOR_BUFFER_BIT 0x00004000
  91. #define GL_HINT_BIT 0x00008000
  92. #define GL_EVAL_BIT 0x00010000
  93. #define GL_LIST_BIT 0x00020000
  94. #define GL_TEXTURE_BIT 0x00020000
  95. #define GL_SCISSOR_BIT 0x00080000
  96. #define GL_MULTISAMPLE_BIT 0x20000000
  97. #define GL_ALL_ATTRIB_BITS 0xFFFFFFFF
  98. // Utility
  99. #define GL_VENDOR 0x1F00
  100. #define GL_RENDERER 0x1F01
  101. #define GL_VERSION 0x1F02
  102. #define GL_EXTENSIONS 0x1F03
  103. #define GL_SHADING_LANGUAGE_VERSION 0x8B8C
  104. // Get parameters
  105. #define GL_CURRENT_COLOR 0x0B00
  106. #define GL_COLOR_MATERIAL_FACE 0x0B55
  107. #define GL_COLOR_MATERIAL_MODE 0x0B56
  108. #define GL_COLOR_MATERIAL 0x0B57
  109. #define GL_FOG_START 0x0B63
  110. #define GL_FOG_END 0x0B64
  111. #define GL_DEPTH_CLEAR_VALUE 0x0B73
  112. #define GL_STENCIL_CLEAR_VALUE 0x0B91
  113. #define GL_MATRIX_MODE 0x0BA0
  114. #define GL_NORMALIZE 0x0BA1
  115. #define GL_VIEWPORT 0x0BA2
  116. #define GL_BLEND_DST 0x0BE0
  117. #define GL_BLEND_SRC 0x0BE1
  118. #define GL_COLOR_CLEAR_VALUE 0x0C22
  119. #define GL_DOUBLEBUFFER 0x0C32
  120. #define GL_TEXTURE_GEN_S 0x0C60
  121. #define GL_TEXTURE_GEN_T 0x0C61
  122. #define GL_TEXTURE_GEN_R 0x0C62
  123. #define GL_TEXTURE_GEN_Q 0x0C63
  124. #define GL_MAX_TEXTURE_SIZE 0x0D33
  125. #define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36
  126. #define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38
  127. #define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39
  128. #define GL_RED_BITS 0x0D52
  129. #define GL_GREEN_BITS 0x0D53
  130. #define GL_BLUE_BITS 0x0D54
  131. #define GL_ALPHA_BITS 0x0D55
  132. #define GL_DEPTH_BITS 0x0D56
  133. #define GL_STENCIL_BITS 0x0D57
  134. #define GL_ACTIVE_TEXTURE 0x84E0
  135. #define GL_CLIENT_ACTIVE_TEXTURE 0x84E1
  136. #define GL_MAX_TEXTURE_UNITS 0x84E2
  137. #define GL_MAX_LIGHTS 0x0D31
  138. #define GL_AUTO_NORMAL 0x0D80
  139. #define GL_MAP1_COLOR_4 0x0D90
  140. #define GL_MAP1_INDEX 0x0D91
  141. #define GL_MAP1_NORMAL 0x0D92
  142. #define GL_MAP1_TEXTURE_COORD_1 0x0D93
  143. #define GL_MAP1_TEXTURE_COORD_2 0x0D94
  144. #define GL_MAP1_TEXTURE_COORD_3 0x0D95
  145. #define GL_MAP1_TEXTURE_COORD_4 0x0D96
  146. #define GL_MAP1_VERTEX_3 0x0D97
  147. #define GL_MAP1_VERTEX_4 0x0D98
  148. #define GL_MAP2_COLOR_4 0x0DB0
  149. #define GL_MAP2_INDEX 0x0DB1
  150. #define GL_MAP2_NORMAL 0x0DB2
  151. #define GL_MAP2_TEXTURE_COORD_1 0x0DB3
  152. #define GL_MAP2_TEXTURE_COORD_2 0x0DB4
  153. #define GL_MAP2_TEXTURE_COORD_3 0x0DB5
  154. #define GL_MAP2_TEXTURE_COORD_4 0x0DB6
  155. #define GL_MAP2_VERTEX_3 0x0DB7
  156. #define GL_MAP2_VERTEX_4 0x0DB8
  157. #define GL_NORMAL_ARRAY 0x8075
  158. #define GL_NORMAL_ARRAY_TYPE 0x807E
  159. #define GL_SAMPLE_BUFFERS 0x80A8
  160. #define GL_SAMPLES 0x80A9
  161. #define GL_MAX_TEXTURE_LOD_BIAS 0x84FD
  162. // Blend factors
  163. #define GL_ZERO 0
  164. #define GL_ONE 1
  165. #define GL_SRC_COLOR 0x0300
  166. #define GL_ONE_MINUS_SRC_COLOR 0x0301
  167. #define GL_SRC_ALPHA 0x0302
  168. #define GL_ONE_MINUS_SRC_ALPHA 0x0303
  169. #define GL_DST_ALPHA 0x0304
  170. #define GL_ONE_MINUS_DST_ALPHA 0x0305
  171. #define GL_DST_COLOR 0x0306
  172. #define GL_ONE_MINUS_DST_COLOR 0x0307
  173. #define GL_SRC_ALPHA_SATURATE 0x0308
  174. // Sides
  175. #define GL_FRONT_LEFT 0x0400
  176. #define GL_FRONT_RIGHT 0x0401
  177. #define GL_BACK_LEFT 0x0402
  178. #define GL_BACK_RIGHT 0x0403
  179. #define GL_FRONT 0x0404
  180. #define GL_BACK 0x0405
  181. #define GL_LEFT 0x0406
  182. #define GL_RIGHT 0x0407
  183. #define GL_FRONT_AND_BACK 0x0408
  184. // Error codes
  185. #define GL_NO_ERROR 0
  186. #define GL_INVALID_ENUM 0x0500
  187. #define GL_INVALID_VALUE 0x0501
  188. #define GL_INVALID_OPERATION 0x0502
  189. #define GL_STACK_OVERFLOW 0x0503
  190. #define GL_STACK_UNDERFLOW 0x0504
  191. #define GL_OUT_OF_MEMORY 0x0505
  192. #define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
  193. // Triangle winding order
  194. #define GL_CW 0x0900
  195. #define GL_CCW 0x0901
  196. // Hint enums
  197. #define GL_DONT_CARE 0x1100
  198. #define GL_FASTEST 0x1101
  199. #define GL_NICEST 0x1102
  200. #define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50
  201. #define GL_POINT_SMOOTH_HINT 0x0C51
  202. #define GL_LINE_SMOOTH_HINT 0x0C52
  203. #define GL_POLYGON_SMOOTH_HINT 0x0C53
  204. #define GL_FOG_HINT 0x0C54
  205. #define GL_GENERATE_MIPMAP_HINT 0x8192
  206. #define GL_TEXTURE_COMPRESSION_HINT 0x84EF
  207. // Reading pixels & unpacking texture patterns
  208. #define GL_UNPACK_SWAP_BYTES 0x0CF0
  209. #define GL_UNPACK_LSB_FIRST 0x0CF1
  210. #define GL_UNPACK_ROW_LENGTH 0x0CF2
  211. #define GL_UNPACK_SKIP_ROWS 0x0CF3
  212. #define GL_UNPACK_SKIP_PIXELS 0x0CF4
  213. #define GL_UNPACK_ALIGNMENT 0x0CF5
  214. #define GL_UNPACK_SKIP_IMAGES 0x806D
  215. #define GL_UNPACK_IMAGE_HEIGHT 0x806E
  216. #define GL_PACK_SWAP_BYTES 0x0D00
  217. #define GL_PACK_LSB_FIRST 0x0D01
  218. #define GL_PACK_ROW_LENGTH 0x0D02
  219. #define GL_PACK_SKIP_ROWS 0x0D03
  220. #define GL_PACK_SKIP_PIXELS 0x0D04
  221. #define GL_PACK_ALIGNMENT 0x0D05
  222. #define GL_PACK_SKIP_IMAGES 0x806B
  223. #define GL_PACK_IMAGE_HEIGHT 0x806C
  224. // Listing enums
  225. #define GL_COMPILE 0x1300
  226. #define GL_COMPILE_AND_EXECUTE 0x1301
  227. // Type enums
  228. #define GL_BITMAP 0x1A00
  229. #define GL_BYTE 0x1400
  230. #define GL_UNSIGNED_BYTE 0x1401
  231. #define GL_SHORT 0x1402
  232. #define GL_UNSIGNED_SHORT 0x1403
  233. #define GL_INT 0x1404
  234. #define GL_UNSIGNED_INT 0x1405
  235. #define GL_FLOAT 0x1406
  236. #define GL_2_BYTES 0x1407
  237. #define GL_3_BYTES 0x1408
  238. #define GL_4_BYTES 0x1409
  239. #define GL_DOUBLE 0x140A
  240. #define GL_HALF_FLOAT 0x140B
  241. #define GL_UNSIGNED_BYTE_3_3_2 0x8032
  242. #define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
  243. #define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
  244. #define GL_UNSIGNED_INT_8_8_8_8 0x8035
  245. #define GL_UNSIGNED_INT_10_10_10_2 0x8036
  246. #define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362
  247. #define GL_UNSIGNED_SHORT_5_6_5 0x8363
  248. #define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
  249. #define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365
  250. #define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
  251. #define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
  252. #define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
  253. #define GL_BOOL 0x8B56
  254. // Format enums
  255. #define GL_COLOR_INDEX 0x1900
  256. #define GL_STENCIL_INDEX 0x1901
  257. #define GL_DEPTH_COMPONENT 0x1902
  258. #define GL_RED 0x1903
  259. #define GL_GREEN 0x1904
  260. #define GL_BLUE 0x1905
  261. #define GL_ALPHA 0x1906
  262. #define GL_RGB 0x1907
  263. #define GL_RGBA 0x1908
  264. #define GL_LUMINANCE 0x1909
  265. #define GL_LUMINANCE8 0x8040
  266. #define GL_LUMINANCE_ALPHA 0x190A
  267. #define GL_R3_G3_B2 0x2A10
  268. #define GL_BGR 0x80E0
  269. #define GL_BGRA 0x80E1
  270. #define GL_ALPHA4 0x803B
  271. #define GL_ALPHA8 0x803C
  272. #define GL_ALPHA12 0x803D
  273. #define GL_ALPHA16 0x803E
  274. #define GL_LUMINANCE4 0x803F
  275. #define GL_LUMINANCE8 0x8040
  276. #define GL_LUMINANCE12 0x8041
  277. #define GL_LUMINANCE16 0x8042
  278. #define GL_LUMINANCE4_ALPHA4 0x8043
  279. #define GL_LUMINANCE6_ALPHA2 0x8044
  280. #define GL_LUMINANCE8_ALPHA8 0x8045
  281. #define GL_LUMINANCE12_ALPHA4 0x8046
  282. #define GL_LUMINANCE12_ALPHA12 0x8047
  283. #define GL_LUMINANCE16_ALPHA16 0x8048
  284. #define GL_INTENSITY 0x8049
  285. #define GL_INTENSITY4 0x804A
  286. #define GL_INTENSITY8 0x804B
  287. #define GL_INTENSITY12 0x804C
  288. #define GL_INTENSITY16 0x804D
  289. #define GL_RGB4 0x804F
  290. #define GL_RGB5 0x8050
  291. #define GL_RGB8 0x8051
  292. #define GL_RGB10 0x8052
  293. #define GL_RGB12 0x8053
  294. #define GL_RGB16 0x8054
  295. #define GL_RGBA2 0x8055
  296. #define GL_RGBA4 0x8056
  297. #define GL_RGB5_A1 0x8057
  298. #define GL_RGBA8 0x8058
  299. #define GL_RGB10_A2 0x8059
  300. #define GL_RGBA12 0x805A
  301. #define GL_RGBA16 0x805B
  302. #define GL_COLOR_INDEX8_EXT 0x80E5
  303. #define GL_DEPTH_COMPONENT16 0x81A5
  304. #define GL_DEPTH_COMPONENT16_SGIX 0x81A5
  305. #define GL_DEPTH_COMPONENT24 0x81A6
  306. #define GL_DEPTH_COMPONENT24_SGIX 0x81A6
  307. #define GL_DEPTH_COMPONENT32 0x81A7
  308. #define GL_DEPTH_COMPONENT32_SGIX 0x81A7
  309. #define GL_RG 0x8227
  310. #define GL_COMPRESSED_ALPHA 0x84E9
  311. #define GL_COMPRESSED_ALPHA_ARB 0x84E9
  312. #define GL_COMPRESSED_LUMINANCE 0x84EA
  313. #define GL_COMPRESSED_LUMINANCE_ARB 0x84EA
  314. #define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB
  315. #define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB
  316. #define GL_COMPRESSED_INTENSITY 0x84EC
  317. #define GL_COMPRESSED_INTENSITY_ARB 0x84EC
  318. #define GL_COMPRESSED_RGB 0x84ED
  319. #define GL_COMPRESSED_RGB_ARB 0x84ED
  320. #define GL_COMPRESSED_RGBA 0x84EE
  321. #define GL_COMPRESSED_RGBA_ARB 0x84EE
  322. #define GL_DEPTH_STENCIL 0x84F9
  323. #define GL_DEPTH_STENCIL_EXT 0x84F9
  324. #define GL_DEPTH_STENCIL_NV 0x84F9
  325. #define GL_SRGB 0x8C40
  326. #define GL_SRGB_EXT 0x8C40
  327. #define GL_SRGB8 0x8C41
  328. #define GL_SRGB8_EXT 0x8C41
  329. #define GL_SRGB_ALPHA 0x8C42
  330. #define GL_SRGB_ALPHA_EXT 0x8C42
  331. #define GL_SRGB8_ALPHA8 0x8C43
  332. #define GL_SRGB8_ALPHA8_EXT 0x8C43
  333. #define GL_SLUMINANCE_ALPHA 0x8C44
  334. #define GL_SLUMINANCE_ALPHA_EXT 0x8C44
  335. #define GL_SLUMINANCE8_ALPHA8 0x8C45
  336. #define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45
  337. #define GL_SLUMINANCE 0x8C46
  338. #define GL_SLUMINANCE_EXT 0x8C46
  339. #define GL_SLUMINANCE8 0x8C47
  340. #define GL_SLUMINANCE8_EXT 0x8C47
  341. // Lighting related defines
  342. #define GL_LIGHTING 0x0B50
  343. #define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51
  344. #define GL_LIGHT_MODEL_TWO_SIDE 0x0B52
  345. #define GL_LIGHT_MODEL_AMBIENT 0x0B53
  346. #define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8
  347. #define GL_SINGLE_COLOR 0x81F9
  348. #define GL_SEPARATE_SPECULAR_COLOR 0x81FA
  349. #define GL_FLAT 0x1D00
  350. #define GL_SMOOTH 0x1D01
  351. #define GL_AMBIENT 0x1200
  352. #define GL_DIFFUSE 0x1201
  353. #define GL_SPECULAR 0x1202
  354. #define GL_POSITION 0x1203
  355. #define GL_SPOT_DIRECTION 0x1204
  356. #define GL_SPOT_EXPONENT 0x1205
  357. #define GL_SPOT_CUTOFF 0x1206
  358. #define GL_CONSTANT_ATTENUATION 0x1207
  359. #define GL_LINEAR_ATTENUATION 0x1208
  360. #define GL_QUADRATIC_ATTENUATION 0x1209
  361. #define GL_EMISSION 0x1600
  362. #define GL_SHININESS 0x1601
  363. #define GL_AMBIENT_AND_DIFFUSE 0x1602
  364. #define GL_COLOR_INDEXES 0x1603
  365. #define GL_LIGHT0 0x4000
  366. #define GL_LIGHT1 0x4001
  367. #define GL_LIGHT2 0x4002
  368. #define GL_LIGHT3 0x4003
  369. #define GL_LIGHT4 0x4004
  370. #define GL_LIGHT5 0x4005
  371. #define GL_LIGHT6 0x4006
  372. #define GL_LIGHT7 0x4007
  373. // Blend factors & modes
  374. #define GL_CONSTANT_COLOR 0x8001
  375. #define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
  376. #define GL_CONSTANT_ALPHA 0x8003
  377. #define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
  378. #define GL_FUNC_ADD 0x8006
  379. #define GL_MIN 0x8007
  380. #define GL_MAX 0x8008
  381. #define GL_BLEND_EQUATION_RGB 0x8009
  382. #define GL_FUNC_SUBTRACT 0x800A
  383. #define GL_FUNC_REVERSE_SUBTRACT 0x800B
  384. #define GL_BLEND_EQUATION_ALPHA 0x883D
  385. // Points
  386. #define GL_POINT_SMOOTH 0x0B10
  387. #define GL_POINT_SIZE 0x0B11
  388. #define GL_POINT_SIZE_MIN_EXT 0x8126
  389. #define GL_POINT_SIZE_MAX_EXT 0x8127
  390. #define GL_DISTANCE_ATTENUATION_EXT 0x8129
  391. // Polygon modes
  392. #define GL_POINT 0x1B00
  393. #define GL_LINE 0x1B01
  394. #define GL_FILL 0x1B02
  395. // Stencil buffer operations
  396. #define GL_KEEP 0x1E00
  397. #define GL_REPLACE 0x1E01
  398. #define GL_INCR 0x1E02
  399. #define GL_INCR_WRAP 0x8507
  400. #define GL_DECR 0x1E03
  401. #define GL_DECR_WRAP 0x8508
  402. #define GL_INVERT 0x150A
  403. // Texture targets
  404. #define GL_TEXTURE_1D 0x0DE0
  405. #define GL_TEXTURE_2D 0x0DE1
  406. #define GL_PROXY_TEXTURE_1D 0x8063
  407. #define GL_PROXY_TEXTURE_2D 0x8064
  408. #define GL_TEXTURE_3D 0x806F
  409. #define GL_PROXY_TEXTURE_3D 0x8070
  410. #define GL_TEXTURE_CUBE_MAP 0x8513
  411. #define GL_TEXTURE_1D_ARRAY 0x8C18
  412. #define GL_TEXTURE_2D_ARRAY 0x8C1A
  413. // Texture parameters
  414. #define GL_TEXTURE_WIDTH 0x1000
  415. #define GL_TEXTURE_HEIGHT 0x1001
  416. // Texture Unit indices
  417. #define GL_TEXTURE0 0x84C0
  418. #define GL_TEXTURE0_ARB 0x84C0
  419. #define GL_TEXTURE1 0x84C1
  420. #define GL_TEXTURE1_ARB 0x84C1
  421. #define GL_TEXTURE2 0x84C2
  422. #define GL_TEXTURE2_ARB 0x84C2
  423. #define GL_TEXTURE3 0x84C3
  424. #define GL_TEXTURE3_ARB 0x84C3
  425. #define GL_TEXTURE4 0x84C4
  426. #define GL_TEXTURE4_ARB 0x84C4
  427. #define GL_TEXTURE5 0x84C5
  428. #define GL_TEXTURE5_ARB 0x84C5
  429. #define GL_TEXTURE6 0x84C6
  430. #define GL_TEXTURE6_ARB 0x84C6
  431. #define GL_TEXTURE7 0x84C7
  432. #define GL_TEXTURE7_ARB 0x84C7
  433. #define GL_TEXTURE8 0x84C8
  434. #define GL_TEXTURE8_ARB 0x84C8
  435. #define GL_TEXTURE9 0x84C9
  436. #define GL_TEXTURE9_ARB 0x84C9
  437. #define GL_TEXTURE10 0x84CA
  438. #define GL_TEXTURE10_ARB 0x84CA
  439. #define GL_TEXTURE11 0x84CB
  440. #define GL_TEXTURE11_ARB 0x84CB
  441. #define GL_TEXTURE12 0x84CC
  442. #define GL_TEXTURE12_ARB 0x84CC
  443. #define GL_TEXTURE13 0x84CD
  444. #define GL_TEXTURE13_ARB 0x84CD
  445. #define GL_TEXTURE14 0x84CE
  446. #define GL_TEXTURE14_ARB 0x84CE
  447. #define GL_TEXTURE15 0x84CF
  448. #define GL_TEXTURE15_ARB 0x84CF
  449. #define GL_TEXTURE16 0x84D0
  450. #define GL_TEXTURE16_ARB 0x84D0
  451. #define GL_TEXTURE17 0x84D1
  452. #define GL_TEXTURE17_ARB 0x84D1
  453. #define GL_TEXTURE18 0x84D2
  454. #define GL_TEXTURE18_ARB 0x84D2
  455. #define GL_TEXTURE19 0x84D3
  456. #define GL_TEXTURE19_ARB 0x84D3
  457. #define GL_TEXTURE20 0x84D4
  458. #define GL_TEXTURE20_ARB 0x84D4
  459. #define GL_TEXTURE21 0x84D5
  460. #define GL_TEXTURE21_ARB 0x84D5
  461. #define GL_TEXTURE22 0x84D6
  462. #define GL_TEXTURE22_ARB 0x84D6
  463. #define GL_TEXTURE23 0x84D7
  464. #define GL_TEXTURE23_ARB 0x84D7
  465. #define GL_TEXTURE24 0x84D8
  466. #define GL_TEXTURE24_ARB 0x84D8
  467. #define GL_TEXTURE25 0x84D9
  468. #define GL_TEXTURE25_ARB 0x84D9
  469. #define GL_TEXTURE26 0x84DA
  470. #define GL_TEXTURE26_ARB 0x84DA
  471. #define GL_TEXTURE27 0x84DB
  472. #define GL_TEXTURE27_ARB 0x84DB
  473. #define GL_TEXTURE28 0x84DC
  474. #define GL_TEXTURE28_ARB 0x84DC
  475. #define GL_TEXTURE29 0x84DD
  476. #define GL_TEXTURE29_ARB 0x84DD
  477. #define GL_TEXTURE30 0x84DE
  478. #define GL_TEXTURE30_ARB 0x84DE
  479. #define GL_TEXTURE31 0x84DF
  480. #define GL_TEXTURE31_ARB 0x84DF
  481. // Texture coord names
  482. #define GL_S 0x2000
  483. #define GL_T 0x2001
  484. #define GL_R 0x2002
  485. #define GL_Q 0x2003
  486. // Texture Environment and Parameters
  487. #define GL_ADD 0x0104
  488. #define GL_ALPHA_SCALE 0x0D1C
  489. #define GL_MODULATE 0x2100
  490. #define GL_DECAL 0x2101
  491. #define GL_TEXTURE_ENV_MODE 0x2200
  492. #define GL_TEXTURE_ENV_COLOR 0x2201
  493. #define GL_TEXTURE_ENV 0x2300
  494. #define GL_NEAREST 0x2600
  495. #define GL_LINEAR 0x2601
  496. #define GL_NEAREST_MIPMAP_NEAREST 0x2700
  497. #define GL_LINEAR_MIPMAP_NEAREST 0x2701
  498. #define GL_NEAREST_MIPMAP_LINEAR 0x2702
  499. #define GL_LINEAR_MIPMAP_LINEAR 0x2703
  500. #define GL_TEXTURE_MAG_FILTER 0x2800
  501. #define GL_TEXTURE_MIN_FILTER 0x2801
  502. #define GL_TEXTURE_WRAP_S 0x2802
  503. #define GL_TEXTURE_WRAP_T 0x2803
  504. #define GL_CLAMP 0x2900
  505. #define GL_REPEAT 0x2901
  506. #define GL_CLAMP_TO_BORDER 0x812D
  507. #define GL_CLAMP_TO_EDGE 0x812F
  508. #define GL_GENERATE_MIPMAP 0x8191
  509. #define GL_MIRRORED_REPEAT 0x8370
  510. #define GL_SUBTRACT 0x84E7
  511. #define GL_TEXTURE_FILTER_CONTROL 0x8500
  512. #define GL_TEXTURE_LOD_BIAS 0x8501
  513. #define GL_COMBINE 0x8570
  514. #define GL_COMBINE_RGB 0x8571
  515. #define GL_COMBINE_ALPHA 0x8572
  516. #define GL_RGB_SCALE 0x8573
  517. #define GL_ADD_SIGNED 0x8574
  518. #define GL_INTERPOLATE 0x8575
  519. #define GL_CONSTANT 0x8576
  520. #define GL_PRIMARY_COLOR 0x8577
  521. #define GL_PREVIOUS 0x8578
  522. #define GL_SRC0_RGB 0x8580
  523. #define GL_SOURCE0_RGB 0x8580
  524. #define GL_SRC1_RGB 0x8581
  525. #define GL_SOURCE1_RGB 0x8581
  526. #define GL_SRC2_RGB 0x8582
  527. #define GL_SOURCE2_RGB 0x8582
  528. #define GL_SRC0_ALPHA 0x8588
  529. #define GL_SOURCE0_ALPHA 0x8588
  530. #define GL_SRC1_ALPHA 0x8589
  531. #define GL_SOURCE1_ALPHA 0x8589
  532. #define GL_SRC2_ALPHA 0x858A
  533. #define GL_SOURCE2_ALPHA 0x858A
  534. #define GL_OPERAND0_RGB 0x8590
  535. #define GL_OPERAND1_RGB 0x8591
  536. #define GL_OPERAND2_RGB 0x8592
  537. #define GL_OPERAND0_ALPHA 0x8598
  538. #define GL_OPERAND1_ALPHA 0x8599
  539. #define GL_OPERAND2_ALPHA 0x859A
  540. #define GL_DOT3_RGB 0x86AE
  541. #define GL_DOT3_RGBA 0x86AF
  542. // Texture gen modes
  543. #define GL_EYE_LINEAR 0x2400
  544. #define GL_OBJECT_LINEAR 0x2401
  545. #define GL_SPHERE_MAP 0x2402
  546. #define GL_NORMAL_MAP 0x8511
  547. #define GL_REFLECTION_MAP 0x8512
  548. // Texture gen parameters
  549. #define GL_TEXTURE_BORDER_COLOR 0x1004
  550. #define GL_TEXTURE_GEN_MODE 0x2500
  551. #define GL_OBJECT_PLANE 0x2501
  552. #define GL_EYE_PLANE 0x2502
  553. // Client state capabilities
  554. #define GL_VERTEX_ARRAY 0x8074
  555. #define GL_COLOR_ARRAY 0x8076
  556. #define GL_TEXTURE_COORD_ARRAY 0x8078
  557. // Fog parameters
  558. #define GL_EXP 0x0800
  559. #define GL_EXP2 0x0801
  560. #define GL_FOG_MODE 0x0B65
  561. #define GL_FOG_COLOR 0x0B66
  562. #define GL_FOG_DENSITY 0x0B62
  563. // Scissor enums
  564. #define GL_SCISSOR_BOX 0x0C10
  565. #define GL_SCISSOR_TEST 0x0C11
  566. // OpenGL State & GLGet
  567. #define GL_MODELVIEW_MATRIX 0x0BA6
  568. #define GL_PROJECTION_MATRIX 0x0BA7
  569. // User clipping planes
  570. #define GL_MAX_CLIP_PLANES 0x0D32
  571. #define GL_CLIP_PLANE0 0x3000
  572. #define GL_CLIP_PLANE1 0x3001
  573. #define GL_CLIP_PLANE2 0x3002
  574. #define GL_CLIP_PLANE3 0x3003
  575. #define GL_CLIP_PLANE4 0x3004
  576. #define GL_CLIP_PLANE5 0x3005
  577. // Buffer objects
  578. #define GL_ARRAY_BUFFER 0x8892
  579. #define GL_ELEMENT_ARRAY_BUFFER 0x8893
  580. #define GL_STREAM_DRAW 0x88e0
  581. #define GL_STREAM_READ 0x88e1
  582. #define GL_STREAM_COPY 0x88e2
  583. #define GL_STATIC_DRAW 0x88e4
  584. #define GL_STATIC_READ 0x88e5
  585. #define GL_STATIC_COPY 0x88e6
  586. #define GL_DYNAMIC_DRAW 0x88e8
  587. #define GL_DYNAMIC_READ 0x88e9
  588. #define GL_DYNAMIC_COPY 0x88ea
  589. // Programmable pipeline
  590. #define GL_FRAGMENT_SHADER 0x8B30
  591. #define GL_VERTEX_SHADER 0x8B31
  592. #define GL_SHADER_TYPE 0x8B4F
  593. #define GL_DELETE_STATUS 0x8B80
  594. #define GL_COMPILE_STATUS 0x8B81
  595. #define GL_LINK_STATUS 0x8B82
  596. #define GL_INFO_LOG_LENGTH 0x8B84
  597. #define GL_SHADER_SOURCE_LENGTH 0x8B88
  598. #ifdef __cplusplus
  599. }
  600. #endif