Skip to content

Commit

Permalink
[render] imgui static asserts test also qt window manager
Browse files Browse the repository at this point in the history
  • Loading branch information
alemuntoni committed Jan 23, 2025
1 parent 911eb38 commit 2143462
Showing 1 changed file with 52 additions and 53 deletions.
105 changes: 52 additions & 53 deletions tests/render/000-static-asserts/drawers.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,62 +247,10 @@ void drawersStaticAssertsWM()
!BlockerEventDrawerConcept<ViewerDrawer<RenderAppVD>&&>,
"ViewerDrawer&& does satisfy the BlockerEventDrawerConcept");

#ifdef VCLIB_RENDER_BACKEND_BGFX
using RenderAppTD = RenderApp<WMQ, Canvas, TextDrawer>;

// TextDrawer
static_assert(
DrawerConcept<TextDrawer<RenderAppTD>>,
"TextDrawer does not satisfy the DrawerConcept");
static_assert(
DrawerConcept<const TextDrawer<RenderAppTD>>,
"const TextDrawer does not satisfy the DrawerConcept");
static_assert(
DrawerConcept<TextDrawer<RenderAppTD>&>,
"TextDrawer& does not satisfy the DrawerConcept");
static_assert(
DrawerConcept<const TextDrawer<RenderAppTD>&>,
"const TextDrawer& does not satisfy the DrawerConcept");
static_assert(
DrawerConcept<TextDrawer<RenderAppTD>&&>,
"TextDrawer&& does not satisfy the DrawerConcept");

static_assert(
!EventDrawerConcept<TextDrawer<RenderAppTD>>,
"TextDrawer does satisfy the EventDrawerConcept");
static_assert(
!EventDrawerConcept<const TextDrawer<RenderAppTD>>,
"const TextDrawer does satisfy the EventDrawerConcept");
static_assert(
!EventDrawerConcept<TextDrawer<RenderAppTD>&>,
"TextDrawer& does satisfy the EventDrawerConcept");
static_assert(
!EventDrawerConcept<const TextDrawer<RenderAppTD>&>,
"const TextDrawer& does satisfy the EventDrawerConcept");
static_assert(
!EventDrawerConcept<TextDrawer<RenderAppTD>&&>,
"TextDrawer&& does satisfy the EventDrawerConcept");
#endif
}

void drawersStaticAsserts()
{
using namespace vcl;

// static asserts for each window manager
#ifdef VCLIB_WITH_QT
drawersStaticAssertsWM<WMQ>();
#endif

#if VCLIB_WITH_GLFW
drawersStaticAssertsWM<WMG>();
#endif

// static assers for drawers that work with specific window managers
#ifdef VCLIB_WITH_IMGUI
using namespace vcl::imgui;

using RenderAppID = RenderApp<WMG, Canvas, ImGuiDrawer>;
using RenderAppID = RenderApp<WM, Canvas, ImGuiDrawer>;

// ImguiDrawer
static_assert(
Expand Down Expand Up @@ -353,6 +301,57 @@ void drawersStaticAsserts()
BlockerEventDrawerConcept<ImGuiDrawer<RenderAppID>&&>,
"ImguiDrawer&& does not satisfy the BlockerEventDrawerConcept");
#endif

#ifdef VCLIB_RENDER_BACKEND_BGFX
using RenderAppTD = RenderApp<WM, Canvas, TextDrawer>;

// TextDrawer
static_assert(
DrawerConcept<TextDrawer<RenderAppTD>>,
"TextDrawer does not satisfy the DrawerConcept");
static_assert(
DrawerConcept<const TextDrawer<RenderAppTD>>,
"const TextDrawer does not satisfy the DrawerConcept");
static_assert(
DrawerConcept<TextDrawer<RenderAppTD>&>,
"TextDrawer& does not satisfy the DrawerConcept");
static_assert(
DrawerConcept<const TextDrawer<RenderAppTD>&>,
"const TextDrawer& does not satisfy the DrawerConcept");
static_assert(
DrawerConcept<TextDrawer<RenderAppTD>&&>,
"TextDrawer&& does not satisfy the DrawerConcept");

static_assert(
!EventDrawerConcept<TextDrawer<RenderAppTD>>,
"TextDrawer does satisfy the EventDrawerConcept");
static_assert(
!EventDrawerConcept<const TextDrawer<RenderAppTD>>,
"const TextDrawer does satisfy the EventDrawerConcept");
static_assert(
!EventDrawerConcept<TextDrawer<RenderAppTD>&>,
"TextDrawer& does satisfy the EventDrawerConcept");
static_assert(
!EventDrawerConcept<const TextDrawer<RenderAppTD>&>,
"const TextDrawer& does satisfy the EventDrawerConcept");
static_assert(
!EventDrawerConcept<TextDrawer<RenderAppTD>&&>,
"TextDrawer&& does satisfy the EventDrawerConcept");
#endif
}

void drawersStaticAsserts()
{
using namespace vcl;

// static asserts for each window manager
#ifdef VCLIB_WITH_QT
drawersStaticAssertsWM<WMQ>();
#endif

#if VCLIB_WITH_GLFW
drawersStaticAssertsWM<WMG>();
#endif
}

#endif // DRAWERS_H

0 comments on commit 2143462

Please sign in to comment.