Browse Source

Update to latest pugl, deprecate use of onReshape to follow pugl

Signed-off-by: falkTX <falktx@falktx.com>
develop
falkTX 1 day ago
parent
commit
d11070dd18
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
32 changed files with 419 additions and 294 deletions
  1. +7
    -0
      .github/workflows/build.yml
  2. +4
    -4
      dgl/Geometry.hpp
  3. +1
    -1
      dgl/OpenGL.hpp
  4. +9
    -6
      dgl/Window.hpp
  5. +0
    -2
      dgl/src/ApplicationPrivateData.cpp
  6. +36
    -32
      dgl/src/Cairo.cpp
  7. +2
    -0
      dgl/src/Geometry.cpp
  8. +1
    -1
      dgl/src/OpenGL.cpp
  9. +50
    -35
      dgl/src/OpenGL2.cpp
  10. +43
    -35
      dgl/src/OpenGL3.cpp
  11. +37
    -33
      dgl/src/Stub.cpp
  12. +0
    -5
      dgl/src/TopLevelWidgetPrivateData.cpp
  13. +0
    -1
      dgl/src/TopLevelWidgetPrivateData.hpp
  14. +37
    -7
      dgl/src/Vulkan.cpp
  15. +3
    -5
      dgl/src/Window.cpp
  16. +19
    -18
      dgl/src/WindowPrivateData.cpp
  17. +1
    -1
      dgl/src/pugl-upstream
  18. +0
    -27
      dgl/src/pugl.cpp
  19. +0
    -3
      dgl/src/pugl.hpp
  20. +7
    -13
      distrho/DistrhoUI.hpp
  21. +3
    -3
      distrho/src/DistrhoUI.cpp
  22. +44
    -2
      distrho/src/DistrhoUIPrivateData.hpp
  23. +2
    -6
      tests/Application.cpp
  24. +2
    -5
      tests/Color.cpp
  25. +9
    -4
      tests/Demo.cpp
  26. +5
    -3
      tests/FileBrowserDialog.cpp
  27. +37
    -20
      tests/Makefile
  28. +5
    -3
      tests/NanoImage.cpp
  29. +5
    -3
      tests/NanoSubWidgets.cpp
  30. +2
    -6
      tests/Point.cpp
  31. +4
    -10
      tests/Window.cpp
  32. +44
    -0
      tests/dgl.cpp

+ 7
- 0
.github/workflows/build.yml View File

@@ -84,6 +84,13 @@ jobs:
run: |
make clean >/dev/null
make -j ${{ env.JOBS }}
- name: No deprecated methods allowed
env:
CFLAGS: -Werror
CXXFLAGS: -Werror -DDGL_ALLOW_DEPRECATED_METHODS=0
run: |
make clean >/dev/null
make -j ${{ env.JOBS }}
- name: No namespace
env:
CFLAGS: -Werror


+ 4
- 4
dgl/Geometry.hpp View File

@@ -369,7 +369,7 @@ public:
bool operator==(const Line<T>& line) const noexcept;
bool operator!=(const Line<T>& line) const noexcept;

#ifdef DGL_ALLOW_DEPRECATED_METHODS
#if DGL_ALLOW_DEPRECATED_METHODS
/**
Draw this line using the current OpenGL state.@n
DEPRECATED Please use draw(const GraphicsContext&) instead.
@@ -487,7 +487,7 @@ public:
bool operator==(const Circle<T>& cir) const noexcept;
bool operator!=(const Circle<T>& cir) const noexcept;

#ifdef DGL_ALLOW_DEPRECATED_METHODS
#if DGL_ALLOW_DEPRECATED_METHODS
/**
Draw this circle using the current OpenGL state.@n
DEPRECATED Please use draw(const GraphicsContext&) instead.
@@ -580,7 +580,7 @@ public:
bool operator==(const Triangle<T>& tri) const noexcept;
bool operator!=(const Triangle<T>& tri) const noexcept;

#ifdef DGL_ALLOW_DEPRECATED_METHODS
#if DGL_ALLOW_DEPRECATED_METHODS
/**
Draw this triangle using the current OpenGL state.@n
DEPRECATED Please use draw(const GraphicsContext&) instead.
@@ -811,7 +811,7 @@ public:
bool operator==(const Rectangle<T>& size) const noexcept;
bool operator!=(const Rectangle<T>& size) const noexcept;

#ifdef DGL_ALLOW_DEPRECATED_METHODS
#if DGL_ALLOW_DEPRECATED_METHODS
/**
Draw this rectangle using the current OpenGL state.@n
DEPRECATED Please use draw(const GraphicsContext&) instead.


+ 1
- 1
dgl/OpenGL.hpp View File

@@ -274,7 +274,7 @@ public:
inline void drawAt(const GraphicsContext& context, int x, int y)
{ drawAt(context, Point<int>(x, y)); }

#ifdef DGL_ALLOW_DEPRECATED_METHODS
#if DGL_ALLOW_DEPRECATED_METHODS
/**
Constructor using raw image data, specifying an OpenGL image format.
@note @a rawData must remain valid for the lifetime of this Image.


+ 9
- 6
dgl/Window.hpp View File

@@ -479,6 +479,7 @@ public:
*/
void setTransientParent(uintptr_t transientParentWindowHandle);

#if DGL_ALLOW_DEPRECATED_METHODS
/** DEPRECATED Use isIgnoringKeyRepeat(). */
DISTRHO_DEPRECATED_BY("isIgnoringKeyRepeat()")
inline bool getIgnoringKeyRepeat() const noexcept { return isIgnoringKeyRepeat(); }
@@ -490,6 +491,7 @@ public:
/** DEPRECATED Use runAsModal(bool). */
DISTRHO_DEPRECATED_BY("runAsModal(bool)")
inline void exec(bool blockWait = false) { runAsModal(blockWait); }
#endif

protected:
/**
@@ -528,12 +530,11 @@ protected:
*/
virtual void onFocus(bool focus, CrossingMode mode);

/**
A function called when the window is resized.
If there is a top-level widget associated with this window, its size will be set right after this function.
The default implementation sets up drawing context where necessary.
*/
#if DGL_ALLOW_DEPRECATED_METHODS
/** DEPRECATED DO NOT USE */
DISTRHO_DEPRECATED
virtual void onReshape(uint width, uint height);
#endif

/**
A function called when scale factor requested for this window changes.
@@ -542,7 +543,7 @@ protected:
*/
virtual void onScaleFactorChanged(double scaleFactor);

#ifdef DGL_USE_FILE_BROWSER
#ifdef DGL_USE_FILE_BROWSER
/**
A function called when a path is selected by the user, as triggered by openFileBrowser().
This action happens after the user confirms the action, so the file browser dialog will be closed at this point.
@@ -550,10 +551,12 @@ protected:
*/
virtual void onFileSelected(const char* filename);

#if DGL_ALLOW_DEPRECATED_METHODS
/** DEPRECATED Use onFileSelected(). */
DISTRHO_DEPRECATED_BY("onFileSelected(const char*)")
inline virtual void fileBrowserSelected(const char* filename) { return onFileSelected(filename); }
#endif
#endif

