Browse Source

Use GL_R8 instead of GL_RED on ES3

shared-context
Mikko Mononen 11 years ago
parent
commit
a888e741ac
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      src/nanovg_gl3.h

+ 4
- 0
src/nanovg_gl3.h View File

@@ -453,7 +453,11 @@ static int glnvg__renderCreateTexture(void* uptr, int type, int w, int h, const
if (type == NVG_TEXTURE_RGBA)
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
else
#ifdef NANOVG_GLES3
glTexImage2D(GL_TEXTURE_2D, 0, GL_R8, w, h, 0, GL_RED, GL_UNSIGNED_BYTE, data);
#else
glTexImage2D(GL_TEXTURE_2D, 0, GL_RED, w, h, 0, GL_RED, GL_UNSIGNED_BYTE, data);
#endif

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);


Loading…
Cancel
Save