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

svn-gridflow at artengine.ca svn-gridflow at artengine.ca
Mon Aug 9 14:11:50 EDT 2010


Author: matju
Date: Mon Aug  9 14:11:49 2010
New Revision: 6003

Log:
pow(more,7)

Modified:
    trunk/src/opengl.cxx

Modified: trunk/src/opengl.cxx
==============================================================================
--- trunk/src/opengl.cxx (original)
+++ trunk/src/opengl.cxx Mon Aug  9 14:11:49 2010
@@ -46,7 +46,7 @@
 		if (it==backward.end()) RAISE("unknown %s GLenum %d (at least not allowed in this context)",name,int(e));
 		return it->second;
 	}
-	EnumType &add (t_symbol *s, GLenum i) {forward[s]=i; backward[i]=s; return *this;}
+	EnumType &add (t_symbol *s, GLenum i, int dummy=0) {forward[s]=i; backward[i]=s; return *this;}
 };
 static t_symbol *tolower_gensym (const char *s) {
 	char t[64]; strcpy(t,s);
@@ -65,7 +65,6 @@
 MAKETYPE(depth_func)
 MAKETYPE(front_face_mode)
 MAKETYPE(logic_op)
-MAKETYPE(stencil_func)
 MAKETYPE(pixel_store)
 MAKETYPE(pixel_transfer)
 MAKETYPE(shade_model)
@@ -122,53 +121,30 @@
 	.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_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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D_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)
@@ -230,18 +206,12 @@
 	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_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
@@ -250,46 +220,24 @@
 	.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)
+	.D(GL_NEVER)	.D(GL_ALWAYS)
+	.D(GL_LESS)	.D(GL_GEQUAL)
+	.D(GL_EQUAL)	.D(GL_NOTEQUAL)
+	.D(GL_LEQUAL)	.D(GL_GREATER)
 	;
 	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 // same as depth 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)
+	.D(GL_CLEAR)		.D(GL_SET)
+	.D(GL_AND)		.D(GL_NAND)
+	.D(GL_AND_REVERSE)	.D(GL_OR_INVERTED)
+	.D(GL_COPY)		.D(GL_COPY_INVERTED)
+	.D(GL_AND_INVERTED)	.D(GL_OR_REVERSE)
+	.D(GL_NOOP)		.D(GL_INVERT)
+	.D(GL_XOR)		.D(GL_EQUIV)
+	.D(GL_OR)		.D(GL_NOR)
 	;
 	pixel_store
 	.D(GL_PACK_SWAP_BYTES)
@@ -314,33 +262,20 @@
 	.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)
+	.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
-	.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)
+	.D(GL_POST_COLOR_MATRIX_RED_SCALE)	.D(GL_POST_COLOR_MATRIX_RED_BIAS)
+	.D(GL_POST_COLOR_MATRIX_GREEN_SCALE)	.D(GL_POST_COLOR_MATRIX_GREEN_BIAS)
+	.D(GL_POST_COLOR_MATRIX_BLUE_SCALE)	.D(GL_POST_COLOR_MATRIX_BLUE_BIAS)
+	.D(GL_POST_COLOR_MATRIX_ALPHA_SCALE)	.D(GL_POST_COLOR_MATRIX_ALPHA_BIAS)
+	.D(GL_POST_CONVOLUTION_RED_SCALE)	.D(GL_POST_CONVOLUTION_GREEN_BIAS)
+	.D(GL_POST_CONVOLUTION_RED_BIAS)	.D(GL_POST_CONVOLUTION_GREEN_SCALE)
+	.D(GL_POST_CONVOLUTION_BLUE_SCALE)	.D(GL_POST_CONVOLUTION_BLUE_BIAS)
+	.D(GL_POST_CONVOLUTION_ALPHA_SCALE)	.D(GL_POST_CONVOLUTION_ALPHA_BIAS)
 	#endif
 	;
 	shade_model
@@ -388,22 +323,16 @@
 	tex_target
 	.D(GL_TEXTURE_2D)
 	.D(GL_PROXY_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)
+	.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)
 	.D(GL_PROXY_TEXTURE_CUBE_MAP)
 	;
 	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)
+	.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)
 	;
 	tex_iformat
 	.D(GL_ALPHA)