private:
PrivateData* const pData;


+ 0
- 2
dgl/src/ApplicationPrivateData.cpp View File

@@ -165,13 +165,11 @@ void Application::PrivateData::quit()

isQuitting = true;

#ifndef DPF_TEST_APPLICATION_CPP
for (WindowListReverseIterator rit = windows.rbegin(), rite = windows.rend(); rit != rite; ++rit)
{
DGL_NAMESPACE::Window* const window(*rit);
window->close();
}
#endif
}

double Application::PrivateData::getTime() const


+ 36
- 32
dgl/src/Cairo.cpp View File

@@ -93,7 +93,7 @@ void Line<T>::draw(const GraphicsContext& context, const T width)
cairo_stroke(handle);
}

#ifdef DGL_ALLOW_DEPRECATED_METHODS
#if DGL_ALLOW_DEPRECATED_METHODS
template<typename T>
void Line<T>::draw()
{
@@ -101,13 +101,6 @@ void Line<T>::draw()
}
#endif

template class Line<double>;
template class Line<float>;
template class Line<int>;
template class Line<uint>;
template class Line<short>;
template class Line<ushort>;

// -----------------------------------------------------------------------
// Circle

@@ -169,7 +162,7 @@ void Circle<T>::drawOutline(const GraphicsContext& context, const T lineWidth)
drawCircle<T>(handle, fPos, fNumSegments, fSize, fSin, fCos, true);
}

#ifdef DGL_ALLOW_DEPRECATED_METHODS
#if DGL_ALLOW_DEPRECATED_METHODS
template<typename T>
void Circle<T>::draw()
{
@@ -183,13 +176,6 @@ void Circle<T>::drawOutline()
}
#endif

template class Circle<double>;
template class Circle<float>;
template class Circle<int>;
template class Circle<uint>;
template class Circle<short>;
template class Circle<ushort>;

// -----------------------------------------------------------------------
// Triangle

@@ -232,7 +218,7 @@ void Triangle<T>::drawOutline(const GraphicsContext& context, const T lineWidth)
drawTriangle<T>(handle, pos1, pos2, pos3, true);
}

#ifdef DGL_ALLOW_DEPRECATED_METHODS
#if DGL_ALLOW_DEPRECATED_METHODS
template<typename T>
void Triangle<T>::draw()
{
@@ -246,13 +232,6 @@ void Triangle<T>::drawOutline()
}
#endif

template class Triangle<double>;
template class Triangle<float>;
template class Triangle<int>;
template class Triangle<uint>;
template class Triangle<short>;
template class Triangle<ushort>;

// -----------------------------------------------------------------------
// Rectangle

@@ -289,7 +268,7 @@ void Rectangle<T>::drawOutline(const GraphicsContext& context, const T lineWidth
drawRectangle(handle, *this, true);
}

#ifdef DGL_ALLOW_DEPRECATED_METHODS
#if DGL_ALLOW_DEPRECATED_METHODS
template<typename T>
void Rectangle<T>::draw()
{
@@ -303,13 +282,6 @@ void Rectangle<T>::drawOutline()
}
#endif

template class Rectangle<double>;
template class Rectangle<float>;
template class Rectangle<int>;
template class Rectangle<uint>;
template class Rectangle<short>;
template class Rectangle<ushort>;

// -----------------------------------------------------------------------
// CairoImage

@@ -877,4 +849,36 @@ void Window::PrivateData::endContext()

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

#ifndef DGL_GEOMETRY_CPP_INCLUDED
template class Line<double>;
template class Line<float>;
template class Line<int>;
template class Line<uint>;
template class Line<short>;
template class Line<ushort>;

template class Circle<double>;
template class Circle<float>;
template class Circle<int>;
template class Circle<uint>;
template class Circle<short>;
template class Circle<ushort>;

template class Triangle<double>;
template class Triangle<float>;
template class Triangle<int>;
template class Triangle<uint>;
template class Triangle<short>;
template class Triangle<ushort>;

template class Rectangle<double>;
template class Rectangle<float>;
template class Rectangle<int>;
template class Rectangle<uint>;
template class Rectangle<short>;
template class Rectangle<ushort>;
#endif

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

END_NAMESPACE_DGL

+ 2
- 0
dgl/src/Geometry.cpp View File

@@ -23,6 +23,8 @@

#include "../Geometry.hpp"

#define DGL_GEOMETRY_CPP_INCLUDED

#include <cmath>

START_NAMESPACE_DGL


+ 1
- 1
dgl/src/OpenGL.cpp View File

@@ -125,7 +125,7 @@ OpenGLImage& OpenGLImage::operator=(const OpenGLImage& image) noexcept
return *this;
}

#ifdef DGL_ALLOW_DEPRECATED_METHODS
#if DGL_ALLOW_DEPRECATED_METHODS
OpenGLImage::OpenGLImage(const char* const rdata, const uint w, const uint h, const GLenum fmt)
: ImageBase(rdata, w, h, asDISTRHOImageFormat(fmt)),
setupCalled(false),


+ 50
- 35
dgl/src/OpenGL2.cpp View File

@@ -93,7 +93,7 @@ void Line<T>::draw(const GraphicsContext&, const T width)
drawLine<T>(posStart, posEnd);
}

#ifdef DGL_ALLOW_DEPRECATED_METHODS
#if DGL_ALLOW_DEPRECATED_METHODS
template<typename T>
void Line<T>::draw()
{
@@ -101,13 +101,6 @@ void Line<T>::draw()
}
#endif

template class Line<double>;
template class Line<float>;
template class Line<int>;
template class Line<uint>;
template class Line<short>;
template class Line<ushort>;

// --------------------------------------------------------------------------------------------------------------------
// Circle

@@ -168,7 +161,7 @@ void Circle<T>::drawOutline(const GraphicsContext& context, const T lineWidth)
drawCircle<T>(context, fPos, fNumSegments, fSize, fSin, fCos, true);
}

#ifdef DGL_ALLOW_DEPRECATED_METHODS
#if DGL_ALLOW_DEPRECATED_METHODS
template<typename T>
void Circle<T>::draw()
{
@@ -182,13 +175,6 @@ void Circle<T>::drawOutline()
}
#endif

template class Circle<double>;
template class Circle<float>;
template class Circle<int>;
template class Circle<uint>;
template class Circle<short>;
template class Circle<ushort>;

// --------------------------------------------------------------------------------------------------------------------
// Triangle

@@ -236,7 +222,7 @@ void Triangle<T>::drawOutline(const GraphicsContext&, const T lineWidth)
drawTriangle<T>(pos1, pos2, pos3, true);
}

#ifdef DGL_ALLOW_DEPRECATED_METHODS
#if DGL_ALLOW_DEPRECATED_METHODS
template<typename T>
void Triangle<T>::draw()
{
@@ -250,13 +236,6 @@ void Triangle<T>::drawOutline()
}
#endif

template class Triangle<double>;
template class Triangle<float>;
template class Triangle<int>;
template class Triangle<uint>;
template class Triangle<short>;
template class Triangle<ushort>;

