nullboundary / glfont

A modern opengl text rending library for Golang

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Windows glitch

kivutar opened this issue · comments

glfont is glitchy on Windows. We can see lines going from the top left corner of the screen to each glyph.

That might be a tough one to debug. It could easily be a problem with the library or one of its dependencies such as freetype, x/image or opengl.

It's very possible that it comes from go-gl yes. Or glfont.

On this same program, I'm able to draw images to the screen using a very similar shader that you are using. The glitch happens only on the text labels.

Your code looks perfectly fine. The only suspicious thing was that you're never using glPixelStorei(GL_UNPACK_ALIGNMENT, 1); while most gl freetype tutorials are using it. I tried adding it and it didn't fix the problem so it is indeed a tough bug.

@nullboundary Found a fix: gl.DrawArrays(gl.TRIANGLES, 0, 16) instead of gl.DrawArrays(gl.TRIANGLES, 0, 24)