@@ -554,12 +483,8 @@
 	.D(GL_GENERATE_MIPMAP)
 	;
 	texture_min_filter
-	.D(GL_NEAREST)
-	.D(GL_LINEAR)
-	.D(GL_NEAREST_MIPMAP_NEAREST)
-	.D(GL_LINEAR_MIPMAP_NEAREST)
-	.D(GL_NEAREST_MIPMAP_LINEAR)
-	.D(GL_LINEAR_MIPMAP_LINEAR)
+	.D(GL_NEAREST).D(GL_NEAREST_MIPMAP_NEAREST).D(GL_NEAREST_MIPMAP_LINEAR)
+	 .D(GL_LINEAR) .D(GL_LINEAR_MIPMAP_NEAREST) .D(GL_LINEAR_MIPMAP_LINEAR)
 	;
 	texture_mag_filter
 	.D(GL_NEAREST)
@@ -582,18 +507,9 @@
 	.D(GL_TEXTURE_LOD_BIAS)
 	.D(GL_COMBINE_RGB)
 	.D(GL_COMBINE_ALPHA)
-	.D(GL_SRC0_RGB)
-	.D(GL_SRC1_RGB)
-	.D(GL_SRC2_RGB)
-	.D(GL_SRC0_ALPHA)
-	.D(GL_SRC1_ALPHA)
-	.D(GL_SRC2_ALPHA)
-	.D(GL_OPERAND0_RGB)
-	.D(GL_OPERAND1_RGB)
-	.D(GL_OPERAND2_RGB)
-	.D(GL_OPERAND0_ALPHA)
-	.D(GL_OPERAND1_ALPHA)
-	.D(GL_OPERAND2_ALPHA)
+	.D(GL_SRC0_RGB).D(GL_SRC0_ALPHA).D(GL_OPERAND0_RGB).D(GL_OPERAND0_ALPHA)
+	.D(GL_SRC1_RGB).D(GL_SRC1_ALPHA).D(GL_OPERAND1_RGB).D(GL_OPERAND1_ALPHA)
+	.D(GL_SRC2_RGB).D(GL_SRC2_ALPHA).D(GL_OPERAND2_RGB).D(GL_OPERAND2_ALPHA)
 	.D(GL_RGB_SCALE)
 	.D(GL_ALPHA_SCALE)
 	.D(GL_COORD_REPLACE)
@@ -612,10 +528,8 @@
 	.D(GL_CONSTANT)
 	.D(GL_PRIMARY_COLOR)
 	.D(GL_PREVIOUS)
-	.D(GL_SRC_COLOR)
-	.D(GL_ONE_MINUS_SRC_COLOR)
-	.D(GL_SRC_ALPHA)
-	.D(GL_ONE_MINUS_SRC_ALPHA)
+	.D(GL_SRC_COLOR).D(GL_ONE_MINUS_SRC_COLOR)
+	.D(GL_SRC_ALPHA).D(GL_ONE_MINUS_SRC_ALPHA)
 	;
 	tex_gen_coord
 	.D(GL_S)
@@ -716,69 +630,317 @@
 	.D(GL_3D_COLOR_TEXTURE)
 	.D(GL_4D_COLOR_TEXTURE)
 	;
+	#undef D
+	#define D(NAME,ARGS...) add(tolower_gensym(#NAME+3),NAME,ARGS)
 	get_parameter // 1