// --------------------------------------------------------------------------------------------------------------------
// Rectangle

@@ -290,13 +269,13 @@ static void drawRectangle(const Rectangle<T>& rect, const bool outline)
}

template<typename T>
void Rectangle<T>::draw(const GraphicsContext& context)
void Rectangle<T>::draw(const GraphicsContext&)
{
drawRectangle<T>(*this, false);
}

template<typename T>
void Rectangle<T>::drawOutline(const GraphicsContext& context, const T lineWidth)
void Rectangle<T>::drawOutline(const GraphicsContext&, const T lineWidth)
{
DISTRHO_SAFE_ASSERT_RETURN(lineWidth != 0,);

@@ -304,7 +283,7 @@ void Rectangle<T>::drawOutline(const GraphicsContext& context, const T lineWidth
drawRectangle<T>(*this, true);
}

#ifdef DGL_ALLOW_DEPRECATED_METHODS
#if DGL_ALLOW_DEPRECATED_METHODS
template<typename T>
void Rectangle<T>::draw()
{
@@ -318,13 +297,6 @@ void Rectangle<T>::drawOutline()
}
#endif

template class Rectangle<double>;
template class Rectangle<float>;
template class Rectangle<int>;
template class Rectangle<uint>;
template class Rectangle<short>;
template class Rectangle<ushort>;

// --------------------------------------------------------------------------------------------------------------------
// OpenGLImage

@@ -408,7 +380,7 @@ void OpenGLImage::drawAt(const GraphicsContext&, const Point<int>& pos)
drawOpenGLImage(*this, pos, textureId, setupCalled);
}

#ifdef DGL_ALLOW_DEPRECATED_METHODS
#if DGL_ALLOW_DEPRECATED_METHODS
void OpenGLImage::draw()
{
drawOpenGLImage(*this, Point<int>(0, 0), textureId, setupCalled);
@@ -559,6 +531,17 @@ void Window::PrivateData::destroyContext()

void Window::PrivateData::startContext()
{
const PuglArea size = puglGetSizeHint(view, PUGL_CURRENT_SIZE);

glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glViewport(0, 0, static_cast<GLsizei>(size.width), static_cast<GLsizei>(size.height));
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0.0, static_cast<GLdouble>(size.width), static_cast<GLdouble>(size.height), 0.0, 0.0, 1.0);
glViewport(0, 0, static_cast<GLsizei>(size.width), static_cast<GLsizei>(size.height));
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}

void Window::PrivateData::endContext()
@@ -567,4 +550,36 @@ void Window::PrivateData::endContext()

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

#ifndef DGL_GEOMETRY_CPP_INCLUDED
template class Line<double>;
template class Line<float>;
template class Line<int>;
template class Line<uint>;
template class Line<short>;
template class Line<ushort>;

template class Circle<double>;
template class Circle<float>;
template class Circle<int>;
template class Circle<uint>;
template class Circle<short>;
template class Circle<ushort>;

template class Triangle<double>;
template class Triangle<float>;
template class Triangle<int>;
template class Triangle<uint>;
template class Triangle<short>;
template class Triangle<ushort>;

template class Rectangle<double>;
template class Rectangle<float>;
template class Rectangle<int>;
template class Rectangle<uint>;
template class Rectangle<short>;
template class Rectangle<ushort>;
#endif

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

END_NAMESPACE_DGL

+ 43
- 35
dgl/src/OpenGL3.cpp View File

@@ -93,10 +93,12 @@ DGL_EXT(PFNGLVERTEXATTRIBPOINTERPROC, glVertexAttribPointer)

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

#if DGL_ALLOW_DEPRECATED_METHODS
static void notImplemented(const char* const name)
{
d_stderr2("OpenGL3 function not implemented: %s", name);
}
#endif

// --------------------------------------------------------------------------------------------------------------------
// Color
@@ -149,7 +151,7 @@ void Line<T>::draw(const GraphicsContext& context, const T width)
glBindBuffer(GL_ARRAY_BUFFER, 0);
}

#ifdef DGL_ALLOW_DEPRECATED_METHODS
#if DGL_ALLOW_DEPRECATED_METHODS
template<typename T>
void Line<T>::draw()
{
@@ -157,13 +159,6 @@ void Line<T>::draw()
}
#endif

template class Line<double>;
template class Line<float>;
template class Line<int>;
template class Line<uint>;
template class Line<short>;
template class Line<ushort>;

// --------------------------------------------------------------------------------------------------------------------
// Circle

@@ -260,7 +255,7 @@ void Circle<T>::drawOutline(const GraphicsContext& context, const T lineWidth)
drawCircle<T>(context, fPos, fNumSegments, fSize, fSin, fCos, true);
}

#ifdef DGL_ALLOW_DEPRECATED_METHODS
#if DGL_ALLOW_DEPRECATED_METHODS
template<typename T>
void Circle<T>::draw()
{
@@ -274,13 +269,6 @@ void Circle<T>::drawOutline()
}
#endif

template class Circle<double>;
template class Circle<float>;
template class Circle<int>;
template class Circle<uint>;
template class Circle<short>;
template class Circle<ushort>;

// --------------------------------------------------------------------------------------------------------------------
// Triangle

@@ -344,7 +332,7 @@ void Triangle<T>::drawOutline(const GraphicsContext& context, const T lineWidth)
drawTriangle<T>(context, pos1, pos2, pos3, true);
}

#ifdef DGL_ALLOW_DEPRECATED_METHODS
#if DGL_ALLOW_DEPRECATED_METHODS
template<typename T>
void Triangle<T>::draw()
{
@@ -358,13 +346,6 @@ void Triangle<T>::drawOutline()
}
#endif

template class Triangle<double>;
template class Triangle<float>;
template class Triangle<int>;
template class Triangle<uint>;
template class Triangle<short>;
template class Triangle<ushort>;

// --------------------------------------------------------------------------------------------------------------------
// Rectangle

@@ -424,7 +405,7 @@ void Rectangle<T>::drawOutline(const GraphicsContext& context, const T lineWidth
drawRectangle<T>(context, *this, true);
}

#ifdef DGL_ALLOW_DEPRECATED_METHODS
#if DGL_ALLOW_DEPRECATED_METHODS
template<typename T>
void Rectangle<T>::draw()
{
@@ -438,13 +419,6 @@ void Rectangle<T>::drawOutline()
}
#endif

template class Rectangle<double>;
template class Rectangle<float>;
template class Rectangle<int>;
template class Rectangle<uint>;
template class Rectangle<short>;
template class Rectangle<ushort>;

// --------------------------------------------------------------------------------------------------------------------
// OpenGLImage

@@ -626,18 +600,18 @@ const char* OpenGLImage::getRawData() const noexcept
}
#endif

#ifdef DGL_ALLOW_DEPRECATED_METHODS
#if DGL_ALLOW_DEPRECATED_METHODS
void OpenGLImage::draw()
{
notImplemented("OpenGLImage::draw");
}

void OpenGLImage::drawAt(const int x, const int y)
void OpenGLImage::drawAt(int, int)
{
notImplemented("OpenGLImage::drawAt");
}

void OpenGLImage::drawAt(const Point<int>& pos)
void OpenGLImage::drawAt(const Point<int>&)
{
notImplemented("OpenGLImage::drawAt");
}
@@ -1013,6 +987,8 @@ void Window::PrivateData::startContext()
gl3context.width = size.width;
gl3context.height = size.height;
glUseProgram(gl3context.program);

glViewport(0, 0, static_cast<GLsizei>(size.width), static_cast<GLsizei>(size.height));
}

void Window::PrivateData::endContext()
@@ -1022,4 +998,36 @@ void Window::PrivateData::endContext()

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

#ifndef DGL_GEOMETRY_CPP_INCLUDED
template class Line<double>;
template class Line<float>;
template class Line<int>;
template class Line<uint>;
template class Line<short>;
template class Line<ushort>;

template class Circle<double>;
template class Circle<float>;
template class Circle<int>;
template class Circle<uint>;
template class Circle<short>;
template class Circle<ushort>;

template class Triangle<double>;
template class Triangle<float>;
template class Triangle<int>;
template class Triangle<uint>;
template class Triangle<short>;
template class Triangle<ushort>;

template class Rectangle<double>;
template class Rectangle<float>;
template class Rectangle<int>;
template class Rectangle<uint>;
template class Rectangle<short>;
template class Rectangle<ushort>;
#endif

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

END_NAMESPACE_DGL

+ 37
- 33
dgl/src/Stub.cpp View File

@@ -70,12 +70,12 @@ void Color::setFor(const GraphicsContext&, bool)
// Line

template<typename T>
void Line<T>::draw(const GraphicsContext& context, T)
void Line<T>::draw(const GraphicsContext&, T)
{
notImplemented("Line::draw");
}

#ifdef DGL_ALLOW_DEPRECATED_METHODS
#if DGL_ALLOW_DEPRECATED_METHODS
template<typename T>
void Line<T>::draw()
{
@@ -83,13 +83,6 @@ void Line<T>::draw()
}
#endif

template class Line<double>;
template class Line<float>;
template class Line<int>;
template class Line<uint>;
template class Line<short>;
template class Line<ushort>;

// --------------------------------------------------------------------------------------------------------------------
// Circle

@@ -105,7 +98,7 @@ void Circle<T>::drawOutline(const GraphicsContext&, T)
notImplemented("Circle::drawOutline");
}

#ifdef DGL_ALLOW_DEPRECATED_METHODS
#if DGL_ALLOW_DEPRECATED_METHODS
template<typename T>
void Circle<T>::draw()
{
@@ -119,13 +112,6 @@ void Circle<T>::drawOutline()
}
#endif

template class Circle<double>;
template class Circle<float>;
template class Circle<int>;
template class Circle<uint>;
template class Circle<short>;
template class Circle<ushort>;

// --------------------------------------------------------------------------------------------------------------------
// Triangle

@@ -141,7 +127,7 @@ void Triangle<T>::drawOutline(const GraphicsContext&, T)
notImplemented("Triangle::drawOutline");
}

#ifdef DGL_ALLOW_DEPRECATED_METHODS
#if DGL_ALLOW_DEPRECATED_METHODS
template<typename T>
void Triangle<T>::draw()
{
@@ -155,13 +141,6 @@ void Triangle<T>::drawOutline()
}
#endif

template class Triangle<double>;
template class Triangle<float>;
template class Triangle<int>;
template class Triangle<uint>;
template class Triangle<short>;
template class Triangle<ushort>;

// --------------------------------------------------------------------------------------------------------------------
// Rectangle

@@ -177,7 +156,7 @@ void Rectangle<T>::drawOutline(const GraphicsContext&, T)
notImplemented("Rectangle::drawOutline");
}

#ifdef DGL_ALLOW_DEPRECATED_METHODS
#if DGL_ALLOW_DEPRECATED_METHODS
template<typename T>
void Rectangle<T>::draw()
{
@@ -191,13 +170,6 @@ void Rectangle<T>::drawOutline()
}
#endif

template class Rectangle<double>;
template class Rectangle<float>;
template class Rectangle<int>;
template class Rectangle<uint>;
template class Rectangle<short>;
template class Rectangle<ushort>;

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

void SubWidget::PrivateData::display(uint, uint, double)
@@ -237,4 +209,36 @@ void Window::PrivateData::endContext()

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

#ifndef DGL_GEOMETRY_CPP_INCLUDED
template class Line<double>;
template class Line<float>;
template class Line<int>;
template class Line<uint>;
template class Line<short>;
template class Line<ushort>;

template class Circle<double>;
template class Circle<float>;
template class Circle<int>;
template class Circle<uint>;
template class Circle<short>;
template class Circle<ushort>;

template class Triangle<double>;
template class Triangle<float>;
template class Triangle<int>;
template class Triangle<uint>;
template class Triangle<short>;
template class Triangle<ushort>;

template class Rectangle<double>;
template class Rectangle<float>;
template class Rectangle<int>;
template class Rectangle<uint>;
template class Rectangle<short>;
template class Rectangle<ushort>;
#endif

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

END_NAMESPACE_DGL

+ 0
- 5
dgl/src/TopLevelWidgetPrivateData.cpp View File

@@ -135,11 +135,6 @@ bool TopLevelWidget::PrivateData::scrollEvent(const ScrollEvent& ev)
return selfw->pData->giveScrollEventForSubWidgets(rev);
}

void TopLevelWidget::PrivateData::fallbackOnResize(const uint width, const uint height)
{
puglFallbackOnResize(window.pData->view, width, height);
}

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

END_NAMESPACE_DGL

+ 0
- 1
dgl/src/TopLevelWidgetPrivateData.hpp View File

@@ -38,7 +38,6 @@ struct TopLevelWidget::PrivateData {
bool mouseEvent(const MouseEvent& ev);
bool motionEvent(const MotionEvent& ev);
bool scrollEvent(const ScrollEvent& ev);
void fallbackOnResize(uint width, uint height);

DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(PrivateData)
};


+ 37
- 7
dgl/src/Vulkan.cpp View File

@@ -76,7 +76,7 @@ void Line<T>::draw(const GraphicsContext&, T)
notImplemented("Line::draw");
}

#ifdef DGL_ALLOW_DEPRECATED_METHODS
#if DGL_ALLOW_DEPRECATED_METHODS
template<typename T>
void Line<T>::draw()
{
@@ -106,7 +106,7 @@ void Circle<T>::drawOutline(const GraphicsContext&, T)
notImplemented("Circle::drawOutline");
}

#ifdef DGL_ALLOW_DEPRECATED_METHODS
#if DGL_ALLOW_DEPRECATED_METHODS
template<typename T>
void Circle<T>::draw()
{
@@ -142,7 +142,7 @@ void Triangle<T>::drawOutline(const GraphicsContext&, T)
notImplemented("Triangle::drawOutline");
}

#ifdef DGL_ALLOW_DEPRECATED_METHODS
#if DGL_ALLOW_DEPRECATED_METHODS
template<typename T>
void Triangle<T>::draw()
{
@@ -178,7 +178,7 @@ void Rectangle<T>::drawOutline(const GraphicsContext&, T)
notImplemented("Rectangle::drawOutline");
}

