[Gridflow-cvs] [svn] commit: r5992 - /trunk/src/opengl.cxx

svn-gridflow at artengine.ca svn-gridflow at artengine.ca
Sat Aug 7 15:32:38 EDT 2010


Author: matju
Date: Sat Aug  7 15:32:36 2010
New Revision: 5992

Log:
more more more

Modified:
    trunk/src/opengl.cxx

Modified: trunk/src/opengl.cxx
==============================================================================
--- trunk/src/opengl.cxx (original)
+++ trunk/src/opengl.cxx Sat Aug  7 15:32:36 2010
@@ -41,7 +41,7 @@
 			return it->second;
 		} else RAISE("to %s: expected float or symbol",name);
 	}
-	void add (t_symbol *s, GLenum i) {forward[s]=i; backward[i]=s;}
+	EnumType &add (t_symbol *s, GLenum i) {forward[s]=i; backward[i]=s; return *this;}
 };
 static t_symbol *tolower_gensym (const char *s) {
 	char t[64]; strcpy(t,s);
@@ -70,354 +70,360 @@
 MAKETYPE(material_mode)
 MAKETYPE(copy_tex_target)
 MAKETYPE(copy_tex_format)
+MAKETYPE(mesh_mode)
 static void init_enums () {
-	#define define(NAME) THAT.add(tolower_gensym(#NAME+3),NAME);
-	#define THAT primitive_type
-	define(GL_POINTS)
-	define(GL_LINES)
-	define(GL_LINE_LOOP)
-	define(GL_LINE_STRIP)
-	define(GL_TRIANGLES)
-	define(GL_TRIANGLE_STRIP)
-	define(GL_TRIANGLE_FAN)
-	define(GL_QUADS)
-	define(GL_QUAD_STRIP)
-	define(GL_POLYGON)
-	#undef THAT
-	#define THAT capability
-	define(GL_ALPHA_TEST)
-	define(GL_AUTO_NORMAL)
-	define(GL_BLEND)
-	define(GL_CLIP_PLANE0)
-	define(GL_CLIP_PLANE1)
-	define(GL_CLIP_PLANE2)
-	define(GL_CLIP_PLANE3)
-	define(GL_CLIP_PLANE4)
-	define(GL_CLIP_PLANE5)
-	define(GL_COLOR_LOGIC_OP)
-	define(GL_COLOR_MATERIAL)
-	define(GL_COLOR_SUM)
-	define(GL_COLOR_TABLE)
-	define(GL_CONVOLUTION_1D)
-	define(GL_CONVOLUTION_2D)
-	define(GL_CULL_FACE)
-	define(GL_DEPTH_TEST)
-	define(GL_DITHER)
-	define(GL_FOG)
-	define(GL_HISTOGRAM)
-	define(GL_INDEX_LOGIC_OP)
-	define(GL_LIGHT0)
-	define(GL_LIGHT1)
-	define(GL_LIGHT2)
-	define(GL_LIGHT3)
-	define(GL_LIGHT4)
-	define(GL_LIGHT5)
-	define(GL_LIGHT6)
-	define(GL_LIGHT7)
-	define(GL_LIGHTING)
-	define(GL_LINE_SMOOTH)
-	define(GL_LINE_STIPPLE)
-	define(GL_MAP1_COLOR_4)
-	define(GL_MAP1_INDEX)
-	define(GL_MAP1_NORMAL)
-	define(GL_MAP1_TEXTURE_COORD_1)
-	define(GL_MAP1_TEXTURE_COORD_2)
-	define(GL_MAP1_TEXTURE_COORD_3)
-	define(GL_MAP1_TEXTURE_COORD_4)
-	define(GL_MAP1_VERTEX_3)
-	define(GL_MAP1_VERTEX_4)
-	define(GL_MAP2_COLOR_4)
-	define(GL_MAP2_INDEX)
-	define(GL_MAP2_NORMAL)
-	define(GL_MAP2_TEXTURE_COORD_1)
-	define(GL_MAP2_TEXTURE_COORD_2)
-	define(GL_MAP2_TEXTURE_COORD_3)
-	define(GL_MAP2_TEXTURE_COORD_4)
-	define(GL_MAP2_VERTEX_3)
-	define(GL_MAP2_VERTEX_4)
-	define(GL_MINMAX)
-	define(GL_MULTISAMPLE)
-	define(GL_NORMALIZE)
-	define(GL_POINT_SMOOTH)
-	define(GL_POINT_SPRITE)
-	define(GL_POLYGON_OFFSET_FILL)
-	define(GL_POLYGON_OFFSET_LINE)
-	define(GL_POLYGON_OFFSET_POINT)
-	define(GL_POLYGON_SMOOTH)
-	define(GL_POLYGON_STIPPLE)
-	define(GL_POST_COLOR_MATRIX_COLOR_TABLE)
-	define(GL_POST_CONVOLUTION_COLOR_TABLE)
-	define(GL_RESCALE_NORMAL)
-	define(GL_SAMPLE_ALPHA_TO_COVERAGE)
-	define(GL_SAMPLE_ALPHA_TO_ONE)
-	define(GL_SAMPLE_COVERAGE)
-	define(GL_SEPARABLE_2D)
-	define(GL_SCISSOR_TEST)
-	define(GL_STENCIL_TEST)
-	define(GL_TEXTURE_1D)
-	define(GL_TEXTURE_2D)
-	define(GL_TEXTURE_3D)
-	define(GL_TEXTURE_CUBE_MAP)
-	define(GL_TEXTURE_GEN_Q)
-	define(GL_TEXTURE_GEN_R)
-	define(GL_TEXTURE_GEN_S)
-	define(GL_TEXTURE_GEN_T)
-	define(GL_VERTEX_PROGRAM_POINT_SIZE)
-	define(GL_VERTEX_PROGRAM_TWO_SIDE)
-	#undef THAT
-	#define THAT client_state_capability
-	define(GL_COLOR_ARRAY)
-	define(GL_EDGE_FLAG_ARRAY)
-	define(GL_FOG_COORD_ARRAY)
-	define(GL_INDEX_ARRAY)
-	define(GL_NORMAL_ARRAY)
-	define(GL_SECONDARY_COLOR_ARRAY)
-	define(GL_TEXTURE_COORD_ARRAY)
-	define(GL_VERTEX_ARRAY)
-	#undef THAT
-	#define THAT which_side
-	define(GL_FRONT)
-	define(GL_BACK)
-	define(GL_FRONT_AND_BACK)
-	#undef THAT
-	#define THAT texture_target
-	define(GL_TEXTURE_1D)
-	define(GL_TEXTURE_2D)
-	define(GL_TEXTURE_3D)
-	define(GL_TEXTURE_CUBE_MAP)
-	#undef THAT
-	#define THAT blend_equation
-	define(GL_FUNC_ADD)
-	define(GL_FUNC_SUBTRACT)
-	define(GL_FUNC_REVERSE_SUBTRACT)
-	define(GL_MIN)
-	define(GL_MAX)
-	#undef THAT
-	#define THAT blend_func
-	define(GL_ZERO)
-	define(GL_ONE)
-	define(GL_SRC_COLOR)
-	define(GL_ONE_MINUS_SRC_COLOR)
-	define(GL_DST_COLOR)
-	define(GL_ONE_MINUS_DST_COLOR)
-	define(GL_SRC_ALPHA)
-	define(GL_ONE_MINUS_SRC_ALPHA)
-	define(GL_DST_ALPHA)
-	define(GL_ONE_MINUS_DST_ALPHA)
-	define(GL_CONSTANT_COLOR)
-	define(GL_ONE_MINUS_CONSTANT_COLOR)
-	define(GL_CONSTANT_ALPHA)
-	define(GL_ONE_MINUS_CONSTANT_ALPHA)
-	define(GL_SRC_ALPHA_SATURATE) // not supposed to be available as dfactor
-	#undef THAT
-	#define THAT copy_pixels_type
-	define(GL_COLOR)
-	define(GL_DEPTH)
-	define(GL_STENCIL)
-	#undef THAT
-	#define THAT depth_func
-	define(GL_NEVER)
-	define(GL_LESS)
-	define(GL_EQUAL)
-	define(GL_LEQUAL)
-	define(GL_GREATER)
-	define(GL_NOTEQUAL)
-	define(GL_GEQUAL)
-	define(GL_ALWAYS)
-	#undef THAT
-	#define THAT front_face_mode
-	define(GL_CW)
-	define(GL_CCW)
-	#undef THAT
-	#define THAT logic_op
-	define(GL_CLEAR)
-	define(GL_SET)
-	define(GL_COPY)
-	define(GL_COPY_INVERTED)
-	define(GL_NOOP)
-	define(GL_INVERT)
-	define(GL_AND)
-	define(GL_NAND)
-	define(GL_OR)
-	define(GL_NOR)
-	define(GL_XOR)
-	define(GL_EQUIV)
-	define(GL_AND_REVERSE)
-	define(GL_AND_INVERTED)
-	define(GL_OR_REVERSE)
-	define(GL_OR_INVERTED)
-	#undef THAT
-	#define THAT stencil_func
-	define(GL_NEVER)
-	define(GL_LESS)
-	define(GL_LEQUAL)
-	define(GL_GREATER)
-	define(GL_GEQUAL)
-	define(GL_EQUAL)
-	define(GL_NOTEQUAL)
-	define(GL_ALWAYS)
-	#undef THAT
-	#define THAT pixel_store
-	define(GL_PACK_SWAP_BYTES)
-	define(GL_PACK_LSB_FIRST)
-	define(GL_PACK_ROW_LENGTH)
-	define(GL_PACK_IMAGE_HEIGHT)
-	define(GL_PACK_SKIP_PIXELS)
-	define(GL_PACK_SKIP_ROWS)
-	define(GL_PACK_SKIP_IMAGES)
-	define(GL_PACK_ALIGNMENT)
-	define(GL_UNPACK_SWAP_BYTES)
-	define(GL_UNPACK_LSB_FIRST)
-	define(GL_UNPACK_ROW_LENGTH)
-	define(GL_UNPACK_IMAGE_HEIGHT)
-	define(GL_UNPACK_SKIP_PIXELS)
-	define(GL_UNPACK_SKIP_ROWS)
-	define(GL_UNPACK_SKIP_IMAGES)
-	define(GL_UNPACK_ALIGNMENT)
-	#undef THAT
-	#define THAT pixel_transfer
-	define(GL_MAP_COLOR)
-	define(GL_MAP_STENCIL)
-	define(GL_INDEX_SHIFT)
-	define(GL_INDEX_OFFSET)
-	define(GL_RED_SCALE)
-	define(GL_RED_BIAS)
-	define(GL_GREEN_SCALE)
-	define(GL_GREEN_BIAS)
-	define(GL_BLUE_SCALE)
-	define(GL_BLUE_BIAS)
-	define(GL_ALPHA_SCALE)
-	define(GL_ALPHA_BIAS)
-	define(GL_DEPTH_SCALE)
-	define(GL_DEPTH_BIAS)
+	#define D(NAME) add(tolower_gensym(#NAME+3),NAME)
+	primitive_type
+	.D(GL_POINTS)
+	.D(GL_LINES)
+	.D(GL_LINE_LOOP)
+	.D(GL_LINE_STRIP)
+	.D(GL_TRIANGLES)
+	.D(GL_TRIANGLE_STRIP)
+	.D(GL_TRIANGLE_FAN)
+	.D(GL_QUADS)
+	.D(GL_QUAD_STRIP)
+	.D(GL_POLYGON)
+	;
+	capability
+	.D(GL_ALPHA_TEST)
+	.D(GL_AUTO_NORMAL)
+	.D(GL_BLEND)
+	.D(GL_CLIP_PLANE0)
+	.D(GL_CLIP_PLANE1)
+	.D(GL_CLIP_PLANE2)
+	.D(GL_CLIP_PLANE3)
+	.D(GL_CLIP_PLANE4)
+	.D(GL_CLIP_PLANE5)
+	.D(GL_COLOR_LOGIC_OP)
+	.D(GL_COLOR_MATERIAL)
+	.D(GL_COLOR_SUM)
+	.D(GL_COLOR_TABLE)
+	.D(GL_CONVOLUTION_1D)
+	.D(GL_CONVOLUTION_2D)
+	.D(GL_CULL_FACE)
+	.D(GL_DEPTH_TEST)
+	.D(GL_DITHER)
+	.D(GL_FOG)
+	.D(GL_HISTOGRAM)
+	.D(GL_INDEX_LOGIC_OP)
+	.D(GL_LIGHT0)
+	.D(GL_LIGHT1)
+	.D(GL_LIGHT2)
+	.D(GL_LIGHT3)
+	.D(GL_LIGHT4)
+	.D(GL_LIGHT5)
+	.D(GL_LIGHT6)
+	.D(GL_LIGHT7)
+	.D(GL_LIGHTING)
+	.D(GL_LINE_SMOOTH)
+	.D(GL_LINE_STIPPLE)
+	.D(GL_MAP1_COLOR_4)
+	.D(GL_MAP1_INDEX)
+	.D(GL_MAP1_NORMAL)
+	.D(GL_MAP1_TEXTURE_COORD_1)
+	.D(GL_MAP1_TEXTURE_COORD_2)
+	.D(GL_MAP1_TEXTURE_COORD_3)
+	.D(GL_MAP1_TEXTURE_COORD_4)
+	.D(GL_MAP1_VERTEX_3)
+	.D(GL_MAP1_VERTEX_4)
+	.D(GL_MAP2_COLOR_4)
+	.D(GL_MAP2_INDEX)
+	.D(GL_MAP2_NORMAL)
+	.D(GL_MAP2_TEXTURE_COORD_1)
+	.D(GL_MAP2_TEXTURE_COORD_2)
+	.D(GL_MAP2_TEXTURE_COORD_3)
+	.D(GL_MAP2_TEXTURE_COORD_4)
+	.D(GL_MAP2_VERTEX_3)
+	.D(GL_MAP2_VERTEX_4)
+	.D(GL_MINMAX)
+	.D(GL_MULTISAMPLE)
+	.D(GL_NORMALIZE)
+	.D(GL_POINT_SMOOTH)
+	.D(GL_POINT_SPRITE)
+	.D(GL_POLYGON_OFFSET_FILL)
+	.D(GL_POLYGON_OFFSET_LINE)
+	.D(GL_POLYGON_OFFSET_POINT)
+	.D(GL_POLYGON_SMOOTH)
+	.D(GL_POLYGON_STIPPLE)
+	.D(GL_POST_COLOR_MATRIX_COLOR_TABLE)
+	.D(GL_POST_CONVOLUTION_COLOR_TABLE)
+	.D(GL_RESCALE_NORMAL)
+	.D(GL_SAMPLE_ALPHA_TO_COVERAGE)
+	.D(GL_SAMPLE_ALPHA_TO_ONE)
+	.D(GL_SAMPLE_COVERAGE)
+	.D(GL_SEPARABLE_2D)
+	.D(GL_SCISSOR_TEST)
+	.D(GL_STENCIL_TEST)
+	.D(GL_TEXTURE_1D)
+	.D(GL_TEXTURE_2D)
+	.D(GL_TEXTURE_3D)
+	.D(GL_TEXTURE_CUBE_MAP)
+	.D(GL_TEXTURE_GEN_Q)
+	.D(GL_TEXTURE_GEN_R)
+	.D(GL_TEXTURE_GEN_S)
+	.D(GL_TEXTURE_GEN_T)
+	.D(GL_VERTEX_PROGRAM_POINT_SIZE)
+	.D(GL_VERTEX_PROGRAM_TWO_SIDE)
+	;
+	client_state_capability
+	.D(GL_COLOR_ARRAY)
+	.D(GL_EDGE_FLAG_ARRAY)
+	.D(GL_FOG_COORD_ARRAY)
+	.D(GL_INDEX_ARRAY)
+	.D(GL_NORMAL_ARRAY)
+	.D(GL_SECONDARY_COLOR_ARRAY)
+	.D(GL_TEXTURE_COORD_ARRAY)
+	.D(GL_VERTEX_ARRAY)
+	;
+	which_side
+	.D(GL_FRONT)
+	.D(GL_BACK)
+	.D(GL_FRONT_AND_BACK)
+	;
+	texture_target
+	.D(GL_TEXTURE_1D)
+	.D(GL_TEXTURE_2D)
+	.D(GL_TEXTURE_3D)
+	.D(GL_TEXTURE_CUBE_MAP)
+	;
+	blend_equation
+	.D(GL_FUNC_ADD)
+	.D(GL_FUNC_SUBTRACT)
+	.D(GL_FUNC_REVERSE_SUBTRACT)
+	.D(GL_MIN)
+	.D(GL_MAX)
+	;
+	blend_func
+	.D(GL_ZERO)
+	.D(GL_ONE)
+	.D(GL_SRC_COLOR)
+	.D(GL_ONE_MINUS_SRC_COLOR)
+	.D(GL_DST_COLOR)
+	.D(GL_ONE_MINUS_DST_COLOR)
+	.D(GL_SRC_ALPHA)
+	.D(GL_ONE_MINUS_SRC_ALPHA)
+	.D(GL_DST_ALPHA)
+	.D(GL_ONE_MINUS_DST_ALPHA)
+	.D(GL_CONSTANT_COLOR)
+	.D(GL_ONE_MINUS_CONSTANT_COLOR)
+	.D(GL_CONSTANT_ALPHA)
+	.D(GL_ONE_MINUS_CONSTANT_ALPHA)
+	.D(GL_SRC_ALPHA_SATURATE) // not supposed to be available as dfactor
+	;
+	copy_pixels_type
+	.D(GL_COLOR)
+	.D(GL_DEPTH)
+	.D(GL_STENCIL)
+	;
+	depth_func
+	.D(GL_NEVER)
+	.D(GL_LESS)
+	.D(GL_EQUAL)
+	.D(GL_LEQUAL)
+	.D(GL_GREATER)
+	.D(GL_NOTEQUAL)
+	.D(GL_GEQUAL)
+	.D(GL_ALWAYS)
+	;
+	front_face_mode
+	.D(GL_CW)
+	.D(GL_CCW)
+	;
+	logic_op
+	.D(GL_CLEAR)
+	.D(GL_SET)
+	.D(GL_COPY)
+	.D(GL_COPY_INVERTED)
+	.D(GL_NOOP)
+	.D(GL_INVERT)
+	.D(GL_AND)
+	.D(GL_NAND)
+	.D(GL_OR)
+	.D(GL_NOR)
+	.D(GL_XOR)
+	.D(GL_EQUIV)
+	.D(GL_AND_REVERSE)
+	.D(GL_AND_INVERTED)
+	.D(GL_OR_REVERSE)
+	.D(GL_OR_INVERTED)
+	;
+	stencil_func
+	.D(GL_NEVER)
+	.D(GL_LESS)
+	.D(GL_LEQUAL)
+	.D(GL_GREATER)
+	.D(GL_GEQUAL)
+	.D(GL_EQUAL)
+	.D(GL_NOTEQUAL)
+	.D(GL_ALWAYS)
+	;
+	pixel_store
+	.D(GL_PACK_SWAP_BYTES)
+	.D(GL_PACK_LSB_FIRST)
+	.D(GL_PACK_ROW_LENGTH)
+	.D(GL_PACK_IMAGE_HEIGHT)
+	.D(GL_PACK_SKIP_PIXELS)
+	.D(GL_PACK_SKIP_ROWS)
+	.D(GL_PACK_SKIP_IMAGES)
+	.D(GL_PACK_ALIGNMENT)
+	.D(GL_UNPACK_SWAP_BYTES)
+	.D(GL_UNPACK_LSB_FIRST)
+	.D(GL_UNPACK_ROW_LENGTH)
+	.D(GL_UNPACK_IMAGE_HEIGHT)
+	.D(GL_UNPACK_SKIP_PIXELS)
+	.D(GL_UNPACK_SKIP_ROWS)
+	.D(GL_UNPACK_SKIP_IMAGES)
+	.D(GL_UNPACK_ALIGNMENT)
+	;
+	pixel_transfer
+	.D(GL_MAP_COLOR)
+	.D(GL_MAP_STENCIL)
+	.D(GL_INDEX_SHIFT)
+	.D(GL_INDEX_OFFSET)
+	.D(GL_RED_SCALE)
+	.D(GL_RED_BIAS)
+	.D(GL_GREEN_SCALE)
+	.D(GL_GREEN_BIAS)
+	.D(GL_BLUE_SCALE)
+	.D(GL_BLUE_BIAS)
+	.D(GL_ALPHA_SCALE)
+	.D(GL_ALPHA_BIAS)
+	.D(GL_DEPTH_SCALE)
+	.D(GL_DEPTH_BIAS)
 	#ifdef ARB
-	define(GL_POST_COLOR_MATRIX_RED_SCALE)
-	define(GL_POST_COLOR_MATRIX_GREEN_SCALE)
-	define(GL_POST_COLOR_MATRIX_BLUE_SCALE)
-	define(GL_POST_COLOR_MATRIX_ALPHA_SCALE)
-	define(GL_POST_COLOR_MATRIX_RED_BIAS)
-	define(GL_POST_COLOR_MATRIX_GREEN_BIAS)
-	define(GL_POST_COLOR_MATRIX_BLUE_BIAS)
-	define(GL_POST_COLOR_MATRIX_ALPHA_BIAS)
-	define(GL_POST_CONVOLUTION_RED_SCALE)
-	define(GL_POST_CONVOLUTION_GREEN_SCALE)
-	define(GL_POST_CONVOLUTION_BLUE_SCALE)
-	define(GL_POST_CONVOLUTION_ALPHA_SCALE)
-	define(GL_POST_CONVOLUTION_RED_BIAS)
-	define(GL_POST_CONVOLUTION_GREEN_BIAS)
-	define(GL_POST_CONVOLUTION_BLUE_BIAS)
-	define(GL_POST_CONVOLUTION_ALPHA_BIAS)
+	.D(GL_POST_COLOR_MATRIX_RED_SCALE)
+	.D(GL_POST_COLOR_MATRIX_GREEN_SCALE)
+	.D(GL_POST_COLOR_MATRIX_BLUE_SCALE)
+	.D(GL_POST_COLOR_MATRIX_ALPHA_SCALE)
+	.D(GL_POST_COLOR_MATRIX_RED_BIAS)
+	.D(GL_POST_COLOR_MATRIX_GREEN_BIAS)
+	.D(GL_POST_COLOR_MATRIX_BLUE_BIAS)
+	.D(GL_POST_COLOR_MATRIX_ALPHA_BIAS)
+	.D(GL_POST_CONVOLUTION_RED_SCALE)
+	.D(GL_POST_CONVOLUTION_GREEN_SCALE)
+	.D(GL_POST_CONVOLUTION_BLUE_SCALE)
+	.D(GL_POST_CONVOLUTION_ALPHA_SCALE)
+	.D(GL_POST_CONVOLUTION_RED_BIAS)
+	.D(GL_POST_CONVOLUTION_GREEN_BIAS)
+	.D(GL_POST_CONVOLUTION_BLUE_BIAS)
+	.D(GL_POST_CONVOLUTION_ALPHA_BIAS)
 	#endif
-	#undef THAT
-	#define THAT shade_model
-	define(GL_FLAT)
-	define(GL_SMOOTH)
-	#undef THAT
-	#define THAT stencil_op
-	define(GL_KEEP)
-	define(GL_ZERO)
-	define(GL_REPLACE)
-	define(GL_INCR)
-	define(GL_INCR_WRAP)
-	define(GL_DECR)
-	define(GL_DECR_WRAP)
-	define(GL_INVERT)
-	#undef THAT
-	#define THAT render_mode
-	define(GL_RENDER)
-	define(GL_SELECT)
-	define(GL_FEEDBACK)
-	#undef THAT
-	#define THAT buffer_mode
-	define(GL_NONE) // not always acceptable
-	define(GL_FRONT_AND_BACK) // not always acceptable
-	define(GL_FRONT_LEFT)
-	define(GL_FRONT_RIGHT)
-	define(GL_BACK_LEFT)
-	define(GL_BACK_RIGHT)
-	define(GL_FRONT)
-	define(GL_BACK)
-	define(GL_LEFT)
-	define(GL_RIGHT)
-	define(GL_AUX0)
-	define(GL_AUX1)
-	define(GL_AUX2)
-	define(GL_AUX3)
-	#undef THAT
-	#define THAT material_mode
-	define(GL_EMISSION)
-	define(GL_AMBIENT)
-	define(GL_DIFFUSE)
-	define(GL_SPECULAR)
-	define(GL_AMBIENT_AND_DIFFUSE)
-	#undef THAT
-	#define THAT copy_tex_target
-	define(GL_TEXTURE_2D)
-	define(GL_TEXTURE_CUBE_MAP_POSITIVE_X)
-	define(GL_TEXTURE_CUBE_MAP_NEGATIVE_X)
-	define(GL_TEXTURE_CUBE_MAP_POSITIVE_Y)
-	define(GL_TEXTURE_CUBE_MAP_NEGATIVE_Y)
-	define(GL_TEXTURE_CUBE_MAP_POSITIVE_Z)
-	define(GL_TEXTURE_CUBE_MAP_NEGATIVE_Z)
-	#undef THAT
-	#define THAT copy_tex_format
-	define(GL_ALPHA)
-	define(GL_ALPHA4)
-	define(GL_ALPHA8)
-	define(GL_ALPHA12)
-	define(GL_ALPHA16)
-	define(GL_COMPRESSED_ALPHA)
-	define(GL_COMPRESSED_LUMINANCE)
-	define(GL_COMPRESSED_LUMINANCE_ALPHA)
-	define(GL_COMPRESSED_INTENSITY)
-	define(GL_COMPRESSED_RGB)
-	define(GL_COMPRESSED_RGBA)
-	define(GL_DEPTH_COMPONENT)
-	define(GL_DEPTH_COMPONENT16)
-	define(GL_DEPTH_COMPONENT24)
-	define(GL_DEPTH_COMPONENT32)
-	define(GL_LUMINANCE)
-	define(GL_LUMINANCE4)
-	define(GL_LUMINANCE8)
-	define(GL_LUMINANCE12)
-	define(GL_LUMINANCE16)
-	define(GL_LUMINANCE_ALPHA)
-	define(GL_LUMINANCE4_ALPHA4)
-	define(GL_LUMINANCE6_ALPHA2)
-	define(GL_LUMINANCE8_ALPHA8)
-	define(GL_LUMINANCE12_ALPHA4)
-	define(GL_LUMINANCE12_ALPHA12)
-	define(GL_LUMINANCE16_ALPHA16)
-	define(GL_INTENSITY)
-	define(GL_INTENSITY4)
-	define(GL_INTENSITY8)
-	define(GL_INTENSITY12)
-	define(GL_INTENSITY16)
-	define(GL_RGB)
-	define(GL_R3_G3_B2)
-	define(GL_RGB4)
-	define(GL_RGB5)
-	define(GL_RGB8)
-	define(GL_RGB10)
-	define(GL_RGB12)
-	define(GL_RGB16)
-	define(GL_RGBA)
-	define(GL_RGBA2)
-	define(GL_RGBA4)
-	define(GL_RGB5_A1)
-	define(GL_RGBA8)
-	define(GL_RGB10_A2)
-	define(GL_RGBA12)
-	define(GL_RGBA16)
-	define(GL_SLUMINANCE)
-	define(GL_SLUMINANCE8)
-	define(GL_SLUMINANCE_ALPHA)
-	define(GL_SLUMINANCE8_ALPHA8)
-	define(GL_SRGB)
-	define(GL_SRGB8)
-	define(GL_SRGB_ALPHA)
-	define(GL_SRGB8_ALPHA8)
-	#undef THAT
+	;
+	shade_model
+	.D(GL_FLAT)
+	.D(GL_SMOOTH)
+	;
+	stencil_op
+	.D(GL_KEEP)
+	.D(GL_ZERO)
+	.D(GL_REPLACE)
+	.D(GL_INCR)
+	.D(GL_INCR_WRAP)
+	.D(GL_DECR)
+	.D(GL_DECR_WRAP)
+	.D(GL_INVERT)
+	;
+	render_mode
+	.D(GL_RENDER)
+	.D(GL_SELECT)
+	.D(GL_FEEDBACK)
+	;
+	buffer_mode
+	.D(GL_NONE) // not always acceptable
+	.D(GL_FRONT_AND_BACK) // not always acceptable
+	.D(GL_FRONT_LEFT)
+	.D(GL_FRONT_RIGHT)
+	.D(GL_BACK_LEFT)
+	.D(GL_BACK_RIGHT)
+	.D(GL_FRONT)
+	.D(GL_BACK)
+	.D(GL_LEFT)
+	.D(GL_RIGHT)
+	.D(GL_AUX0)
+	.D(GL_AUX1)
+	.D(GL_AUX2)
+	.D(GL_AUX3)
+	;
+	material_mode
+	.D(GL_EMISSION)
+	.D(GL_AMBIENT)
+	.D(GL_DIFFUSE)
+	.D(GL_SPECULAR)
+	.D(GL_AMBIENT_AND_DIFFUSE)
+	;
+	copy_tex_target
+	.D(GL_TEXTURE_2D)
+	.D(GL_TEXTURE_CUBE_MAP_POSITIVE_X)
+	.D(GL_TEXTURE_CUBE_MAP_NEGATIVE_X)
+	.D(GL_TEXTURE_CUBE_MAP_POSITIVE_Y)
+	.D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Y)
+	.D(GL_TEXTURE_CUBE_MAP_POSITIVE_Z)
+	.D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Z)
+	;
+	copy_tex_format
+	.D(GL_ALPHA)
+	.D(GL_ALPHA4)
+	.D(GL_ALPHA8)
+	.D(GL_ALPHA12)
+	.D(GL_ALPHA16)
+	.D(GL_COMPRESSED_ALPHA)
+	.D(GL_COMPRESSED_LUMINANCE)
+	.D(GL_COMPRESSED_LUMINANCE_ALPHA)
+	.D(GL_COMPRESSED_INTENSITY)
+	.D(GL_COMPRESSED_RGB)
+	.D(GL_COMPRESSED_RGBA)
+	.D(GL_DEPTH_COMPONENT)
+	.D(GL_DEPTH_COMPONENT16)
+	.D(GL_DEPTH_COMPONENT24)
+	.D(GL_DEPTH_COMPONENT32)
+	.D(GL_LUMINANCE)
+	.D(GL_LUMINANCE4)
+	.D(GL_LUMINANCE8)
+	.D(GL_LUMINANCE12)
+	.D(GL_LUMINANCE16)
+	.D(GL_LUMINANCE_ALPHA)
+	.D(GL_LUMINANCE4_ALPHA4)
+	.D(GL_LUMINANCE6_ALPHA2)
+	.D(GL_LUMINANCE8_ALPHA8)
+	.D(GL_LUMINANCE12_ALPHA4)
+	.D(GL_LUMINANCE12_ALPHA12)
+	.D(GL_LUMINANCE16_ALPHA16)
+	.D(GL_INTENSITY)
+	.D(GL_INTENSITY4)
+	.D(GL_INTENSITY8)
+	.D(GL_INTENSITY12)
+	.D(GL_INTENSITY16)
+	.D(GL_RGB)
+	.D(GL_R3_G3_B2)
+	.D(GL_RGB4)
+	.D(GL_RGB5)
+	.D(GL_RGB8)
+	.D(GL_RGB10)
+	.D(GL_RGB12)
+	.D(GL_RGB16)
+	.D(GL_RGBA)
+	.D(GL_RGBA2)
+	.D(GL_RGBA4)
+	.D(GL_RGB5_A1)
+	.D(GL_RGBA8)
+	.D(GL_RGB10_A2)
+	.D(GL_RGBA12)
+	.D(GL_RGBA16)
+	.D(GL_SLUMINANCE)
+	.D(GL_SLUMINANCE8)
+	.D(GL_SLUMINANCE_ALPHA)
+	.D(GL_SLUMINANCE8_ALPHA8)
+	.D(GL_SRGB)
+	.D(GL_SRGB8)
+	.D(GL_SRGB_ALPHA)
+	.D(GL_SRGB8_ALPHA8)
+	;
+	mesh_mode
+	.D(GL_POINT)
+	.D(GL_LINE)
+	.D(GL_FILL) // only for mesh2
+	;
 }
 // comments in the class body list those functions not supported by GF but supported by GEM in openGL dir.
 \class GFGL : FObject {
@@ -483,8 +489,8 @@
 		default: RAISE("need 1 or 2 args");
 	}}
 	\decl 0 eval_mesh (...) {switch (argc) {
-		case 3: glEvalMesh1(argv[0],argv[1],argv[2]); break; // enum...
-		case 5: glEvalMesh2(argv[0],argv[1],argv[2],argv[3],argv[4]); break; // enum...
+		case 3: glEvalMesh1(mesh_mode(argv[0]),argv[1],argv[2]); break;
+		case 5: glEvalMesh2(mesh_mode(argv[0]),argv[1],argv[2],argv[3],argv[4]); break;
 		default: RAISE("need 3 or 5 args");
 	}}
 	\decl 0 eval_point (...) {switch (argc) {



More information about the Gridflow-cvs mailing list