… | |
… | |
1073 | } |
1073 | } |
1074 | |
1074 | |
1075 | // somewhat hackish, but for textures that require it, it really |
1075 | // somewhat hackish, but for textures that require it, it really |
1076 | // improves the look, and most others don't suffer. |
1076 | // improves the look, and most others don't suffer. |
1077 | glBindTexture (GL_TEXTURE_2D, name); |
1077 | glBindTexture (GL_TEXTURE_2D, name); |
1078 | glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); |
1078 | //glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); |
1079 | glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); |
1079 | //glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); |
|
|
1080 | // use uglier nearest interpolation because linear suffers |
|
|
1081 | // from transparent color bleeding and ugly wrapping effects. |
|
|
1082 | glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); |
1080 | } |
1083 | } |
1081 | |
1084 | |
1082 | int |
1085 | int |
1083 | ox (CFClient::Map self) |
1086 | ox (CFClient::Map self) |
1084 | ALIAS: |
1087 | ALIAS: |
1085 | oy = 1 |
1088 | oy = 1 |
|
|
1089 | x = 2 |
|
|
1090 | y = 3 |
1086 | CODE: |
1091 | CODE: |
1087 | switch (ix) |
1092 | switch (ix) |
1088 | { |
1093 | { |
1089 | case 0: RETVAL = self->ox; break; |
1094 | case 0: RETVAL = self->ox; break; |
1090 | case 1: RETVAL = self->oy; break; |
1095 | case 1: RETVAL = self->oy; break; |
|
|
1096 | case 2: RETVAL = self->x; break; |
|
|
1097 | case 3: RETVAL = self->y; break; |
1091 | } |
1098 | } |
1092 | OUTPUT: |
1099 | OUTPUT: |
1093 | RETVAL |
1100 | RETVAL |
1094 | |
1101 | |
1095 | void |
1102 | void |
… | |
… | |
1679 | |
1686 | |
1680 | void glColor (float r, float g, float b, float a = 1.0) |
1687 | void glColor (float r, float g, float b, float a = 1.0) |
1681 | PROTOTYPE: @ |
1688 | PROTOTYPE: @ |
1682 | CODE: |
1689 | CODE: |
1683 | // microsoft visual "c" rounds instead of truncating... |
1690 | // microsoft visual "c" rounds instead of truncating... |
1684 | glColor4ub (MIN ((int)(r * 255.f), 255), |
1691 | glColor4ub (MIN ((int)(r * 256.f), 255), |
1685 | MIN ((int)(g * 255.f), 255), |
1692 | MIN ((int)(g * 256.f), 255), |
1686 | MIN ((int)(b * 255.f), 255), |
1693 | MIN ((int)(b * 256.f), 255), |
1687 | MIN ((int)(a * 255.f), 255)); |
1694 | MIN ((int)(a * 256.f), 255)); |
1688 | |
1695 | |
1689 | void glInterleavedArrays (int format, int stride, char *data) |
1696 | void glInterleavedArrays (int format, int stride, char *data) |
1690 | |
1697 | |
1691 | void glDrawElements (int mode, int count, int type, char *indices) |
1698 | void glDrawElements (int mode, int count, int type, char *indices) |
1692 | |
1699 | |