ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/Client.xs
(Generate patch)

Comparing deliantra/Deliantra-Client/Client.xs (file contents):
Revision 1.89 by root, Sun May 21 00:02:01 2006 UTC vs.
Revision 1.97 by root, Fri May 26 18:28:23 2006 UTC

486 RETVAL 486 RETVAL
487 487
488void 488void
489SDL_GL_SwapBuffers () 489SDL_GL_SwapBuffers ()
490 490
491char *
492SDL_GetKeyName (int sym)
493
491void 494void
492SDL_PollEvent () 495SDL_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;
557lowdelay (int fd, int val = 1) 564lowdelay (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
563char *
564gl_version ()
565 CODE:
566 RETVAL = (char *)glGetString (GL_VERSION);
567 OUTPUT:
568 RETVAL
569
570char *
571gl_extensions ()
572 CODE:
573 RETVAL = (char *)glGetString (GL_EXTENSIONS);
574 OUTPUT:
575 RETVAL
576 569
577void 570void
578add_font (char *file) 571add_font (char *file)
579 CODE: 572 CODE:
580 FcConfigAppFontAddFile (0, (const FcChar8 *)file); /* no idea wether this is required */ 573 FcConfigAppFontAddFile (0, (const FcChar8 *)file); /* no idea wether this is required */
717 710
718CFClient::Layout 711CFClient::Layout
719new (SV *class, int rgba = 0) 712new (SV *class, int rgba = 0)
720 CODE: 713 CODE:
721#if _WIN32 714#if _WIN32
722 rgba = 0;//D 715 //rgba = 0;//D make stext nicer, breaks TextView
723#endif 716#endif
724 New (0, RETVAL, 1, struct cf_layout); 717 New (0, RETVAL, 1, struct cf_layout);
725 718
726 RETVAL->pl = pango_layout_new (rgba ? cairo_context : ft2_context); 719 RETVAL->pl = pango_layout_new (rgba ? cairo_context : ft2_context);
727 RETVAL->rgba = rgba; 720 RETVAL->rgba = rgba;
1083 tex->r = r; 1076 tex->r = r;
1084 tex->g = g; 1077 tex->g = g;
1085 tex->b = b; 1078 tex->b = b;
1086 tex->a = a; 1079 tex->a = a;
1087 } 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);
1088} 1087}
1089 1088
1090int 1089int
1091ox (CFClient::Map self) 1090ox (CFClient::Map self)
1092 ALIAS: 1091 ALIAS:
1604 1603
1605 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; )
1606 newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); 1605 newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv));
1607} 1606}
1608 1607
1608char *
1609gl_vendor ()
1610 CODE:
1611 RETVAL = (char *)glGetString (GL_VENDOR);
1612 OUTPUT:
1613 RETVAL
1614
1615char *
1616gl_version ()
1617 CODE:
1618 RETVAL = (char *)glGetString (GL_VERSION);
1619 OUTPUT:
1620 RETVAL
1621
1622char *
1623gl_extensions ()
1624 CODE:
1625 RETVAL = (char *)glGetString (GL_EXTENSIONS);
1626 OUTPUT:
1627 RETVAL
1628
1609int glGetError () 1629int glGetError ()
1610 1630
1611void glClear (int mask) 1631void glClear (int mask)
1612 1632
1613void glClearColor (float r, float g, float b, float a = 1.0) 1633void glClearColor (float r, float g, float b, float a = 1.0)
1635 1655
1636void glPopMatrix () 1656void glPopMatrix ()
1637 1657
1638void glLoadIdentity () 1658void glLoadIdentity ()
1639 1659
1640# near and far are due to microsofts buggy c compiler 1660# near_ and far_ are due to microsofts buggy "c" compiler
1661void glFrustum (double left, double right, double bottom, double top, double near_, double far_)
1662
1663# near_ and far_ are due to microsofts buggy "c" compiler
1641void glOrtho (double left, double right, double bottom, double top, double near_, double far_) 1664void glOrtho (double left, double right, double bottom, double top, double near_, double far_)
1642 1665
1643void glViewport (int x, int y, int width, int height) 1666void glViewport (int x, int y, int width, int height)
1644 1667
1645void glScissor (int x, int y, int width, int height) 1668void glScissor (int x, int y, int width, int height)
1661void glEnd () 1684void glEnd ()
1662 1685
1663void glColor (float r, float g, float b, float a = 1.0) 1686void glColor (float r, float g, float b, float a = 1.0)
1664 PROTOTYPE: @ 1687 PROTOTYPE: @
1665 CODE: 1688 CODE:
1689 // microsoft visual "c" rounds instead of truncating...
1666 glColor4ub (MIN ((int)(r * 255.f), 255), 1690 glColor4ub (MIN ((int)(r * 255.f), 255),
1667 MIN ((int)(g * 255.f), 255), 1691 MIN ((int)(g * 255.f), 255),
1668 MIN ((int)(b * 255.f), 255), 1692 MIN ((int)(b * 255.f), 255),
1669 MIN ((int)(a * 255.f), 255)); 1693 MIN ((int)(a * 255.f), 255));
1670 1694
1672 1696
1673void glDrawElements (int mode, int count, int type, char *indices) 1697void glDrawElements (int mode, int count, int type, char *indices)
1674 1698
1675# 1.2 void glDrawRangeElements (int mode, int start, int end 1699# 1.2 void glDrawRangeElements (int mode, int start, int end
1676 1700
1701void glRasterPos (float x, float y, float z = 0.)
1702 CODE:
1703 glRasterPos3f (0, 0, z);
1704 glBitmap (0, 0, 0, 0, x, y, 0);
1705
1677void glVertex (float x, float y, float z = 0.) 1706void glVertex (float x, float y, float z = 0.)
1678 CODE: 1707 CODE:
1679 glVertex3f (x, y, z); 1708 glVertex3f (x, y, z);
1680 1709
1681void glTexCoord (float s, float t) 1710void glTexCoord (float s, float t)
1708 1737
1709void glTexImage2D (int target, int level, int internalformat, int width, int height, int border, int format, int type, char *data) 1738void glTexImage2D (int target, int level, int internalformat, int width, int height, int border, int format, int type, char *data)
1710 1739
1711void glCopyTexImage2D (int target, int level, int internalformat, int x, int y, int width, int height, int border) 1740void glCopyTexImage2D (int target, int level, int internalformat, int x, int y, int width, int height, int border)
1712 1741
1713void glRasterPos (int x, int y) 1742void glDrawPixels (int width, int height, int format, int type, char *pixels)
1714 CODE:
1715 glRasterPos2i (x, y);
1716 1743
1717void glCopyPixels (int x, int y, int width, int height, int type = GL_COLOR) 1744void glCopyPixels (int x, int y, int width, int height, int type = GL_COLOR)
1718 1745
1719int glGenTexture () 1746int glGenTexture ()
1720 CODE: 1747 CODE:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines