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.c (5642B)


      1 /* Generated from glut.ffi */
      2 
      3 #include "../pico.h"
      4 
      5 #include "GL/glut.h"
      6 #include "GL/glu.h"
      7 #include "GL/gl.h"
      8 
      9 any cfun_glutInitDisplayMode(any ex) {
     10    any x = ex, y;
     11    x = cdr(x);
     12    y = EVAL(car(x));
     13    NeedNum(ex, y);
     14    int b1 = (int) unBox(y);
     15    glutInitDisplayMode(b1);
     16    return Nil;
     17 }
     18 
     19 any cfun_glutInitWindowSize(any ex) {
     20    any x = ex, y;
     21    x = cdr(x);
     22    y = EVAL(car(x));
     23    NeedNum(ex, y);
     24    int b1 = (int) unBox(y);
     25    x = cdr(x);
     26    y = EVAL(car(x));
     27    NeedNum(ex, y);
     28    int b2 = (int) unBox(y);
     29    glutInitWindowSize(b1, b2);
     30    return Nil;
     31 }
     32 
     33 any cfun_glutInitWindowPosition(any ex) {
     34    any x = ex, y;
     35    x = cdr(x);
     36    y = EVAL(car(x));
     37    NeedNum(ex, y);
     38    int b1 = (int) unBox(y);
     39    x = cdr(x);
     40    y = EVAL(car(x));
     41    NeedNum(ex, y);
     42    int b2 = (int) unBox(y);
     43    glutInitWindowPosition(b1, b2);
     44    return Nil;
     45 }
     46 
     47 any cfun_glutCreateWindow(any ex) {
     48    any x = ex, y;
     49    x = cdr(x);
     50    y = EVAL(car(x));
     51    any y1s = xSym(y);
     52    char b1[bufSize(y1s)];
     53    bufString(y1s, b1);
     54    int z = glutCreateWindow(b1);
     55    return box(z);
     56 }
     57 
     58 any cfun_glutSwapBuffers(any ex __attribute__((unused))) {
     59    glutSwapBuffers();
     60    return Nil;
     61 }
     62 
     63 static any lcb_display;
     64 
     65 static any lfun_display() {
     66    prog(lcb_display);
     67    return Nil;
     68 }
     69 
     70 any cfun_glutDisplayFunc(any ex) {
     71    any x = ex, y;
     72    x = cdr(x);
     73    y = EVAL(car(x));
     74    lcb_display = y;
     75    void* b1 = (void*) lfun_display;
     76    glutDisplayFunc(b1);
     77    return Nil;
     78 }
     79 
     80 any cfun_glutSolidCube(any ex) {
     81    any x = ex, y;
     82    x = cdr(x);
     83    y = EVAL(car(x));
     84    NeedNum(ex, y);
     85    double b1 = (double) unBox(y) / 10000;
     86    glutSolidCube(b1);
     87    return Nil;
     88 }
     89 
     90 any cfun_glutWireCube(any ex) {
     91    any x = ex, y;
     92    x = cdr(x);
     93    y = EVAL(car(x));
     94    NeedNum(ex, y);
     95    double b1 = (double) unBox(y) / 10000;
     96    glutWireCube(b1);
     97    return Nil;
     98 }
     99 
    100 any cfun_glutSolidTeapot(any ex) {
    101    any x = ex, y;
    102    x = cdr(x);
    103    y = EVAL(car(x));
    104    NeedNum(ex, y);
    105    double b1 = (double) unBox(y) / 10000;
    106    glutSolidTeapot(b1);
    107    return Nil;
    108 }
    109 
    110 any cfun_glutPostRedisplay(any ex __attribute__((unused))) {
    111    glutPostRedisplay();
    112    return Nil;
    113 }
    114 
    115 static any lcb_menu;
    116 
    117 static any lfun_menu(int value) {
    118    cell c[1];
    119    Push(c[0], box(value));
    120    apply(NULL, lcb_menu, NO, 1, c);
    121    drop(c[0]);
    122    return Nil;
    123 }
    124 
    125 any cfun_glutCreateMenu(any ex) {
    126    any x = ex, y;
    127    x = cdr(x);
    128    y = EVAL(car(x));
    129    lcb_menu = y;
    130    void* b1 = (void*) lfun_menu;
    131    int z = glutCreateMenu(b1);
    132    return box(z);
    133 }
    134 
    135 any cfun_glutAddMenuEntry(any ex) {
    136    any x = ex, y;
    137    x = cdr(x);
    138    y = EVAL(car(x));
    139    any y1s = xSym(y);
    140    char b1[bufSize(y1s)];
    141    bufString(y1s, b1);
    142    x = cdr(x);
    143    y = EVAL(car(x));
    144    NeedNum(ex, y);
    145    int b2 = (int) unBox(y);
    146    glutAddMenuEntry(b1, b2);
    147    return Nil;
    148 }
    149 
    150 any cfun_glutAttachMenu(any ex) {
    151    any x = ex, y;
    152    x = cdr(x);
    153    y = EVAL(car(x));
    154    NeedNum(ex, y);
    155    int b1 = (int) unBox(y);
    156    glutAttachMenu(b1);
    157    return Nil;
    158 }
    159 
    160 static any lcb_keyboard;
    161 
    162 static any lfun_keyboard(unsigned char key, int xv, int yv) {
    163    cell c[3];
    164    Push(c[0], box(key));
    165    Push(c[1], box(xv));
    166    Push(c[2], box(yv));
    167    apply(NULL, lcb_keyboard, NO, 3, c);
    168    drop(c[0]);
    169    return Nil;
    170 }
    171 
    172 any cfun_glutKeyboardFunc(any ex) {
    173    any x = ex, y;
    174    x = cdr(x);
    175    y = EVAL(car(x));
    176    lcb_keyboard = y;
    177    void* b1 = (void*) lfun_keyboard;
    178    glutKeyboardFunc(b1);
    179    return Nil;
    180 }
    181 
    182 static any lcb_motion;
    183 
    184 static any lfun_motion(int xv, int yv) {
    185    cell c[2];
    186    Push(c[0], box(xv));
    187    Push(c[1], box(yv));
    188    apply(NULL, lcb_motion, NO, 2, c);
    189    drop(c[0]);
    190    return Nil;
    191 }
    192 
    193 any cfun_glutMotionFunc(any ex) {
    194    any x = ex, y;
    195    x = cdr(x);
    196    y = EVAL(car(x));
    197    lcb_motion = y;
    198    void* b1 = (void*) lfun_motion;
    199    glutMotionFunc(b1);
    200    return Nil;
    201 }
    202 
    203 static any lcb_mouse;
    204 
    205 static any lfun_mouse(int button, int state, int xv, int yv) {
    206    cell c[4];
    207    Push(c[0], box(button));
    208    Push(c[1], box(state));
    209    Push(c[2], box(xv));
    210    Push(c[3], box(yv));
    211    apply(NULL, lcb_mouse, NO, 4, c);
    212    drop(c[0]);
    213    return Nil;
    214 }
    215 
    216 any cfun_glutMouseFunc(any ex) {
    217    any x = ex, y;
    218    x = cdr(x);
    219    y = EVAL(car(x));
    220    lcb_mouse = y;
    221    void* b1 = (void*) lfun_mouse;
    222    glutMouseFunc(b1);
    223    return Nil;
    224 }
    225 
    226 static any lcb_reshape;
    227 
    228 static any lfun_reshape(int width, int height) {
    229    cell c[2];
    230    Push(c[0], box(width));
    231    Push(c[1], box(height));
    232    apply(NULL, lcb_reshape, NO, 2, c);
    233    drop(c[0]);
    234    return Nil;
    235 }
    236 
    237 any cfun_glutReshapeFunc(any ex) {
    238    any x = ex, y;
    239    x = cdr(x);
    240    y = EVAL(car(x));
    241    lcb_reshape = y;
    242    void* b1 = (void*) lfun_reshape;
    243    glutReshapeFunc(b1);
    244    return Nil;
    245 }
    246 
    247 static any lcb_special;
    248 
    249 static any lfun_special(int key, int xv, int yv) {
    250    cell c[3];
    251    Push(c[0], box(key));
    252    Push(c[1], box(xv));
    253    Push(c[2], box(yv));
    254    apply(NULL, lcb_special, NO, 3, c);
    255    drop(c[0]);
    256    return Nil;
    257 }
    258 
    259 any cfun_glutSpecialFunc(any ex) {
    260    any x = ex, y;
    261    x = cdr(x);
    262    y = EVAL(car(x));
    263    lcb_special = y;
    264    void* b1 = (void*) lfun_special;
    265    glutSpecialFunc(b1);
    266    return Nil;
    267 }
    268 
    269 static any lcb_timer;
    270 
    271 static any lfun_timer(int val) {
    272    cell c[1];
    273    Push(c[0], box(val));
    274    apply(NULL, lcb_timer, NO, 1, c);
    275    drop(c[0]);
    276    return Nil;
    277 }
    278 
    279 any cfun_glutTimerFunc(any ex) {
    280    any x = ex, y;
    281    x = cdr(x);
    282    y = EVAL(car(x));
    283    NeedNum(ex, y);
    284    int b1 = (int) unBox(y);
    285    x = cdr(x);
    286    y = EVAL(car(x));
    287    lcb_timer = y;
    288    void* b2 = (void*) lfun_timer;
    289    x = cdr(x);
    290    y = EVAL(car(x));
    291    NeedNum(ex, y);
    292    int b3 = (int) unBox(y);
    293    glutTimerFunc(b1, b2, b3);
    294    return Nil;
    295 }
    296 
    297 any cfun_glutMainLoop(any ex __attribute__((unused))) {
    298    glutMainLoop();
    299    return Nil;
    300 }