Index: /trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/feedback/feedback.def
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/feedback/feedback.def	(revision 17269)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/feedback/feedback.def	(revision 17269)
@@ -0,0 +1,6 @@
+; Copyright (c) 2001, Stanford University
+; All rights reserved.
+;
+; See the file LICENSE.txt for information on redistributing this software.
+EXPORTS
+SPULoad
Index: /trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/feedback/feedback.py
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/feedback/feedback.py	(revision 17269)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/feedback/feedback.py	(revision 17269)
@@ -0,0 +1,269 @@
+# Copyright (c) 2001, Stanford University
+# All rights reserved.
+#
+# See the file LICENSE.txt for information on redistributing this software.
+
+import sys
+
+import apiutil
+
+
+apiutil.CopyrightC()
+
+print """
+/* DO NOT EDIT - generated by feedback.py */
+#include <stdio.h>
+#include "cr_spu.h"
+#include "feedbackspu.h"
+#include "feedbackspu_proto.h"
+#include "cr_packfunctions.h"
+#include "cr_glstate.h"
+
+"""
+
+keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
+
+for func_name in keys:
+	return_type = apiutil.ReturnType(func_name)
+	params = apiutil.Parameters(func_name)
+	if apiutil.FindSpecial( "feedback", func_name ):
+		print 'static %s FEEDBACKSPU_APIENTRY feedbackspu_%s( %s )' % ( return_type, func_name, apiutil.MakeDeclarationString(params) )
+		print '{'
+		print '\tfeedback_spu.super.%s( %s );' % ( func_name, apiutil.MakeCallString(params) )
+		print '}'
+
+
+
+print """
+#define CHANGE( name, func ) crSPUChangeInterface( (void *)&(feedback_spu.self), (void *)feedback_spu.self.name, (void *)((SPUGenericFunction) func) )
+#define CHANGESWAP( name, swapfunc, regfunc ) crSPUChangeInterface( (void *)&(feedback_spu.self), (void *)feedback_spu.self.name, (void *)((SPUGenericFunction) (feedback_spu.swap ? swapfunc: regfunc )) )
+
+static void __loadFeedbackAPI( void )
+{
+"""
+for func_name in keys:
+	return_type = apiutil.ReturnType(func_name)
+	params = apiutil.Parameters(func_name)
+	if apiutil.FindSpecial( "feedback", func_name ):
+		print '\tCHANGE( %s, crStateFeedback%s );' % (func_name, func_name )
+print """
+}
+
+static void __loadSelectAPI( void )
+{
+"""
+for func_name in keys:
+	if apiutil.FindSpecial( "select", func_name ):
+		print '\tCHANGE( %s, crStateSelect%s );' % (func_name, func_name )
+	elif apiutil.FindSpecial( "feedback", func_name ):
+		print '\tCHANGE( %s, feedbackspu_%s );' % (func_name, func_name )
+print """
+}
+
+static void __loadRenderAPI( void )
+{
+"""
+
+for func_name in keys:
+	return_type = apiutil.ReturnType(func_name)
+	if apiutil.FindSpecial( "feedback", func_name ) or apiutil.FindSpecial( "select", func_name ):
+		print '\tCHANGE( %s, feedbackspu_%s );' % (func_name, func_name )
+print """
+}
+"""
+
+print """
+static GLint FEEDBACKSPU_APIENTRY feedbackspu_RenderMode ( GLenum mode )
+{
+	feedback_spu.render_mode = mode;
+
+	switch (mode) {
+		case GL_FEEDBACK:
+			/*printf("Switching to Feedback API\\n");*/
+			__loadFeedbackAPI( );
+			break;
+		case GL_SELECT:
+			/*printf("Switching to Selection API\\n");*/
+			__loadSelectAPI( );
+			break;
+		case GL_RENDER:
+			/*printf("Switching to Render API\\n");*/
+			__loadRenderAPI( );
+			break;
+	}
+
+	return crStateRenderMode( mode );
+}
+
+static void FEEDBACKSPU_APIENTRY feedbackspu_Begin ( GLenum mode )
+{
+	if (feedback_spu.render_mode == GL_FEEDBACK)
+		crStateFeedbackBegin( mode );
+	else if (feedback_spu.render_mode == GL_SELECT)
+		crStateSelectBegin( mode );
+	else
+	{
+		crStateBegin( mode );
+		feedback_spu.super.Begin( mode );
+	}
+}
+
+static void FEEDBACKSPU_APIENTRY feedbackspu_End ( void )
+{
+	if (feedback_spu.render_mode == GL_FEEDBACK)
+		crStateFeedbackEnd( );
+	else if (feedback_spu.render_mode == GL_SELECT)
+		crStateSelectEnd( );
+	else
+	{
+		crStateEnd( );
+		feedback_spu.super.End( );
+	}
+}
+
+static void FEEDBACKSPU_APIENTRY feedbackspu_Bitmap ( GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap )
+{
+	crStateBitmap( width, height, xorig, yorig, xmove, ymove, bitmap );
+
+	if (feedback_spu.render_mode == GL_FEEDBACK)
+		crStateFeedbackBitmap( width, height, xorig, yorig, xmove, ymove, bitmap );
+	else if (feedback_spu.render_mode == GL_SELECT)
+		crStateSelectBitmap( width, height, xorig, yorig, xmove, ymove, bitmap );
+	else
+		feedback_spu.super.Bitmap( width, height, xorig, yorig, xmove, ymove, bitmap );
+}
+
+static void FEEDBACKSPU_APIENTRY feedbackspu_CopyPixels( GLint x, GLint y, GLsizei width, GLsizei height, GLenum type )
+{
+	if (feedback_spu.render_mode == GL_FEEDBACK)
+		crStateFeedbackCopyPixels( x, y, width, height, type );
+	else if (feedback_spu.render_mode == GL_SELECT)
+		crStateSelectCopyPixels( x, y, width, height, type );
+	else
+		feedback_spu.super.CopyPixels( x, y, width, height, type );
+}
+
+static void FEEDBACKSPU_APIENTRY feedbackspu_DrawPixels( GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels )
+{
+	if (feedback_spu.render_mode == GL_FEEDBACK)
+		crStateFeedbackDrawPixels( width, height, format, type, pixels );
+	else if (feedback_spu.render_mode == GL_SELECT)
+		crStateSelectDrawPixels( width, height, format, type, pixels );
+	else
+		feedback_spu.super.DrawPixels( width, height, format, type, pixels );
+}
+
+static void FEEDBACKSPU_APIENTRY feedbackspu_GetBooleanv( GLenum pname, GLboolean *params )
+
+{
+	if (pname == GL_FEEDBACK_BUFFER_SIZE ||
+	    pname == GL_FEEDBACK_BUFFER_TYPE ||
+	    pname == GL_SELECTION_BUFFER_SIZE)
+		crStateFeedbackGetBooleanv( pname, params );
+	else
+	if (pname == GL_VIEWPORT && feedback_spu.default_viewport)
+		crStateGetBooleanv( pname, params );
+	else
+		feedback_spu.super.GetBooleanv( pname, params );
+}
+
+static void FEEDBACKSPU_APIENTRY feedbackspu_GetDoublev( GLenum pname, GLdouble *params )
+
+{
+	if (pname == GL_FEEDBACK_BUFFER_SIZE ||
+	    pname == GL_FEEDBACK_BUFFER_TYPE ||
+	    pname == GL_SELECTION_BUFFER_SIZE)
+		crStateFeedbackGetDoublev( pname, params );
+	else
+	if (pname == GL_VIEWPORT && feedback_spu.default_viewport)
+		crStateGetDoublev( pname, params );
+	else
+		feedback_spu.super.GetDoublev( pname, params );
+}
+
+static void FEEDBACKSPU_APIENTRY feedbackspu_GetFloatv( GLenum pname, GLfloat *params )
+
+{
+	if (pname == GL_FEEDBACK_BUFFER_SIZE ||
+	    pname == GL_FEEDBACK_BUFFER_TYPE ||
+	    pname == GL_SELECTION_BUFFER_SIZE)
+		crStateFeedbackGetFloatv( pname, params );
+	else
+	if (pname == GL_VIEWPORT && feedback_spu.default_viewport)
+		crStateGetFloatv( pname, params );
+	else
+		feedback_spu.super.GetFloatv( pname, params );
+}
+
+static void FEEDBACKSPU_APIENTRY feedbackspu_GetIntegerv( GLenum pname, GLint *params )
+
+{
+	if (pname == GL_FEEDBACK_BUFFER_SIZE ||
+	    pname == GL_FEEDBACK_BUFFER_TYPE ||
+	    pname == GL_SELECTION_BUFFER_SIZE)
+		crStateFeedbackGetIntegerv( pname, params );
+	else
+	if (pname == GL_VIEWPORT && feedback_spu.default_viewport)
+		crStateGetIntegerv( pname, params );
+	else
+		feedback_spu.super.GetIntegerv( pname, params );
+}
+
+SPUNamedFunctionTable _cr_feedback_table[] = {
+"""
+
+for func_name in keys:
+	if apiutil.FindSpecial( "feedback_state", func_name ):
+		print '\t{ "%s", (SPUGenericFunction) feedbackspu_%s }, ' % ( func_name, func_name )
+print """
+	{ "GetBooleanv", (SPUGenericFunction) feedbackspu_GetBooleanv },
+	{ "GetDoublev", (SPUGenericFunction) feedbackspu_GetDoublev },
+	{ "GetFloatv", (SPUGenericFunction) feedbackspu_GetFloatv },
+	{ "GetIntegerv", (SPUGenericFunction) feedbackspu_GetIntegerv },
+	{ "FeedbackBuffer", (SPUGenericFunction) crStateFeedbackBuffer },
+	{ "SelectBuffer", (SPUGenericFunction) crStateSelectBuffer },
+	{ "InitNames", (SPUGenericFunction) crStateInitNames },
+	{ "LoadName", (SPUGenericFunction) crStateLoadName },
+	{ "PushName", (SPUGenericFunction) crStatePushName },
+	{ "PopName", (SPUGenericFunction) crStatePopName },
+	{ "Begin", (SPUGenericFunction) feedbackspu_Begin },
+	{ "End", (SPUGenericFunction) feedbackspu_End },
+	{ "Bitmap", (SPUGenericFunction) feedbackspu_Bitmap },
+	{ "CopyPixels", (SPUGenericFunction) feedbackspu_CopyPixels },
+	{ "DrawPixels", (SPUGenericFunction) feedbackspu_DrawPixels },
+	{ "TexCoord1d", (SPUGenericFunction) feedbackspu_TexCoord1d },
+	{ "TexCoord1dv", (SPUGenericFunction) feedbackspu_TexCoord1dv },
+	{ "TexCoord1f", (SPUGenericFunction) feedbackspu_TexCoord1f },
+	{ "TexCoord1fv", (SPUGenericFunction) feedbackspu_TexCoord1fv },
+	{ "TexCoord1s", (SPUGenericFunction) feedbackspu_TexCoord1s },
+	{ "TexCoord1sv", (SPUGenericFunction) feedbackspu_TexCoord1sv },
+	{ "TexCoord1i", (SPUGenericFunction) feedbackspu_TexCoord1i },
+	{ "TexCoord1iv", (SPUGenericFunction) feedbackspu_TexCoord1iv },
+	{ "TexCoord2d", (SPUGenericFunction) feedbackspu_TexCoord2d },
+	{ "TexCoord2dv", (SPUGenericFunction) feedbackspu_TexCoord2dv },
+	{ "TexCoord2f", (SPUGenericFunction) feedbackspu_TexCoord2f },
+	{ "TexCoord2fv", (SPUGenericFunction) feedbackspu_TexCoord2fv },
+	{ "TexCoord2s", (SPUGenericFunction) feedbackspu_TexCoord2s },
+	{ "TexCoord2sv", (SPUGenericFunction) feedbackspu_TexCoord2sv },
+	{ "TexCoord2i", (SPUGenericFunction) feedbackspu_TexCoord2i },
+	{ "TexCoord2iv", (SPUGenericFunction) feedbackspu_TexCoord2iv },
+	{ "TexCoord3d", (SPUGenericFunction) feedbackspu_TexCoord3d },
+	{ "TexCoord3dv", (SPUGenericFunction) feedbackspu_TexCoord3dv },
+	{ "TexCoord3f", (SPUGenericFunction) feedbackspu_TexCoord3f },
+	{ "TexCoord3fv", (SPUGenericFunction) feedbackspu_TexCoord3fv },
+	{ "TexCoord3s", (SPUGenericFunction) feedbackspu_TexCoord3s },
+	{ "TexCoord3sv", (SPUGenericFunction) feedbackspu_TexCoord3sv },
+	{ "TexCoord3i", (SPUGenericFunction) feedbackspu_TexCoord3i },
+	{ "TexCoord3iv", (SPUGenericFunction) feedbackspu_TexCoord3iv },
+	{ "TexCoord4d", (SPUGenericFunction) feedbackspu_TexCoord4d },
+	{ "TexCoord4dv", (SPUGenericFunction) feedbackspu_TexCoord4dv },
+	{ "TexCoord4f", (SPUGenericFunction) feedbackspu_TexCoord4f },
+	{ "TexCoord4fv", (SPUGenericFunction) feedbackspu_TexCoord4fv },
+	{ "TexCoord4s", (SPUGenericFunction) feedbackspu_TexCoord4s },
+	{ "TexCoord4sv", (SPUGenericFunction) feedbackspu_TexCoord4sv },
+	{ "TexCoord4i", (SPUGenericFunction) feedbackspu_TexCoord4i },
+	{ "TexCoord4iv", (SPUGenericFunction) feedbackspu_TexCoord4iv },
+	{ "RenderMode", (SPUGenericFunction) feedbackspu_RenderMode },
+	{ NULL, NULL }
+};
+"""
Index: /trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/feedback/feedback_funcs.py
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/feedback/feedback_funcs.py	(revision 17269)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/feedback/feedback_funcs.py	(revision 17269)
@@ -0,0 +1,39 @@
+# Copyright (c) 2001, Stanford University
+# All rights reserved.
+#
+# See the file LICENSE.txt for information on redistributing this software.
+
+import sys
+
+import apiutil
+
+
+apiutil.CopyrightC()
+
+print """
+/* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED BY feedback_funcs.py SCRIPT */
+#ifndef CR_STATE_FEEDBACK_FUNCS_H
+#define CR_STATE_FEEDBACK_FUNCS_H
+
+#include "cr_error.h"
+
+#if defined(WINDOWS)
+#define STATE_APIENTRY __stdcall
+#else
+#define STATE_APIENTRY
+#endif
+
+#define STATE_UNUSED(x) ((void)x)"""
+
+keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
+
+for func_name in apiutil.AllSpecials( "feedback" ):
+	return_type = apiutil.ReturnType(func_name)
+	params = apiutil.Parameters(func_name)
+	print '%s STATE_APIENTRY crStateFeedback%s( %s );' % (return_type, func_name, apiutil.MakeDeclarationString(params))
+
+for func_name in apiutil.AllSpecials( "select" ):
+	return_type = apiutil.ReturnType(func_name)
+	params = apiutil.Parameters(func_name)
+	print '%s STATE_APIENTRY crStateSelect%s( %s );' % (return_type, func_name, apiutil.MakeDeclarationString(params))
+print '\n#endif /* CR_STATE_FEEDBACK_FUNCS_H */'
Index: /trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/feedback/feedback_special
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/feedback/feedback_special	(revision 17269)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/feedback/feedback_special	(revision 17269)
@@ -0,0 +1,64 @@
+Vertex2d
+Vertex2dv
+Vertex2f
+Vertex2fv
+Vertex2i
+Vertex2iv
+Vertex2s
+Vertex2sv
+Vertex3d
+Vertex3dv
+Vertex3f
+Vertex3fv
+Vertex3i
+Vertex3iv
+Vertex3s
+Vertex3sv
+Vertex4d
+Vertex4dv
+Vertex4f
+Vertex4fv
+Vertex4i
+Vertex4iv
+Vertex4s
+Vertex4sv
+Rectf
+Recti
+Rectd
+Rects
+Rectiv
+Rectfv
+Rectdv
+Rectsv
+TexCoord1d
+TexCoord1dv
+TexCoord1f
+TexCoord1fv
+TexCoord1i
+TexCoord1iv
+TexCoord1s
+TexCoord1sv
+TexCoord2d
+TexCoord2dv
+TexCoord2f
+TexCoord2fv
+TexCoord2i
+TexCoord2iv
+TexCoord2s
+TexCoord2sv
+TexCoord3d
+TexCoord3dv
+TexCoord3f
+TexCoord3fv
+TexCoord3i
+TexCoord3iv
+TexCoord3s
+TexCoord3sv
+TexCoord4d
+TexCoord4dv
+TexCoord4f
+TexCoord4fv
+TexCoord4i
+TexCoord4iv
+TexCoord4s
+TexCoord4sv
Index: /trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/feedback/feedback_state.py
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/feedback/feedback_state.py	(revision 17269)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/feedback/feedback_state.py	(revision 17269)
@@ -0,0 +1,30 @@
+# Copyright (c) 2001, Stanford University
+# All rights reserved.
+#
+# See the file LICENSE.txt for information on redistributing this software.
+
+import sys
+
+import apiutil
+
+
+apiutil.CopyrightC()
+
+print """
+#include "cr_server.h"
+#include "feedbackspu.h"
+#include "feedbackspu_proto.h"
+"""
+
+keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
+
+for func_name in keys:
+	if apiutil.FindSpecial( "feedback_state", func_name ):
+		return_type = apiutil.ReturnType(func_name)
+		params = apiutil.Parameters(func_name)
+		print '%s FEEDBACKSPU_APIENTRY feedbackspu_%s( %s )' % (return_type, func_name, apiutil.MakeDeclarationString(params))
+		print '{'
+		print '\tcrState%s( %s );' % (func_name, apiutil.MakeCallString(params))
+		print ''
+		print '\tfeedback_spu.super.%s( %s );' % (func_name, apiutil.MakeCallString(params))
+		print '}'
Index: /trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/feedback/feedback_state_special
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/feedback/feedback_state_special	(revision 17269)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/feedback/feedback_state_special	(revision 17269)
@@ -0,0 +1,60 @@
+# Copyright (c) 2001, Stanford University
+# All rights reserved.
+#
+# See the file LICENSE.txt for information on redistributing this software.
+ClipPlane
+MatrixMode
+LoadIdentity
+PopMatrix
+PushMatrix
+LoadMatrixf
+LoadMatrixd
+MultMatrixf
+MultMatrixd
+LoadTransposeMatrixfARB
+LoadTransposeMatrixdARB
+MultTransposeMatrixfARB
+MultTransposeMatrixdARB
+Translatef
+Translated
+Rotatef
+Rotated
+Scalef
+Scaled
+Frustum
+Ortho
+Viewport
+DepthRange
+Scissor
+PushAttrib
+PopAttrib
+PassThrough
+PolygonMode
+Color4f
+Color4fv
+Color3f
+Color3fv
+RasterPos2d
+RasterPos2dv
+RasterPos2f
+RasterPos2fv
+RasterPos2i
+RasterPos2iv
+RasterPos2s
+RasterPos2sv
+RasterPos3d
+RasterPos3dv
+RasterPos3f
+RasterPos3fv
+RasterPos3i
+RasterPos3iv
+RasterPos3s
+RasterPos3sv
+RasterPos4d
+RasterPos4dv
+RasterPos4f
+RasterPos4fv
+RasterPos4i
+RasterPos4iv
+RasterPos4s
+RasterPos4sv
Index: /trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/feedback/feedbackspu.h
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/feedback/feedbackspu.h	(revision 17269)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/feedback/feedbackspu.h	(revision 17269)
@@ -0,0 +1,40 @@
+/* Copyright (c) 2001, Stanford University
+ * All rights reserved.
+ *
+ * See the file LICENSE.txt for information on redistributing this software.
+ */
+
+#ifndef FEEDBACK_SPU_H
+#define FEEDBACK_SPU_H
+
+#ifdef WINDOWS
+#define FEEDBACKSPU_APIENTRY __stdcall
+#else
+#define FEEDBACKSPU_APIENTRY
+#endif
+
+#include "cr_spu.h"
+#include "cr_timer.h"
+#include "cr_glstate.h"
+
+typedef struct {
+	int id;
+	int has_child;
+	SPUDispatchTable self, child, super;
+
+	int render_mode;
+
+	int default_viewport;
+
+	CRCurrentStatePointers current;
+} feedbackSPU;
+
+extern feedbackSPU feedback_spu;
+
+extern SPUNamedFunctionTable _cr_feedback_table[];
+
+extern SPUOptions feedbackSPUOptions[];
+
+extern void feedbackspuGatherConfiguration( void );
+
+#endif /* FEEDBACK_SPU_H */
Index: /trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/feedback/feedbackspu_config.c
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/feedback/feedbackspu_config.c	(revision 17269)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/feedback/feedbackspu_config.c	(revision 17269)
@@ -0,0 +1,43 @@
+/* Copyright (c) 2001, Stanford University
+ * All rights reserved
+ *
+ * See the file LICENSE.txt for information on redistributing this software.
+ */
+
+#include "cr_string.h"
+#include "cr_environment.h"
+#include "cr_error.h"
+#include "cr_mem.h"
+#include "feedbackspu.h"
+
+#include <stdio.h>
+#ifndef WINDOWS
+#include <unistd.h>
+#endif
+
+static void __setDefaults( void )
+{
+	feedback_spu.render_mode = GL_RENDER;
+}
+
+static void set_default_viewport( void *foo, const char *response )
+{
+   sscanf( response, "%d", &(feedback_spu.default_viewport) );
+}
+
+/* option, type, nr, default, min, max, title, callback
+ */
+SPUOptions feedbackSPUOptions[] = {
+
+   { "default_viewport", CR_BOOL, 1, "0", "0", "1",
+     "Return default viewport parameters", (SPUOptionCB)set_default_viewport },
+
+   { NULL, CR_BOOL, 0, NULL, NULL, NULL, NULL, NULL },
+
+};
+
+
+void feedbackspuGatherConfiguration( void )
+{
+	__setDefaults();
+}
Index: /trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/feedback/feedbackspu_init.c
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/feedback/feedbackspu_init.c	(revision 17269)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/feedback/feedbackspu_init.c	(revision 17269)
@@ -0,0 +1,80 @@
+/* Copyright (c) 2001, Stanford University
+ * All rights reserved
+ *
+ * See the file LICENSE.txt for information on redistributing this software.
+ */
+
+#include "cr_spu.h"
+#include "cr_environment.h"
+#include "cr_string.h"
+#include "cr_error.h"
+#include "cr_mem.h"
+#include "cr_server.h"
+#include "feedbackspu.h"
+#include <fcntl.h>
+#ifndef WINDOWS
+#include <unistd.h>
+#endif
+
+feedbackSPU feedback_spu;
+
+static SPUFunctions feedback_functions = {
+	NULL, /* CHILD COPY */
+	NULL, /* DATA */
+	_cr_feedback_table /* THE ACTUAL FUNCTIONS */
+};
+
+static SPUFunctions *feedbackSPUInit( int id, SPU *child, SPU *self,
+		unsigned int context_id,
+		unsigned int num_contexts )
+{
+	CRContext *ctx;
+	(void) context_id;
+	(void) num_contexts;
+
+	feedback_spu.id = id;
+	feedback_spu.has_child = 0;
+	if (child)
+	{
+		crSPUInitDispatchTable( &(feedback_spu.child) );
+		crSPUCopyDispatchTable( &(feedback_spu.child), &(child->dispatch_table) );
+		feedback_spu.has_child = 1;
+	}
+	crSPUInitDispatchTable( &(feedback_spu.super) );
+	crSPUCopyDispatchTable( &(feedback_spu.super), &(self->superSPU->dispatch_table) );
+	feedbackspuGatherConfiguration();
+
+	/* create/init default state tracker */
+	crStateInit();
+	ctx = crStateGetCurrent();
+	CRASSERT(ctx);
+	crStateSetCurrentPointers(ctx, &feedback_spu.current);
+
+	return &feedback_functions;
+}
+
+static void feedbackSPUSelfDispatch(SPUDispatchTable *self)
+{
+	crSPUInitDispatchTable( &(feedback_spu.self) );
+	crSPUCopyDispatchTable( &(feedback_spu.self), self );
+}
+
+static int feedbackSPUCleanup(void)
+{
+	return 1;
+}
+
+int SPULoad( char **name, char **super, SPUInitFuncPtr *init,
+	     SPUSelfDispatchFuncPtr *self, SPUCleanupFuncPtr *cleanup,
+	     SPUOptionsPtr *options, int *flags )
+{
+	*name = "feedback";
+	*super = "passthrough";
+	*init = feedbackSPUInit;
+	*self = feedbackSPUSelfDispatch;
+	*cleanup = feedbackSPUCleanup;
+	*options = feedbackSPUOptions;
+	*flags = (SPU_NO_PACKER|SPU_NOT_TERMINAL|SPU_MAX_SERVERS_ZERO);
+	
+	return 1;
+}
Index: /trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/feedback/feedbackspu_proto.py
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/feedback/feedbackspu_proto.py	(revision 17269)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/feedback/feedbackspu_proto.py	(revision 17269)
@@ -0,0 +1,34 @@
+# Copyright (c) 2001, Stanford University
+# All rights reserved.
+#
+# See the file LICENSE.txt for information on redistributing this software.
+
+import sys
+
+import apiutil
+
+
+apiutil.CopyrightC()
+
+print """
+/* DO NOT EDIT - generated by feedback.py */
+
+#ifndef FEEDBACKSPU_PROTO_H
+#define FEEDBACKSPU_PROTO_H
+
+#include "feedbackspu.h"
+
+"""
+
+keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
+
+for func_name in keys:
+	if apiutil.FindSpecial( "feedback_state", func_name ):
+		return_type = apiutil.ReturnType(func_name)
+		params = apiutil.Parameters(func_name)
+		print 'extern %s FEEDBACKSPU_APIENTRY feedbackspu_%s( %s );' % (return_type, func_name, apiutil.MakeDeclarationString(params))
+
+
+print """
+#endif
+"""
Index: /trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/feedback/select_special
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/feedback/select_special	(revision 17269)
+++ /trunk/src/VBox/Additions/WINNT/Graphics/crOpenGL/feedback/select_special	(revision 17269)
@@ -0,0 +1,56 @@
+Vertex2d
+Vertex2dv
+Vertex2f
+Vertex2fv
+Vertex2i
+Vertex2iv
+Vertex2s
+Vertex2sv
+Vertex3d
+Vertex3dv
+Vertex3f
+Vertex3fv
+Vertex3i
+Vertex3iv
+Vertex3s
+Vertex3sv
+Vertex4d
+Vertex4dv
+Vertex4f
+Vertex4fv
+Vertex4i
+Vertex4iv
+Vertex4s
+Vertex4sv
+Rectf
+Recti
+Rectd
+Rects
+Rectiv
+Rectfv
+Rectdv
+Rectsv
+RasterPos2d
+RasterPos2dv
+RasterPos2f
+RasterPos2fv
+RasterPos2i
+RasterPos2iv
+RasterPos2s
+RasterPos2sv
+RasterPos3d
+RasterPos3dv
+RasterPos3f
+RasterPos3fv
+RasterPos3i
+RasterPos3iv
+RasterPos3s
+RasterPos3sv
+RasterPos4d
+RasterPos4dv
+RasterPos4f
+RasterPos4fv
+RasterPos4i
+RasterPos4iv
+RasterPos4s
+RasterPos4sv
