Using Glyphy for Render Music Glyphs

92 views
Skip to first unread message

022...@stud.sbg.ac.at

unread,
Aug 24, 2016, 9:58:26 PM8/24/16
to GLyphy
Dear Behad,
I'm trying to use Glyphy to render Music Glyphs. I'm working with the Guido Engine. I actualized the OpenGL environment von Guido, and now I'm trying to replace FTGL with Glyphy. FTGL is quite old, and I have some problems with the encoding. I'm using the examples of your source code (slightly modified for my purpose). The problem here, is that I cann't not render all the characters at the display. Attached are 2 screenshots, 1 with FTGL and 1 with Glyphy. I have to inherit a class from the GUido Engine (there is no another way to do that), and there I have to read the text from a file and after that I should render it. Here, if I render each character i Become the following error at atlas::alloc glTexSubImage2D failed with error 0501 on line 75, I can only put the render function in another method "EndDraw", but than I cannot render all the text. Attached are the methods with FTGL and with Glyphy. I can not realize what I should do to have a solution.
Another question, maybe you can see that the anti alias is not perfect when the lines are diagonal, do you have some functions for this, or I should have to write my own shaders?
Regards.
Luis Valdivia
Guido-Glyphy.png
Guido_FTGL.png
Guido_FTGL.cpp
Guido_Glyphy.cpp

Behdad Esfahbod

unread,
Sep 5, 2016, 12:39:28 AM9/5/16
to gly...@googlegroups.com
Hi Luis,

Thanks for the message.  I'm not sure how you are integrating with GLyphy exactly.  What you have attached is not enough for me to have any useful suggestions for you.  Unfortunately I'm extremely busy with other work currently, so I'm not sure if I can help..

Let me know if you have specific questions though.

Cheers,

behdad

--
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.



--

022...@stud.sbg.ac.at

unread,
Sep 12, 2016, 11:22:16 PM9/12/16
to GLyphy
Thanks for your answer. Maybe you can give me an explanation what are you doing in the following function from your example:

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


Reply all
Reply to author
Forward
0 new messages