/* This file was automatically generated with cstubgen. */ #include "lisptype.h" #include "lispenvironment.h" #include "lispatom.h" #include "standard.h" #include "arggetter.h" #include "lispplugin.h" #include "platmath.h" #include "stubs.h" #include "genericstructs.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef HAVE_GL_GLUT_H #include #include #include #include "glutcode.h" static void base_glBegin(LispEnvironment& aEnvironment, LispInt aStackTop) { /* Obtain arguments passed in. */ ShortIntegerArgument(arg1, 1 ); /* Call the actual function. */ glBegin(arg1); /* Return result. */ InternalTrue(aEnvironment,aEnvironment.iStack.GetElement(aStackTop)); } static void base_glVertex3d(LispEnvironment& aEnvironment, LispInt aStackTop) { /* Obtain arguments passed in. */ DoubleFloatArgument(arg1, 1); DoubleFloatArgument(arg2, 2); DoubleFloatArgument(arg3, 3); /* Call the actual function. */ glVertex3d(arg1, arg2, arg3); /* Return result. */ InternalTrue(aEnvironment,aEnvironment.iStack.GetElement(aStackTop)); } static void base_glEnd(LispEnvironment& aEnvironment, LispInt aStackTop) { /* Obtain arguments passed in. */ /* Call the actual function. */ glEnd(); /* Return result. */ InternalTrue(aEnvironment,aEnvironment.iStack.GetElement(aStackTop)); } static void base_glClearColor(LispEnvironment& aEnvironment, LispInt aStackTop) { /* Obtain arguments passed in. */ DoubleFloatArgument(arg1, 1); DoubleFloatArgument(arg2, 2); DoubleFloatArgument(arg3, 3); DoubleFloatArgument(arg4, 4); /* Call the actual function. */ glClearColor(arg1, arg2, arg3, arg4); /* Return result. */ InternalTrue(aEnvironment,aEnvironment.iStack.GetElement(aStackTop)); } static void base_glClear(LispEnvironment& aEnvironment, LispInt aStackTop) { /* Obtain arguments passed in. */ ShortIntegerArgument(arg1, 1 ); /* Call the actual function. */ glClear(arg1); /* Return result. */ InternalTrue(aEnvironment,aEnvironment.iStack.GetElement(aStackTop)); } static void base_glColor4d(LispEnvironment& aEnvironment, LispInt aStackTop) { /* Obtain arguments passed in. */ DoubleFloatArgument(arg1, 1); DoubleFloatArgument(arg2, 2); DoubleFloatArgument(arg3, 3); DoubleFloatArgument(arg4, 4); /* Call the actual function. */ glColor4d(arg1, arg2, arg3, arg4); /* Return result. */ InternalTrue(aEnvironment,aEnvironment.iStack.GetElement(aStackTop)); } static void base_glFrontFace(LispEnvironment& aEnvironment, LispInt aStackTop) { /* Obtain arguments passed in. */ ShortIntegerArgument(arg1, 1 ); /* Call the actual function. */ glFrontFace(arg1); /* Return result. */ InternalTrue(aEnvironment,aEnvironment.iStack.GetElement(aStackTop)); } static void base_glPointSize(LispEnvironment& aEnvironment, LispInt aStackTop) { /* Obtain arguments passed in. */ DoubleFloatArgument(arg1, 1); /* Call the actual function. */ glPointSize(arg1); /* Return result. */ InternalTrue(aEnvironment,aEnvironment.iStack.GetElement(aStackTop)); } static void base_glLineWidth(LispEnvironment& aEnvironment, LispInt aStackTop) { /* Obtain arguments passed in. */ DoubleFloatArgument(arg1, 1); /* Call the actual function. */ glLineWidth(arg1); /* Return result. */ InternalTrue(aEnvironment,aEnvironment.iStack.GetElement(aStackTop)); } static void base_glEnable(LispEnvironment& aEnvironment, LispInt aStackTop) { /* Obtain arguments passed in. */ ShortIntegerArgument(arg1, 1 ); /* Call the actual function. */ glEnable(arg1); /* Return result. */ InternalTrue(aEnvironment,aEnvironment.iStack.GetElement(aStackTop)); } static void base_glDisable(LispEnvironment& aEnvironment, LispInt aStackTop) { /* Obtain arguments passed in. */ ShortIntegerArgument(arg1, 1 ); /* Call the actual function. */ glDisable(arg1); /* Return result. */ InternalTrue(aEnvironment,aEnvironment.iStack.GetElement(aStackTop)); } static void base_glPushMatrix(LispEnvironment& aEnvironment, LispInt aStackTop) { /* Obtain arguments passed in. */ /* Call the actual function. */ glPushMatrix(); /* Return result. */ InternalTrue(aEnvironment,aEnvironment.iStack.GetElement(aStackTop)); } static void base_glPopMatrix(LispEnvironment& aEnvironment, LispInt aStackTop) { /* Obtain arguments passed in. */ /* Call the actual function. */ glPopMatrix(); /* Return result. */ InternalTrue(aEnvironment,aEnvironment.iStack.GetElement(aStackTop)); } static void base_glLoadIdentity(LispEnvironment& aEnvironment, LispInt aStackTop) { /* Obtain arguments passed in. */ /* Call the actual function. */ glLoadIdentity(); /* Return result. */ InternalTrue(aEnvironment,aEnvironment.iStack.GetElement(aStackTop)); } static void base_glRotated(LispEnvironment& aEnvironment, LispInt aStackTop) { /* Obtain arguments passed in. */ DoubleFloatArgument(arg1, 1); DoubleFloatArgument(arg2, 2); DoubleFloatArgument(arg3, 3); DoubleFloatArgument(arg4, 4); /* Call the actual function. */ glRotated(arg1, arg2, arg3, arg4); /* Return result. */ InternalTrue(aEnvironment,aEnvironment.iStack.GetElement(aStackTop)); } static void base_glScaled(LispEnvironment& aEnvironment, LispInt aStackTop) { /* Obtain arguments passed in. */ DoubleFloatArgument(arg1, 1); DoubleFloatArgument(arg2, 2); DoubleFloatArgument(arg3, 3); /* Call the actual function. */ glScaled(arg1, arg2, arg3); /* Return result. */ InternalTrue(aEnvironment,aEnvironment.iStack.GetElement(aStackTop)); } static void base_glTranslated(LispEnvironment& aEnvironment, LispInt aStackTop) { /* Obtain arguments passed in. */ DoubleFloatArgument(arg1, 1); DoubleFloatArgument(arg2, 2); DoubleFloatArgument(arg3, 3); /* Call the actual function. */ glTranslated(arg1, arg2, arg3); /* Return result. */ InternalTrue(aEnvironment,aEnvironment.iStack.GetElement(aStackTop)); } static void base_glNormal3d(LispEnvironment& aEnvironment, LispInt aStackTop) { /* Obtain arguments passed in. */ DoubleFloatArgument(arg1, 1); DoubleFloatArgument(arg2, 2); DoubleFloatArgument(arg3, 3); /* Call the actual function. */ glNormal3d(arg1, arg2, arg3); /* Return result. */ InternalTrue(aEnvironment,aEnvironment.iStack.GetElement(aStackTop)); } static void base_glMatrixMode(LispEnvironment& aEnvironment, LispInt aStackTop) { /* Obtain arguments passed in. */ ShortIntegerArgument(arg1, 1 ); /* Call the actual function. */ glMatrixMode(arg1); /* Return result. */ InternalTrue(aEnvironment,aEnvironment.iStack.GetElement(aStackTop)); } static void base_glOrtho(LispEnvironment& aEnvironment, LispInt aStackTop) { /* Obtain arguments passed in. */ DoubleFloatArgument(arg1, 1); DoubleFloatArgument(arg2, 2); DoubleFloatArgument(arg3, 3); DoubleFloatArgument(arg4, 4); DoubleFloatArgument(arg5, 5); DoubleFloatArgument(arg6, 6); /* Call the actual function. */ glOrtho(arg1, arg2, arg3, arg4, arg5, arg6); /* Return result. */ InternalTrue(aEnvironment,aEnvironment.iStack.GetElement(aStackTop)); } static void base_glFrustum(LispEnvironment& aEnvironment, LispInt aStackTop) { /* Obtain arguments passed in. */ DoubleFloatArgument(arg1, 1); DoubleFloatArgument(arg2, 2); DoubleFloatArgument(arg3, 3); DoubleFloatArgument(arg4, 4); DoubleFloatArgument(arg5, 5); DoubleFloatArgument(arg6, 6); /* Call the actual function. */ glFrustum(arg1, arg2, arg3, arg4, arg5, arg6); /* Return result. */ InternalTrue(aEnvironment,aEnvironment.iStack.GetElement(aStackTop)); } static void base_glViewport(LispEnvironment& aEnvironment, LispInt aStackTop) { /* Obtain arguments passed in. */ ShortIntegerArgument(arg1, 1 ); ShortIntegerArgument(arg2, 2 ); ShortIntegerArgument(arg3, 3 ); ShortIntegerArgument(arg4, 4 ); /* Call the actual function. */ glViewport(arg1, arg2, arg3, arg4); /* Return result. */ InternalTrue(aEnvironment,aEnvironment.iStack.GetElement(aStackTop)); } static void base_GlutMainLoop(LispEnvironment& aEnvironment, LispInt aStackTop) { /* Obtain arguments passed in. */ InpStringArgument(arg1, 1); ShortIntegerArgument(arg2, 2 ); ShortIntegerArgument(arg3, 3 ); /* Call the actual function. */ GlutMainLoop(arg1, arg2, arg3); /* Return result. */ InternalTrue(aEnvironment,aEnvironment.iStack.GetElement(aStackTop)); } static void base_GlutViewWidth(LispEnvironment& aEnvironment, LispInt aStackTop) { /* Obtain arguments passed in. */ /* Call the actual function. */ int r = GlutViewWidth(); /* Return result. */ ReturnShortInteger(aEnvironment,aEnvironment.iStack.GetElement(aStackTop),r); } static void base_GlutViewHeight(LispEnvironment& aEnvironment, LispInt aStackTop) { /* Obtain arguments passed in. */ /* Call the actual function. */ int r = GlutViewHeight(); /* Return result. */ ReturnShortInteger(aEnvironment,aEnvironment.iStack.GetElement(aStackTop),r); } static void base_GlutEnableAnimation(LispEnvironment& aEnvironment, LispInt aStackTop) { /* Obtain arguments passed in. */ /* Call the actual function. */ GlutEnableAnimation(); /* Return result. */ InternalTrue(aEnvironment,aEnvironment.iStack.GetElement(aStackTop)); } static void base_GlutDisableAnimation(LispEnvironment& aEnvironment, LispInt aStackTop) { /* Obtain arguments passed in. */ /* Call the actual function. */ GlutDisableAnimation(); /* Return result. */ InternalTrue(aEnvironment,aEnvironment.iStack.GetElement(aStackTop)); } static void base_glutPostRedisplay(LispEnvironment& aEnvironment, LispInt aStackTop) { /* Obtain arguments passed in. */ /* Call the actual function. */ glutPostRedisplay(); /* Return result. */ InternalTrue(aEnvironment,aEnvironment.iStack.GetElement(aStackTop)); } static void base_GlutGetElapsedTime(LispEnvironment& aEnvironment, LispInt aStackTop) { /* Obtain arguments passed in. */ /* Call the actual function. */ int r = GlutGetElapsedTime(); /* Return result. */ ReturnShortInteger(aEnvironment,aEnvironment.iStack.GetElement(aStackTop),r); } class OpenGLPlugin : public LispPluginBase { public: virtual void Add(LispEnvironment& aEnvironment); virtual void Remove(LispEnvironment& aEnvironment); }; void OpenGLPlugin::Add(LispEnvironment& aEnvironment) { SetShortIntegerConstant(aEnvironment, "GL_FALSE", GL_FALSE); SetShortIntegerConstant(aEnvironment, "GL_TRUE", GL_TRUE); SetShortIntegerConstant(aEnvironment, "GL_LINES", GL_LINES); SetShortIntegerConstant(aEnvironment, "GL_POINTS", GL_POINTS); SetShortIntegerConstant(aEnvironment, "GL_LINE_STRIP", GL_LINE_STRIP); SetShortIntegerConstant(aEnvironment, "GL_LINE_LOOP", GL_LINE_LOOP); SetShortIntegerConstant(aEnvironment, "GL_TRIANGLES", GL_TRIANGLES); SetShortIntegerConstant(aEnvironment, "GL_TRIANGLE_STRIP", GL_TRIANGLE_STRIP); SetShortIntegerConstant(aEnvironment, "GL_TRIANGLE_FAN", GL_TRIANGLE_FAN); SetShortIntegerConstant(aEnvironment, "GL_QUADS", GL_QUADS); SetShortIntegerConstant(aEnvironment, "GL_QUAD_STRIP", GL_QUAD_STRIP); SetShortIntegerConstant(aEnvironment, "GL_POLYGON", GL_POLYGON); SetShortIntegerConstant(aEnvironment, "GL_EDGE_FLAG", GL_EDGE_FLAG); SetShortIntegerConstant(aEnvironment, "GL_CURRENT_BIT", GL_CURRENT_BIT); SetShortIntegerConstant(aEnvironment, "GL_POINT_BIT", GL_POINT_BIT); SetShortIntegerConstant(aEnvironment, "GL_LINE_BIT", GL_LINE_BIT); SetShortIntegerConstant(aEnvironment, "GL_POLYGON_BIT", GL_POLYGON_BIT); SetShortIntegerConstant(aEnvironment, "GL_POLYGON_STIPPLE_BIT", GL_POLYGON_STIPPLE_BIT); SetShortIntegerConstant(aEnvironment, "GL_PIXEL_MODE_BIT", GL_PIXEL_MODE_BIT); SetShortIntegerConstant(aEnvironment, "GL_LIGHTING_BIT", GL_LIGHTING_BIT); SetShortIntegerConstant(aEnvironment, "GL_FOG_BIT", GL_FOG_BIT); SetShortIntegerConstant(aEnvironment, "GL_DEPTH_BUFFER_BIT", GL_DEPTH_BUFFER_BIT); SetShortIntegerConstant(aEnvironment, "GL_ACCUM_BUFFER_BIT", GL_ACCUM_BUFFER_BIT); SetShortIntegerConstant(aEnvironment, "GL_STENCIL_BUFFER_BIT", GL_STENCIL_BUFFER_BIT); SetShortIntegerConstant(aEnvironment, "GL_VIEWPORT_BIT", GL_VIEWPORT_BIT); SetShortIntegerConstant(aEnvironment, "GL_TRANSFORM_BIT", GL_TRANSFORM_BIT); SetShortIntegerConstant(aEnvironment, "GL_ENABLE_BIT", GL_ENABLE_BIT); SetShortIntegerConstant(aEnvironment, "GL_COLOR_BUFFER_BIT", GL_COLOR_BUFFER_BIT); SetShortIntegerConstant(aEnvironment, "GL_HINT_BIT", GL_HINT_BIT); SetShortIntegerConstant(aEnvironment, "GL_EVAL_BIT", GL_EVAL_BIT); SetShortIntegerConstant(aEnvironment, "GL_LIST_BIT", GL_LIST_BIT); SetShortIntegerConstant(aEnvironment, "GL_TEXTURE_BIT", GL_TEXTURE_BIT); SetShortIntegerConstant(aEnvironment, "GL_SCISSOR_BIT", GL_SCISSOR_BIT); SetShortIntegerConstant(aEnvironment, "GL_ALL_ATTRIB_BITS", GL_ALL_ATTRIB_BITS); SetShortIntegerConstant(aEnvironment, "GL_MATRIX_MODE", GL_MATRIX_MODE); SetShortIntegerConstant(aEnvironment, "GL_MODELVIEW", GL_MODELVIEW); SetShortIntegerConstant(aEnvironment, "GL_PROJECTION", GL_PROJECTION); SetShortIntegerConstant(aEnvironment, "GL_TEXTURE", GL_TEXTURE); SetShortIntegerConstant(aEnvironment, "GLUT_LEFT_BUTTON", GLUT_LEFT_BUTTON); SetShortIntegerConstant(aEnvironment, "GLUT_MIDDLE_BUTTON", GLUT_MIDDLE_BUTTON); SetShortIntegerConstant(aEnvironment, "GLUT_RIGHT_BUTTON", GLUT_RIGHT_BUTTON); SetShortIntegerConstant(aEnvironment, "GLUT_DOWN", GLUT_DOWN); SetShortIntegerConstant(aEnvironment, "GLUT_UP", GLUT_UP); aEnvironment.SetCommand(base_glBegin, "glBegin",1,YacasEvaluator::Function | YacasEvaluator::Fixed); aEnvironment.SetCommand(base_glVertex3d, "glVertex3d",3,YacasEvaluator::Function | YacasEvaluator::Fixed); aEnvironment.SetCommand(base_glEnd, "glEnd",0,YacasEvaluator::Function | YacasEvaluator::Fixed); aEnvironment.SetCommand(base_glClearColor, "glClearColor",4,YacasEvaluator::Function | YacasEvaluator::Fixed); aEnvironment.SetCommand(base_glClear, "glClear",1,YacasEvaluator::Function | YacasEvaluator::Fixed); aEnvironment.SetCommand(base_glColor4d, "glColor4d",4,YacasEvaluator::Function | YacasEvaluator::Fixed); aEnvironment.SetCommand(base_glFrontFace, "glFrontFace",1,YacasEvaluator::Function | YacasEvaluator::Fixed); aEnvironment.SetCommand(base_glPointSize, "glPointSize",1,YacasEvaluator::Function | YacasEvaluator::Fixed); aEnvironment.SetCommand(base_glLineWidth, "glLineWidth",1,YacasEvaluator::Function | YacasEvaluator::Fixed); aEnvironment.SetCommand(base_glEnable, "glEnable",1,YacasEvaluator::Function | YacasEvaluator::Fixed); aEnvironment.SetCommand(base_glDisable, "glDisable",1,YacasEvaluator::Function | YacasEvaluator::Fixed); aEnvironment.SetCommand(base_glPushMatrix, "glPushMatrix",0,YacasEvaluator::Function | YacasEvaluator::Fixed); aEnvironment.SetCommand(base_glPopMatrix, "glPopMatrix",0,YacasEvaluator::Function | YacasEvaluator::Fixed); aEnvironment.SetCommand(base_glLoadIdentity, "glLoadIdentity",0,YacasEvaluator::Function | YacasEvaluator::Fixed); aEnvironment.SetCommand(base_glRotated, "glRotated",4,YacasEvaluator::Function | YacasEvaluator::Fixed); aEnvironment.SetCommand(base_glScaled, "glScaled",3,YacasEvaluator::Function | YacasEvaluator::Fixed); aEnvironment.SetCommand(base_glTranslated, "glTranslated",3,YacasEvaluator::Function | YacasEvaluator::Fixed); aEnvironment.SetCommand(base_glNormal3d, "glNormal3d",3,YacasEvaluator::Function | YacasEvaluator::Fixed); aEnvironment.SetCommand(base_glMatrixMode, "glMatrixMode",1,YacasEvaluator::Function | YacasEvaluator::Fixed); aEnvironment.SetCommand(base_glOrtho, "glOrtho",6,YacasEvaluator::Function | YacasEvaluator::Fixed); aEnvironment.SetCommand(base_glFrustum, "glFrustum",6,YacasEvaluator::Function | YacasEvaluator::Fixed); aEnvironment.SetCommand(base_glViewport, "glViewport",4,YacasEvaluator::Function | YacasEvaluator::Fixed); aEnvironment.SetCommand(base_GlutMainLoop, "GlutMainLoop",3,YacasEvaluator::Function | YacasEvaluator::Fixed); aEnvironment.SetCommand(base_GlutViewWidth, "GlutViewWidth",0,YacasEvaluator::Function | YacasEvaluator::Fixed); aEnvironment.SetCommand(base_GlutViewHeight, "GlutViewHeight",0,YacasEvaluator::Function | YacasEvaluator::Fixed); aEnvironment.SetCommand(base_GlutEnableAnimation, "GlutEnableAnimation",0,YacasEvaluator::Function | YacasEvaluator::Fixed); aEnvironment.SetCommand(base_GlutDisableAnimation, "GlutDisableAnimation",0,YacasEvaluator::Function | YacasEvaluator::Fixed); aEnvironment.SetCommand(base_glutPostRedisplay, "glutPostRedisplay",0,YacasEvaluator::Function | YacasEvaluator::Fixed); aEnvironment.SetCommand(base_GlutGetElapsedTime, "GlutGetElapsedTime",0,YacasEvaluator::Function | YacasEvaluator::Fixed); GlutSetEnv(aEnvironment); } void OpenGLPlugin::Remove(LispEnvironment& aEnvironment) { //printf("CLOSED DLL!!!\n"); aEnvironment.RemoveCoreCommand("glBegin"); aEnvironment.RemoveCoreCommand("glVertex3d"); aEnvironment.RemoveCoreCommand("glEnd"); aEnvironment.RemoveCoreCommand("glClearColor"); aEnvironment.RemoveCoreCommand("glClear"); aEnvironment.RemoveCoreCommand("glColor4d"); aEnvironment.RemoveCoreCommand("glFrontFace"); aEnvironment.RemoveCoreCommand("glPointSize"); aEnvironment.RemoveCoreCommand("glLineWidth"); aEnvironment.RemoveCoreCommand("glEnable"); aEnvironment.RemoveCoreCommand("glDisable"); aEnvironment.RemoveCoreCommand("glPushMatrix"); aEnvironment.RemoveCoreCommand("glPopMatrix"); aEnvironment.RemoveCoreCommand("glLoadIdentity"); aEnvironment.RemoveCoreCommand("glRotated"); aEnvironment.RemoveCoreCommand("glScaled"); aEnvironment.RemoveCoreCommand("glTranslated"); aEnvironment.RemoveCoreCommand("glNormal3d"); aEnvironment.RemoveCoreCommand("glMatrixMode"); aEnvironment.RemoveCoreCommand("glOrtho"); aEnvironment.RemoveCoreCommand("glFrustum"); aEnvironment.RemoveCoreCommand("glViewport"); aEnvironment.RemoveCoreCommand("GlutMainLoop"); aEnvironment.RemoveCoreCommand("GlutViewWidth"); aEnvironment.RemoveCoreCommand("GlutViewHeight"); aEnvironment.RemoveCoreCommand("GlutEnableAnimation"); aEnvironment.RemoveCoreCommand("GlutDisableAnimation"); aEnvironment.RemoveCoreCommand("glutPostRedisplay"); aEnvironment.RemoveCoreCommand("GlutGetElapsedTime"); } extern "C" { LispPluginBase* make_opengl (void) { return NEW OpenGLPlugin; } } #else extern "C" { LispPluginBase* maker(void) { return NULL; } }; #endif //HAVE_GL_GLUT_H