… | |
… | |
188 | |
188 | |
189 | _pango_opengl_font_set_glyph_cache_destroy (font, (GDestroyNotify)free_glyph_info); |
189 | _pango_opengl_font_set_glyph_cache_destroy (font, (GDestroyNotify)free_glyph_info); |
190 | _pango_opengl_font_set_cache_glyph_data (font, glyph, g); |
190 | _pango_opengl_font_set_cache_glyph_data (font, glyph, g); |
191 | } |
191 | } |
192 | |
192 | |
|
|
193 | if (renderer->curtex) |
|
|
194 | glEnd (); |
|
|
195 | |
193 | tc_get (&g->tex, bm.width, bm.height); |
196 | tc_get (&g->tex, bm.width, bm.height); |
194 | |
197 | |
195 | g->left = bm.left; |
198 | g->left = bm.left; |
196 | g->top = bm.top; |
199 | g->top = bm.top; |
197 | |
|
|
198 | if (renderer->curtex) |
|
|
199 | { |
|
|
200 | glEnd (); |
|
|
201 | renderer->curtex = 0; |
|
|
202 | } |
|
|
203 | |
200 | |
204 | glBindTexture (GL_TEXTURE_2D, g->tex.name); |
201 | glBindTexture (GL_TEXTURE_2D, g->tex.name); |
205 | glPixelStorei (GL_UNPACK_ROW_LENGTH, bm.stride); |
202 | glPixelStorei (GL_UNPACK_ROW_LENGTH, bm.stride); |
206 | glPixelStorei (GL_UNPACK_ALIGNMENT, 1); |
203 | glPixelStorei (GL_UNPACK_ALIGNMENT, 1); |
207 | glTexSubImage2D (GL_TEXTURE_2D, 0, g->tex.x, g->tex.y, bm.width, bm.height, GL_ALPHA, GL_UNSIGNED_BYTE, bm.bitmap); |
204 | glTexSubImage2D (GL_TEXTURE_2D, 0, g->tex.x, g->tex.y, bm.width, bm.height, GL_ALPHA, GL_UNSIGNED_BYTE, bm.bitmap); |
208 | glPixelStorei (GL_UNPACK_ROW_LENGTH, 0); |
205 | glPixelStorei (GL_UNPACK_ROW_LENGTH, 0); |
209 | glPixelStorei (GL_UNPACK_ALIGNMENT, 4); |
206 | glPixelStorei (GL_UNPACK_ALIGNMENT, 4); |
|
|
207 | |
|
|
208 | renderer->curtex = g->tex.name; |
|
|
209 | glBegin (GL_QUADS); |
210 | } |
210 | } |
211 | |
211 | |
212 | x += g->left; |
212 | x += g->left; |
213 | y -= g->top; |
213 | y -= g->top; |
214 | |
214 | |
… | |
… | |
222 | if (renderer->curtex) |
222 | if (renderer->curtex) |
223 | glEnd (); |
223 | glEnd (); |
224 | |
224 | |
225 | glBindTexture (GL_TEXTURE_2D, g->tex.name); |
225 | glBindTexture (GL_TEXTURE_2D, g->tex.name); |
226 | renderer->curtex = g->tex.name; |
226 | renderer->curtex = g->tex.name; |
|
|
227 | |
227 | glBegin (GL_QUADS); |
228 | glBegin (GL_QUADS); |
228 | } |
229 | } |
229 | |
230 | |
230 | glTexCoord2f (x1, y1); glVertex2i (x , y ); |
231 | glTexCoord2f (x1, y1); glVertex2i (x , y ); |
231 | glTexCoord2f (x2, y1); glVertex2i (x + g->tex.w, y ); |
232 | glTexCoord2f (x2, y1); glVertex2i (x + g->tex.w, y ); |