-	.D(GL_ACCUM_ALPHA_BITS).D(GL_ACCUM_BLUE_BITS).D(GL_ACCUM_GREEN_BITS).D(GL_ACCUM_RED_BITS)
-	.D(GL_ACTIVE_TEXTURE)
-	.D(GL_ALPHA_BIAS).D(GL_ALPHA_BITS).D(GL_ALPHA_SCALE).D(GL_ALPHA_TEST).D(GL_ALPHA_TEST_REF)
-	.D(GL_ARRAY_BUFFER_BINDING)
-	.D(GL_ATTRIB_STACK_DEPTH)
-	.D(GL_AUTO_NORMAL)
-	.D(GL_AUX_BUFFERS)
-	.D(GL_BLEND)
-	.D(GL_BLUE_BIAS).D(GL_BLUE_BITS).D(GL_BLUE_SCALE)
-	.D(GL_CLIENT_ATTRIB_STACK_DEPTH)
-	.D(GL_UNPACK_SWAP_BYTES)
-	.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_ARRAY).D(GL_COLOR_ARRAY_BUFFER_BINDING).D(GL_COLOR_ARRAY_SIZE)
-	.D(GL_COLOR_ARRAY_STRIDE)
-	.D(GL_COLOR_LOGIC_OP)
-	.D(GL_COLOR_MATERIAL).D(GL_COLOR_MATERIAL_FACE).D(GL_COLOR_MATERIAL_PARAMETER)
-	.D(GL_COLOR_MATRIX_STACK_DEPTH)
-	.D(GL_COLOR_SUM).D(GL_COLOR_TABLE)
-	.D(GL_CONVOLUTION_1D).D(GL_CONVOLUTION_2D)
-	.D(GL_CULL_FACE)
-	.D(GL_CURRENT_FOG_COORD)
-	.D(GL_CURRENT_INDEX)
-	.D(GL_CURRENT_PROGRAM)
-	.D(GL_CURRENT_RASTER_DISTANCE)
-	.D(GL_CURRENT_RASTER_INDEX)
-	.D(GL_CURRENT_RASTER_POSITION_VALID)
+	.D(GL_ACCUM_ALPHA_BITS,1).D(GL_ACCUM_BLUE_BITS,1).D(GL_ACCUM_GREEN_BITS,1).D(GL_ACCUM_RED_BITS,1)
+	.D(GL_ACTIVE_TEXTURE,1)
+	.D(GL_ALPHA_BIAS,1).D(GL_ALPHA_BITS,1).D(GL_ALPHA_SCALE,1).D(GL_ALPHA_TEST,1).D(GL_ALPHA_TEST_REF,1)
+	.D(GL_ARRAY_BUFFER_BINDING,1)
+	.D(GL_ATTRIB_STACK_DEPTH,1)
+	.D(GL_AUTO_NORMAL,1)
+	.D(GL_AUX_BUFFERS,1)
+	.D(GL_BLEND,1)
+	.D(GL_BLUE_BIAS,1).D(GL_BLUE_BITS,1).D(GL_BLUE_SCALE,1)
+	.D(GL_CLIENT_ATTRIB_STACK_DEPTH,1)
+	.D(GL_CLIP_PLANE0,1).D(GL_CLIP_PLANE1,1).D(GL_CLIP_PLANE2,1)
+	.D(GL_CLIP_PLANE3,1).D(GL_CLIP_PLANE4,1).D(GL_CLIP_PLANE5,1)
+	.D(GL_COLOR_ARRAY,1).D(GL_COLOR_ARRAY_BUFFER_BINDING,1).D(GL_COLOR_ARRAY_SIZE,1)
+	.D(GL_COLOR_ARRAY_STRIDE,1)
+	.D(GL_COLOR_LOGIC_OP,1)
+	.D(GL_COLOR_MATERIAL,1).D(GL_COLOR_MATERIAL_FACE,1).D(GL_COLOR_MATERIAL_PARAMETER,1)
+	.D(GL_COLOR_MATRIX_STACK_DEPTH,1)
+	.D(GL_COLOR_SUM,1).D(GL_COLOR_TABLE,1)
+	.D(GL_CONVOLUTION_1D,1).D(GL_CONVOLUTION_2D,1)
+	.D(GL_CULL_FACE,1)
+	.D(GL_CURRENT_FOG_COORD,1)
+	.D(GL_CURRENT_INDEX,1)
+	.D(GL_CURRENT_PROGRAM,1)
+	.D(GL_CURRENT_RASTER_DISTANCE,1)
+	.D(GL_CURRENT_RASTER_INDEX,1)
+	.D(GL_CURRENT_RASTER_POSITION_VALID,1)
 	;
 	get_parameter // 1 GLenum
