mirror of https://github.com/adamdruppe/arsd.git
Merge branch 'master' of github.com:adamdruppe/arsd
This commit is contained in:
commit
a27d4ba66a
17
nanovega.d
17
nanovega.d
|
@ -14663,7 +14663,7 @@ error:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create NanoVega OpenGL image from texture id.
|
/// Using OpenGL texture id creates GLNVGtexture and return its id.
|
||||||
/// Group: images
|
/// Group: images
|
||||||
public int glCreateImageFromHandleGL2 (NVGContext ctx, GLuint textureId, int w, int h, int imageFlags) nothrow @trusted @nogc {
|
public int glCreateImageFromHandleGL2 (NVGContext ctx, GLuint textureId, int w, int h, int imageFlags) nothrow @trusted @nogc {
|
||||||
GLNVGcontext* gl = cast(GLNVGcontext*)ctx.internalParams().userPtr;
|
GLNVGcontext* gl = cast(GLNVGcontext*)ctx.internalParams().userPtr;
|
||||||
|
@ -14680,6 +14680,21 @@ public int glCreateImageFromHandleGL2 (NVGContext ctx, GLuint textureId, int w,
|
||||||
return tex.id;
|
return tex.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Create NVGImage from OpenGL texture id.
|
||||||
|
/// Group: images
|
||||||
|
public NVGImage glCreateImageFromOpenGLTexture(NVGContext ctx, GLuint textureId, int w, int h, int imageFlags) nothrow @trusted @nogc {
|
||||||
|
auto id = glCreateImageFromHandleGL2(ctx, textureId, w, h, imageFlags);
|
||||||
|
|
||||||
|
NVGImage res;
|
||||||
|
if (id > 0) {
|
||||||
|
res.id = id;
|
||||||
|
version(nanovega_debug_image_manager_rc) { import core.stdc.stdio; printf("createImageRGBA: img=%p; imgid=%d\n", &res, res.id); }
|
||||||
|
res.ctx = ctx;
|
||||||
|
ctx.nvg__imageIncRef(res.id, false); // don't increment driver refcount
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
/// Returns OpenGL texture id for NanoVega image.
|
/// Returns OpenGL texture id for NanoVega image.
|
||||||
/// Group: images
|
/// Group: images
|
||||||
public GLuint glImageHandleGL2 (NVGContext ctx, int image) nothrow @trusted @nogc {
|
public GLuint glImageHandleGL2 (NVGContext ctx, int image) nothrow @trusted @nogc {
|
||||||
|
|
Loading…
Reference in New Issue