Browse Source

Update DGL

tags/v1.9.11
falkTX 6 years ago
parent
commit
4a3c0e57d1
7 changed files with 14 additions and 15 deletions
  1. +1
    -1
      source/modules/dgl/Application.hpp
  2. +2
    -2
      source/modules/dgl/src/Application.cpp
  3. +1
    -1
      source/modules/dgl/src/Geometry.cpp
  4. +3
    -3
      source/modules/dgl/src/NanoVG.cpp
  5. +4
    -4
      source/modules/dgl/src/WidgetPrivateData.hpp
  6. +3
    -1
      source/modules/dgl/src/Window.cpp
  7. +0
    -3
      source/modules/dgl/src/pugl/pugl_osx.m

+ 1
- 1
source/modules/dgl/Application.hpp View File

@@ -62,7 +62,7 @@ public:
idle() is called at regular intervals. idle() is called at regular intervals.
@note This function is meant for standalones only, *never* call this from plugins. @note This function is meant for standalones only, *never* call this from plugins.
*/ */
void exec();
void exec(int idleTime = 10);


/** /**
Quit the application. Quit the application.


+ 2
- 2
source/modules/dgl/src/Application.cpp View File

@@ -44,12 +44,12 @@ void Application::idle()
} }
} }


void Application::exec()
void Application::exec(int idleTime)
{ {
for (; pData->doLoop;) for (; pData->doLoop;)
{ {
idle(); idle();
d_msleep(10);
d_msleep(idleTime);
} }
} }




+ 1
- 1
source/modules/dgl/src/Geometry.cpp View File

@@ -545,7 +545,7 @@ const T& Circle<T>::getX() const noexcept
template<typename T> template<typename T>
const T& Circle<T>::getY() const noexcept const T& Circle<T>::getY() const noexcept
{ {
return fPos.fX;
return fPos.fY;
} }


template<typename T> template<typename T>


+ 3
- 3
source/modules/dgl/src/NanoVG.cpp View File

@@ -472,8 +472,8 @@ void NanoVG::skewY(float angle)
void NanoVG::scale(float x, float y) void NanoVG::scale(float x, float y)
{ {
if (fContext == nullptr) return; if (fContext == nullptr) return;
DISTRHO_SAFE_ASSERT_RETURN(x > 0.0f,);
DISTRHO_SAFE_ASSERT_RETURN(y > 0.0f,);
DISTRHO_SAFE_ASSERT_RETURN(d_isNotZero(x),);
DISTRHO_SAFE_ASSERT_RETURN(d_isNotZero(y),);


nvgScale(fContext, x, y); nvgScale(fContext, x, y);
} }
@@ -865,7 +865,7 @@ float NanoVG::textBounds(float x, float y, const char* string, const char* end,


float b[4]; float b[4];
const float ret = nvgTextBounds(fContext, x, y, string, end, b); const float ret = nvgTextBounds(fContext, x, y, string, end, b);
bounds = Rectangle<float>(b[0], b[1], b[2], b[3]);
bounds = Rectangle<float>(b[0], b[1], b[2] - b[0], b[3] - b[1]);
return ret; return ret;
} }




+ 4
- 4
source/modules/dgl/src/WidgetPrivateData.hpp View File

@@ -1,6 +1,6 @@
/* /*
* DISTRHO Plugin Framework (DPF) * DISTRHO Plugin Framework (DPF)
* Copyright (C) 2012-2016 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2012-2018 Filipe Coelho <falktx@falktx.com>
* *
* Permission to use, copy, modify, and/or distribute this software for any purpose with * Permission to use, copy, modify, and/or distribute this software for any purpose with
* or without fee is hereby granted, provided that the above copyright notice and this * or without fee is hereby granted, provided that the above copyright notice and this
@@ -63,9 +63,9 @@ struct Widget::PrivateData {
subWidgets.clear(); subWidgets.clear();
} }


void display(const uint width, const uint height)
void display(const uint width, const uint height, const bool renderingSubWidget)
{ {
if (skipDisplay || ! visible)
if ((skipDisplay && ! renderingSubWidget) || size.isInvalid() || ! visible)
return; return;


bool needsDisableScissor = false; bool needsDisableScissor = false;
@@ -123,7 +123,7 @@ struct Widget::PrivateData {
Widget* const widget(*it); Widget* const widget(*it);
DISTRHO_SAFE_ASSERT_CONTINUE(widget->pData != this); DISTRHO_SAFE_ASSERT_CONTINUE(widget->pData != this);


widget->pData->display(width, height);
widget->pData->display(width, height, true);
} }
} }




+ 3
- 1
source/modules/dgl/src/Window.cpp View File

@@ -33,6 +33,8 @@
#if defined(DISTRHO_OS_WINDOWS) #if defined(DISTRHO_OS_WINDOWS)
# include "pugl/pugl_win.cpp" # include "pugl/pugl_win.cpp"
#elif defined(DISTRHO_OS_MAC) #elif defined(DISTRHO_OS_MAC)
# define PuglWindow DISTRHO_JOIN_MACRO(PuglWindow, DGL_NAMESPACE)
# define PuglOpenGLView DISTRHO_JOIN_MACRO(PuglOpenGLView, DGL_NAMESPACE)
# include "pugl/pugl_osx.m" # include "pugl/pugl_osx.m"
#else #else
# include <sys/types.h> # include <sys/types.h>
@@ -721,7 +723,7 @@ struct Window::PrivateData {
FOR_EACH_WIDGET(it) FOR_EACH_WIDGET(it)
{ {
Widget* const widget(*it); Widget* const widget(*it);
widget->pData->display(fWidth, fHeight);
widget->pData->display(fWidth, fHeight, false);
} }


fSelf->onDisplayAfter(); fSelf->onDisplayAfter();


+ 0
- 3
source/modules/dgl/src/pugl/pugl_osx.m View File

@@ -24,9 +24,6 @@


#include "pugl_internal.h" #include "pugl_internal.h"


#define PuglWindow PuglWindow ## DGL_NAMESPACE
#define PuglOpenGLView PuglOpenGLView ## DGL_NAMESPACE

@interface PuglWindow : NSWindow @interface PuglWindow : NSWindow
{ {
@public @public


Loading…
Cancel
Save