mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-17 20:52:36 +01:00
Allow to create a nvg texture from a BGFX texture. (#2548)
This commit is contained in:
committed by
GitHub
parent
9694171d1b
commit
078666d373
@@ -1324,3 +1324,19 @@ void nvgluSetViewFramebuffer(bgfx::ViewId _viewId, NVGLUframebuffer* _framebuffe
|
||||
bgfx::setViewFrameBuffer(_viewId, _framebuffer->handle);
|
||||
bgfx::setViewMode(_viewId, bgfx::ViewMode::Sequential);
|
||||
}
|
||||
|
||||
int nvgCreateBgfxTexture(struct NVGcontext *_ctx,
|
||||
bgfx::TextureHandle _id,
|
||||
int _width,
|
||||
int _height,
|
||||
int _flags) {
|
||||
struct NVGparams *params = nvgInternalParams(_ctx);
|
||||
struct GLNVGcontext *gl = (struct GLNVGcontext *)params->userPtr;
|
||||
struct GLNVGtexture *tex = glnvg__allocTexture(gl);
|
||||
tex->id = _id;
|
||||
tex->width = _width;
|
||||
tex->height = _height;
|
||||
tex->flags = _flags;
|
||||
tex->type = NVG_TEXTURE_RGBA;
|
||||
return tex->id.idx;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user