memononen / nanovg

Antialiased 2D vector drawing library on top of OpenGL for UI and visualizations.
zlib License
5.15k stars 771 forks source link

iOS: OpenGL analysis reports GLES error #213

Open wtholliday opened 9 years ago

wtholliday commented 9 years ago

When running the nanovg demo on iOS, the GL analyzer reports the following error:

nanovg-error

However as best I can tell, the calls to enable mipmapping are never made. Specifically, the line:

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);

in glnvg__renderCreateTexture is never called.

wtholliday commented 9 years ago

For your convenience, here's the nanovg demo on iOS: https://github.com/wtholliday/nanovg-ios-demo

wtholliday commented 9 years ago

Ok, so the texture causing the error is the "default texture" (texture 0) and GL_TEXTURE_MIN_FILTER is set to GL_NEAREST_MIPMAP_LINEAR. If I add:

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);

after the call to glBindTexture in glnvg__renderFlush then the error goes away. Is that the right thing to do?