… | |
… | |
1447 | for (y = 0; y < h; y++) |
1447 | for (y = 0; y < h; y++) |
1448 | for (x = 0; x < w; x++) |
1448 | for (x = 0; x < w; x++) |
1449 | { |
1449 | { |
1450 | unsigned char m = data [x + y * w]; |
1450 | unsigned char m = data [x + y * w]; |
1451 | |
1451 | |
|
|
1452 | if (m) |
|
|
1453 | { |
1452 | float *c = color [m & 15]; |
1454 | float *c = color [m & 15]; |
1453 | |
1455 | |
1454 | float tx1 = m & 0x40 ? 0.5 : m & 0x80 ? 0.25 : 0.; |
1456 | float tx1 = m & 0x40 ? 0.5 : 0.; |
1455 | float tx2 = tx1 + 0.25; |
1457 | float tx2 = tx1 + 0.5; |
1456 | |
1458 | |
1457 | glColor4f (c[0], c[1], c[2], 0.75); |
1459 | glColor4f (c[0], c[1], c[2], 0.75); |
1458 | glTexCoord2f (tx1, 0.); glVertex2i (x , y ); |
1460 | glTexCoord2f (tx1, 0.); glVertex2i (x , y ); |
1459 | glTexCoord2f (tx1, 1.); glVertex2i (x , y + 1); |
1461 | glTexCoord2f (tx1, 1.); glVertex2i (x , y + 1); |
1460 | glTexCoord2f (tx2, 1.); glVertex2i (x + 1, y + 1); |
1462 | glTexCoord2f (tx2, 1.); glVertex2i (x + 1, y + 1); |
1461 | glTexCoord2f (tx2, 0.); glVertex2i (x + 1, y ); |
1463 | glTexCoord2f (tx2, 0.); glVertex2i (x + 1, y ); |
|
|
1464 | } |
1462 | } |
1465 | } |
1463 | |
1466 | |
1464 | glEnd (); |
1467 | glEnd (); |
1465 | glDisable (GL_BLEND); |
1468 | glDisable (GL_BLEND); |
1466 | glDisable (GL_TEXTURE_2D); |
1469 | glDisable (GL_TEXTURE_2D); |
… | |
… | |
1712 | const_iv (GL_SCISSOR_TEST), |
1715 | const_iv (GL_SCISSOR_TEST), |
1713 | const_iv (GL_DEPTH_TEST), |
1716 | const_iv (GL_DEPTH_TEST), |
1714 | const_iv (GL_ALPHA_TEST), |
1717 | const_iv (GL_ALPHA_TEST), |
1715 | const_iv (GL_NORMALIZE), |
1718 | const_iv (GL_NORMALIZE), |
1716 | const_iv (GL_RESCALE_NORMAL), |
1719 | const_iv (GL_RESCALE_NORMAL), |
|
|
1720 | const_iv (GL_FRONT), |
|
|
1721 | const_iv (GL_BACK), |
1717 | const_iv (GL_AND), |
1722 | const_iv (GL_AND), |
1718 | const_iv (GL_ONE), |
1723 | const_iv (GL_ONE), |
1719 | const_iv (GL_ZERO), |
1724 | const_iv (GL_ZERO), |
1720 | const_iv (GL_SRC_ALPHA), |
1725 | const_iv (GL_SRC_ALPHA), |
1721 | const_iv (GL_DST_ALPHA), |
1726 | const_iv (GL_DST_ALPHA), |
… | |
… | |
1843 | |
1848 | |
1844 | void glPopMatrix () |
1849 | void glPopMatrix () |
1845 | |
1850 | |
1846 | void glLoadIdentity () |
1851 | void glLoadIdentity () |
1847 | |
1852 | |
|
|
1853 | void glDrawBuffer (int buffer) |
|
|
1854 | |
|
|
1855 | void glReadBuffer (int buffer) |
|
|
1856 | |
1848 | # near_ and far_ are due to microsofts buggy "c" compiler |
1857 | # near_ and far_ are due to microsofts buggy "c" compiler |
1849 | void glFrustum (double left, double right, double bottom, double top, double near_, double far_) |
1858 | void glFrustum (double left, double right, double bottom, double top, double near_, double far_) |
1850 | |
1859 | |
1851 | # near_ and far_ are due to microsofts buggy "c" compiler |
1860 | # near_ and far_ are due to microsofts buggy "c" compiler |
1852 | void glOrtho (double left, double right, double bottom, double top, double near_, double far_) |
1861 | void glOrtho (double left, double right, double bottom, double top, double near_, double far_) |