~hp/d2tk

a65cb3f8c62fc9db16e70699613329d29b726898 — Hanspeter Portner 4 years ago 14c56cc
Squashed 'nanovg/' changes from 75dbf61..997c861

997c861 omk: add nvgUpdateSubImage.

git-subtree-dir: nanovg
git-subtree-split: 997c861c17db6d01f525718b782cbdc4c3016e18
2 files changed, 8 insertions(+), 0 deletions(-)

M src/nanovg.c
M src/nanovg.h
M src/nanovg.c => src/nanovg.c +5 -0
@@ 841,6 841,11 @@ void nvgUpdateImage(NVGcontext* ctx, int image, const unsigned char* data)
	ctx->params.renderUpdateTexture(ctx->params.userPtr, image, 0,0, w,h, data);
}

void nvgUpdateSubImage(NVGcontext* ctx, int image, const unsigned char* data, int x, int y, int w, int h)
{
	ctx->params.renderUpdateTexture(ctx->params.userPtr, image, x,y, w,h, data);
}

void nvgImageSize(NVGcontext* ctx, int image, int* w, int* h)
{
	ctx->params.renderGetTextureSize(ctx->params.userPtr, image, w, h);

M src/nanovg.h => src/nanovg.h +3 -0
@@ 386,6 386,9 @@ int nvgCreateImageARGB(NVGcontext* ctx, int w, int h, int imageFlags, const unsi
// Updates image data specified by image handle.
void nvgUpdateImage(NVGcontext* ctx, int image, const unsigned char* data);

// Updates part image data specified by image handle.
void nvgUpdateSubImage(NVGcontext* ctx, int image, const unsigned char* data, int x, int y, int w, int h);

// Returns the dimensions of a created image.
void nvgImageSize(NVGcontext* ctx, int image, int* w, int* h);