… | |
… | |
486 | RETVAL |
486 | RETVAL |
487 | |
487 | |
488 | void |
488 | void |
489 | SDL_GL_SwapBuffers () |
489 | SDL_GL_SwapBuffers () |
490 | |
490 | |
|
|
491 | char * |
|
|
492 | SDL_GetKeyName (int sym) |
|
|
493 | |
491 | void |
494 | void |
492 | SDL_PollEvent () |
495 | SDL_PollEvent () |
493 | PPCODE: |
496 | PPCODE: |
494 | { |
497 | { |
495 | SDL_Event ev; |
498 | SDL_Event ev; |
… | |
… | |
513 | hv_store (hv, "gain", 4, newSViv (ev.active.gain), 0); |
516 | hv_store (hv, "gain", 4, newSViv (ev.active.gain), 0); |
514 | hv_store (hv, "state", 5, newSViv (ev.active.state), 0); |
517 | hv_store (hv, "state", 5, newSViv (ev.active.state), 0); |
515 | break; |
518 | break; |
516 | |
519 | |
517 | case SDL_MOUSEMOTION: |
520 | case SDL_MOUSEMOTION: |
|
|
521 | hv_store (hv, "mod", 3, newSViv (SDL_GetModState ()), 0); |
|
|
522 | |
518 | hv_store (hv, "state", 5, newSViv (ev.motion.state), 0); |
523 | hv_store (hv, "state", 5, newSViv (ev.motion.state), 0); |
519 | hv_store (hv, "x", 1, newSViv (ev.motion.x), 0); |
524 | hv_store (hv, "x", 1, newSViv (ev.motion.x), 0); |
520 | hv_store (hv, "y", 1, newSViv (ev.motion.y), 0); |
525 | hv_store (hv, "y", 1, newSViv (ev.motion.y), 0); |
521 | hv_store (hv, "xrel", 4, newSViv (ev.motion.xrel), 0); |
526 | hv_store (hv, "xrel", 4, newSViv (ev.motion.xrel), 0); |
522 | hv_store (hv, "yrel", 4, newSViv (ev.motion.yrel), 0); |
527 | hv_store (hv, "yrel", 4, newSViv (ev.motion.yrel), 0); |
523 | break; |
528 | break; |
524 | |
529 | |
525 | case SDL_MOUSEBUTTONDOWN: |
530 | case SDL_MOUSEBUTTONDOWN: |
526 | case SDL_MOUSEBUTTONUP: |
531 | case SDL_MOUSEBUTTONUP: |
|
|
532 | hv_store (hv, "mod", 3, newSViv (SDL_GetModState ()), 0); |
|
|
533 | |
527 | hv_store (hv, "button", 6, newSViv (ev.button.button), 0); |
534 | hv_store (hv, "button", 6, newSViv (ev.button.button), 0); |
528 | hv_store (hv, "state", 5, newSViv (ev.button.state), 0); |
535 | hv_store (hv, "state", 5, newSViv (ev.button.state), 0); |
529 | hv_store (hv, "x", 1, newSViv (ev.button.x), 0); |
536 | hv_store (hv, "x", 1, newSViv (ev.button.x), 0); |
530 | hv_store (hv, "y", 1, newSViv (ev.button.y), 0); |
537 | hv_store (hv, "y", 1, newSViv (ev.button.y), 0); |
531 | break; |
538 | break; |
… | |
… | |
557 | lowdelay (int fd, int val = 1) |
564 | lowdelay (int fd, int val = 1) |
558 | CODE: |
565 | CODE: |
559 | #ifndef _WIN32 |
566 | #ifndef _WIN32 |
560 | setsockopt (fd, IPPROTO_TCP, TCP_NODELAY, &val, sizeof (val)); |
567 | setsockopt (fd, IPPROTO_TCP, TCP_NODELAY, &val, sizeof (val)); |
561 | #endif |
568 | #endif |
562 | |
|
|
563 | char * |
|
|
564 | gl_vendor () |
|
|
565 | CODE: |
|
|
566 | RETVAL = (char *)glGetString (GL_VENDOR); |
|
|
567 | OUTPUT: |
|
|
568 | RETVAL |
|
|
569 | |
|
|
570 | char * |
|
|
571 | gl_version () |
|
|
572 | CODE: |
|
|
573 | RETVAL = (char *)glGetString (GL_VERSION); |
|
|
574 | OUTPUT: |
|
|
575 | RETVAL |
|
|
576 | |
|
|
577 | char * |
|
|
578 | gl_extensions () |
|
|
579 | CODE: |
|
|
580 | RETVAL = (char *)glGetString (GL_EXTENSIONS); |
|
|
581 | OUTPUT: |
|
|
582 | RETVAL |
|
|
583 | |
569 | |
584 | void |
570 | void |
585 | add_font (char *file) |
571 | add_font (char *file) |
586 | CODE: |
572 | CODE: |
587 | FcConfigAppFontAddFile (0, (const FcChar8 *)file); /* no idea wether this is required */ |
573 | FcConfigAppFontAddFile (0, (const FcChar8 *)file); /* no idea wether this is required */ |
… | |
… | |
724 | |
710 | |
725 | CFClient::Layout |
711 | CFClient::Layout |
726 | new (SV *class, int rgba = 0) |
712 | new (SV *class, int rgba = 0) |
727 | CODE: |
713 | CODE: |
728 | #if _WIN32 |
714 | #if _WIN32 |
729 | rgba = 0;//D |
715 | //rgba = 0;//D make stext nicer, breaks TextView |
730 | #endif |
716 | #endif |
731 | New (0, RETVAL, 1, struct cf_layout); |
717 | New (0, RETVAL, 1, struct cf_layout); |
732 | |
718 | |
733 | RETVAL->pl = pango_layout_new (rgba ? cairo_context : ft2_context); |
719 | RETVAL->pl = pango_layout_new (rgba ? cairo_context : ft2_context); |
734 | RETVAL->rgba = rgba; |
720 | RETVAL->rgba = rgba; |
… | |
… | |
1090 | tex->r = r; |
1076 | tex->r = r; |
1091 | tex->g = g; |
1077 | tex->g = g; |
1092 | tex->b = b; |
1078 | tex->b = b; |
1093 | tex->a = a; |
1079 | tex->a = a; |
1094 | } |
1080 | } |
|
|
1081 | |
|
|
1082 | // somewhat hackish, but for textures that require it, it really |
|
|
1083 | // improves the look, and most others don't suffer. |
|
|
1084 | glBindTexture (GL_TEXTURE_2D, name); |
|
|
1085 | glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); |
|
|
1086 | glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); |
1095 | } |
1087 | } |
1096 | |
1088 | |
1097 | int |
1089 | int |
1098 | ox (CFClient::Map self) |
1090 | ox (CFClient::Map self) |
1099 | ALIAS: |
1091 | ALIAS: |
… | |
… | |
1611 | |
1603 | |
1612 | for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) |
1604 | for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) |
1613 | newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); |
1605 | newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); |
1614 | } |
1606 | } |
1615 | |
1607 | |
|
|
1608 | char * |
|
|
1609 | gl_vendor () |
|
|
1610 | CODE: |
|
|
1611 | RETVAL = (char *)glGetString (GL_VENDOR); |
|
|
1612 | OUTPUT: |
|
|
1613 | RETVAL |
|
|
1614 | |
|
|
1615 | char * |
|
|
1616 | gl_version () |
|
|
1617 | CODE: |
|
|
1618 | RETVAL = (char *)glGetString (GL_VERSION); |
|
|
1619 | OUTPUT: |
|
|
1620 | RETVAL |
|
|
1621 | |
|
|
1622 | char * |
|
|
1623 | gl_extensions () |
|
|
1624 | CODE: |
|
|
1625 | RETVAL = (char *)glGetString (GL_EXTENSIONS); |
|
|
1626 | OUTPUT: |
|
|
1627 | RETVAL |
|
|
1628 | |
1616 | int glGetError () |
1629 | int glGetError () |
1617 | |
1630 | |
1618 | void glClear (int mask) |
1631 | void glClear (int mask) |
1619 | |
1632 | |
1620 | void glClearColor (float r, float g, float b, float a = 1.0) |
1633 | void glClearColor (float r, float g, float b, float a = 1.0) |