rougier / freetype-gl

OpenGL text using one vertex buffer, one texture and FreeType
Other
1.65k stars 266 forks source link

Segmentation fault on makefont #101

Closed rougier closed 8 years ago

rougier commented 8 years ago

I've a problem with the makefont, I suspect this commit to be responsible.

Dependencies to GLFW have been removed but at some point in the font generation, the atlas is uploaded to the texture and it seg faults. Does anyone got the same behavior ?

adrianbroher commented 8 years ago

I've a problem with the makefont, I suspect this commit to be responsible.

It's must be that commit, there were no other changes on makefont the last time. makefont calls texture_font_load_glyphs which in turn calls texture_atlas_upload (texture-font.c:657). Can you comment out that line to confirm if it is the cause of the segfault?

Does anyone got the same behavior ?

It's not reproducible for me obviously.

rougier commented 8 years ago

Yes, I identified the same faulty line. How is that it is not reproducible for you since there is no available GL context when texture_atlas_upload is called, no ?

adrianbroher commented 8 years ago

How is that it is not reproducible for you since there is no available GL context when texture_atlas_upload is called, no ?

The application just works as expected and I don't know why. Maybe the OpenGL context of the window manager 'bleeds through'.

Anyway. How should we fix this? Undoing the commits? I would prefer remove said line and let the client application call texture_atlas_upload instead.

adrianbroher commented 8 years ago

I would prefer remove said line and let the client application call texture_atlas_upload instead.

It seems like this is already done in the harfbuzz variant.

rougier commented 8 years ago

Yes, for making the font, there is no need to to upload the texture and it is better to let the client app do that.