Browse Source

Merge pull request #156 from floooh/pr_clamp_to_edge

Fix texture completeness for non-POT textures on GLES2/WebGL
shared-context
Mikko Mononen 10 years ago
parent
commit
dc70bbc3f3
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      src/nanovg_gl.h

+ 3
- 0
src/nanovg_gl.h View File

@@ -663,6 +663,9 @@ static int glnvg__renderCreateTexture(void* uptr, int type, int w, int h, int im
} }
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);

glPixelStorei(GL_UNPACK_ALIGNMENT, 4); glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
#ifndef NANOVG_GLES2 #ifndef NANOVG_GLES2
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);


Loading…
Cancel
Save