commit fb2966126a5a94797f048ea58b460a048fd4a0ea
parent 5a65496535aa53e8d9b467beb7f6245e330fa090
Author: falkTX <falktx@gmail.com>
Date: Sat, 24 May 2014 04:23:02 +0100
NanoVG: Add constructor with custom atlas size
Diffstat:
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/dgl/NanoVG.hpp b/dgl/NanoVG.hpp
@@ -256,10 +256,16 @@ public:
/**
Constructor.
+ Uses 512x512 as default atlas size.
*/
NanoVG();
/**
+ Constructor using custom atlas size.
+ */
+ NanoVG(int atlasWidth, int atlasHeight);
+
+ /**
Destructor.
*/
~NanoVG();
@@ -780,7 +786,7 @@ protected:
private:
/**
Widget display function.
- Implemented internally to wrap begine/endFrame() automaticaly.
+ Implemented internally to wrap begin/endFrame() automaticaly.
*/
void onDisplay() override
{
diff --git a/dgl/src/NanoVG.cpp b/dgl/src/NanoVG.cpp
@@ -128,6 +128,12 @@ NanoVG::NanoVG()
DISTRHO_SAFE_ASSERT_RETURN(fContext != nullptr,);
}
+NanoVG::NanoVG(int atlasWidth, int atlasHeight)
+ : fContext(nvgCreateGL(atlasWidth, atlasHeight, NVG_ANTIALIAS))
+{
+ DISTRHO_SAFE_ASSERT_RETURN(fContext != nullptr,);
+}
+
NanoVG::~NanoVG()
{
if (fContext == nullptr)