Browse Source

Fixed use of nvglImageHandlexx in GL utils from earlier PR

- nvglImageHandle was changes to contain GL postfix, changed GL utils
to use that too
- fixed silly failure check bug in FBO demo
shared-context
Mikko Mononen 9 years ago
parent
commit
b83cf92652
2 changed files with 12 additions and 2 deletions
  1. +1
    -1
      example/example_fbo.c
  2. +11
    -1
      src/nanovg_gl_utils.h

+ 1
- 1
example/example_fbo.c View File

@@ -175,7 +175,7 @@ int main()
return -1;
}

if (!loadFonts(vg) == -1) {
if (loadFonts(vg) == -1) {
printf("Could not load fonts\n");
return -1;
}


+ 11
- 1
src/nanovg_gl_utils.h View File

@@ -64,7 +64,17 @@ NVGLUframebuffer* nvgluCreateFramebuffer(NVGcontext* ctx, int w, int h, int imag
memset(fb, 0, sizeof(NVGLUframebuffer));

fb->image = nvgCreateImageRGBA(ctx, w, h, imageFlags | NVG_IMAGE_FLIPY | NVG_IMAGE_PREMULTIPLIED, NULL);
fb->texture = nvglImageHandle(ctx, fb->image);

#if defined NANOVG_GL2
fb->texture = nvglImageHandleGL2(ctx, fb->image);
#elif defined NANOVG_GL3
fb->texture = nvglImageHandleGL3(ctx, fb->image);
#elif defined NANOVG_GLES2
fb->texture = nvglImageHandleGLES2(ctx, fb->image);
#elif defined NANOVG_GLES3
fb->texture = nvglImageHandleGLES3(ctx, fb->image);
#endif

fb->ctx = ctx;

// frame buffer object


Loading…
Cancel
Save