Browse Source

Add DGL_NO_SHARED_RESOURCES; Fix build

pull/32/head
falkTX 4 years ago
parent
commit
d6d1d3b55c
3 changed files with 11 additions and 12 deletions
  1. +5
    -1
      dgl/NanoVG.hpp
  2. +6
    -1
      dgl/src/NanoVG.cpp
  3. +0
    -10
      dgl/src/Window.cpp

+ 5
- 1
dgl/NanoVG.hpp View File

@@ -20,7 +20,9 @@
#include "Color.hpp"
#include "Widget.hpp"

#define NANOVG_DEJAVU_SANS_TTF "__dpf_dejavusans_ttf__"
#ifndef DGL_NO_SHARED_RESOURCES
# define NANOVG_DEJAVU_SANS_TTF "__dpf_dejavusans_ttf__"
#endif

struct NVGcontext;
struct NVGpaint;
@@ -844,10 +846,12 @@ public:
*/
int textBreakLines(const char* string, const char* end, float breakRowWidth, TextRow& rows, int maxRows);

#ifndef DGL_NO_SHARED_RESOURCES
/**
Load DPF's internal shared resources for this NanoVG class.
*/
virtual void loadSharedResources();
#endif

private:
NVGcontext* const fContext;


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

@@ -15,9 +15,12 @@
*/

#include "../NanoVG.hpp"
#include "Resources.hpp"
#include "WidgetPrivateData.hpp"

#ifndef DGL_NO_SHARED_RESOURCES
# include "Resources.hpp"
#endif

// -----------------------------------------------------------------------

#if defined(DISTRHO_OS_WINDOWS)
@@ -895,6 +898,7 @@ int NanoVG::textBreakLines(const char* string, const char* end, float breakRowWi
return 0;
}

#ifndef DGL_NO_SHARED_RESOURCES
void NanoVG::loadSharedResources()
{
if (nvgFindFont(fContext, NANOVG_DEJAVU_SANS_TTF) >= 0)
@@ -904,6 +908,7 @@ void NanoVG::loadSharedResources()

nvgCreateFontMem(fContext, NANOVG_DEJAVU_SANS_TTF, (const uchar*)dejavusans_ttf, dejavusans_ttf_size, 0);
}
#endif

// -----------------------------------------------------------------------



+ 0
- 10
dgl/src/Window.cpp View File

@@ -1317,16 +1317,6 @@ bool Window::handlePluginSpecial(const bool press, const Key key)
return pData->handlePluginSpecial(press, key);
}

bool Window::handlePluginKeyboard(const bool press, const uint key)
{
return pData->handlePluginKeyboard(press, key);
}

bool Window::handlePluginSpecial(const bool press, const Key key)
{
return pData->handlePluginSpecial(press, key);
}

// -----------------------------------------------------------------------

StandaloneWindow::StandaloneWindow()


Loading…
Cancel
Save