-	.D(GL_ALPHA_TEST_FUNC)
-	.D(GL_BLEND_DST_ALPHA).D(GL_BLEND_DST_RGB)
-	.D(GL_BLEND_EQUATION_RGB).D(GL_BLEND_EQUATION_ALPHA)
-	.D(GL_BLEND_SRC_ALPHA).D(GL_BLEND_SRC_RGB)
-	//.D(GL_CLIENT_ACTIVE_TEXTURE) (minus GL_TEXTURE0)
-	.D(GL_COLOR_ARRAY_TYPE)
-	.D(GL_CULL_FACE_MODE)
+	.D(GL_ALPHA_TEST_FUNC,1)
+	.D(GL_BLEND_DST_ALPHA,1).D(GL_BLEND_DST_RGB,1)
+	.D(GL_BLEND_EQUATION_RGB,1).D(GL_BLEND_EQUATION_ALPHA,1)
+	.D(GL_BLEND_SRC_ALPHA,1).D(GL_BLEND_SRC_RGB,1)
+	//.D(GL_CLIENT_ACTIVE_TEXTURE,1) (minus GL_TEXTURE0)
+	.D(GL_COLOR_ARRAY_TYPE,1)
+	.D(GL_CULL_FACE_MODE,1)
 	;
 	get_parameter // 2
-	.D(GL_ALIASED_POINT_SIZE_RANGE)
-	.D(GL_ALIASED_LINE_WIDTH_RANGE)
+	.D(GL_ALIASED_POINT_SIZE_RANGE,2)
+	.D(GL_ALIASED_LINE_WIDTH_RANGE,2)
 	;
 	get_parameter // 3
-	.D(GL_CURRENT_NORMAL)
+	.D(GL_CURRENT_NORMAL,3)
 	;
 	get_parameter // 4
-	.D(GL_ACCUM_CLEAR_VALUE)
-	.D(GL_BLEND_COLOR)
-	.D(GL_COLOR_CLEAR_VALUE)
-	.D(GL_COLOR_WRITEMASK)
-	.D(GL_CURRENT_COLOR)
-	.D(GL_CURRENT_RASTER_COLOR).D(GL_CURRENT_RASTER_POSITION)
-	.D(GL_CURRENT_RASTER_SECONDARY_COLOR)
-	.D(GL_CURRENT_RASTER_TEXTURE_COORDS)
-	.D(GL_CURRENT_SECONDARY_COLOR)
-	.D(GL_CURRENT_TEXTURE_COORDS)
+	.D(GL_ACCUM_CLEAR_VALUE,4)
+	.D(GL_BLEND_COLOR,4)
+	.D(GL_COLOR_CLEAR_VALUE,4)
+	.D(GL_COLOR_WRITEMASK,4)
+	.D(GL_CURRENT_COLOR,4)
+	.D(GL_CURRENT_RASTER_COLOR,4).D(GL_CURRENT_RASTER_POSITION,4)
+	.D(GL_CURRENT_RASTER_SECONDARY_COLOR,4)
+	.D(GL_CURRENT_RASTER_TEXTURE_COORDS,4)
+	.D(GL_CURRENT_SECONDARY_COLOR,4)
+	.D(GL_CURRENT_TEXTURE_COORDS,4)
 	;
 	get_parameter // 16
-	.D(GL_COLOR_MATRIX)
+	.D(GL_COLOR_MATRIX,16)
 	;
 	get_parameter // other
