| 130 | } |
| 131 | |
| 132 | static GLuint BindFont(const CTexFont* _Font) |
| 133 | { |
| 134 | GLuint TexID = 0; |
| 135 | glGenTextures(1, &TexID); |
| 136 | glBindTexture(GL_TEXTURE_2D, TexID); |
| 137 | glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_FALSE); |
| 138 | glPixelStorei(GL_UNPACK_LSB_FIRST, GL_FALSE); |
| 139 | glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); |
| 140 | glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); |
| 141 | glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); |
| 142 | glPixelStorei(GL_UNPACK_ALIGNMENT, 1); |
| 143 | glTexImage2D(GL_TEXTURE_2D, 0, GL_RED, _Font->m_TexWidth, _Font->m_TexHeight, 0, GL_RED, GL_UNSIGNED_BYTE, _Font->m_TexBytes); |
| 144 | glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); |
| 145 | glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); |
| 146 | glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); |
| 147 | glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); |
| 148 | glBindTexture(GL_TEXTURE_2D, 0); |
| 149 | |
| 150 | return TexID; |
| 151 | } |
| 152 | |
| 153 | //static unsigned int s_indexData[INDEX_COUNT]; |
| 154 | //static GLuint s_indexArrayObject, s_indexBuffer; |