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.94 by root, Tue May 23 18:57:35 2006 UTC vs.
Revision 1.98 by root, Mon May 29 02:01:56 2006 UTC

565 CODE: 565 CODE:
566#ifndef _WIN32 566#ifndef _WIN32
567 setsockopt (fd, IPPROTO_TCP, TCP_NODELAY, &val, sizeof (val)); 567 setsockopt (fd, IPPROTO_TCP, TCP_NODELAY, &val, sizeof (val));
568#endif 568#endif
569 569
570char *
571gl_vendor ()
572 CODE:
573 RETVAL = (char *)glGetString (GL_VENDOR);
574 OUTPUT:
575 RETVAL
576
577char *
578gl_version ()
579 CODE:
580 RETVAL = (char *)glGetString (GL_VERSION);
581 OUTPUT:
582 RETVAL
583
584char *
585gl_extensions ()
586 CODE:
587 RETVAL = (char *)glGetString (GL_EXTENSIONS);
588 OUTPUT:
589 RETVAL
590
591void 570void
592add_font (char *file) 571add_font (char *file)
593 CODE: 572 CODE:
594 FcConfigAppFontAddFile (0, (const FcChar8 *)file); /* no idea wether this is required */ 573 FcConfigAppFontAddFile (0, (const FcChar8 *)file); /* no idea wether this is required */
595#ifdef _WIN32 574#ifdef _WIN32
731 710
732CFClient::Layout 711CFClient::Layout
733new (SV *class, int rgba = 0) 712new (SV *class, int rgba = 0)
734 CODE: 713 CODE:
735#if _WIN32 714#if _WIN32
736 rgba = 0;//D 715 //rgba = 0;//D make stext nicer, breaks TextView
737#endif 716#endif
738 New (0, RETVAL, 1, struct cf_layout); 717 New (0, RETVAL, 1, struct cf_layout);
739 718
740 RETVAL->pl = pango_layout_new (rgba ? cairo_context : ft2_context); 719 RETVAL->pl = pango_layout_new (rgba ? cairo_context : ft2_context);
741 RETVAL->rgba = rgba; 720 RETVAL->rgba = rgba;
988{ 967{
989 HV *hv = (HV *)SvRV (self); 968 HV *hv = (HV *)SvRV (self);
990 float s = SvNV (*hv_fetch (hv, "s", 1, 1)); 969 float s = SvNV (*hv_fetch (hv, "s", 1, 1));
991 float t = SvNV (*hv_fetch (hv, "t", 1, 1)); 970 float t = SvNV (*hv_fetch (hv, "t", 1, 1));
992 int name = SvIV (*hv_fetch (hv, "name", 4, 1)); 971 int name = SvIV (*hv_fetch (hv, "name", 4, 1));
993 int wrap_mode = SvIV (*hv_fetch (hv, "wrap_mode", 9, 1));
994 972
995 if (items < 5) 973 if (items < 5)
996 { 974 {
997 w = SvNV (*hv_fetch (hv, "w", 1, 1)); 975 w = SvNV (*hv_fetch (hv, "w", 1, 1));
998 h = SvNV (*hv_fetch (hv, "h", 1, 1)); 976 h = SvNV (*hv_fetch (hv, "h", 1, 1));
1005 glEnable (GL_ALPHA_TEST); 983 glEnable (GL_ALPHA_TEST);
1006 glAlphaFunc (GL_GREATER, 0.01f); 984 glAlphaFunc (GL_GREATER, 0.01f);
1007 } 985 }
1008 986
1009 glBindTexture (GL_TEXTURE_2D, name); 987 glBindTexture (GL_TEXTURE_2D, name);
1010
1011 if (wrap_mode)
1012 {
1013 glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
1014 glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
1015 }
1016 988
1017 glBegin (GL_QUADS); 989 glBegin (GL_QUADS);
1018 glTexCoord2f (0, 0); glVertex2f (x , y ); 990 glTexCoord2f (0, 0); glVertex2f (x , y );
1019 glTexCoord2f (0, t); glVertex2f (x , y + h); 991 glTexCoord2f (0, t); glVertex2f (x , y + h);
1020 glTexCoord2f (s, t); glVertex2f (x + w, y + h); 992 glTexCoord2f (s, t); glVertex2f (x + w, y + h);
1097 tex->r = r; 1069 tex->r = r;
1098 tex->g = g; 1070 tex->g = g;
1099 tex->b = b; 1071 tex->b = b;
1100 tex->a = a; 1072 tex->a = a;
1101 } 1073 }
1074
1075 // somewhat hackish, but for textures that require it, it really
1076 // improves the look, and most others don't suffer.
1077 glBindTexture (GL_TEXTURE_2D, name);
1078 glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
1079 glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
1102} 1080}
1103 1081
1104int 1082int
1105ox (CFClient::Map self) 1083ox (CFClient::Map self)
1106 ALIAS: 1084 ALIAS:
1577 const_iv (GL_TEXTURE_MAG_FILTER), 1555 const_iv (GL_TEXTURE_MAG_FILTER),
1578 const_iv (GL_TEXTURE_MIN_FILTER), 1556 const_iv (GL_TEXTURE_MIN_FILTER),
1579 const_iv (GL_TEXTURE_ENV_MODE), 1557 const_iv (GL_TEXTURE_ENV_MODE),
1580 const_iv (GL_TEXTURE_WRAP_S), 1558 const_iv (GL_TEXTURE_WRAP_S),
1581 const_iv (GL_TEXTURE_WRAP_T), 1559 const_iv (GL_TEXTURE_WRAP_T),
1560 const_iv (GL_REPEAT),
1582 const_iv (GL_CLAMP), 1561 const_iv (GL_CLAMP),
1583 const_iv (GL_REPEAT), 1562 const_iv (GL_CLAMP_TO_EDGE),
1584 const_iv (GL_NEAREST), 1563 const_iv (GL_NEAREST),
1585 const_iv (GL_LINEAR), 1564 const_iv (GL_LINEAR),
1586 const_iv (GL_NEAREST_MIPMAP_NEAREST), 1565 const_iv (GL_NEAREST_MIPMAP_NEAREST),
1587 const_iv (GL_LINEAR_MIPMAP_NEAREST), 1566 const_iv (GL_LINEAR_MIPMAP_NEAREST),
1588 const_iv (GL_NEAREST_MIPMAP_LINEAR), 1567 const_iv (GL_NEAREST_MIPMAP_LINEAR),
1618 1597
1619 for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; ) 1598 for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; )
1620 newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); 1599 newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv));
1621} 1600}
1622 1601
1602char *
1603gl_vendor ()
1604 CODE:
1605 RETVAL = (char *)glGetString (GL_VENDOR);
1606 OUTPUT:
1607 RETVAL
1608
1609char *
1610gl_version ()
1611 CODE:
1612 RETVAL = (char *)glGetString (GL_VERSION);
1613 OUTPUT:
1614 RETVAL
1615
1616char *
1617gl_extensions ()
1618 CODE:
1619 RETVAL = (char *)glGetString (GL_EXTENSIONS);
1620 OUTPUT:
1621 RETVAL
1622
1623int glGetError () 1623int glGetError ()
1624 1624
1625void glClear (int mask) 1625void glClear (int mask)
1626 1626
1627void glClearColor (float r, float g, float b, float a = 1.0) 1627void glClearColor (float r, float g, float b, float a = 1.0)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines