Skip to content

Commit

Permalink
[render] fix clang build error
Browse files Browse the repository at this point in the history
  • Loading branch information
alemuntoni committed Jan 9, 2025
1 parent 4675a86 commit 49a5784
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 45 deletions.
85 changes: 41 additions & 44 deletions tests/render/000-static-asserts/drawers.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@
#include <vclib/bgfx/drawers/text_drawer.h>
#endif

template<typename DR>
using BlockEventDrawer = vcl::EventDrawer<DR, true>;

#ifdef VCLIB_WITH_QT
template<typename DR>
using WMQ = vcl::qt::WidgetManager<DR>;
Expand All @@ -65,7 +62,7 @@ void drawersStaticAssertsWM()

using RendererTypePD = Renderer<WM, Canvas, PlainDrawer>;
using RendererTypeED = Renderer<WM, Canvas, EventDrawer>;
using RendererTypeBED = Renderer<WM, Canvas, BlockEventDrawer>;
using RendererTypeBED = Renderer<WM, Canvas, BlockerEventDrawer>;
using RendererTypeVD = Renderer<WM, Canvas, ViewerDrawer>;

// PlainDrawer
Expand Down Expand Up @@ -166,70 +163,70 @@ void drawersStaticAssertsWM()
!CanBlockEventDrawerConcept<EventDrawer<RendererTypeED>&&>,
"EventDrawer&& does satisfy the CanBlockEventDrawerConcept");

// BlockEventDrawer
// BlockerEventDrawer
static_assert(
DrawerConcept<BlockEventDrawer<RendererTypeBED>>,
"BlockEventDrawer does not satisfy the DrawerConcept");
DrawerConcept<BlockerEventDrawer<RendererTypeBED>>,
"BlockerEventDrawer does not satisfy the DrawerConcept");
static_assert(
DrawerConcept<const BlockEventDrawer<RendererTypeBED>>,
"const BlockEventDrawer does not satisfy the DrawerConcept");
DrawerConcept<const BlockerEventDrawer<RendererTypeBED>>,
"const BlockerEventDrawer does not satisfy the DrawerConcept");
static_assert(
DrawerConcept<BlockEventDrawer<RendererTypeBED>&>,
"BlockEventDrawer& does not satisfy the DrawerConcept");
DrawerConcept<BlockerEventDrawer<RendererTypeBED>&>,
"BlockerEventDrawer& does not satisfy the DrawerConcept");
static_assert(
DrawerConcept<const BlockEventDrawer<RendererTypeBED>&>,
"const BlockEventDrawer& does not satisfy the DrawerConcept");
DrawerConcept<const BlockerEventDrawer<RendererTypeBED>&>,
"const BlockerEventDrawer& does not satisfy the DrawerConcept");
static_assert(
DrawerConcept<BlockEventDrawer<RendererTypeBED>&&>,
"BlockEventDrawer&& does not satisfy the DrawerConcept");
DrawerConcept<BlockerEventDrawer<RendererTypeBED>&&>,
"BlockerEventDrawer&& does not satisfy the DrawerConcept");

static_assert(
EventDrawerConcept<BlockEventDrawer<RendererTypeBED>>,
"BlockEventDrawer does not satisfy the EventDrawerConcept");
EventDrawerConcept<BlockerEventDrawer<RendererTypeBED>>,
"BlockerEventDrawer does not satisfy the EventDrawerConcept");
static_assert(
EventDrawerConcept<const BlockEventDrawer<RendererTypeBED>>,
"const BlockEventDrawer does not satisfy the EventDrawerConcept");
EventDrawerConcept<const BlockerEventDrawer<RendererTypeBED>>,
"const BlockerEventDrawer does not satisfy the EventDrawerConcept");
static_assert(
EventDrawerConcept<BlockEventDrawer<RendererTypeBED>&>,
"BlockEventDrawer& does not satisfy the EventDrawerConcept");
EventDrawerConcept<BlockerEventDrawer<RendererTypeBED>&>,
"BlockerEventDrawer& does not satisfy the EventDrawerConcept");
static_assert(
EventDrawerConcept<const BlockEventDrawer<RendererTypeBED>&>,
EventDrawerConcept<const BlockerEventDrawer<RendererTypeBED>&>,
"const BlockEventDrawer& does not satisfy the EventDrawerConcept");
static_assert(
EventDrawerConcept<BlockEventDrawer<RendererTypeBED>&&>,
"BlockEventDrawer&& does not satisfy the EventDrawerConcept");
EventDrawerConcept<BlockerEventDrawer<RendererTypeBED>&&>,
"BlockerEventDrawer&& does not satisfy the EventDrawerConcept");

static_assert(
!CantBlockEventDrawerConcept<BlockEventDrawer<RendererTypeBED>>,
"BlockEventDrawer does satisfy the CantBlockEventDrawerConcept");
!CantBlockEventDrawerConcept<BlockerEventDrawer<RendererTypeBED>>,
"BlockerEventDrawer does satisfy the CantBlockEventDrawerConcept");
static_assert(
!CantBlockEventDrawerConcept<const BlockEventDrawer<RendererTypeBED>>,
"const BlockEventDrawer does satisfy the CantBlockEventDrawerConcept");
!CantBlockEventDrawerConcept<const BlockerEventDrawer<RendererTypeBED>>,
"const BlockerEventDrawer does satisfy the CantBlockEventDrawerConcept");
static_assert(
!CantBlockEventDrawerConcept<BlockEventDrawer<RendererTypeBED>&>,
"BlockEventDrawer& does satisfy the CantBlockEventDrawerConcept");
!CantBlockEventDrawerConcept<BlockerEventDrawer<RendererTypeBED>&>,
"BlockerEventDrawer& does satisfy the CantBlockEventDrawerConcept");
static_assert(
!CantBlockEventDrawerConcept<const BlockEventDrawer<RendererTypeBED>&>,
"const BlockEventDrawer& does satisfy the CantBlockEventDrawerConcept");
!CantBlockEventDrawerConcept<const BlockerEventDrawer<RendererTypeBED>&>,
"const BlockerEventDrawer& does satisfy the CantBlockEventDrawerConcept");
static_assert(
!CantBlockEventDrawerConcept<BlockEventDrawer<RendererTypeBED>&&>,
"BlockEventDrawer&& does satisfy the CantBlockEventDrawerConcept");
!CantBlockEventDrawerConcept<BlockerEventDrawer<RendererTypeBED>&&>,
"BlockerEventDrawer&& does satisfy the CantBlockEventDrawerConcept");

static_assert(
CanBlockEventDrawerConcept<BlockEventDrawer<RendererTypeBED>>,
"BlockEventDrawer does not satisfy the CanBlockEventDrawerConcept");
CanBlockEventDrawerConcept<BlockerEventDrawer<RendererTypeBED>>,
"BlockerEventDrawer does not satisfy the CanBlockEventDrawerConcept");
static_assert(
CanBlockEventDrawerConcept<const BlockEventDrawer<RendererTypeBED>>,
"const BlockEventDrawer does not satisfy the CanBlockEventDrawerConcept");
CanBlockEventDrawerConcept<const BlockerEventDrawer<RendererTypeBED>>,
"const BlockerEventDrawer does not satisfy the CanBlockEventDrawerConcept");
static_assert(
CanBlockEventDrawerConcept<BlockEventDrawer<RendererTypeBED>&>,
"BlockEventDrawer& does not satisfy the CanBlockEventDrawerConcept");
CanBlockEventDrawerConcept<BlockerEventDrawer<RendererTypeBED>&>,
"BlockerEventDrawer& does not satisfy the CanBlockEventDrawerConcept");
static_assert(
CanBlockEventDrawerConcept<const BlockEventDrawer<RendererTypeBED>&>,
"const BlockEventDrawer& does not satisfy the CanBlockEventDrawerConcept");
CanBlockEventDrawerConcept<const BlockerEventDrawer<RendererTypeBED>&>,
"const BlockerEventDrawer& does not satisfy the CanBlockEventDrawerConcept");
static_assert(
CanBlockEventDrawerConcept<BlockEventDrawer<RendererTypeBED>&&>,
"BlockEventDrawer&& does not satisfy the CanBlockEventDrawerConcept");
CanBlockEventDrawerConcept<BlockerEventDrawer<RendererTypeBED>&&>,
"BlockerEventDrawer&& does not satisfy the CanBlockEventDrawerConcept");

// ViewerDrawer
static_assert(
Expand Down
2 changes: 1 addition & 1 deletion vclib/render/include/vclib/imgui/imgui_drawer.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
namespace vcl::imgui {

template<typename DerivedRenderer>
class ImGuiDrawer : public EventDrawer<DerivedRenderer, true>
class ImGuiDrawer : public BlockerEventDrawer<DerivedRenderer>
{
protected:
using DRT = DerivedRenderer;
Expand Down
10 changes: 10 additions & 0 deletions vclib/render/include/vclib/render/drawers/event_drawer.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

namespace vcl {

namespace detail {

/**
* @brief The EventDrawer class is a base class for all drawers that handle
* events.
Expand Down Expand Up @@ -186,6 +188,14 @@ class EventDrawer<DerivedRenderer, true> : public PlainDrawer<DerivedRenderer>
}
};

} // namespace detail

template<typename DerivedRenderer>
using EventDrawer = detail::EventDrawer<DerivedRenderer, false>;

template<typename DerivedRenderer>
using BlockerEventDrawer = detail::EventDrawer<DerivedRenderer, true>;

} // namespace vcl

#endif // EVENT_DRAWER_H

0 comments on commit 49a5784

Please sign in to comment.