Browse Source

Add NanoImage::getTextureHandle()

pull/6/head
falkTX 7 years ago
parent
commit
9864c371e9
2 changed files with 11 additions and 0 deletions
  1. +5
    -0
      dgl/NanoVG.hpp
  2. +6
    -0
      dgl/src/NanoVG.cpp

+ 5
- 0
dgl/NanoVG.hpp View File

@@ -47,6 +47,11 @@ public:
*/
Size<uint> getSize() const noexcept;

/**
Get the OpenGL texture handle.
*/
GLuint getTextureHandle() const;

/**
Update image data.
*/


+ 6
- 0
dgl/src/NanoVG.cpp View File

@@ -46,6 +46,7 @@
//#define STB_IMAGE_STATIC 1
#define NANOVG_GL2_IMPLEMENTATION 1
#include "nanovg/nanovg_gl.h"
#include "oui-blendish/blendish.h"

#if defined(NANOVG_GL2)
# define nvgCreateGL nvgCreateGL2
@@ -129,6 +130,11 @@ Size<uint> NanoImage::getSize() const noexcept
return fSize;
}

GLuint NanoImage::getTextureHandle() const
{
return nvglImageHandle(fContext, fImageId);
}

void NanoImage::updateImage(const uchar* const data)
{
DISTRHO_SAFE_ASSERT_RETURN(data != nullptr,);


Loading…
Cancel
Save