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

lib.l (4579B)


      1 # 18sep07abu
      2 # 01apr08jk
      3 # (c) Software Lab. Alexander Burger
      4 
      5 (setq *Scl 4)
      6 
      7 # Primitives
      8 (def 'GL_POINTS         (hex "0000"))
      9 (def 'GL_LINES          (hex "0001"))
     10 (def 'GL_LINE_LOOP      (hex "0002"))
     11 (def 'GL_LINE_STRIP     (hex "0003"))
     12 (def 'GL_TRIANGLES      (hex "0004"))
     13 (def 'GL_TRIANGLE_STRIP (hex "0005"))
     14 (def 'GL_TRIANGLE_FAN   (hex "0006"))
     15 (def 'GL_QUADS          (hex "0007"))
     16 (def 'GL_QUAD_STRIP     (hex "0008"))
     17 (def 'GL_POLYGON        (hex "0009"))
     18 
     19 # Matrix Mode
     20 (def 'GL_MATRIX_MODE (hex "0BA0"))
     21 (def 'GL_MODELVIEW   (hex "1700"))
     22 (def 'GL_PROJECTION  (hex "1701"))
     23 (def 'GL_TEXTURE     (hex "1702"))
     24 
     25 # glPush/PopAttrib bits
     26 (def 'GL_CURRENT_BIT          (hex "00000001"))
     27 (def 'GL_POINT_BIT            (hex "00000002"))
     28 (def 'GL_LINE_BIT             (hex "00000004"))
     29 (def 'GL_POLYGON_BIT          (hex "00000008"))
     30 (def 'GL_POLYGON_STIPPLE_BIT  (hex "00000010"))
     31 (def 'GL_PIXEL_MODE_BIT       (hex "00000020"))
     32 (def 'GL_LIGHTING_BIT         (hex "00000040"))
     33 (def 'GL_FOG_BIT              (hex "00000080"))
     34 (def 'GL_DEPTH_BUFFER_BIT     (hex "00000100"))
     35 (def 'GL_ACCUM_BUFFER_BIT     (hex "00000200"))
     36 (def 'GL_STENCIL_BUFFER_BIT   (hex "00000400"))
     37 (def 'GL_VIEWPORT_BIT         (hex "00000800"))
     38 (def 'GL_TRANSFORM_BIT        (hex "00001000"))
     39 (def 'GL_ENABLE_BIT           (hex "00002000"))
     40 (def 'GL_COLOR_BUFFER_BIT     (hex "00004000"))
     41 (def 'GL_HINT_BIT             (hex "00008000"))
     42 (def 'GL_EVAL_BIT             (hex "00010000"))
     43 (def 'GL_LIST_BIT             (hex "00020000"))
     44 (def 'GL_TEXTURE_BIT          (hex "00040000"))
     45 (def 'GL_SCISSOR_BIT          (hex "00080000"))
     46 (def 'GL_ALL_ATTRIB_BITS      (hex "000FFFFF"))
     47 
     48 # AlphaFunction
     49 (def 'GL_LESS                 (hex "00000201"))
     50 
     51 # BlendingFactorDest
     52 (def 'GL_SRC_ALPHA            (hex "00000302"))
     53 (def 'GL_ONE_MINUS_SRC_ALPHA  (hex "00000303"))
     54 
     55 # DrawBufferMode
     56 (def 'GL_FRONT_AND_BACK  		(hex "00000408"))
     57 
     58 # GetTarget
     59 (def 'GL_BLEND                (hex "00000BE2"))
     60 (def 'GL_COLOR_MATERIAL       (hex "00000B57"))
     61 (def 'GL_CULL_FACE            (hex "00000B44"))
     62 (def 'GL_DEPTH_TEST           (hex "00000B71"))
     63 (def 'GL_LIGHTING             (hex "00000B50"))
     64 (def 'GL_LINE_SMOOTH          (hex "00000B20"))
     65 (def 'GL_LINE_SMOOTH_HINT     (hex "00000C52"))
     66 
     67 # HintMode
     68 (def 'GL_NICEST					(hex "00001102"))
     69 
     70 # LightName
     71 (def 'GL_LIGHT0               (hex "00004000"))
     72 
     73 # MaterialParameter
     74 (def 'GL_AMBIENT_AND_DIFFUSE	(hex "00001602"))
     75 
     76 # ShadingModel
     77 (def 'GL_FLAT               	(hex "00001D00"))
     78 (def 'GL_SMOOTH               (hex "00001D01"))
     79 
     80 
     81 # GLUT API macro definitions -- the display mode definitions
     82 (def 'GLUT_RGB          (hex "0000"))
     83 (def 'GLUT_RGBA         (hex "0000"))
     84 (def 'GLUT_INDEX        (hex "0001"))
     85 (def 'GLUT_SINGLE       (hex "0000"))
     86 (def 'GLUT_DOUBLE       (hex "0002"))
     87 (def 'GLUT_ACCUM        (hex "0004"))
     88 (def 'GLUT_ALPHA        (hex "0008"))
     89 (def 'GLUT_DEPTH        (hex "0010"))
     90 (def 'GLUT_STENCIL      (hex "0020"))
     91 (def 'GLUT_MULTISAMPLE  (hex "0080"))
     92 (def 'GLUT_STEREO       (hex "0100"))
     93 (def 'GLUT_LUMINANCE    (hex "0200"))
     94 
     95 # Function keys
     96 (def 'GLUT_KEY_F1		1)
     97 (def 'GLUT_KEY_F2		2)
     98 (def 'GLUT_KEY_F3		3)
     99 (def 'GLUT_KEY_F4		4)
    100 (def 'GLUT_KEY_F5		5)
    101 (def 'GLUT_KEY_F6		6)
    102 (def 'GLUT_KEY_F7		7)
    103 (def 'GLUT_KEY_F8		8)
    104 (def 'GLUT_KEY_F9		9)
    105 (def 'GLUT_KEY_F10	10)
    106 (def 'GLUT_KEY_F11	11)
    107 (def 'GLUT_KEY_F12	12)
    108 # Directional keys
    109 (def 'GLUT_KEY_LEFT			100)
    110 (def 'GLUT_KEY_UP				101)
    111 (def 'GLUT_KEY_RIGHT			102)
    112 (def 'GLUT_KEY_DOWN			103)
    113 (def 'GLUT_KEY_PAGE_UP		104)
    114 (def 'GLUT_KEY_PAGE_DOWN	105)
    115 (def 'GLUT_KEY_HOME			106)
    116 (def 'GLUT_KEY_END			107)
    117 (def 'GLUT_KEY_INSERT		108)
    118 
    119 # Mouse state definitions
    120 (def 'GLUT_LEFT_BUTTON		0)
    121 (def 'GLUT_MIDDLE_BUTTON	1)
    122 (def 'GLUT_RIGHT_BUTTON		2)
    123 
    124 # Callback Functions
    125 # Keep references in global symbols, to protect from garbage collection
    126 
    127 # Display Function
    128 (de displayFunc Prg
    129    (glut:DisplayFunc (setq *GlutDisplayFunc (cdr Prg))) )
    130 
    131 # CreateMenu Function
    132 (de createMenu Prg
    133    (glut:CreateMenu (setq *CreateMenu Prg)) )
    134 
    135 # Keyboard Function
    136 (de keyboardFunc Prg
    137    (glut:KeyboardFunc (setq *GlutKeyboardFunc Prg)) )
    138 
    139 # Motion Function
    140 (de motionFunc Prg
    141    (glut:MotionFunc (setq *GlutMotionFunc Prg)) )
    142 
    143 # Mouse Function
    144 (de mouseFunc Prg
    145    (glut:MouseFunc (setq *GlutMouseFunc Prg)) )
    146 
    147 # Reshape Function
    148 (de reshapeFunc Prg
    149    (glut:ReshapeFunc (setq *GlutReshapeFunc Prg)) )
    150 
    151 # Special Function
    152 (de specialFunc Prg
    153    (glut:SpecialFunc (setq *GlutSpecialFunc Prg)) )
    154 
    155 # Timer Function
    156 (de timerFunc (Msec Fun Val)
    157    (glut:TimerFunc Msec (setq *GlutTimerFunc Fun) Val) )
    158 
    159 # vi:et:ts=3:sw=3