#ifdef DGL_ALLOW_DEPRECATED_METHODS
#if DGL_ALLOW_DEPRECATED_METHODS
template<typename T>
void Rectangle<T>::draw()
{
@@ -289,8 +289,38 @@ void Window::PrivateData::endContext()
{
}

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

END_NAMESPACE_DGL
#ifndef DGL_GEOMETRY_CPP_INCLUDED
template class Line<double>;
template class Line<float>;
template class Line<int>;
template class Line<uint>;
template class Line<short>;
template class Line<ushort>;

// -----------------------------------------------------------------------
template class Circle<double>;
template class Circle<float>;
template class Circle<int>;
template class Circle<uint>;
template class Circle<short>;
template class Circle<ushort>;

template class Triangle<double>;
template class Triangle<float>;
template class Triangle<int>;
template class Triangle<uint>;
template class Triangle<short>;
template class Triangle<ushort>;

template class Rectangle<double>;
template class Rectangle<float>;
template class Rectangle<int>;
template class Rectangle<uint>;
template class Rectangle<short>;
template class Rectangle<ushort>;
#endif

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

END_NAMESPACE_DGL

+ 3
- 5
dgl/src/Window.cpp View File

@@ -397,12 +397,10 @@ Application& Window::getApp() const noexcept
return pData->app;
}

#ifndef DPF_TEST_WINDOW_CPP
const GraphicsContext& Window::getGraphicsContext() const noexcept
{
return pData->getGraphicsContext();
}
#endif

uintptr_t Window::getNativeWindowHandle() const noexcept
{
@@ -583,11 +581,11 @@ void Window::onFocus(bool, CrossingMode)
{
}

void Window::onReshape(const uint width, const uint height)
#if DGL_ALLOW_DEPRECATED_METHODS
void Window::onReshape(uint, uint)
{
if (pData->view != nullptr)
puglFallbackOnResize(pData->view, width, height);
}
#endif

void Window::onScaleFactorChanged(double)
{


+ 19
- 18
dgl/src/WindowPrivateData.cpp View File

@@ -268,9 +268,7 @@ Window::PrivateData::~PrivateData()
isVisible = false;
}

#ifndef DPF_TEST_WINDOW_CPP
destroyContext();
#endif
puglFreeView(view);
}

@@ -646,9 +644,7 @@ void Window::PrivateData::onPuglConfigure(const uint width, const uint height)

DGL_DBGp("PUGL: onReshape : %d %d\n", width, height);

#ifndef DPF_TEST_WINDOW_CPP
createContextIfNeeded();
#endif

if (autoScaling)
{
@@ -672,9 +668,27 @@ void Window::PrivateData::onPuglConfigure(const uint width, const uint height)
autoScaling ? autoScaleFactor : scaleFactor);
#endif

#if DGL_ALLOW_DEPRECATED_METHODS
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable:4996)
#elif defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 460
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
self->onReshape(uwidth, uheight);
#if defined(_MSC_VER)
#pragma warning(pop)
#elif defined(__clang__)
#pragma clang diagnostic pop
#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 460
#pragma GCC diagnostic pop
#endif
#endif

#ifndef DPF_TEST_WINDOW_CPP
FOR_EACH_TOP_LEVEL_WIDGET(it)
{
TopLevelWidget* const widget = *it;
@@ -689,7 +703,6 @@ void Window::PrivateData::onPuglConfigure(const uint width, const uint height)
*/
((Widget*)widget)->setSize(uwidth, uheight);
}
#endif

// always repaint after a resize
puglObscureView(view);
@@ -701,7 +714,6 @@ void Window::PrivateData::onPuglExpose()

puglOnDisplayPrepare(view);

#ifndef DPF_TEST_WINDOW_CPP
startContext();

FOR_EACH_TOP_LEVEL_WIDGET(it)
@@ -721,7 +733,6 @@ void Window::PrivateData::onPuglExpose()
}

endContext();
#endif
}

void Window::PrivateData::onPuglClose()
@@ -774,7 +785,6 @@ void Window::PrivateData::onPuglKey(const Widget::KeyboardEvent& ev)
if (modal.child != nullptr)
return modal.child->focus();

#ifndef DPF_TEST_WINDOW_CPP
FOR_EACH_TOP_LEVEL_WIDGET_INV(rit)
{
TopLevelWidget* const widget(*rit);
@@ -782,7 +792,6 @@ void Window::PrivateData::onPuglKey(const Widget::KeyboardEvent& ev)
if (widget->isVisible() && widget->onKeyboard(ev))
break;
}
#endif
}

void Window::PrivateData::onPuglText(const Widget::CharacterInputEvent& ev)
@@ -792,7 +801,6 @@ void Window::PrivateData::onPuglText(const Widget::CharacterInputEvent& ev)
if (modal.child != nullptr)
return modal.child->focus();

#ifndef DPF_TEST_WINDOW_CPP
FOR_EACH_TOP_LEVEL_WIDGET_INV(rit)
{
TopLevelWidget* const widget(*rit);
@@ -800,7 +808,6 @@ void Window::PrivateData::onPuglText(const Widget::CharacterInputEvent& ev)
if (widget->isVisible() && widget->onCharacterInput(ev))
break;
}
#endif
}

void Window::PrivateData::onPuglMouse(const Widget::MouseEvent& ev)
@@ -810,7 +817,6 @@ void Window::PrivateData::onPuglMouse(const Widget::MouseEvent& ev)
if (modal.child != nullptr)
return modal.child->focus();

#ifndef DPF_TEST_WINDOW_CPP
FOR_EACH_TOP_LEVEL_WIDGET_INV(rit)
{
TopLevelWidget* const widget(*rit);
@@ -818,7 +824,6 @@ void Window::PrivateData::onPuglMouse(const Widget::MouseEvent& ev)
if (widget->isVisible() && widget->onMouse(ev))
break;
}
#endif
}

void Window::PrivateData::onPuglMotion(const Widget::MotionEvent& ev)
@@ -828,7 +833,6 @@ void Window::PrivateData::onPuglMotion(const Widget::MotionEvent& ev)
if (modal.child != nullptr)
return modal.child->focus();

#ifndef DPF_TEST_WINDOW_CPP
FOR_EACH_TOP_LEVEL_WIDGET_INV(rit)
{
TopLevelWidget* const widget(*rit);
@@ -836,7 +840,6 @@ void Window::PrivateData::onPuglMotion(const Widget::MotionEvent& ev)
if (widget->isVisible() && widget->onMotion(ev))
break;
}
#endif
}

void Window::PrivateData::onPuglScroll(const Widget::ScrollEvent& ev)
@@ -846,7 +849,6 @@ void Window::PrivateData::onPuglScroll(const Widget::ScrollEvent& ev)
if (modal.child != nullptr)
return modal.child->focus();

