scripts added from old sdlpl to generate constants
Kartik Thakore [Tue, 4 Aug 2009 11:31:46 +0000 (07:31 -0400)]
scripts/OpenGL/Constants.pm [new file with mode: 0644]
scripts/const.pl [new file with mode: 0644]
scripts/gl_const.pl [new file with mode: 0644]
scripts/opengl_words.txt [new file with mode: 0644]
scripts/sdl_const.pl [new file with mode: 0644]
scripts/sdl_words.txt [new file with mode: 0644]

diff --git a/scripts/OpenGL/Constants.pm b/scripts/OpenGL/Constants.pm
new file mode 100644 (file)
index 0000000..b404936
--- /dev/null
@@ -0,0 +1,433 @@
+# SDL::OpenGL::Constants
+#
+# This is an autogenerate file, don't bother editing
+#
+# Copyright (C) 2003 David J. Goehrig <dave@sdlperl.org>
+
+package SDL::OpenGL::Constants;
+
+
+sub main::GL_COLOR_BUFFER_BIT { 0x00004000 } 
+sub main::GL_DEPTH_BUFFER_BIT { 0x00000100 } 
+sub main::GL_ACCUM_BUFFER_BIT { 0x00000200 } 
+sub main::GL_STENCIL_BUFFER_BIT { 0x00000400 } 
+sub main::GL_POINTS { 0x0000 } 
+sub main::GL_LINES { 0x0001 } 
+sub main::GL_LINE_STRIP { 0x0003 } 
+sub main::GL_LINE_LOOP { 0x0002 } 
+sub main::GL_TRIANGLES { 0x0004 } 
+sub main::GL_TRIANGLE_STRIP { 0x0005 } 
+sub main::GL_TRIANGLE_FAN { 0x0006 } 
+sub main::GL_QUADS { 0x0007 } 
+sub main::GL_QUAD_STRIP { 0x0008 } 
+sub main::GL_POLYGON { 0x0009 } 
+sub main::GL_LINE_STIPPLE { 0x0B24 } 
+sub main::GL_FRONT { 0x0404 } 
+sub main::GL_BACK { 0x0405 } 
+sub main::GL_POINT { 0x1B00 } 
+sub main::GL_LINE { 0x1B01 } 
+sub main::GL_FILL { 0x1B02 } 
+sub main::GL_CCW { 0x0901 } 
+sub main::GL_CW { 0x0900 } 
+sub main::GL_FRONT_AND_BACK { 0x0408 } 
+sub main::GL_CULL_FACE { 0x0B44 } 
+sub main::GL_POLYGON_STIPPLE { 0x0B42 } 
+sub main::GL_NORMALIZE { 0x0BA1 } 
+sub main::GL_RESCALE_NORMAL { 0x803A } 
+sub main::GL_VERTEX_ARRAY { 0x8074 } 
+sub main::GL_COLOR_ARRAY { 0x8076 } 
+sub main::GL_INDEX_ARRAY { 0x8077 } 
+sub main::GL_NORMAL_ARRAY { 0x8075 } 
+sub main::GL_TEXTURE_COORD_ARRAY { 0x8078 } 
+sub main::GL_EDGE_FLAG_ARRAY { 0x8079 } 
+sub main::GL_BYTE { 0x1400 } 
+sub main::GL_UNSIGNED_BYTE { 0x1401 } 
+sub main::GL_SHORT { 0x1402 } 
+sub main::GL_UNSIGNED_SHORT { 0x1403 } 
+sub main::GL_INT { 0x1404 } 
+sub main::GL_UNSIGNED_INT { 0x1405 } 
+sub main::GL_FLOAT { 0x1406 } 
+sub main::GL_DOUBLE { 0x140A } 
+sub main::GL_V2F { 0x2A20 } 
+sub main::GL_V3F { 0x2A21 } 
+sub main::GL_C4UB_V2F { 0x2A22 } 
+sub main::GL_C4UB_V3F { 0x2A23 } 
+sub main::GL_C3F_V3F { 0x2A24 } 
+sub main::GL_N3F_V3F { 0x2A25 } 
+sub main::GL_C4F_N3F_V3F { 0x2A26 } 
+sub main::GL_T2F_V3F { 0x2A27 } 
+sub main::GL_T4F_V4F { 0x2A28 } 
+sub main::GL_T2F_C4UB_V3F { 0x2A29 } 
+sub main::GL_T2F_C3F_V3F { 0x2A2A } 
+sub main::GL_T2F_N3F_V3F { 0x2A2B } 
+sub main::GL_T2F_C4F_N3F_V3F { 0x2A2C } 
+sub main::GL_T4F_C4F_N3F_V4F { 0x2A2D } 
+sub main::GL_ALL_ATTRIB_BITS { 0x000FFFFF } 
+sub main::GL_CURRENT_BIT { 0x00000001 } 
+sub main::GL_ENABLE_BIT { 0x00002000 } 
+sub main::GL_EVAL_BIT { 0x00010000 } 
+sub main::GL_FOG_BIT { 0x00000080 } 
+sub main::GL_HINT_BIT { 0x00008000 } 
+sub main::GL_LIGHTING_BIT { 0x00000040 } 
+sub main::GL_LINE_BIT { 0x00000004 } 
+sub main::GL_LIST_BIT { 0x00020000 } 
+sub main::GL_PIXEL_MODE_BIT { 0x00000020 } 
+sub main::GL_POINT_BIT { 0x00000002 } 
+sub main::GL_POLYGON_BIT { 0x00000008 } 
+sub main::GL_POLYGON_STIPPLE_BIT { 0x00000010 } 
+sub main::GL_SCISSOR_BIT { 0x00080000 } 
+sub main::GL_TEXTURE_BIT { 0x00040000 } 
+sub main::GL_TRANSFORM_BIT { 0x00001000 } 
+sub main::GL_VIEWPORT_BIT { 0x00000800 } 
+sub main::GL_CLIENT_PIXEL_STORE_BIT { 0x00000001 } 
+sub main::GL_CLIENT_VERTEX_ARRAY_BIT { 0x00000002 } 
+sub main::GL_ALL_CLIENT_ATTRIB_BITS { 0xFFFFFFFF } 
+sub main::GL_MODELVIEW { 0x1700 } 
+sub main::GL_PROJECTION { 0x1701 } 
+sub main::GL_TEXTURE { 0x1702 } 
+sub main::GL_SMOOTH { 0x1D01 } 
+sub main::GL_FLAT { 0x1D00 } 
+sub main::GL_LIGHT0 { 0x4000 } 
+sub main::GL_LIGHT1 { 0x4001 } 
+sub main::GL_LIGHT2 { 0x4002 } 
+sub main::GL_LIGHT3 { 0x4003 } 
+sub main::GL_LIGHT4 { 0x4004 } 
+sub main::GL_LIGHT5 { 0x4005 } 
+sub main::GL_LIGHT6 { 0x4006 } 
+sub main::GL_LIGHT7 { 0x4007 } 
+sub main::GL_AMBIENT { 0x1200 } 
+sub main::GL_DIFFUSE { 0x1201 } 
+sub main::GL_AMBIENT_AND_DIFFUSE { 0x1602 } 
+sub main::GL_SPECULAR { 0x1202 } 
+sub main::GL_SHININESS { 0x1601 } 
+sub main::GL_EMISSION { 0x1600 } 
+sub main::GL_COLOR_INDEXES { 0x1603 } 
+sub main::GL_POSITION { 0x1203 } 
+sub main::GL_SPOT_DIRECTION { 0x1204 } 
+sub main::GL_SPOT_EXPONENT { 0x1205 } 
+sub main::GL_SPOT_CUTOFF { 0x1206 } 
+sub main::GL_CONSTANT_ATTENUATION { 0x1207 } 
+sub main::GL_LINEAR_ATTENUATION { 0x1208 } 
+sub main::GL_QUADRATIC_ATTENUATION { 0x1209 } 
+sub main::GL_LIGHT_MODEL_AMBIENT { 0x0B53 } 
+sub main::GL_LIGHT_MODEL_LOCAL_VIEWER { 0x0B51 } 
+sub main::GL_LIGHT_MODEL_TWO_SIDE { 0x0B52 } 
+sub main::GL_LIGHT_MODEL_COLOR_CONTROL { 0x81F8 } 
+sub main::GL_FALSE { 0x0 } 
+sub main::GL_TRUE { 0x1 } 
+sub main::GL_SINGLE_COLOR { 0x81F9 } 
+sub main::GL_ZERO { 0x0 } 
+sub main::GL_ONE { 0x1 } 
+sub main::GL_DST_COLOR { 0x0306 } 
+sub main::GL_SRC_COLOR { 0x0300 } 
+sub main::GL_ONE_MINUS_DST_COLOR { 0x0307 } 
+sub main::GL_ONE_MINUS_SRC_COLOR { 0x0301 } 
+sub main::GL_SRC_ALPHA { 0x0302 } 
+sub main::GL_ONE_MINUS_SRC_ALPHA { 0x0303 } 
+sub main::GL_SRC_ALPHA_SATURATE { 0x0308 } 
+sub main::GL_CONSTANT_COLOR { 0x8001 } 
+sub main::GL_ONE_MINUS_CONSTANT_COLOR { 0x8002 } 
+sub main::GL_CONSTANT_ALPHA { 0x8003 } 
+sub main::GL_ONE_MINUS_CONSTANT_ALPHA { 0x8004 } 
+sub main::GL_POINT_SMOOTH_HINT { 0x0C51 } 
+sub main::GL_LINE_SMOOTH_HINT { 0x0C52 } 
+sub main::GL_POLYGON_SMOOTH_HINT { 0x0C53 } 
+sub main::GL_FOG_HINT { 0x0C54 } 
+sub main::GL_PERSPECTIVE_CORRECTION_HINT { 0x0C50 } 
+sub main::GL_EXP { 0x0800 } 
+sub main::GL_EXP2 { 0x0801 } 
+sub main::GL_FOG_MODE { 0x0B65 } 
+sub main::GL_LINEAR { 0x2601 } 
+sub main::GL_FOG_DENSITY { 0x0B62 } 
+sub main::GL_FOG_START { 0x0B63 } 
+sub main::GL_FOG_END { 0x0B64 } 
+sub main::GL_FOG_COLOR { 0x0B66 } 
+sub main::GL_POLYGON_OFFSET_LINE { 0x2A02 } 
+sub main::GL_POLYGON_OFFSET_FILL { 0x8037 } 
+sub main::GL_POLYGON_OFFSET_POINT { 0x2A01 } 
+sub main::GL_COLOR_INDEX { 0x1900 } 
+sub main::GL_RGB { 0x1907 } 
+sub main::GL_RGBA { 0x1908 } 
+sub main::GL_BGR { 0x80E0 } 
+sub main::GL_BGRA { 0x80E1 } 
+sub main::GL_RED { 0x1903 } 
+sub main::GL_GREEN { 0x1904 } 
+sub main::GL_BLUE { 0x1905 } 
+sub main::GL_ALPHA { 0x1906 } 
+sub main::GL_LUMINANCE { 0x1909 } 
+sub main::GL_LUMINANCE_ALPHA { 0x190A } 
+sub main::GL_STENCIL_INDEX { 0x1901 } 
+sub main::GL_DEPTH_COMPONENT { 0x1902 } 
+sub main::GL_BITMAP { 0x1A00 } 
+sub main::GL_UNSIGNED_BYTE_3_3_2 { 0x8032 } 
+sub main::GL_UNSIGNED_BYTE_2_3_3_REV { 0x8362 } 
+sub main::GL_UNSIGNED_SHORT_5_6_5 { 0x8363 } 
+sub main::GL_UNSIGNED_SHORT_5_6_5_REV { 0x8364 } 
+sub main::GL_UNSIGNED_SHORT_4_4_4_4 { 0x8033 } 
+sub main::GL_UNSIGNED_SHORT_4_4_4_4_REV { 0x8365 } 
+sub main::GL_UNSIGNED_SHORT_5_5_5_1 { 0x8034 } 
+sub main::GL_UNSIGNED_SHORT_1_5_5_5_REV { 0x8366 } 
+sub main::GL_UNSIGNED_INT_8_8_8_8 { 0x8035 } 
+sub main::GL_UNSIGNED_INT_8_8_8_8_REV { 0x8367 } 
+sub main::GL_UNSIGNED_INT_10_10_10_2 { 0x8036 } 
+sub main::GL_UNSIGNED_INT_2_10_10_10_REV { 0x8368 } 
+sub main::GL_UNPACK_SWAP_BYTES { 0x0CF0 } 
+sub main::GL_PACK_SWAP_BYTES { 0x0D00 } 
+sub main::GL_UNPACK_LSB_FIRST { 0x0CF1 } 
+sub main::GL_PACK_LSB_FIRST { 0x0D01 } 
+sub main::GL_UNPACK_ROW_LENGTH { 0x0CF2 } 
+sub main::GL_PACK_ROW_LENGTH { 0x0D02 } 
+sub main::GL_UNPACK_SKIP_ROWS { 0x0CF3 } 
+sub main::GL_PACK_SKIP_ROWS { 0x0D03 } 
+sub main::GL_UNPACK_SKIP_PIXELS { 0x0CF4 } 
+sub main::GL_PACK_SKIP_PIXELS { 0x0D04 } 
+sub main::GL_UNPACK_ALIGNMENT { 0x0CF5 } 
+sub main::GL_PACK_ALIGNMENT { 0x0D05 } 
+sub main::GL_UNPACK_IMAGE_HEIGHT { 0x806E } 
+sub main::GL_PACK_IMAGE_HEIGHT { 0x806C } 
+sub main::GL_UNPACK_SKIP_IMAGES { 0x806D } 
+sub main::GL_PACK_SKIP_IMAGES { 0x806B } 
+sub main::GL_MAP_COLOR { 0x0D10 } 
+sub main::GL_MAP_STENCIL { 0x0D11 } 
+sub main::GL_INDEX_SHIFT { 0x0D12 } 
+sub main::GL_INDEX_OFFSET { 0x0D13 } 
+sub main::GL_RED_SCALE { 0x0D14 } 
+sub main::GL_GREEN_SCALE { 0x0D18 } 
+sub main::GL_BLUE_SCALE { 0x0D1A } 
+sub main::GL_ALPHA_SCALE { 0x0D1C } 
+sub main::GL_DEPTH_SCALE { 0x0D1E } 
+sub main::GL_RED_BIAS { 0x0D15 } 
+sub main::GL_GREEN_BIAS { 0x0D19 } 
+sub main::GL_BLUE_BIAS { 0x0D1B } 
+sub main::GL_ALPHA_BIAS { 0x0D1D } 
+sub main::GL_DEPTH_BIAS { 0x0D1F } 
+sub main::GL_POST_CONVOLUTION_RED_SCALE { 0x801C } 
+sub main::GL_POST_CONVOLUTION_GREEN_SCALE { 0x801D } 
+sub main::GL_POST_CONVOLUTION_BLUE_SCALE { 0x801E } 
+sub main::GL_POST_CONVOLUTION_ALPHA_SCALE { 0x801F } 
+sub main::GL_POST_CONVOLUTION_RED_BIAS { 0x8020 } 
+sub main::GL_POST_CONVOLUTION_GREEN_BIAS { 0x8021 } 
+sub main::GL_POST_CONVOLUTION_BLUE_BIAS { 0x8022 } 
+sub main::GL_POST_CONVOLUTION_ALPHA_BIAS { 0x8023 } 
+sub main::GL_POST_COLOR_MATRIX_RED_SCALE { 0x80B4 } 
+sub main::GL_POST_COLOR_MATRIX_GREEN_SCALE { 0x80B5 } 
+sub main::GL_POST_COLOR_MATRIX_BLUE_SCALE { 0x80B6 } 
+sub main::GL_POST_COLOR_MATRIX_ALPHA_SCALE { 0x80B7 } 
+sub main::GL_POST_COLOR_MATRIX_RED_BIAS { 0x80B8 } 
+sub main::GL_POST_COLOR_MATRIX_GREEN_BIAS { 0x80B9 } 
+sub main::GL_POST_COLOR_MATRIX_BLUE_BIAS { 0x80BA } 
+sub main::GL_POST_COLOR_MATRIX_ALPHA_BIAS { 0x80BB } 
+sub main::GL_PIXEL_MAP_I_TO_I { 0x0C70 } 
+sub main::GL_PIXEL_MAP_S_TO_S { 0x0C71 } 
+sub main::GL_PIXEL_MAP_I_TO_R { 0x0C72 } 
+sub main::GL_PIXEL_MAP_I_TO_G { 0x0C73 } 
+sub main::GL_PIXEL_MAP_I_TO_B { 0x0C74 } 
+sub main::GL_PIXEL_MAP_I_TO_A { 0x0C75 } 
+sub main::GL_PIXEL_MAP_R_TO_R { 0x0C76 } 
+sub main::GL_PIXEL_MAP_G_TO_G { 0x0C77 } 
+sub main::GL_PIXEL_MAP_B_TO_B { 0x0C78 } 
+sub main::GL_PIXEL_MAP_A_TO_A { 0x0C79 } 
+sub main::GL_TEXTURE_1D { 0x0DE0 } 
+sub main::GL_TEXTURE_2D { 0x0DE1 } 
+sub main::GL_TEXTURE_3D { 0x806F } 
+sub main::GL_PROXY_TEXTURE_2D { 0x8064 } 
+sub main::GL_ALPHA4 { 0x803B } 
+sub main::GL_ALPHA8 { 0x803C } 
+sub main::GL_ALPHA12 { 0x803D } 
+sub main::GL_ALPHA16 { 0x803E } 
+sub main::GL_LUMINANCE4 { 0x803F } 
+sub main::GL_LUMINANCE8 { 0x8040 } 
+sub main::GL_LUMINANCE12 { 0x8041 } 
+sub main::GL_LUMINANCE16 { 0x8042 } 
+sub main::GL_LUMINANCE4_ALPHA4 { 0x8043 } 
+sub main::GL_LUMINANCE6_ALPHA2 { 0x8044 } 
+sub main::GL_LUMINANCE8_ALPHA8 { 0x8045 } 
+sub main::GL_LUMINANCE12_ALPHA4 { 0x8046 } 
+sub main::GL_LUMINANCE12_ALPHA12 { 0x8047 } 
+sub main::GL_LUMINANCE16_ALPHA16 { 0x8048 } 
+sub main::GL_INTENSITY { 0x8049 } 
+sub main::GL_INTENSITY4 { 0x804A } 
+sub main::GL_INTENSITY8 { 0x804B } 
+sub main::GL_INTENSITY12 { 0x804C } 
+sub main::GL_INTENSITY16 { 0x804D } 
+sub main::GL_R3_G3_B2 { 0x2A10 } 
+sub main::GL_RGB4 { 0x804F } 
+sub main::GL_RGB5 { 0x8050 } 
+sub main::GL_RGB8 { 0x8051 } 
+sub main::GL_RGB10 { 0x8052 } 
+sub main::GL_RGB12 { 0x8053 } 
+sub main::GL_RGB16 { 0x8054 } 
+sub main::GL_RGBA2 { 0x8055 } 
+sub main::GL_RGBA4 { 0x8056 } 
+sub main::GL_RGB5_A1 { 0x8057 } 
+sub main::GL_RGBA8 { 0x8058 } 
+sub main::GL_RGB10_A2 { 0x8059 } 
+sub main::GL_RGBA12 { 0x805A } 
+sub main::GL_RGBA16 { 0x805B } 
+sub main::GL_MAX_TEXTURE_SIZE { 0x0D33 } 
+sub main::GL_TEXTURE_BASE_LEVEL { 0x813C } 
+sub main::GL_TEXTURE_MAX_LEVEL { 0x813D } 
+sub main::GL_TEXTURE_MAX_LOD { 0x813B } 
+sub main::GL_TEXTURE_MIN_LOD { 0x813A } 
+sub main::GL_TEXTURE_ENV_MODE { 0x2200 } 
+sub main::GL_TEXTURE_ENV_COLOR { 0x2201 } 
+sub main::GL_DECAL { 0x2101 } 
+sub main::GL_REPLACE { 0x1E01 } 
+sub main::GL_MODULATE { 0x2100 } 
+sub main::GL_BLEND { 0x0BE2 } 
+sub main::GL_TEXTURE_WRAP_S { 0x2802 } 
+sub main::GL_TEXTURE_WRAP_T { 0x2803 } 
+sub main::GL_TEXTURE_WRAP_R { 0x8072 } 
+sub main::GL_TEXTURE_MAG_FILTER { 0x2800 } 
+sub main::GL_TEXTURE_MIN_FILTER { 0x2801 } 
+sub main::GL_TEXTURE_BORDER_COLOR { 0x1004 } 
+sub main::GL_TEXTURE_PRIORITY { 0x8066 } 
+sub main::GL_CLAMP { 0x2900 } 
+sub main::GL_CLAMP_TO_EDGE { 0x812F } 
+sub main::GL_REPEAT { 0x2901 } 
+sub main::GL_NEAREST { 0x2600 } 
+sub main::GL_NEAREST_MIPMAP_NEAREST { 0x2700 } 
+sub main::GL_NEAREST_MIPMAP_LINEAR { 0x2702 } 
+sub main::GL_LINEAR_MIPMAP_NEAREST { 0x2701 } 
+sub main::GL_LINEAR_MIPMAP_LINEAR { 0x2703 } 
+sub main::GL_S { 0x2000 } 
+sub main::GL_T { 0x2001 } 
+sub main::GL_R { 0x2002 } 
+sub main::GL_Q { 0x2003 } 
+sub main::GL_TEXTURE_GEN_MODE { 0x2500 } 
+sub main::GL_OBJECT_PLANE { 0x2501 } 
+sub main::GL_EYE_PLANE { 0x2502 } 
+sub main::GL_EYE_LINEAR { 0x2400 } 
+sub main::GL_OBJECT_LINEAR { 0x2401 } 
+sub main::GL_SPHERE_MAP { 0x2402 } 
+sub main::GL_LEFT { 0x0406 } 
+sub main::GL_RIGHT { 0x0407 } 
+sub main::GL_FRONT_LEFT { 0x0400 } 
+sub main::GL_FRONT_RIGHT { 0x0401 } 
+sub main::GL_BACK_LEFT { 0x0402 } 
+sub main::GL_BACK_RIGHT { 0x0403 } 
+sub main::GL_NONE { 0x0 } 
+sub main::GL_SCISSOR_TEST { 0x0C11 } 
+sub main::GL_NEVER { 0x0200 } 
+sub main::GL_ALWAYS { 0x0207 } 
+sub main::GL_LESS { 0x0201 } 
+sub main::GL_LEQUAL { 0x0203 } 
+sub main::GL_EQUAL { 0x0202 } 
+sub main::GL_GEQUAL { 0x0206 } 
+sub main::GL_GREATER { 0x0204 } 
+sub main::GL_NOTEQUAL { 0x0205 } 
+sub main::GL_KEEP { 0x1E00 } 
+sub main::GL_INCR { 0x1E02 } 
+sub main::GL_DECR { 0x1E03 } 
+sub main::GL_INVERT { 0x150A } 
+sub main::GL_CLEAR { 0x1500 } 
+sub main::GL_COPY { 0x1503 } 
+sub main::GL_NOOP { 0x1505 } 
+sub main::GL_SET { 0x150F } 
+sub main::GL_COPY_INVERTED { 0x150C } 
+sub main::GL_AND_REVERSE { 0x1502 } 
+sub main::GL_OR_REVERSE { 0x150B } 
+sub main::GL_AND { 0x1501 } 
+sub main::GL_OR { 0x1507 } 
+sub main::GL_NAND { 0x150E } 
+sub main::GL_NOR { 0x1508 } 
+sub main::GL_XOR { 0x1506 } 
+sub main::GL_EQUIV { 0x1509 } 
+sub main::GL_AND_INVERTED { 0x1504 } 
+sub main::GL_OR_INVERTED { 0x150D } 
+sub main::GL_LOAD { 0x0101 } 
+sub main::GL_RETURN { 0x0102 } 
+sub main::GL_ADD { 0x0104 } 
+sub main::GL_MULT { 0x0103 } 
+sub main::GL_ACCUM { 0x0100 } 
+sub main::GL_MAP1_VERTEX_3 { 0x0D97 } 
+sub main::GL_MAP1_VERTEX_4 { 0x0D98 } 
+sub main::GL_MAP1_INDEX { 0x0D91 } 
+sub main::GL_MAP1_COLOR_4 { 0x0D90 } 
+sub main::GL_MAP1_NORMAL { 0x0D92 } 
+sub main::GL_MAP1_TEXTURE_COORD_1 { 0x0D93 } 
+sub main::GL_MAP1_TEXTURE_COORD_2 { 0x0D94 } 
+sub main::GL_MAP1_TEXTURE_COORD_3 { 0x0D95 } 
+sub main::GL_MAP1_TEXTURE_COORD_4 { 0x0D96 } 
+sub main::GL_MAP2_VERTEX_3 { 0x0DB7 } 
+sub main::GL_MAP2_VERTEX_4 { 0x0DB8 } 
+sub main::GL_MAP2_INDEX { 0x0DB1 } 
+sub main::GL_MAP2_COLOR_4 { 0x0DB0 } 
+sub main::GL_MAP2_NORMAL { 0x0DB2 } 
+sub main::GL_MAP2_TEXTURE_COORD_1 { 0x0DB3 } 
+sub main::GL_MAP2_TEXTURE_COORD_2 { 0x0DB4 } 
+sub main::GL_MAP2_TEXTURE_COORD_3 { 0x0DB5 } 
+sub main::GL_MAP2_TEXTURE_COORD_4 { 0x0DB6 } 
+sub main::GL_AUTO_NORMAL { 0x0D80 } 
+sub main::GL_LIGHTING { 0x0B50 } 
+sub main::GL_DEPTH_TEST { 0x0B71 } 
+sub main::GL_COLOR_TABLE { 0x80D0 } 
+sub main::GL_POST_CONVOLUTION_COLOR_TABLE { 0x80D1 } 
+sub main::GL_POST_COLOR_MATRIX_COLOR_TABLE { 0x80D2 } 
+sub main::GL_PROXY_COLOR_TABLE { 0x80D3 } 
+sub main::GL_PROXY_POST_CONVOLUTION_COLOR_TABLE { 0x80D4 } 
+sub main::GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE { 0x80D5 } 
+sub main::GL_CONVOLUTION_1D { 0x8010 } 
+sub main::GL_CONVOLUTION_2D { 0x8011 } 
+sub main::GL_SEPARABLE_2D { 0x8012 } 
+sub main::GL_CONVOLUTION_BORDER_MODE { 0x8013 } 
+sub main::GL_CONVOLUTION_FILTER_SCALE { 0x8014 } 
+sub main::GL_CONVOLUTION_FILTER_BIAS { 0x8015 } 
+sub main::GL_REDUCE { 0x8016 } 
+sub main::GL_CONSTANT_BORDER { 0x8151 } 
+sub main::GL_REPLICATE_BORDER { 0x8153 } 
+sub main::GL_HISTOGRAM { 0x8024 } 
+sub main::GL_PROXY_HISTOGRAM { 0x8025 } 
+sub main::GL_MINMAX { 0x802E } 
+sub main::GL_MIN { 0x8007 } 
+sub main::GL_MAX { 0x8008 } 
+sub main::GL_FUNC_ADD { 0x8006 } 
+sub main::GL_FUNC_SUBTRACT { 0x800A } 
+sub main::GL_FUNC_REVERSE_SUBTRACT { 0x800B } 
+sub main::GL_COLOR_TABLE_SCALE { 0x80D6 } 
+sub main::GL_READ_BUFFER { 0x0C02 } 
+sub main::GLU_DISPLAY_MODE { 100204 } 
+sub main::GLU_NURBS_MODE { 100160 } 
+sub main::GLU_CULLING { 100201 } 
+sub main::GLU_SAMPLING_METHOD { 100205 } 
+sub main::GLU_SAMPLING_TOLERANCE { 100203 } 
+sub main::GLU_PARAMETRIC_TOLERANCE { 100202 } 
+sub main::GLU_U_STEP { 100206 } 
+sub main::GLU_V_STEP { 100207 } 
+sub main::GLU_AUTO_LOAD_MATRIX { 100200 } 
+sub main::GLU_FILL { 100012 } 
+sub main::GLU_OUTLINE_POLYGON { 100240 } 
+sub main::GLU_OUTLINE_PATCH { 100241 } 
+sub main::GLU_NURBS_RENDERER { 100162 } 
+sub main::GLU_NURBS_TESSELLATOR { 100161 } 
+sub main::GLU_PATH_LENGTH { 100215 } 
+sub main::GLU_DOMAIN_DISTANCE { 100217 } 
+sub main::GLU_OBJECT_PATH_LENGTH { 100209 } 
+sub main::GLU_OBJECT_PARAMETRIC_ERROR { 100208 } 
+sub main::GLU_NURBS_ERROR { 100103 } 
+sub main::GLU_NURBS_BEGIN { 100164 } 
+sub main::GLU_NURBS_BEGIN_DATA { 100170 } 
+sub main::GLU_NURBS_TEXTURE_COORD { 100168 } 
+sub main::GLU_NURBS_TEXTURE_COORD_DATA { 100174 } 
+sub main::GLU_NURBS_COLOR { 100167 } 
+sub main::GLU_NURBS_COLOR_DATA { 100173 } 
+sub main::GLU_NURBS_NORMAL { 100166 } 
+sub main::GLU_NURBS_NORMAL_DATA { 100172 } 
+sub main::GLU_NURBS_VERTEX { 100165 } 
+sub main::GLU_NURBS_VERTEX_DATA { 100171 } 
+sub main::GLU_NURBS_END { 100169 } 
+sub main::GLU_NURBS_END_DATA { 100175 } 
+sub main::GLU_MAP1_TRIM_2 { 100210 } 
+sub main::GLU_MAP1_TRIM_3 { 100211 } 
+sub main::GLU_TESS_BOUNDARY_ONLY { 100141 } 
+sub main::GLU_TESS_TOLERANCE { 100142 } 
+sub main::GLU_TESS_WINDING_RULE { 100140 } 
+sub main::GLU_TESS_WINDING_ODD { 100130 } 
+sub main::GLU_TESS_WINDING_NONZERO { 100131 } 
+sub main::GLU_TESS_WINDING_POSITIVE { 100132 } 
+sub main::GLU_TESS_WINDING_NEGATIVE { 100133 } 
+sub main::GLU_TESS_WINDING_ABS_GEQ_TWO { 100134 } 
+
+
+1;
+
diff --git a/scripts/const.pl b/scripts/const.pl
new file mode 100644 (file)
index 0000000..9b95e7f
--- /dev/null
@@ -0,0 +1,167 @@
+#!/usr/bin/perl -w
+
+# Since the sdl_const.pl and gl_const.pl scripts with 2.0-beta2 don't seem to
+# work at all, this script takes SDL/Constans.pm and OpenGL/Constants.pm (as
+# original from 2.0-beta2) and fixes them up, and moves them into ../lib/
+
+# I already did this for 1.20.2, so you need to run this only if you intent
+# to rebuild the .pm files.
+
+# See http://Bloodgate.com/perl/sdl/sdl_perl.html
+
+use strict;
+
+##############################################################################
+
+my $sdl = read_file('SDL/Constants.pm');
+
+# remove 'main::' on subs
+$sdl =~ s/sub main::([\w]+)/sub $1/g;
+
+# turn on () on subs to make peep optimizer to inline them
+#$sdl =~ s/sub ([\w]+)\s+{/sub $1 () {/g;
+
+write_file('../lib/SDL/Constants.pm',insert_export($sdl));
+
+undef $sdl;
+
+##############################################################################
+
+my $gl = read_file('OpenGL/Constants.pm');
+
+# remove 'main::' on subs
+$gl =~ s/sub main::([\w]+)/sub $1/g;
+
+# turn on () on subs to make peep optimizer to inline them
+#$gl =~ s/sub ([\w]+)\s+{/sub $1 () {/g;
+
+write_file 
+  ('../lib/SDL/OpenGL/Constants.pm',insert_export($gl,grep_constants()));
+
+1;
+
+sub read_file
+  {
+  my $file = shift;
+
+  print "Reading $file...";
+  my $FILE;
+  open $FILE, $file or die ("Cannot read $file: $!\n");
+  local $/;    # slurp mode
+  my $doc = <$FILE>;
+  close $FILE;
+  print "done.\n";
+  $doc;
+  }
+
+sub write_file
+  {
+  my ($file,$txt) = @_;
+
+  print "Writing $file...";
+  my $FILE;
+  open $FILE, ">$file" or die ("Cannot write $file: $!\n");
+  print $FILE $txt;
+  close $FILE;
+  print "done.\n";
+  }
+
+sub insert_export
+  {
+  my $txt = shift;
+
+  my @sub = ();
+  # gather all sub names
+  $txt =~ s/sub ([\w]+)\s+/push @sub, $1; 'sub ' . $1 . ' '/eg;
+
+  # if we got a second list of names, parse it and include anything that isn't
+  # alreay in
+
+  my $add = "";
+  if (ref($_[0]) eq 'ARRAY')
+    {
+    my $const = shift;
+    foreach my $c (sort @$const)
+      {
+      if ( grep (/^$c->[0]$/, @sub) == 0)
+       {
+       print "Adding $c->[0] $c->[1]\n";
+        $add .= "sub $c->[0] () { $c->[1] }\n";
+        push @sub, $c->[0];
+       }
+      }
+    $add .= "\n";
+    }
+
+  # SDL/Constants.pm contains doubles :-( So filter them out.
+  my @sorted = sort @sub;
+  my $last; @sub = (); my @doubles;
+  foreach my $cur (@sorted)
+    {
+    if (defined $last && $last eq $cur)
+      {
+      # double!
+      push @doubles,$last;
+      }
+    else
+      {
+      push @sub, $last if defined $last;
+      }
+    $last = $cur;
+    }
+  foreach my $cur (@doubles)
+    {
+    $txt =~ s/\bsub $cur.*//g; # remove
+    }
+
+  my $export = "require Exporter;\nuse strict;\n";
+  $export .= "use vars qw/\$VERSION \@ISA \@EXPORT/;";
+  $export .= "\n\@ISA = qw/Exporter/;\n";
+  
+  # this makes Exporter export the symbols from SDL::Constants to whatever
+  # package used SDL::Constants (usually SDL::Event.pm)
+  my $pack;
+  if ($txt =~ /SDL::Constants/)
+    {
+    $txt =~ s/SDL::Constants/SDL::Event/g;
+    $pack = 'SDL::Event';
+    }
+  if ($txt =~ /SDL::OpenGL::Constants/)
+    {
+    $txt =~ s/SDL::OpenGL::Constants/SDL::OpenGL/g;
+    $pack = 'SDL::OpenGL';
+    }
+  $export .= "\nsub import { $pack\->export_to_level(1, \@_); }\n";
+
+  $export .= "\n\@EXPORT = qw/\n";
+
+  my $line = "\t";
+  foreach my $s (sort @sub)
+    {
+    if (length($line)+length($s) > 70)
+      {
+      $export .= "$line\n"; $line = "\t";
+      }
+    $line .= "$s ";
+    }
+  $export .= "$line /;\n";
+
+  # insert Exporter section
+  $txt =~ s/sub/$export\n\n$add\nsub/;
+
+  $txt;
+  }
+
+sub grep_constants
+  {
+  # grep all the OpenGL constants from SDL and return them
+
+  my $sdl_gl = read_file('/usr/include/GL/gl.h');
+
+  my @const = ();
+  $sdl_gl =~ s/^#define (GL_.*?)\s+(0x[\da-fA-F]+)/push @const,[$1,$2];/egm;
+
+  \@const; 
+  }
+
+END { print "\n"; }
diff --git a/scripts/gl_const.pl b/scripts/gl_const.pl
new file mode 100644 (file)
index 0000000..af95922
--- /dev/null
@@ -0,0 +1,69 @@
+#!/usr/bin/env perl
+#
+
+open XS, "< opengl_words.txt";
+open CPP, "| cpp - > OpenGL.cx";
+
+print CPP <<HEADER;
+#include <GL/gl.h>
+#include <GL/glu.h>
+
+--cut--
+HEADER
+
+while (<XS>) {
+       chomp();
+       print CPP "#$_ $_\n";
+       $words{$_} = 0;
+}
+
+close XS;
+close CPP;
+
+my $text;
+open FP, "< OpenGL.cx" 
+       or die "Couldn't open OpenGL.cx\n";
+{
+       local $/ = undef;
+       $text = <FP>;
+}
+
+my ($junk,$goodstuff) = split "--cut--", $text;
+
+$goodstuff =~ s/#(GL[U]?_[A-Z0-9_]+)\s+([0-9xa-fA-F]+)/sub main::$1 { $2 }/g;
+       
+for (split "\n",$goodstuff) {
+       if (/sub main::(GL[U]?_[A-Z0-9_]+)/ ) {
+               push @words, $1;
+       }
+}
+
+for ( @words ) {
+       $words{$_} = 1;
+}
+
+for ( keys %words ) {
+       print STDERR "Failed to find word $_" unless ($words{$_});
+}
+
+open OGL, "> ../lib/SDL/OpenGL/Constants.pm";
+
+$words = join(" ",@words);
+
+print OGL <<HERE;
+# SDL::OpenGL::Constants
+#
+# This is an autogenerate file, don't bother editing.
+# Names are read from a list in opengl_words.txt and written by gl_const.pl.
+#
+# Copyright (C) 2003 David J. Goehrig <dave\@sdlperl.org>
+
+package SDL::OpenGL::Constants;
+
+$goodstuff
+
+1;
+
+HERE
+
+system("rm OpenGL.cx");
diff --git a/scripts/opengl_words.txt b/scripts/opengl_words.txt
new file mode 100644 (file)
index 0000000..c2bfb1b
--- /dev/null
@@ -0,0 +1,423 @@
+GL_COLOR_BUFFER_BIT
+GL_DEPTH_BUFFER_BIT
+GL_ACCUM_BUFFER_BIT
+GL_STENCIL_BUFFER_BIT
+GL_POINTS
+GL_LINES
+GL_LINE_STRIP
+GL_LINE_LOOP
+GL_TRIANGLES
+GL_TRIANGLE_STRIP
+GL_TRIANGLE_FAN
+GL_QUADS
+GL_QUAD_STRIP
+GL_POLYGON
+GL_LINE_STIPPLE
+GL_FRONT
+GL_BACK
+GL_POINT
+GL_LINE
+GL_FILL
+GL_CCW
+GL_CW
+GL_FRONT_AND_BACK
+GL_CULL_FACE
+GL_POLYGON_STIPPLE
+GL_NORMALIZE
+GL_RESCALE_NORMAL
+GL_VERTEX_ARRAY
+GL_COLOR_ARRAY
+GL_INDEX_ARRAY
+GL_NORMAL_ARRAY
+GL_TEXTURE_COORD_ARRAY
+GL_EDGE_FLAG_ARRAY
+GL_BYTE
+GL_UNSIGNED_BYTE
+GL_SHORT
+GL_UNSIGNED_SHORT
+GL_INT
+GL_UNSIGNED_INT
+GL_FLOAT
+GL_DOUBLE
+GL_V2F
+GL_V3F
+GL_C4UB_V2F
+GL_C4UB_V3F
+GL_C3F_V3F
+GL_N3F_V3F
+GL_C4F_N3F_V3F
+GL_T2F_V3F
+GL_T4F_V4F
+GL_T2F_C4UB_V3F
+GL_T2F_C3F_V3F
+GL_T2F_N3F_V3F
+GL_T2F_C4F_N3F_V3F
+GL_T4F_C4F_N3F_V4F
+GL_ALL_ATTRIB_BITS
+GL_CURRENT_BIT
+GL_ENABLE_BIT
+GL_EVAL_BIT
+GL_FOG_BIT
+GL_HINT_BIT
+GL_LIGHTING_BIT
+GL_LINE_BIT
+GL_LIST_BIT
+GL_PIXEL_MODE_BIT
+GL_POINT_BIT
+GL_POLYGON_BIT
+GL_POLYGON_STIPPLE_BIT
+GL_SCISSOR_BIT
+GL_TEXTURE_BIT
+GL_TRANSFORM_BIT
+GL_VIEWPORT_BIT
+GL_CLIENT_PIXEL_STORE_BIT
+GL_CLIENT_VERTEX_ARRAY_BIT
+GL_ALL_CLIENT_ATTRIB_BITS
+GL_MODELVIEW
+GL_PROJECTION
+GL_TEXTURE
+GL_SMOOTH
+GL_FLAT
+GL_LIGHT0
+GL_LIGHT1
+GL_LIGHT2
+GL_LIGHT3
+GL_LIGHT4
+GL_LIGHT5
+GL_LIGHT6
+GL_LIGHT7
+GL_AMBIENT
+GL_DIFFUSE
+GL_AMBIENT_AND_DIFFUSE
+GL_SPECULAR
+GL_SHININESS
+GL_EMISSION
+GL_COLOR_INDEXES
+GL_POSITION
+GL_SPOT_DIRECTION
+GL_SPOT_EXPONENT
+GL_SPOT_CUTOFF
+GL_CONSTANT_ATTENUATION
+GL_LINEAR_ATTENUATION
+GL_QUADRATIC_ATTENUATION
+GL_LIGHT_MODEL_AMBIENT
+GL_LIGHT_MODEL_LOCAL_VIEWER
+GL_LIGHT_MODEL_TWO_SIDE
+GL_LIGHT_MODEL_COLOR_CONTROL
+GL_FALSE
+GL_TRUE
+GL_SINGLE_COLOR
+GL_ZERO
+GL_ONE
+GL_DST_COLOR
+GL_SRC_COLOR
+GL_ONE_MINUS_DST_COLOR
+GL_ONE_MINUS_SRC_COLOR
+GL_SRC_ALPHA
+GL_ONE_MINUS_SRC_ALPHA
+GL_SRC_ALPHA_SATURATE
+GL_CONSTANT_COLOR
+GL_ONE_MINUS_CONSTANT_COLOR
+GL_CONSTANT_ALPHA
+GL_ONE_MINUS_CONSTANT_ALPHA
+GL_POINT_SMOOTH_HINT
+GL_LINE_SMOOTH_HINT
+GL_POLYGON_SMOOTH_HINT
+GL_FOG_HINT
+GL_PERSPECTIVE_CORRECTION_HINT
+GL_EXP
+GL_EXP2
+GL_FOG_MODE
+GL_LINEAR
+GL_FOG_DENSITY
+GL_FOG_START
+GL_FOG_END
+GL_FOG_COLOR
+GL_POLYGON_OFFSET_LINE
+GL_POLYGON_OFFSET_FILL
+GL_POLYGON_OFFSET_POINT
+GL_COLOR_INDEX
+GL_RGB
+GL_RGBA
+GL_BGR
+GL_BGRA
+GL_RED
+GL_GREEN
+GL_BLUE
+GL_ALPHA
+GL_LUMINANCE
+GL_LUMINANCE_ALPHA
+GL_STENCIL_INDEX
+GL_DEPTH_COMPONENT
+GL_BITMAP
+GL_UNSIGNED_BYTE_3_3_2
+GL_UNSIGNED_BYTE_2_3_3_REV
+GL_UNSIGNED_SHORT_5_6_5
+GL_UNSIGNED_SHORT_5_6_5_REV
+GL_UNSIGNED_SHORT_4_4_4_4
+GL_UNSIGNED_SHORT_4_4_4_4_REV
+GL_UNSIGNED_SHORT_5_5_5_1
+GL_UNSIGNED_SHORT_1_5_5_5_REV
+GL_UNSIGNED_INT_8_8_8_8
+GL_UNSIGNED_INT_8_8_8_8_REV
+GL_UNSIGNED_INT_10_10_10_2
+GL_UNSIGNED_INT_2_10_10_10_REV
+GL_UNPACK_SWAP_BYTES
+GL_PACK_SWAP_BYTES
+GL_UNPACK_LSB_FIRST
+GL_PACK_LSB_FIRST
+GL_UNPACK_ROW_LENGTH
+GL_PACK_ROW_LENGTH
+GL_UNPACK_SKIP_ROWS
+GL_PACK_SKIP_ROWS
+GL_UNPACK_SKIP_PIXELS
+GL_PACK_SKIP_PIXELS
+GL_UNPACK_ALIGNMENT
+GL_PACK_ALIGNMENT
+GL_UNPACK_IMAGE_HEIGHT
+GL_PACK_IMAGE_HEIGHT
+GL_UNPACK_SKIP_IMAGES
+GL_PACK_SKIP_IMAGES
+GL_MAP_COLOR
+GL_MAP_STENCIL
+GL_INDEX_SHIFT
+GL_INDEX_OFFSET
+GL_RED_SCALE
+GL_GREEN_SCALE
+GL_BLUE_SCALE
+GL_ALPHA_SCALE
+GL_DEPTH_SCALE
+GL_RED_BIAS
+GL_GREEN_BIAS
+GL_BLUE_BIAS
+GL_ALPHA_BIAS
+GL_DEPTH_BIAS
+GL_POST_CONVOLUTION_RED_SCALE
+GL_POST_CONVOLUTION_GREEN_SCALE
+GL_POST_CONVOLUTION_BLUE_SCALE
+GL_POST_CONVOLUTION_ALPHA_SCALE
+GL_POST_CONVOLUTION_RED_BIAS
+GL_POST_CONVOLUTION_GREEN_BIAS
+GL_POST_CONVOLUTION_BLUE_BIAS
+GL_POST_CONVOLUTION_ALPHA_BIAS
+GL_POST_COLOR_MATRIX_RED_SCALE
+GL_POST_COLOR_MATRIX_GREEN_SCALE
+GL_POST_COLOR_MATRIX_BLUE_SCALE
+GL_POST_COLOR_MATRIX_ALPHA_SCALE
+GL_POST_COLOR_MATRIX_RED_BIAS
+GL_POST_COLOR_MATRIX_GREEN_BIAS
+GL_POST_COLOR_MATRIX_BLUE_BIAS
+GL_POST_COLOR_MATRIX_ALPHA_BIAS
+GL_PIXEL_MAP_I_TO_I
+GL_PIXEL_MAP_S_TO_S
+GL_PIXEL_MAP_I_TO_R
+GL_PIXEL_MAP_I_TO_G
+GL_PIXEL_MAP_I_TO_B
+GL_PIXEL_MAP_I_TO_A
+GL_PIXEL_MAP_R_TO_R
+GL_PIXEL_MAP_G_TO_G
+GL_PIXEL_MAP_B_TO_B
+GL_PIXEL_MAP_A_TO_A
+GL_TEXTURE_1D
+GL_TEXTURE_2D
+GL_TEXTURE_3D
+GL_PROXY_TEXTURE_2D
+GL_ALPHA4
+GL_ALPHA8
+GL_ALPHA12
+GL_ALPHA16
+GL_LUMINANCE4
+GL_LUMINANCE8
+GL_LUMINANCE12
+GL_LUMINANCE16
+GL_LUMINANCE4_ALPHA4
+GL_LUMINANCE6_ALPHA2
+GL_LUMINANCE8_ALPHA8
+GL_LUMINANCE12_ALPHA4
+GL_LUMINANCE12_ALPHA12
+GL_LUMINANCE16_ALPHA16
+GL_INTENSITY
+GL_INTENSITY4
+GL_INTENSITY8
+GL_INTENSITY12
+GL_INTENSITY16
+GL_R3_G3_B2
+GL_RGB4
+GL_RGB5
+GL_RGB8
+GL_RGB10
+GL_RGB12
+GL_RGB16
+GL_RGBA2
+GL_RGBA4
+GL_RGB5_A1
+GL_RGBA8
+GL_RGB10_A2
+GL_RGBA12
+GL_RGBA16
+GL_MAX_TEXTURE_SIZE
+GL_TEXTURE_BASE_LEVEL
+GL_TEXTURE_MAX_LEVEL
+GL_TEXTURE_MAX_LOD
+GL_TEXTURE_MIN_LOD
+GL_TEXTURE_ENV_MODE
+GL_TEXTURE_ENV_COLOR
+GL_DECAL
+GL_REPLACE
+GL_MODULATE
+GL_BLEND
+GL_TEXTURE_WRAP_S
+GL_TEXTURE_WRAP_T
+GL_TEXTURE_WRAP_R
+GL_TEXTURE_MAG_FILTER
+GL_TEXTURE_MIN_FILTER
+GL_TEXTURE_BORDER_COLOR
+GL_TEXTURE_PRIORITY
+GL_CLAMP
+GL_CLAMP_TO_EDGE
+GL_REPEAT
+GL_NEAREST
+GL_NEAREST_MIPMAP_NEAREST
+GL_NEAREST_MIPMAP_LINEAR
+GL_LINEAR_MIPMAP_NEAREST
+GL_LINEAR_MIPMAP_LINEAR
+GL_S
+GL_T
+GL_R
+GL_Q
+GL_TEXTURE_GEN_MODE
+GL_OBJECT_PLANE
+GL_EYE_PLANE
+GL_EYE_LINEAR
+GL_OBJECT_LINEAR
+GL_SPHERE_MAP
+GL_LEFT
+GL_RIGHT
+GL_FRONT_LEFT
+GL_FRONT_RIGHT
+GL_BACK_LEFT
+GL_BACK_RIGHT
+GL_NONE
+GL_SCISSOR_TEST
+GL_NEVER
+GL_ALWAYS
+GL_LESS
+GL_LEQUAL
+GL_EQUAL
+GL_GEQUAL
+GL_GREATER
+GL_NOTEQUAL
+GL_KEEP
+GL_INCR
+GL_DECR
+GL_INVERT
+GL_CLEAR
+GL_COPY
+GL_NOOP
+GL_SET
+GL_COPY_INVERTED
+GL_AND_REVERSE
+GL_OR_REVERSE
+GL_AND
+GL_OR
+GL_NAND
+GL_NOR
+GL_XOR
+GL_EQUIV
+GL_AND_INVERTED
+GL_OR_INVERTED
+GL_LOAD
+GL_RETURN
+GL_ADD
+GL_MULT
+GL_ACCUM
+GL_MAP1_VERTEX_3
+GL_MAP1_VERTEX_4
+GL_MAP1_INDEX
+GL_MAP1_COLOR_4
+GL_MAP1_NORMAL
+GL_MAP1_TEXTURE_COORD_1
+GL_MAP1_TEXTURE_COORD_2
+GL_MAP1_TEXTURE_COORD_3
+GL_MAP1_TEXTURE_COORD_4
+GL_MAP2_VERTEX_3
+GL_MAP2_VERTEX_4
+GL_MAP2_INDEX
+GL_MAP2_COLOR_4
+GL_MAP2_NORMAL
+GL_MAP2_TEXTURE_COORD_1
+GL_MAP2_TEXTURE_COORD_2
+GL_MAP2_TEXTURE_COORD_3
+GL_MAP2_TEXTURE_COORD_4
+GL_AUTO_NORMAL
+GL_LIGHTING
+GL_DEPTH_TEST
+GL_COLOR_TABLE
+GL_POST_CONVOLUTION_COLOR_TABLE
+GL_POST_COLOR_MATRIX_COLOR_TABLE
+GL_PROXY_COLOR_TABLE
+GL_PROXY_POST_CONVOLUTION_COLOR_TABLE
+GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE
+GL_CONVOLUTION_1D
+GL_CONVOLUTION_2D
+GL_SEPARABLE_2D
+GL_CONVOLUTION_BORDER_MODE
+GL_CONVOLUTION_FILTER_SCALE
+GL_CONVOLUTION_FILTER_BIAS
+GL_REDUCE
+GL_CONSTANT_BORDER
+GL_REPLICATE_BORDER
+GL_HISTOGRAM
+GL_PROXY_HISTOGRAM
+GL_MINMAX
+GL_MIN
+GL_MAX
+GL_FUNC_ADD
+GL_FUNC_SUBTRACT
+GL_FUNC_REVERSE_SUBTRACT
+GL_COLOR_TABLE_SCALE
+GL_READ_BUFFER
+GL_FEEDBACK
+GL_SELECT
+GL_RENDER
+GLU_DISPLAY_MODE
+GLU_NURBS_MODE
+GLU_CULLING
+GLU_SAMPLING_METHOD
+GLU_SAMPLING_TOLERANCE
+GLU_PARAMETRIC_TOLERANCE
+GLU_U_STEP
+GLU_V_STEP
+GLU_AUTO_LOAD_MATRIX
+GLU_FILL
+GLU_OUTLINE_POLYGON
+GLU_OUTLINE_PATCH
+GLU_NURBS_RENDERER
+GLU_NURBS_TESSELLATOR
+GLU_PATH_LENGTH
+GLU_DOMAIN_DISTANCE
+GLU_OBJECT_PATH_LENGTH
+GLU_OBJECT_PARAMETRIC_ERROR
+GLU_NURBS_ERROR
+GLU_NURBS_BEGIN
+GLU_NURBS_BEGIN_DATA
+GLU_NURBS_TEXTURE_COORD
+GLU_NURBS_TEXTURE_COORD_DATA
+GLU_NURBS_COLOR
+GLU_NURBS_COLOR_DATA
+GLU_NURBS_NORMAL
+GLU_NURBS_NORMAL_DATA
+GLU_NURBS_VERTEX
+GLU_NURBS_VERTEX_DATA
+GLU_NURBS_END
+GLU_NURBS_END_DATA
+GLU_MAP1_TRIM_2
+GLU_MAP1_TRIM_3
+GLU_TESS_BOUNDARY_ONLY
+GLU_TESS_TOLERANCE
+GLU_TESS_WINDING_RULE
+GLU_TESS_WINDING_ODD
+GLU_TESS_WINDING_NONZERO
+GLU_TESS_WINDING_POSITIVE
+GLU_TESS_WINDING_NEGATIVE
+GLU_TESS_WINDING_ABS_GEQ_TWO
diff --git a/scripts/sdl_const.pl b/scripts/sdl_const.pl
new file mode 100644 (file)
index 0000000..88503ee
--- /dev/null
@@ -0,0 +1,115 @@
+#!/usr/bin/env perl
+#
+
+open XS, "< sdl_words.txt" or die "could not open sdl_words.txt\n";
+open CPP, "| cpp `sdl-config --cflags` - > SDL.cx" or die "Could not pipe to cpp, $!\n";
+
+print CPP <<HEADER;
+#include <SDL.h>
+#define TEXT_SOLID     1
+#define TEXT_SHADED    2
+#define TEXT_BLENDED   4
+#define UTF8_SOLID     8
+#define UTF8_SHADED    16      
+#define UTF8_BLENDED   32
+#define UNICODE_SOLID  64
+#define UNICODE_SHADED 128
+#define UNICODE_BLENDED        256
+
+--cut--
+HEADER
+
+while (<XS>) {
+       chomp();
+       print CPP "#$_ $_\n";
+       $words{$_} = 0;
+}
+
+close XS;
+close CPP;
+
+#
+# ENUMS AREN'T CPPed we got to do this the hard way
+#
+
+open FP, "> sdl_const.c" or die "Could not write to sdl__const.c\n";
+
+print FP <<HERE;
+#include <SDL.h>
+#include <SDL_image.h>
+#include <SDL_mixer.h>
+#include <SDL_ttf.h>
+#include <SDL_net.h>
+#include <smpeg/smpeg.h>
+#define TEXT_SOLID     1
+#define TEXT_SHADED    2
+#define TEXT_BLENDED   4
+#define UTF8_SOLID     8
+#define UTF8_SHADED    16      
+#define UTF8_BLENDED   32
+#define UNICODE_SOLID  64
+#define UNICODE_SHADED 128
+#define UNICODE_BLENDED        256
+
+int
+main ( int argc, char **argv ) {
+
+HERE
+
+for ( grep { $words{$_} == 0 } keys %words ) { 
+       print FP <<THERE;
+       fprintf(stdout,"sub main::$_ { \%i }\n", $_);
+THERE
+
+}
+
+print FP <<HERE;
+}
+HERE
+
+system("gcc `sdl-config --cflags --libs` -o sdl_const sdl_const.c");
+
+my $enums;
+open ENUMS, "./sdl_const |";
+{
+       local $/ = undef;
+       $enums = <ENUMS>;
+}
+close ENUMS;
+
+$goodstuff .= "\n$enums";
+
+for ( split "\n", $goodstuff ) {
+       if (/sub\s+main::([A-Za-z0-9_]+)/) {
+               $words{$1} = 1;
+       }
+}
+
+for (keys %words) {
+       print STDERR "Failed to find $_\n" unless $words{$_};   
+}
+
+(@words) = grep { $words{$_} == 1 } keys %words;
+
+$words = join(" ",@words);
+
+open CONST, "> ../lib/SDL/Constants.pm";
+
+print CONST <<HERE;
+# SDL::Constants
+#
+# This is an automatically generated file, don't bother editing.
+# Names are read from a list in sdl_words.txt and written by sdl_const.pl.
+#
+# Copyright (C) 2003 David J. Goehrig <dave\@sdlperl.org>
+#
+
+package SDL::Constants;
+
+$goodstuff
+
+1;
+
+HERE
+
+system("rm -f SDL.cx sdl_const sdl_const.c");
diff --git a/scripts/sdl_words.txt b/scripts/sdl_words.txt
new file mode 100644 (file)
index 0000000..4104b3f
--- /dev/null
@@ -0,0 +1,261 @@
+AUDIO_S16
+AUDIO_S16MSB
+AUDIO_S8
+AUDIO_U16
+AUDIO_U16MSB
+AUDIO_U8
+CD_STOPPED
+CD_PLAYING
+CD_PAUSED
+CD_ERROR
+CD_TRAYEMPTY
+INADDR_NONE
+INADDR_ANY
+KMOD_ALT
+KMOD_CAPS
+KMOD_CTRL
+KMOD_LALT
+KMOD_LCTRL
+KMOD_LSHIFT
+KMOD_NONE
+KMOD_NUM
+KMOD_RALT
+KMOD_RCTRL
+KMOD_RSHIFT
+KMOD_SHIFT
+MIX_DEFAULT_CHANNELS
+MIX_DEFAULT_FORMAT
+MIX_DEFAULT_FREQUENCY
+MIX_FADING_IN
+MIX_FADING_OUT
+MIX_MAX_VOLUME
+MIX_NO_FADING
+SDLK_0
+SDLK_1
+SDLK_2
+SDLK_3
+SDLK_4
+SDLK_5
+SDLK_6
+SDLK_7
+SDLK_8
+SDLK_9
+SDLK_AMPERSAND
+SDLK_ASTERISK
+SDLK_AT
+SDLK_BACKQUOTE
+SDLK_BACKSLASH
+SDLK_BACKSPACE
+SDLK_BREAK
+SDLK_CAPSLOCK
+SDLK_CARET
+SDLK_CLEAR
+SDLK_COLON
+SDLK_COMMA
+SDLK_DELETE
+SDLK_DOLLAR
+SDLK_DOWN
+SDLK_END
+SDLK_EQUALS
+SDLK_ESCAPE
+SDLK_EURO
+SDLK_EXCLAIM
+SDLK_F1
+SDLK_F10
+SDLK_F11
+SDLK_F12
+SDLK_F13
+SDLK_F14
+SDLK_F15
+SDLK_F2
+SDLK_F3
+SDLK_F4
+SDLK_F5
+SDLK_F6
+SDLK_F7
+SDLK_F8
+SDLK_F9
+SDLK_GREATER
+SDLK_HASH
+SDLK_HELP
+SDLK_HOME
+SDLK_INSERT
+SDLK_KP0
+SDLK_KP1
+SDLK_KP2
+SDLK_KP3
+SDLK_KP4
+SDLK_KP5
+SDLK_KP6
+SDLK_KP7
+SDLK_KP8
+SDLK_KP9
+SDLK_KP_DIVIDE
+SDLK_KP_ENTER
+SDLK_KP_EQUALS
+SDLK_KP_MINUS
+SDLK_KP_MULTIPLY
+SDLK_KP_PERIOD
+SDLK_KP_PLUS
+SDLK_LALT
+SDLK_LCTRL
+SDLK_LEFT
+SDLK_LEFTBRACKET
+SDLK_LEFTPAREN
+SDLK_LESS
+SDLK_LMETA
+SDLK_LSHIFT
+SDLK_LSUPER
+SDLK_MENU
+SDLK_MINUS
+SDLK_MODE
+SDLK_NUMLOCK
+SDLK_PAGEDOWN
+SDLK_PAGEUP
+SDLK_PAUSE
+SDLK_PERIOD
+SDLK_PLUS
+SDLK_POWER
+SDLK_PRINT
+SDLK_QUESTION
+SDLK_QUOTE
+SDLK_QUOTEDBL
+SDLK_RALT
+SDLK_RCTRL
+SDLK_RETURN
+SDLK_RIGHT
+SDLK_RIGHTBRACKET
+SDLK_RIGHTPAREN
+SDLK_RMETA
+SDLK_RSHIFT
+SDLK_RSUPER
+SDLK_SCROLLOCK
+SDLK_SEMICOLON
+SDLK_SLASH
+SDLK_SPACE
+SDLK_SYSREQ
+SDLK_TAB
+SDLK_UNDERSCORE
+SDLK_UP
+SDLK_a
+SDLK_b
+SDLK_c
+SDLK_d
+SDLK_e
+SDLK_f
+SDLK_g
+SDLK_h
+SDLK_i
+SDLK_j
+SDLK_k
+SDLK_l
+SDLK_m
+SDLK_n
+SDLK_o
+SDLK_p
+SDLK_q
+SDLK_r
+SDLK_s
+SDLK_t
+SDLK_u
+SDLK_v
+SDLK_w
+SDLK_x
+SDLK_y
+SDLK_z
+SDL_ACTIVEEVENT
+SDL_ANYFORMAT
+SDL_APPACTIVE
+SDL_APPINPUTFOCUS
+SDL_APPMOUSEFOCUS
+SDL_ASYNCBLIT
+SDL_AUDIO_PAUSED
+SDL_AUDIO_PLAYING
+SDL_AUDIO_STOPPED
+SDL_DOUBLEBUF
+SDL_ENABLE
+SDL_FULLSCREEN
+SDL_GL_ACCUM_ALPHA_SIZE
+SDL_GL_ACCUM_BLUE_SIZE
+SDL_GL_ACCUM_GREEN_SIZE
+SDL_GL_ACCUM_RED_SIZE
+SDL_GL_ALPHA_SIZE
+SDL_GL_BLUE_SIZE
+SDL_GL_BUFFER_SIZE
+SDL_GL_DEPTH_SIZE
+SDL_GL_DOUBLEBUFFER
+SDL_GL_GREEN_SIZE
+SDL_GL_RED_SIZE
+SDL_GL_STENCIL_SIZE
+SDL_GRAB_OFF
+SDL_GRAB_ON
+SDL_GRAB_QUERY
+SDL_HAT_CENTERED
+SDL_HAT_DOWN
+SDL_HAT_LEFT
+SDL_HAT_LEFTDOWN
+SDL_HAT_LEFTUP
+SDL_HAT_RIGHT
+SDL_HAT_RIGHTDOWN
+SDL_HAT_RIGHTUP
+SDL_HAT_UP
+SDL_HWACCEL
+SDL_HWPALETTE
+SDL_HWSURFACE
+SDL_IGNORE
+SDL_INIT_AUDIO
+SDL_INIT_CDROM
+SDL_INIT_EVERYTHING
+SDL_INIT_JOYSTICK
+SDL_INIT_NOPARACHUTE
+SDL_INIT_TIMER
+SDL_INIT_VIDEO
+SDL_IYUV_OVERLAY
+SDL_JOYAXISMOTION
+SDL_JOYBALLMOTION
+SDL_JOYBUTTONDOWN
+SDL_JOYBUTTONUP
+SDL_JOYHATMOTION
+SDL_KEYDOWN
+SDL_KEYUP
+SDL_MIX_MAXVOLUME
+SDL_MOUSEBUTTONDOWN
+SDL_MOUSEBUTTONUP
+SDL_MOUSEMOTION
+SDL_BUTTON_WHEELUP
+SDL_BUTTON_WHEELDOWN
+SDL_OPENGL
+SDL_OPENGLBLIT
+SDL_PREALLOC
+SDL_PRESSED
+SDL_QUERY
+SDL_QUIT
+SDL_RELEASED
+SDL_RESIZABLE
+SDL_RLEACCEL
+SDL_RLEACCELOK
+SDL_SRCALPHA
+SDL_SRCCOLORKEY
+SDL_SWSURFACE
+SDL_SYSWMEVENT
+SDL_UYVY_OVERLAY
+SDL_VIDEORESIZE
+SDL_YUY2_OVERLAY
+SDL_YV12_OVERLAY
+SDL_YVYU_OVERLAY
+SMPEG_ERROR
+SMPEG_PLAYING
+SMPEG_STOPPED
+TTF_STYLE_BOLD
+TTF_STYLE_ITALIC
+TTF_STYLE_NORMAL
+TTF_STYLE_UNDERLINE
+TEXT_SOLID
+TEXT_SHADED
+TEXT_BLENDED
+UTF8_SOLID
+UTF8_SHADED
+UTF8_BLENDED
+UNICODE_SOLID
+UNICODE_SHADED
+UNICODE_BLENDED