mplisp

miniPicoLisp with FFI and modules for Buddy BDD library, OpenGL, Gtk and GMP
git clone https://logand.com/git/mplisp.git/
Log | Files | Refs

glut.ffi (1524B)


      1 # -*- picolisp -*-
      2 
      3 (load "@src/mod/ffi.l")
      4 
      5 (module 'glut '((X) (pack "glut:" (cddddr (chop X)))))
      6 
      7 (if (= *OS "Darwin")
      8     (include "GLUT/glut.h" "OpenGL/glu.h" "OpenGL/gl.h")
      9     (include "GL/glut.h" "GL/glu.h" "GL/gl.h"))
     10 
     11 # define SCL 10000.0
     12 
     13 #(glut:Init 'arg ..) -> T
     14 (cfun void glutInitDisplayMode int)
     15 (cfun void glutInitWindowSize (int width) (int height))
     16 (cfun void glutInitWindowPosition (int width) (int height))
     17 (cfun int glutCreateWindow cstr)
     18 #(glut:BitmapCharacter 'fontNum 'character) -> T
     19 #(glut:StrokeCharacter 'mono 'character) -> T
     20 (cfun void glutSwapBuffers)
     21 (lprg void display)
     22 (cfun void glutDisplayFunc (lprg display))
     23 (cfun void glutSolidCube (double size))
     24 (cfun void glutWireCube (double size))
     25 (cfun void glutSolidTeapot (double size))
     26 (cfun void glutPostRedisplay)
     27 (lfun void menu (int value))
     28 (cfun int glutCreateMenu (lfun menu))
     29 (cfun void glutAddMenuEntry (cstr name) (int value))
     30 (cfun void glutAttachMenu (int button))
     31 (lfun void keyboard (uchar key) (int xv) (int yv))
     32 (cfun void glutKeyboardFunc (lfun keyboard))
     33 (lfun void motion (int xv) (int yv))
     34 (cfun void glutMotionFunc (lfun motion))
     35 (lfun void mouse (int button) (int state) (int xv) (int yv))
     36 (cfun void glutMouseFunc (lfun mouse))
     37 (lfun void reshape (int width) (int height))
     38 (cfun void glutReshapeFunc (lfun reshape))
     39 (lfun void special (int key) (int xv) (int yv))
     40 (cfun void glutSpecialFunc (lfun special))
     41 (lfun void timer (int val))
     42 (cfun void glutTimerFunc (int msec) (lfun timer) (int val))
     43 (cfun void glutMainLoop)