picolisp

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/picolisp.git/
Log | Files | Refs | README | LICENSE

commit 4954a3aae9640f7e183431c15e75ea0a176752ea
parent ca5236c7bf63b6fb566026c23403066c09aff4a3
Author: Alexander Burger <abu@software-lab.de>
Date:   Fri, 10 Jun 2011 07:50:10 +0200

Rearranged "lib/openGl.l"
Diffstat:
Mersatz/picolisp.jar | 0
Mlib/openGl.l | 453+++++++++++++++++++++++++++++++++++++++++++++++--------------------------------
Msrc/vers.h | 2+-
Msrc64/version.l | 4++--
4 files changed, 271 insertions(+), 188 deletions(-)

diff --git a/ersatz/picolisp.jar b/ersatz/picolisp.jar Binary files differ. diff --git a/lib/openGl.l b/lib/openGl.l @@ -1,9 +1,29 @@ -# 05aug10abu +# 09jun11abu # 27jul10jk # (c) Software Lab. Alexander Burger +### OpenGL library interface ### (load "@lib/math.l") +(default + *GluLib "/usr/lib/libGLU.so" + *GlutLib "/usr/lib/libglut.so" ) + +# Pre-consed fixpoint arguments +(setq + "Flt1" (0 . -1.0) + "Flt2" (0 . -1.0) + "Flt3" (0 . -1.0) + "Flt4" (0 . -1.0) + "Dbl1" (0 . 1.0) + "Dbl2" (0 . 1.0) + "Dbl3" (0 . 1.0) + "Dbl4" (0 . 1.0) + "Dbl5" (0 . 1.0) + "Dbl6" (0 . 1.0) ) + + +### /usr/include/GL/gl.h ### ### Constant Definitions ### # Primitives (def 'GL_POINTS (hex "0000")) @@ -23,6 +43,74 @@ (def 'GL_PROJECTION (hex "1701")) (def 'GL_TEXTURE (hex "1702")) +# Points + +# Lines +(def 'GL_LINE_SMOOTH (hex "00000B20")) + +# Polygons +(def 'GL_CULL_FACE (hex "00000B44")) + +# Display Lists + +# Depth buffer +(def 'GL_LESS (hex "00000201")) +(def 'GL_DEPTH_TEST (hex "00000B71")) + +# Lighting +(def 'GL_LIGHTING (hex "00000B50")) +(def 'GL_LIGHT0 (hex "00004000")) +(def 'GL_AMBIENT_AND_DIFFUSE (hex "00001602")) +(def 'GL_FRONT_AND_BACK (hex "00000408")) +(def 'GL_FLAT (hex "00001D00")) +(def 'GL_SMOOTH (hex "00001D01")) +(def 'GL_COLOR_MATERIAL (hex "00000B57")) + +# User clipping planes + +# Accumulation buffer + +# Alpha testing + +# Blending +(def 'GL_BLEND (hex "00000BE2")) +(def 'GL_SRC_ALPHA (hex "00000302")) +(def 'GL_ONE_MINUS_SRC_ALPHA (hex "00000303")) + +# Render Mode + +# Feedback + +# Selection + +# Fog + +# Logic Ops + +# Stencil + +# Buffers, Pixel Drawing/Reading + +# Implementation limits + +# Gets + +# Evaluators + +# Hints +(def 'GL_LINE_SMOOTH_HINT (hex "00000C52")) +(def 'GL_NICEST (hex "00001102")) + +# Scissor box + +# Pixel Mode / Transfer + +# Texture mapping + +# Utility + +# Errors + # glPush/PopAttrib bits (def 'GL_CURRENT_BIT (hex "00000001")) (def 'GL_POINT_BIT (hex "00000002")) @@ -46,141 +134,91 @@ (def 'GL_SCISSOR_BIT (hex "00080000")) (def 'GL_ALL_ATTRIB_BITS (hex "000FFFFF")) -# AlphaFunction -(def 'GL_LESS (hex "00000201")) - -# BlendingFactorDest -(def 'GL_SRC_ALPHA (hex "00000302")) -(def 'GL_ONE_MINUS_SRC_ALPHA (hex "00000303")) - -# DrawBufferMode -(def 'GL_FRONT_AND_BACK (hex "00000408")) - -# GetTarget -(def 'GL_BLEND (hex "00000BE2")) -(def 'GL_COLOR_MATERIAL (hex "00000B57")) -(def 'GL_CULL_FACE (hex "00000B44")) -(def 'GL_DEPTH_TEST (hex "00000B71")) -(def 'GL_LIGHTING (hex "00000B50")) -(def 'GL_LINE_SMOOTH (hex "00000B20")) -(def 'GL_LINE_SMOOTH_HINT (hex "00000C52")) - -# HintMode -(def 'GL_NICEST (hex "00001102")) - -# LightName -(def 'GL_LIGHT0 (hex "00004000")) +# Miscellaneous +(de glClearColor (Red Green Blue Alpha) + (set "Flt1" Red "Flt2" Green "Flt3" Blue "Flt4" Alpha) + (native `*GlutLib "glClearColor" NIL "Flt1" "Flt2" "Flt3" "Flt4") ) -# MaterialParameter -(def 'GL_AMBIENT_AND_DIFFUSE (hex "00001602")) +(de glClear (Mask) + (native `*GlutLib "glClear" NIL Mask) ) -# ShadingModel -(def 'GL_FLAT (hex "00001D00")) -(def 'GL_SMOOTH (hex "00001D01")) +(de glBlendFunc (SFactor DFactor) + (native `*GlutLib "glBlendFunc" NIL SFactor DFactor) ) -# GLUT API macro definitions -- the display mode definitions -(def 'GLUT_RGB (hex "0000")) -(def 'GLUT_RGBA (hex "0000")) -(def 'GLUT_INDEX (hex "0001")) -(def 'GLUT_SINGLE (hex "0000")) -(def 'GLUT_DOUBLE (hex "0002")) -(def 'GLUT_ACCUM (hex "0004")) -(def 'GLUT_ALPHA (hex "0008")) -(def 'GLUT_DEPTH (hex "0010")) -(def 'GLUT_STENCIL (hex "0020")) -(def 'GLUT_MULTISAMPLE (hex "0080")) -(def 'GLUT_STEREO (hex "0100")) -(def 'GLUT_LUMINANCE (hex "0200")) +(de glLineWidth (Width) + (set "Flt1" Width) + (native `*GlutLib "glLineWidth" NIL "Flt1") ) -# Function keys -(def 'GLUT_KEY_F1 1) -(def 'GLUT_KEY_F2 2) -(def 'GLUT_KEY_F3 3) -(def 'GLUT_KEY_F4 4) -(def 'GLUT_KEY_F5 5) -(def 'GLUT_KEY_F6 6) -(def 'GLUT_KEY_F7 7) -(def 'GLUT_KEY_F8 8) -(def 'GLUT_KEY_F9 9) -(def 'GLUT_KEY_F10 10) -(def 'GLUT_KEY_F11 11) -(def 'GLUT_KEY_F12 12) +(de glEnable (Num) + (native `*GlutLib "glEnable" NIL Num) ) -# Directional keys -(def 'GLUT_KEY_LEFT 100) -(def 'GLUT_KEY_UP 101) -(def 'GLUT_KEY_RIGHT 102) -(def 'GLUT_KEY_DOWN 103) -(def 'GLUT_KEY_PAGE_UP 104) -(def 'GLUT_KEY_PAGE_DOWN 105) -(def 'GLUT_KEY_HOME 106) -(def 'GLUT_KEY_END 107) -(def 'GLUT_KEY_INSERT 108) +(de glDisable (Num) + (native `*GlutLib "glDisable" NIL Num) ) -# Mouse state definitions -(def 'GLUT_LEFT_BUTTON 0) -(def 'GLUT_MIDDLE_BUTTON 1) -(def 'GLUT_RIGHT_BUTTON 2) +(de glFlush () + (native `*GlutLib "glFlush") ) -### OpenGL library interface ### -(default - *GluLib "/usr/lib/libGLU.so" - *GlutLib "/usr/lib/libglut.so" ) +(de glHint (Target Mode) + (native `*GlutLib "glHint" NIL Target Mode) ) -# Pre-consed fixpoint arguments -(setq - "Flt1" (0 . -1.0) - "Flt2" (0 . -1.0) - "Flt3" (0 . -1.0) - "Flt4" (0 . -1.0) - "Dbl1" (0 . 1.0) - "Dbl2" (0 . 1.0) - "Dbl3" (0 . 1.0) - "Dbl4" (0 . 1.0) - "Dbl5" (0 . 1.0) - "Dbl6" (0 . 1.0) ) +# Depth Buffer +(de glClearDepth (Depth) + (set "Dbl1" Depth) + (native `*GlutLib "glClearDepth" NIL "Dbl1") ) -### Native functions ### -(de glutInit () - (native `*GlutLib "glutInit" NIL '(NIL (8) . 0)) ) +(de glDepthFunc (Num) + (native `*GlutLib "glDepthFunc" NIL Num) ) -(de glutInitDisplayMode (N) - (native `*GlutLib "glutInitDisplayMode" NIL N) ) +# Accumulation Buffer -(de glutInitWindowPosition (Width Height) - (native `*GlutLib "glutInitWindowPosition" NIL Width Height) ) +# Transformation +(de glMatrixMode (Mode) + (native `*GlutLib "glMatrixMode" NIL Mode) ) -(de glutInitWindowSize (Width Height) - (native `*GlutLib "glutInitWindowSize" NIL Width Height) ) +(de glOrtho (Left Right Bottom Top Near Far) + (set "Dbl1" Left "Dbl2" Right "Dbl3" Bottom "Dbl4" Top "Dbl5" Near "Dbl6" Far) + (native `*GlutLib "glOrtho" NIL "Dbl1" "Dbl2" "Dbl3" "Dbl4" "Dbl5" "Dbl6") ) -(de glutCreateWindow (Name) - (native `*GlutLib "glutCreateWindow" NIL Name) ) +(de glViewport (X Y Width Height) + (native `*GlutLib "glViewport" NIL X Y Width Height) ) -(de glutSwapBuffers () - (native `*GlutLib "glutSwapBuffers") ) +(de glPushMatrix () + (native `*GlutLib "glPushMatrix") ) -(de glMatrixMode (Mode) - (native `*GlutLib "glMatrixMode" NIL Mode) ) +(de glPopMatrix () + (native `*GlutLib "glPopMatrix") ) (de glLoadIdentity () (native `*GlutLib "glLoadIdentity") ) -(de glClear (Mask) - (native `*GlutLib "glClear" NIL Mask) ) +(de glRotatef (A X Y Z) + (set "Flt1" A "Flt2" X "Flt3" Y "Flt4" Z) + (native `*GlutLib "glRotatef" NIL "Flt1" "Flt2" "Flt3" "Flt4") ) + +(de glTranslatef (X Y Z) + (set "Flt1" X "Flt2" Y "Flt3" Z) + (native `*GlutLib "glTranslatef" NIL "Flt1" "Flt2" "Flt3") ) + +# Display Lists +# Drawing Functions (de glBegin (Mode) (native `*GlutLib "glBegin" NIL Mode) ) (de glEnd () (native `*GlutLib "glEnd") ) -(de glClearColor (Red Green Blue Alpha) - (set "Flt1" Red "Flt2" Green "Flt3" Blue "Flt4" Alpha) - (native `*GlutLib "glClearColor" NIL "Flt1" "Flt2" "Flt3" "Flt4") ) +(de glVertex2f (X Y) + (set "Flt1" X "Flt2" Y) + (native `*GlutLib "glVertex2f" NIL "Flt1" "Flt2") ) -(de glClearDepth (Depth) - (set "Dbl1" Depth) - (native `*GlutLib "glClearDepth" NIL "Dbl1") ) +(de glVertex3f (X Y Z) + (set "Flt1" X "Flt2" Y "Flt3" Z) + (native `*GlutLib "glVertex3f" NIL "Flt1" "Flt2" "Flt3") ) + +(de glNormal3f (X Y Z) + (set "Flt1" X "Flt2" Y "Flt3" Z) + (native `*GlutLib "glNormal3f" NIL "Flt1" "Flt2" "Flt3") ) (de glColor3f (Red Green Blue) (set "Flt1" Red "Flt2" Green "Flt3" Blue) @@ -190,122 +228,167 @@ (set "Flt1" Red "Flt2" Green "Flt3" Blue "Flt4" Alpha) (native `*GlutLib "glColor4f" NIL "Flt1" "Flt2" "Flt3" "Flt4") ) -(de glNormal3f (X Y Z) - (set "Flt1" X "Flt2" Y "Flt3" Z) - (native `*GlutLib "glNormal3f" NIL "Flt1" "Flt2" "Flt3") ) +# Vertex Arrays -(de glOrtho (Left Right Bottom Top Near Far) - (set "Dbl1" Left "Dbl2" Right "Dbl3" Bottom "Dbl4" Top "Dbl5" Near "Dbl6" Far) - (native `*GlutLib "glOrtho" NIL "Dbl1" "Dbl2" "Dbl3" "Dbl4" "Dbl5" "Dbl6") ) +# Lighting +(de glShadeModel (Num) + (native `*GlutLib "glShadeModel" NIL Num) ) -(de glRotatef (A X Y Z) - (set "Flt1" A "Flt2" X "Flt3" Y "Flt4" Z) - (native `*GlutLib "glRotatef" NIL "Flt1" "Flt2" "Flt3" "Flt4") ) +(de glColorMaterial (Face Mode) + (native `*GlutLib "glColorMaterial" NIL Face Mode) ) -(de glTranslatef (X Y Z) - (set "Flt1" X "Flt2" Y "Flt3" Z) - (native `*GlutLib "glTranslatef" NIL "Flt1" "Flt2" "Flt3") ) +# Raster functions -(de glVertex2f (X Y) - (set "Flt1" X "Flt2" Y) - (native `*GlutLib "glVertex2f" NIL "Flt1" "Flt2") ) +# Stenciling -(de glVertex3f (X Y Z) - (set "Flt1" X "Flt2" Y "Flt3" Z) - (native `*GlutLib "glVertex3f" NIL "Flt1" "Flt2" "Flt3") ) +# Texture mapping -(de glutSolidCube (Size) - (set "Dbl1" Size) - (native `*GlutLib "glutSolidCube" NIL "Dbl1") ) +# Evaluators -(de glutWireCube (Size) - (set "Dbl1" Size) - (native `*GlutLib "glutWireCube" NIL "Dbl1") ) +# Fog -(de glColorMaterial (Face Mode) - (native `*GlutLib "glColorMaterial" NIL Face Mode) ) +# Selection and Feedback -(de glDepthFunc (Num) - (native `*GlutLib "glDepthFunc" NIL Num) ) -(de glEnable (Num) - (native `*GlutLib "glEnable" NIL Num) ) -(de glDisable (Num) - (native `*GlutLib "glDisable" NIL Num) ) +### /usr/include/GL/glu.h ### -(de glBlendFunc (SFactor DFactor) - (native `*GlutLib "glBlendFunc" NIL SFactor DFactor) ) +(de gluPerspective (Fovy Aspect ZNear ZFar) + (set "Dbl1" Fovy "Dbl2" Aspect "Dbl3" ZNear "Dbl4" ZFar) + (native `*GluLib "gluPerspective" NIL "Dbl1" "Dbl2" "Dbl3" "Dbl4") ) -(de glHint (Target Mode) - (native `*GlutLib "glHint" NIL Target Mode) ) -(de glLineWidth (Width) - (set "Flt1" Width) - (native `*GlutLib "glLineWidth" NIL "Flt1") ) +### /usr/include/GL/freeglut_std.h ### +# Special key codes +(def 'GLUT_KEY_F1 1) +(def 'GLUT_KEY_F2 2) +(def 'GLUT_KEY_F3 3) +(def 'GLUT_KEY_F4 4) +(def 'GLUT_KEY_F5 5) +(def 'GLUT_KEY_F6 6) +(def 'GLUT_KEY_F7 7) +(def 'GLUT_KEY_F8 8) +(def 'GLUT_KEY_F9 9) +(def 'GLUT_KEY_F10 10) +(def 'GLUT_KEY_F11 11) +(def 'GLUT_KEY_F12 12) +(def 'GLUT_KEY_LEFT 100) +(def 'GLUT_KEY_UP 101) +(def 'GLUT_KEY_RIGHT 102) +(def 'GLUT_KEY_DOWN 103) +(def 'GLUT_KEY_PAGE_UP 104) +(def 'GLUT_KEY_PAGE_DOWN 105) +(def 'GLUT_KEY_HOME 106) +(def 'GLUT_KEY_END 107) +(def 'GLUT_KEY_INSERT 108) -(de glFlush () - (native `*GlutLib "glFlush") ) +# Mouse state definitions +(def 'GLUT_LEFT_BUTTON 0) +(def 'GLUT_MIDDLE_BUTTON 1) +(def 'GLUT_RIGHT_BUTTON 2) -(de glPopMatrix () - (native `*GlutLib "glPopMatrix") ) +# Display mode definitions +(def 'GLUT_RGB (hex "0000")) +(def 'GLUT_RGBA (hex "0000")) +(def 'GLUT_INDEX (hex "0001")) +(def 'GLUT_SINGLE (hex "0000")) +(def 'GLUT_DOUBLE (hex "0002")) +(def 'GLUT_ACCUM (hex "0004")) +(def 'GLUT_ALPHA (hex "0008")) +(def 'GLUT_DEPTH (hex "0010")) +(def 'GLUT_STENCIL (hex "0020")) +(def 'GLUT_MULTISAMPLE (hex "0080")) +(def 'GLUT_STEREO (hex "0100")) +(def 'GLUT_LUMINANCE (hex "0200")) -(de glPushMatrix () - (native `*GlutLib "glPushMatrix") ) +### Native functions ### +# Initialization functions +(de glutInit () + (native `*GlutLib "glutInit" NIL '(NIL (8) . 0)) ) -(de glShadeModel (Num) - (native `*GlutLib "glShadeModel" NIL Num) ) +(de glutInitWindowPosition (Width Height) + (native `*GlutLib "glutInitWindowPosition" NIL Width Height) ) -(de glViewport (X Y Width Height) - (native `*GlutLib "glViewport" NIL X Y Width Height) ) +(de glutInitWindowSize (Width Height) + (native `*GlutLib "glutInitWindowSize" NIL Width Height) ) -(de gluPerspective (Fovy Aspect ZNear ZFar) - (set "Dbl1" Fovy "Dbl2" Aspect "Dbl3" ZNear "Dbl4" ZFar) - (native `*GluLib "gluPerspective" NIL "Dbl1" "Dbl2" "Dbl3" "Dbl4") ) +(de glutInitDisplayMode (N) + (native `*GlutLib "glutInitDisplayMode" NIL N) ) +# Process loop function (de glutMainLoop () (native `*GlutLib "glutMainLoop") ) -(de glutAddMenuEntry (Name Val) - (native `*GlutLib "glutAddMenuEntry" NIL Name Val) ) - -(de glutAttachMenu (Button) - (native `*GlutLib "glutAttachMenu" NIL Button) ) +# Window management functions +(de glutCreateWindow (Name) + (native `*GlutLib "glutCreateWindow" NIL Name) ) +# Display-connected functions (de glutPostRedisplay () (native `*GlutLib "glutPostRedisplay") ) -### Callbacks ### -# Display Function -(de displayPrg Prg - (native `*GlutLib "glutDisplayFunc" NIL (lisp 'displayPrg (cons NIL Prg))) ) +(de glutSwapBuffers () + (native `*GlutLib "glutSwapBuffers") ) -# CreateMenu Function +# Mouse cursor functions + +# Overlay stuff + +# Menu stuff (de createMenu (Fun) (native `*GlutLib "glutCreateMenu" NIL (lisp 'createMenu Fun)) ) -# Keyboard Function +(de glutAddMenuEntry (Name Val) + (native `*GlutLib "glutAddMenuEntry" NIL Name Val) ) + +(de glutAttachMenu (Button) + (native `*GlutLib "glutAttachMenu" NIL Button) ) + +# Global callback functions +(de timerFunc (Msec Fun Val) + (native `*GlutLib "glutTimerFunc" NIL Msec (lisp 'timerFunc Fun) Val) ) + (de keyboardFunc (Fun) (native `*GlutLib "glutKeyboardFunc" NIL (lisp 'keyboardFunc Fun)) ) -# Motion Function -(de motionFunc (Fun) - (native `*GlutLib "glutMotionFunc" NIL (lisp 'motionFunc Fun)) ) +(de specialFunc (Fun) + (native `*GlutLib "glutSpecialFunc" NIL (lisp 'specialFunc Fun)) ) + +(de reshapeFunc (Fun) + (native `*GlutLib "glutReshapeFunc" NIL (lisp 'reshapeFunc Fun)) ) + +(de displayPrg Prg + (native `*GlutLib "glutDisplayFunc" NIL (lisp 'displayPrg (cons NIL Prg))) ) -# Mouse Function (de mouseFunc (Fun) (native `*GlutLib "glutMouseFunc" NIL (lisp 'mouseFunc Fun)) ) -# Reshape Function -(de reshapeFunc (Fun) - (native `*GlutLib "glutReshapeFunc" NIL (lisp 'reshapeFunc Fun)) ) +(de motionFunc (Fun) + (native `*GlutLib "glutMotionFunc" NIL (lisp 'motionFunc Fun)) ) -# Special Function -(de specialFunc (Fun) - (native `*GlutLib "glutSpecialFunc" NIL (lisp 'specialFunc Fun)) ) +# State setting and retrieval functions -# Timer Function -(de timerFunc (Msec Fun Val) - (native `*GlutLib "glutTimerFunc" NIL Msec (lisp 'timerFunc Fun) Val) ) +# Font stuff + +# Geometry functions +(de glutWireCube (Size) + (set "Dbl1" Size) + (native `*GlutLib "glutWireCube" NIL "Dbl1") ) + +(de glutSolidCube (Size) + (set "Dbl1" Size) + (native `*GlutLib "glutSolidCube" NIL "Dbl1") ) + +# Teapot rendering functions + +# Game mode functions + +# Video resize functions + +# Colormap functions + +# Misc keyboard and joystick functions + +# Misc functions # vi:et:ts=3:sw=3 diff --git a/src/vers.h b/src/vers.h @@ -1 +1 @@ -static byte Version[4] = {3,0,6,15}; +static byte Version[4] = {3,0,6,16}; diff --git a/src64/version.l b/src64/version.l @@ -1,6 +1,6 @@ -# 06jun11abu +# 10jun11abu # (c) Software Lab. Alexander Burger -(de *Version 3 0 6 15) +(de *Version 3 0 6 16) # vi:et:ts=3:sw=3