#ifndef DPF_TEST_WINDOW_CPP
FOR_EACH_TOP_LEVEL_WIDGET_INV(rit)
{
TopLevelWidget* const widget(*rit);
@@ -854,7 +856,6 @@ void Window::PrivateData::onPuglScroll(const Widget::ScrollEvent& ev)
if (widget->isVisible() && widget->onScroll(ev))
break;
}
#endif
}

const void* Window::PrivateData::getClipboard(size_t& dataSize)


+ 1
- 1
dgl/src/pugl-upstream

@@ -1 +1 @@
Subproject commit 5e2621d714ddf1cb0f86e852f8ba5dffe04aa3a3
Subproject commit 43c0944a2e28c6921bc827ac46f7215e5e59fe26

+ 0
- 27
dgl/src/pugl.cpp View File

@@ -435,33 +435,6 @@ void puglOnDisplayPrepare(PuglView*)
#endif
}

// --------------------------------------------------------------------------------------------------------------------
// DGL specific, build-specific fallback resize

void puglFallbackOnResize(PuglView* const view, const uint width, const uint height)
{
#ifdef DGL_OPENGL
#if defined(DGL_USE_OPENGL3)
glViewport(0, 0, static_cast<GLsizei>(width), static_cast<GLsizei>(height));
#else
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glViewport(0, 0, static_cast<GLsizei>(width), static_cast<GLsizei>(height));
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0.0, static_cast<GLdouble>(width), static_cast<GLdouble>(height), 0.0, 0.0, 1.0);
glViewport(0, 0, static_cast<GLsizei>(width), static_cast<GLsizei>(height));
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
#endif
#else
// unused
(void)view;
(void)width;
(void)height;
#endif
}

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

#if defined(DISTRHO_OS_HAIKU)


+ 0
- 3
dgl/src/pugl.hpp View File

@@ -84,9 +84,6 @@ PuglStatus puglSetSizeAndDefault(PuglView* view, uint width, uint height);
// DGL specific, build-specific drawing prepare
void puglOnDisplayPrepare(PuglView* view);

// DGL specific, build-specific fallback resize
void puglFallbackOnResize(PuglView* view, uint width, uint height);

#if defined(DISTRHO_OS_HAIKU)

// nothing here yet


+ 7
- 13
distrho/DistrhoUI.hpp View File

@@ -1,6 +1,6 @@
/*
* DISTRHO Plugin Framework (DPF)
* Copyright (C) 2012-2024 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2012-2025 Filipe Coelho <falktx@falktx.com>
*
* 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
@@ -291,19 +291,13 @@ protected:
*/
virtual void uiFocus(bool focus, DGL_NAMESPACE::CrossingMode mode);

/**
Window reshape function, called when the window is resized.
This function is for plugin UIs to be able to override Window::onReshape(uint, uint).

The plugin UI size will be set right after this function.
The default implementation sets up the drawing context where necessary.

You should almost never need to override this function.
The most common exception is custom OpenGL setup, but only really needed for custom OpenGL drawing code.
*/
#if DGL_ALLOW_DEPRECATED_METHODS
/** DEPRECATED DO NOT USE */
DISTRHO_DEPRECATED
virtual void uiReshape(uint width, uint height);
#endif

#if DISTRHO_UI_FILE_BROWSER
#if DISTRHO_UI_FILE_BROWSER
/**
Window file selected function, called when a path is selected by the user, as triggered by openFileBrowser().
This function is for plugin UIs to be able to override Window::onFileSelected(const char*).
@@ -314,7 +308,7 @@ protected:
If you need to use files as plugin state, please setup and use states with kStateIsFilenamePath instead.
*/
virtual void uiFileBrowserSelected(const char* filename);
#endif
#endif

/* --------------------------------------------------------------------------------------------------------
* UI Resize Handling, internal */


+ 3
- 3
distrho/src/DistrhoUI.cpp View File

@@ -560,11 +560,11 @@ void UI::uiFocus(bool, DGL_NAMESPACE::CrossingMode)
{
}

void UI::uiReshape(const uint width, const uint height)
#if DGL_ALLOW_DEPRECATED_METHODS
void UI::uiReshape(uint, uint)
{
// NOTE this must be the same as Window::onReshape
pData->fallbackOnResize(width, height);
}
#endif

#if DISTRHO_UI_FILE_BROWSER
void UI::uiFileBrowserSelected(const char*)


+ 44
- 2
distrho/src/DistrhoUIPrivateData.hpp View File

@@ -115,7 +115,9 @@ class PluginWindow : public DGL_NAMESPACE::Window
{
UI* const ui;
bool initializing;
#if DGL_ALLOW_DEPRECATED_METHODS
bool receivedReshapeDuringInit;
#endif

public:
explicit PluginWindow(UI* const uiPtr,
@@ -130,8 +132,10 @@ public:
DISTRHO_UI_USES_SIZE_REQUEST,
false),
ui(uiPtr),
initializing(true),
receivedReshapeDuringInit(false)
initializing(true)
#if DGL_ALLOW_DEPRECATED_METHODS
, receivedReshapeDuringInit(false)
#endif
{
if (pData->view == nullptr)
return;
@@ -159,12 +163,31 @@ public:
initializing = false;
puglBackendLeave(pData->view);

#if DGL_ALLOW_DEPRECATED_METHODS
if (receivedReshapeDuringInit)
{
puglBackendEnter(pData->view);
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable:4996)
#elif defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 460
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
ui->uiReshape(getWidth(), getHeight());
#if defined(_MSC_VER)
#pragma warning(pop)
#elif defined(__clang__)
#pragma clang diagnostic pop
#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 460
#pragma GCC diagnostic pop
#endif
puglBackendLeave(pData->view);
}
#endif
}

// used for temporary windows (VST/CLAP get size without active/visible view)
@@ -213,6 +236,17 @@ protected:
ui->uiFocus(focus, mode);
}

#if DGL_ALLOW_DEPRECATED_METHODS
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable:4996)
#elif defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 460
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
void onReshape(const uint width, const uint height) override
{
DISTRHO_SAFE_ASSERT_RETURN(ui != nullptr,);
@@ -225,6 +259,14 @@ protected:

ui->uiReshape(width, height);
}
#if defined(_MSC_VER)
#pragma warning(pop)
#elif defined(__clang__)
#pragma clang diagnostic pop
#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 460
#pragma GCC diagnostic pop
#endif
#endif