-	.D(GL_COMPRESSED_TEXTURE_FORMATS) // see GL_NUM_COMPRESSED_TEXTURE_FORMATS. uses GLenum.
-	;
+	.D(GL_COMPRESSED_TEXTURE_FORMATS,-1) // goes with .D(GL_NUM_COMPRESSED_TEXTURE_FORMATS,1) and GLenum
+	;
+	get_parameter // unified
+	.D(GL_DEPTH_BIAS,1).D(GL_DEPTH_BITS,1).D(GL_DEPTH_CLEAR_VALUE,1)
+	//GL_DEPTH_FUNC,1e
+	.D(GL_DEPTH_RANGE,1).D(GL_DEPTH_SCALE,1).D(GL_DEPTH_TEST,1).D(GL_DEPTH_WRITEMASK,1)
+	.D(GL_DITHER,1)
+	.D(GL_DOUBLEBUFFER,1)
+	.D(GL_DRAW_BUFFER,1)
+	//GL_DRAW_BUFFERi,1e
+	.D(GL_EDGE_FLAG,1).D(GL_EDGE_FLAG_ARRAY,1).D(GL_EDGE_FLAG_ARRAY_BUFFER_BINDING,1).D(GL_EDGE_FLAG_ARRAY_STRIDE,1)
+	.D(GL_ELEMENT_ARRAY_BUFFER_BINDING,1)
+	.D(GL_FEEDBACK_BUFFER_SIZE,1)
+	//GL_FEEDBACK_BUFFER_TYPE,1e
+	.D(GL_FOG,1)
+	.D(GL_FOG_COORD_ARRAY,1).D(GL_FOG_COORD_ARRAY_BUFFER_BINDING,1)
+	.D(GL_FOG_COORD_ARRAY_STRIDE,1).D(GL_FOG_COORD_ARRAY_TYPE,1)
+	.D(GL_FOG_COORD_SRC,1).D(GL_FOG_COLOR,4).D(GL_FOG_DENSITY,1).D(GL_FOG_END,1)
+	.D(GL_FOG_HINT,1).D(GL_FOG_INDEX,1).D(GL_FOG_MODE,1).D(GL_FOG_START,1)
+	.D(GL_FRAGMENT_SHADER_DERIVATIVE_HINT,1)
+	.D(GL_FRONT_FACE,1)
+	.D(GL_GENERATE_MIPMAP_HINT,1)
+	.D(GL_GREEN_BIAS,1).D(GL_GREEN_BITS,1).D(GL_GREEN_SCALE,1)
+	.D(GL_HISTOGRAM,1)
+	.D(GL_INDEX_ARRAY,1).D(GL_INDEX_ARRAY_BUFFER_BINDING,1).D(GL_INDEX_ARRAY_STRIDE,1).D(GL_INDEX_ARRAY_TYPE,1)
+	.D(GL_INDEX_BITS,1).D(GL_INDEX_CLEAR_VALUE,1).D(GL_INDEX_LOGIC_OP,1).D(GL_INDEX_MODE,1)
+	.D(GL_INDEX_OFFSET,1).D(GL_INDEX_SHIFT,1).D(GL_INDEX_WRITEMASK,1)
+	//GL_LIGHTi,1
+	.D(GL_LIGHTING,1)
+	.D(GL_LIGHT_MODEL_AMBIENT,4)
+	//.D(GL_LIGHT_MODEL_COLOR_CONTROL,1e)
+	.D(GL_LIGHT_MODEL_LOCAL_VIEWER,1)
+	.D(GL_LIGHT_MODEL_TWO_SIDE,1)
+	.D(GL_LINE_SMOOTH,1).D(GL_LINE_SMOOTH_HINT,1)
+	.D(GL_LINE_STIPPLE,1).D(GL_LINE_STIPPLE_PATTERN,1).D(GL_LINE_STIPPLE_REPEAT,1)
+	.D(GL_LINE_WIDTH,1).D(GL_LINE_WIDTH_GRANULARITY,1).D(GL_LINE_WIDTH_RANGE,2)
+	.D(GL_LIST_BASE,1).D(GL_LIST_INDEX,1).D(GL_LIST_MODE,1)
+	.D(GL_LOGIC_OP_MODE,1)
+
+	.D(GL_MAP1_COLOR_4,1)
+	.D(GL_MAP1_GRID_DOMAIN,2).D(GL_MAP1_GRID_SEGMENTS,1).D(GL_MAP1_INDEX,1).D(GL_MAP1_NORMAL,1)
+	.D(GL_MAP1_TEXTURE_COORD_1,1).D(GL_MAP1_TEXTURE_COORD_2,1).D(GL_MAP1_TEXTURE_COORD_3,1).D(GL_MAP1_TEXTURE_COORD_4,1)
+	.D(GL_MAP1_VERTEX_3,1).D(GL_MAP1_VERTEX_4,1).D(GL_MAP2_COLOR_4,1)
+	.D(GL_MAP2_GRID_DOMAIN,4).D(GL_MAP2_GRID_SEGMENTS,2).D(GL_MAP2_INDEX,1).D(GL_MAP2_NORMAL,1)
+	.D(GL_MAP2_TEXTURE_COORD_1,1).D(GL_MAP2_TEXTURE_COORD_2,1).D(GL_MAP2_TEXTURE_COORD_3,1).D(GL_MAP2_TEXTURE_COORD_4,1)
+	.D(GL_MAP2_VERTEX_3,1).D(GL_MAP2_VERTEX_4,1)
+	.D(GL_MAP_COLOR,1).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L_POLYGON_MODE,2e)
+	.D(GL_POLYGON_OFFSET_FACTOR,1)
+	.D(GL_POLYGON_OFFSET_UNITS,1)
+	.D(GL_POLYGON_OFFSET_FILL,1)
+	.D(GL_POLYGON_OFFSET_LINE,1)
+	.D(GL_POLYGON_OFFSET_POINT,1)
+	.D(GL_POLYGON_SMOOTH,1)
+	.D(GL_POLYGON_SMOOTH_HINT,1)
+	.D(GL_POLYGON_STIPPLE,1)
+	.D(GL_POST_COLOR_MATRIX_COLOR_TABLE,1)
+	.D(GL_POST_COLOR_MATRIX_RED_BIAS,1)
+	.D(GL_POST_COLOR_MATRIX_GREEN_BIAS,1)
+	.D(GL_POST_COLOR_MATRIX_BLUE_BIAS,1)
+	.D(GL_POST_COLOR_MATRIX_ALPHA_BIAS,1)
+	.D(GL_POST_COLOR_MATRIX_RED_SCALE,1)
+	.D(GL_POST_COLOR_MATRIX_GREEN_SCALE,1)
+	.D(GL_POST_COLOR_MATRIX_BLUE_SCALE,1)
+	.D(GL_POST_COLOR_MATRIX_ALPHA_SCALE,1)
+	.D(GL_POST_CONVOLUTION_COLOR_TABLE,1)
+	.D(GL_POST_CONVOLUTION_RED_BIAS,1)
+	.D(GL_POST_CONVOLUTION_GREEN_BIAS,1)
+	.D(GL_POST_CONVOLUTION_BLUE_BIAS,1)
+	.D(GL_POST_CONVOLUTION_ALPHA_BIAS,1)
+	.D(GL_POST_CONVOLUTION_RED_SCALE,1)
+	.D(GL_POST_CONVOLUTION_GREEN_SCALE,1)
+	.D(GL_POST_CONVOLUTION_BLUE_SCALE,1)
+	.D(GL_POST_CONVOLUTION_ALPHA_SCALE,1)
+	.D(GL_PROJECTION_MATRIX,16)
+	.D(GL_PROJECTION_STACK_DEPTH,1)
+	//.D(GL_READ_BUFFER,1e)
+	.D(GL_RED_BIAS,1).D(GL_RED_BITS,1).D(GL_RED_SCALE,1)
+	//.D(GL_RENDER_MODE,1e)
+	.D(GL_RESCALE_NORMAL,1)
+	.D(GL_RGBA_MODE,1)
+	.D(GL_SAMPLE_BUFFERS,1)
+	.D(GL_SAMPLE_COVERAGE_VALUE,1)
+	.D(GL_SAMPLE_COVERAGE_INVERT,1)
+	.D(GL_SAMPLES,1)
+	.D(GL_SCISSOR_BOX,4)
+	.D(GL_SCISSOR_TEST,1)
+	.D(GL_SECONDARY_COLOR_ARRAY,1)
+	.D(GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING,1)
+	.D(GL_SECONDARY_COLOR_ARRAY_SIZE,1)
+	.D(GL_SECONDARY_COLOR_ARRAY_STRIDE,1)
+	.D(GL_SECONDARY_COLOR_ARRAY_TYPE,1)
+	.D(GL_SELECTION_BUFFER_SIZE,1)
+	.D(GL_SEPARABLE_2D,1)
+	.D(GL_SHADE_MODEL,1)
+	.D(GL_SMOOTH_LINE_WIDTH_RANGE,2)
+	.D(GL_SMOOTH_LINE_WIDTH_GRANULARITY,1)
+	.D(GL_SMOOTH_POINT_SIZE_RANGE,2)
+	.D(GL_SMOOTH_POINT_SIZE_GRANULARITY,1)
+	.D(GL_STENCIL_BACK_FAIL,1)
+	.D(GL_STENCIL_BACK_FUNC,1)
+	.D(GL_STENCIL_BACK_PASS_DEPTH_FAIL,1)
+	.D(GL_STENCIL_BACK_PASS_DEPTH_PASS,1)
+	.D(GL_STENCIL_BACK_REF,1)
+	.D(GL_STENCIL_BACK_VALUE_MASK,1)
+	.D(GL_STENCIL_BACK_WRITEMASK,1)
+	.D(GL_STENCIL_BITS,1)
+	.D(GL_STENCIL_CLEAR_VALUE,1)
+	//.D(GL_STENCIL_FAIL,1e)
+	//.D(GL_STENCIL_FUNC,1e)
+	//.D(GL_STENCIL_PASS_DEPTH_FAIL,1e)
+	//.D(GL_STENCIL_PASS_DEPTH_PASS,1e)
+	.D(GL_STENCIL_REF,1)
+	.D(GL_STENCIL_TEST,1)
+	.D(GL_STENCIL_VALUE_MASK,1)
+	.D(GL_STENCIL_WRITEMASK,1)
+	.D(GL_STEREO,1)
+	.D(GL_SUBPIXEL_BIT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.D(GL_VERTEX_ARRAY_TYPE,1)
+	.D(GL_VERTEX_PROGRAM_POINT_SIZE,1)
+	.D(GL_VERTEX_PROGRAM_TWO_SIDE,1)
+	.D(GL_VIEWPORT,4)
+	.D(GL_ZOOM_X,1)
+	.D(GL_ZOOM_Y,1)
+	;
+	// strings:
+	//.D(GL_VENDOR,1).D(GL_RENDERER,1).D(GL_VERSION,1).D(GL_SHADING_LANGUAGE_VERSION,1).D(GL_EXTENSIONS,1) // string
+
+	// pointers:
+	//.D(GL_COLOR_ARRAY_POINTER,1).D(GL_EDGE_FLAG_ARRAY_POINTER,1).D(GL_FOG_COORD_ARRAY_POINTER,1)
+	//.D(GL_FEEDBACK_BUFFER_POINTER,1).D(GL_INDEX_ARRAY_POINTER,1).D(GL_NORMAL_ARRAY_POINTER,1)
+	//.D(GL_SECONDARY_COLOR_ARRAY_POINTER,1).D(GL_SELECTION_BUFFER_POINTER,1)
+	//.D(GL_TEXTURE_COORD_ARRAY_POINTER,1).D(GL_VERTEX_ARRAY_POINTER,1)
+
+	// maps:
+	//.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)
 }
 // comments in the class body list those functions not supported by GF but supported by GEM in openGL dir.
 \class GFGL : FObject {
@@ -904,9 +1066,15 @@
 	}
 	// GenLists
 	// GenProgramsARB
