diff --git a/src/nanovg.c b/src/nanovg.c index 9d52ed9..da7e922 100644 --- a/src/nanovg.c +++ b/src/nanovg.c @@ -363,7 +363,7 @@ void nvgDeleteInternal(NVGcontext* ctx) free(ctx); } -void nvgBeginFrame(NVGcontext* ctx, int windowWidth, int windowHeight, float devicePixelRatio) +void nvgBeginFrame(NVGcontext* ctx, float windowWidth, float windowHeight, float devicePixelRatio) { /* printf("Tris: draws:%d fill:%d stroke:%d text:%d TOT:%d\n", ctx->drawCallCount, ctx->fillTriCount, ctx->strokeTriCount, ctx->textTriCount, diff --git a/src/nanovg.h b/src/nanovg.h index ba2a6a8..2255d6a 100644 --- a/src/nanovg.h +++ b/src/nanovg.h @@ -152,7 +152,7 @@ enum NVGimageFlags { // For example, GLFW returns two dimension for an opened window: window size and // frame buffer size. In that case you would set windowWidth/Height to the window size // devicePixelRatio to: frameBufferWidth / windowWidth. -void nvgBeginFrame(NVGcontext* ctx, int windowWidth, int windowHeight, float devicePixelRatio); +void nvgBeginFrame(NVGcontext* ctx, float windowWidth, float windowHeight, float devicePixelRatio); // Cancels drawing the current frame. void nvgCancelFrame(NVGcontext* ctx); @@ -653,7 +653,7 @@ struct NVGparams { int (*renderDeleteTexture)(void* uptr, int image); int (*renderUpdateTexture)(void* uptr, int image, int x, int y, int w, int h, const unsigned char* data); int (*renderGetTextureSize)(void* uptr, int image, int* w, int* h); - void (*renderViewport)(void* uptr, int width, int height, float devicePixelRatio); + void (*renderViewport)(void* uptr, float width, float height, float devicePixelRatio); void (*renderCancel)(void* uptr); void (*renderFlush)(void* uptr); void (*renderFill)(void* uptr, NVGpaint* paint, NVGcompositeOperationState compositeOperation, NVGscissor* scissor, float fringe, const float* bounds, const NVGpath* paths, int npaths); diff --git a/src/nanovg_gl.h b/src/nanovg_gl.h index 75bdae2..7ef160a 100644 --- a/src/nanovg_gl.h +++ b/src/nanovg_gl.h @@ -989,12 +989,12 @@ static void glnvg__setUniforms(GLNVGcontext* gl, int uniformOffset, int image) } } -static void glnvg__renderViewport(void* uptr, int width, int height, float devicePixelRatio) +static void glnvg__renderViewport(void* uptr, float width, float height, float devicePixelRatio) { NVG_NOTUSED(devicePixelRatio); GLNVGcontext* gl = (GLNVGcontext*)uptr; - gl->view[0] = (float)width; - gl->view[1] = (float)height; + gl->view[0] = width; + gl->view[1] = height; } static void glnvg__fill(GLNVGcontext* gl, GLNVGcall* call)