--
You received this message because you are subscribed to the Google Groups "GLyphy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to glyphy+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
void
demo_buffer_draw (demo_buffer_t *buffer)
{
GLint program;
glGetIntegerv (GL_CURRENT_PROGRAM, &program);
GLuint a_glyph_vertex_loc = glGetAttribLocation (program, "a_glyph_vertex");
glBindBuffer (GL_ARRAY_BUFFER, buffer->buf_name);
if (buffer->dirty) {
glBufferData (GL_ARRAY_BUFFER, sizeof (glyph_vertex_t) * buffer->vertices->size (), (const char *) &(*buffer->vertices)[0], GL_STATIC_DRAW);
buffer->dirty = false;
}
glEnableVertexAttribArray (a_glyph_vertex_loc);
glVertexAttribPointer (a_glyph_vertex_loc, 4, GL_FLOAT, GL_FALSE, sizeof (glyph_vertex_t), 0);
glDrawArrays (GL_TRIANGLES, 0, buffer->vertices->size ());
glDisableVertexAttribArray (a_glyph_vertex_loc);
}
I have to read a single character from a file and after that draw it, after that read the next one and draw it (and so on..). I have to call this function every time for each character, again and again. I cannot read all the characters, and after that draw then, I don't have another possibility to interact with the Guido Engine.
After I execute this function I can't call Atlas alloc again, I become the error
glTexSubImage2D failed with error 0501 on line 76 inside from buffer->addtext() Atlas alloc().
I don't know exactly where is the error.
I think after I call buffer_draw I'm erasing some data (?). It looks like I can call buffer_draw() only one time, after that it's not possible to read more characters. How could I change this?
Regards.
Luis