-	// GenTextures
+	\decl 0 gen_textures (int n) {
+		if (n<1) RAISE("$1 must be at least 1");
+		uint32 textures[n];
+		glGenTextures(n,textures);
+		t_atom a[n];
+		for (int i=0; i<n; i++) set_atom(a+i,textures[i]);
+		outlet_anything(outlets[0],&s_list,n,a);
+	}
 	// GetError
-	// GetIntegerv
 	// GLAPI void GLAPIENTRY glGetLightfv(t_atom light, t_atom pname, float *params); // not in GEM
 	// GetMap[dfi]v
 	// GetPointerv
@@ -926,9 +1094,9 @@
 	// Indexsv?
 	// Indexubv?
 	\decl 0 init_names () {glInitNames();}
-	// IsEnabled
+	\decl 0 is_enabled (t_atom cap) {outlet_float(outlets[0],glIsEnabled(capability(cap)));}
 	// IsList
-	// IsTexture
+	\decl 0 is_texture (uint32 texture) {outlet_float(outlets[0],glIsTexture(texture));}
 	\decl 0 light (...) {
 		if (argc<3) RAISE("minimum 3 args");
 		int light = (int)argv[0];
@@ -1072,7 +1240,7 @@
 
 	\decl 0 shade_model (t_atom mode) {shade_model(mode);}
 	\decl 0 stencil_func (t_atom func, int ref, uint32 mask) {
-		glStencilFunc(stencil_func(func),ref,mask);}
+		glStencilFunc(depth_func(func),ref,mask);}
 	\decl 0 stencil_mask (uint32 mask) {glStencilMask(mask);}
 	\decl 0 stencil_op (t_atom fail, t_atom zfail, t_atom zpass) {
 		glStencilOp(stencil_op(fail),stencil_op(zfail),stencil_op(zpass));}



More information about the Gridflow-cvs mailing list