void onScaleFactorChanged(const double scaleFactor) override
{


+ 2
- 6
tests/Application.cpp View File

@@ -1,6 +1,6 @@
/*
* DISTRHO Plugin Framework (DPF)
* Copyright (C) 2012-2024 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2012-2025 Filipe Coelho <falktx@falktx.com>
*
* 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
@@ -15,11 +15,7 @@
*/

#include "tests.hpp"

#define DPF_TEST_APPLICATION_CPP
#include "dgl/src/pugl.cpp"
#include "dgl/src/Application.cpp"
#include "dgl/src/ApplicationPrivateData.cpp"
#include "dgl.cpp"

START_NAMESPACE_DGL



+ 2
- 5
tests/Color.cpp View File

@@ -1,6 +1,6 @@
/*
* DISTRHO Plugin Framework (DPF)
* Copyright (C) 2012-2024 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2012-2025 Filipe Coelho <falktx@falktx.com>
*
* 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
@@ -15,10 +15,7 @@
*/

#include "tests.hpp"

#define DPF_TEST_COLOR_CPP
#include "dgl/src/Application.cpp"
#include "dgl/src/ApplicationPrivateData.cpp"
#include "dgl.cpp"
#include "dgl/src/Color.cpp"

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


+ 9
- 4
tests/Demo.cpp View File

@@ -1,6 +1,6 @@
/*
* DISTRHO Plugin Framework (DPF)
* Copyright (C) 2012-2024 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2012-2025 Filipe Coelho <falktx@falktx.com>
*
* 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
@@ -15,6 +15,14 @@
*/

#include "tests.hpp"
#include "dgl.cpp"
#include "dgl/src/Color.cpp"
#include "dgl/src/EventHandlers.cpp"
#include "dgl/src/ImageBase.cpp"
#ifdef DGL_OPENGL
#include "dgl/src/NanoVG.cpp"
#include "dgl/src/Resources.cpp"
#endif

#include "widgets/ExampleColorWidget.hpp"
#include "widgets/ExampleImagesWidget.hpp"
@@ -29,15 +37,12 @@
#include "images_res/CatPics.cpp"

#ifdef DGL_CAIRO
#include "../dgl/Cairo.hpp"
typedef DGL_NAMESPACE::CairoImage DemoImage;
#endif
#ifdef DGL_OPENGL
#include "../dgl/OpenGL.hpp"
typedef DGL_NAMESPACE::OpenGLImage DemoImage;
#endif
#ifdef DGL_VULKAN
#include "../dgl/Vulkan.hpp"
typedef DGL_NAMESPACE::VulkanImage DemoImage;
#endif



+ 5
- 3
tests/FileBrowserDialog.cpp View File

@@ -1,6 +1,6 @@
/*
* DISTRHO Plugin Framework (DPF)
* Copyright (C) 2012-2024 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2012-2025 Filipe Coelho <falktx@falktx.com>
*
* 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
@@ -15,8 +15,10 @@
*/

#include "tests.hpp"

#include "dgl/NanoVG.hpp"
#include "dgl.cpp"
#include "dgl/src/Color.cpp"
#include "dgl/src/NanoVG.cpp"
#include "dgl/src/Resources.cpp"

START_NAMESPACE_DGL



+ 37
- 20
tests/Makefile View File

@@ -4,6 +4,8 @@
# Created by falkTX
#

export DEBUG = true

include ../Makefile.base.mk

# ---------------------------------------------------------------------------------------------------------------------
@@ -13,7 +15,7 @@ BUILD_CXX_FLAGS += $(DGL_FLAGS) -I.. -I../dgl/src/pugl-upstream/include -DDONT_S
LINK_FLAGS += -lpthread

# TODO fix within pugl
BUILD_CXX_FLAGS += -Wno-extra -Wno-missing-field-initializers
# BUILD_CXX_FLAGS += -Wno-extra -Wno-missing-field-initializers

ifeq ($(MACOS),true)
BUILD_CXX_FLAGS += -ObjC++ -DGL_SILENCE_DEPRECATION -Wno-deprecated-declarations
@@ -29,7 +31,8 @@ MANUAL_TESTS += Demo.cairo
endif

ifeq ($(HAVE_OPENGL),true)
MANUAL_TESTS += Demo.opengl
MANUAL_TESTS += Demo.opengl2
MANUAL_TESTS += Demo.opengl3
MANUAL_TESTS += FileBrowserDialog
MANUAL_TESTS += NanoImage
MANUAL_TESTS += NanoSubWidgets
@@ -37,14 +40,13 @@ endif

ifneq ($(WASM),true)
UNIT_TESTS += Application
UNIT_TESTS += Window.stub
ifeq ($(HAVE_CAIRO),true)
UNIT_TESTS += Window.cairo
endif
ifeq ($(HAVE_OPENGL),true)
UNIT_TESTS += Window.opengl
endif
ifeq ($(HAVE_STUB),true)
UNIT_TESTS += Window.stub
UNIT_TESTS += Window.opengl2
UNIT_TESTS += Window.opengl3
endif
ifeq ($(HAVE_VULKAN),true)
UNIT_TESTS += Window.vulkan
@@ -103,11 +105,16 @@ clean:
@echo "Compiling $< (Cairo)"
$(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(CAIRO_FLAGS) -DDGL_CAIRO -c -o $@

../build/tests/%.cpp.opengl.o: %.cpp
../build/tests/%.cpp.opengl2.o: %.cpp
-@mkdir -p ../build/tests
@echo "Compiling $< (OpenGL)"
@echo "Compiling $< (OpenGL2)"
$(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(OPENGL_FLAGS) -DDGL_OPENGL -c -o $@

../build/tests/%.cpp.opengl3.o: %.cpp
-@mkdir -p ../build/tests
@echo "Compiling $< (OpenGL3)"
$(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(OPENGL_FLAGS) -DDGL_OPENGL -DDGL_USE_OPENGL3 -c -o $@

../build/tests/%.cpp.stub.o: %.cpp
-@mkdir -p ../build/tests
@echo "Compiling $< (Stub)"
@@ -129,7 +136,11 @@ clean:
@echo "Linking $*"
$(SILENT)$(CXX) $< $(LINK_FLAGS) $(DGL_SYSTEM_LIBS) $(CAIRO_LIBS) -o $@

../build/tests/%.opengl$(APP_EXT): ../build/tests/%.cpp.opengl.o
../build/tests/%.opengl2$(APP_EXT): ../build/tests/%.cpp.opengl2.o
@echo "Linking $*"
$(SILENT)$(CXX) $< $(LINK_FLAGS) $(DGL_SYSTEM_LIBS) $(OPENGL_LIBS) -o $@

../build/tests/%.opengl3$(APP_EXT): ../build/tests/%.cpp.opengl3.o
@echo "Linking $*"
$(SILENT)$(CXX) $< $(LINK_FLAGS) $(DGL_SYSTEM_LIBS) $(OPENGL_LIBS) -o $@

@@ -144,34 +155,40 @@ clean:
# ---------------------------------------------------------------------------------------------------------------------
# linking steps (special, links against DGL static lib)

../build/tests/Demo.cairo$(APP_EXT): ../build/tests/Demo.cpp.cairo.o ../build/libdgl-cairo.a
../build/tests/Demo.cairo$(APP_EXT): ../build/tests/Demo.cpp.cairo.o
@echo "Linking Demo (Cairo)"
$(SILENT)$(CXX) $^ $(LINK_FLAGS) $(DGL_SYSTEM_LIBS) $(CAIRO_LIBS) -o $@

../build/tests/Demo.opengl$(APP_EXT): ../build/tests/Demo.cpp.opengl.o ../build/libdgl-opengl.a
../build/tests/Demo.opengl2$(APP_EXT): ../build/tests/Demo.cpp.opengl2.o
@echo "Linking Demo (OpenGL)"
$(SILENT)$(CXX) $^ $(LINK_FLAGS) $(DGL_SYSTEM_LIBS) $(OPENGL_LIBS) -o $@

../build/tests/Demo.vulkan$(APP_EXT): ../build/tests/Demo.cpp.vulkan.o ../build/libdgl-vulkan.a
../build/tests/Demo.opengl3$(APP_EXT): ../build/tests/Demo.cpp.opengl3.o
@echo "Linking Demo (OpenGL)"
$(SILENT)$(CXX) $^ $(LINK_FLAGS) $(DGL_SYSTEM_LIBS) $(OPENGL_LIBS) -o $@

../build/tests/Demo.vulkan$(APP_EXT): ../build/tests/Demo.cpp.vulkan.o
@echo "Linking Demo (Vulkan)"
$(SILENT)$(CXX) $^ $(LINK_FLAGS) $(DGL_SYSTEM_LIBS) $(VULKAN_LIBS) -o $@

../build/tests/FileBrowserDialog$(APP_EXT): ../build/tests/FileBrowserDialog.cpp.o ../build/libdgl-opengl.a
@echo "Linking FileBrowserDialog (OpenGL)"
../build/tests/FileBrowserDialog$(APP_EXT): ../build/tests/FileBrowserDialog.cpp.o
@echo "Linking FileBrowserDialog (OpenGL2)"
$(SILENT)$(CXX) $^ $(LINK_FLAGS) $(DGL_SYSTEM_LIBS) $(OPENGL_LIBS) -o $@

../build/tests/NanoImage$(APP_EXT): ../build/tests/NanoImage.cpp.o ../build/libdgl-opengl.a
@echo "Linking NanoImage (OpenGL)"
../build/tests/NanoImage$(APP_EXT): ../build/tests/NanoImage.cpp.o
@echo "Linking NanoImage (OpenGL2)"
$(SILENT)$(CXX) $^ $(LINK_FLAGS) $(DGL_SYSTEM_LIBS) $(OPENGL_LIBS) -o $@

../build/tests/NanoSubWidgets$(APP_EXT): ../build/tests/NanoSubWidgets.cpp.o ../build/libdgl-opengl.a
@echo "Linking NanoSubWidgets (OpenGL)"
../build/tests/NanoSubWidgets$(APP_EXT): ../build/tests/NanoSubWidgets.cpp.o
@echo "Linking NanoSubWidgets (OpenGL2)"
$(SILENT)$(CXX) $^ $(LINK_FLAGS) $(DGL_SYSTEM_LIBS) $(OPENGL_LIBS) -o $@

# ---------------------------------------------------------------------------------------------------------------------

.PHONY: Demo.opengl FileBrowserDialog NanoImage NanoSubWidgets

-include $(ALL_OBJS:%.o=%.d)
-include ../build/tests/Demo.cpp.cairo.d
-include ../build/tests/Demo.cpp.opengl2.d
-include ../build/tests/Demo.cpp.opengl3.d
-include ../build/tests/Demo.cpp.vulkan.d

# ---------------------------------------------------------------------------------------------------------------------

+ 5
- 3
tests/NanoImage.cpp View File

@@ -1,6 +1,6 @@
/*
* DISTRHO Plugin Framework (DPF)
* Copyright (C) 2012-2024 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2012-2025 Filipe Coelho <falktx@falktx.com>
*
* 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
@@ -15,8 +15,10 @@
*/

#include "tests.hpp"

#include "dgl/NanoVG.hpp"
#include "dgl.cpp"
#include "dgl/src/Color.cpp"
#include "dgl/src/NanoVG.cpp"
#include "dgl/src/Resources.cpp"

START_NAMESPACE_DGL



+ 5
- 3
tests/NanoSubWidgets.cpp View File

@@ -1,6 +1,6 @@
/*
* DISTRHO Plugin Framework (DPF)
* Copyright (C) 2012-2024 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2012-2025 Filipe Coelho <falktx@falktx.com>
*
* 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
@@ -15,8 +15,10 @@
*/

#include "tests.hpp"

#include "../dgl/NanoVG.hpp"
#include "dgl.cpp"
#include "dgl/src/Color.cpp"
#include "dgl/src/NanoVG.cpp"
#include "dgl/src/Resources.cpp"

START_NAMESPACE_DGL



+ 2
- 6
tests/Point.cpp View File

@@ -1,6 +1,6 @@
/*
* DISTRHO Plugin Framework (DPF)
* Copyright (C) 2012-2024 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2012-2025 Filipe Coelho <falktx@falktx.com>
*
* 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
@@ -15,11 +15,7 @@
*/

#include "tests.hpp"

#define DPF_TEST_POINT_CPP
#include "dgl/src/Application.cpp"
#include "dgl/src/ApplicationPrivateData.cpp"
#include "dgl/src/Geometry.cpp"
#include "dgl.cpp"

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



+ 4
- 10
tests/Window.cpp View File

@@ -1,6 +1,6 @@
/*
* DISTRHO Plugin Framework (DPF)
* Copyright (C) 2012-2024 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2012-2025 Filipe Coelho <falktx@falktx.com>
*
* 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
@@ -15,15 +15,9 @@
*/

#include "tests.hpp"

#define DPF_TEST_POINT_CPP
#define DPF_TEST_WINDOW_CPP
#include "dgl/src/pugl.cpp"
#include "dgl/src/Application.cpp"
#include "dgl/src/ApplicationPrivateData.cpp"
#include "dgl/src/Geometry.cpp"
#include "dgl/src/Window.cpp"
#include "dgl/src/WindowPrivateData.cpp"
#include "dgl.cpp"
#include "dgl/src/EventHandlers.cpp"
#include "dgl/src/ImageBase.cpp"

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



+ 44
- 0
tests/dgl.cpp View File

@@ -0,0 +1,44 @@
/*
* DISTRHO Plugin Framework (DPF)
* Copyright (C) 2012-2025 Filipe Coelho <falktx@falktx.com>
*
* 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
* permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
* TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN
* NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#include "dgl/src/pugl.cpp"

#include "dgl/src/Application.cpp"
#include "dgl/src/ApplicationPrivateData.cpp"
#include "dgl/src/Geometry.cpp"
#include "dgl/src/SubWidget.cpp"
#include "dgl/src/SubWidgetPrivateData.cpp"
#include "dgl/src/TopLevelWidget.cpp"
#include "dgl/src/TopLevelWidgetPrivateData.cpp"
#include "dgl/src/Widget.cpp"
#include "dgl/src/WidgetPrivateData.cpp"
#include "dgl/src/Window.cpp"
#include "dgl/src/WindowPrivateData.cpp"

#if defined(DGL_CAIRO)
#include "dgl/src/Cairo.cpp"
#elif defined(DGL_OPENGL)
#include "dgl/src/OpenGL.cpp"
#ifdef DGL_USE_OPENGL3
#include "dgl/src/OpenGL3.cpp"
#else
#include "dgl/src/OpenGL2.cpp"
#endif
#elif defined(DGL_VULKAN)
#include "dgl/src/Vulkan.cpp"
#else
#include "dgl/src/Stub.cpp"
#endif

Loading…
Cancel
Save