-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
48f435d
commit 29f9c62
Showing
9 changed files
with
195 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#***************************************************************************** | ||
#* VCLib * | ||
#* Visual Computing Library * | ||
#* * | ||
#* Copyright(C) 2021-2024 * | ||
#* Visual Computing Lab * | ||
#* ISTI - Italian National Research Council * | ||
#* * | ||
#* All rights reserved. * | ||
#* * | ||
#* This program is free software; you can redistribute it and/or modify * | ||
#* it under the terms of the Mozilla Public License Version 2.0 as published * | ||
#* by the Mozilla Foundation; either version 2 of the License, or * | ||
#* (at your option) any later version. * | ||
#* * | ||
#* This program is distributed in the hope that it will be useful, * | ||
#* but WITHOUT ANY WARRANTY; without even the implied warranty of * | ||
#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | ||
#* Mozilla Public License Version 2.0 * | ||
#* (https://www.mozilla.org/en-US/MPL/2.0/) for more details. * | ||
#****************************************************************************/ | ||
|
||
cmake_minimum_required(VERSION 3.24) | ||
|
||
set(TEST_NAME 000-static-asserts) | ||
project(vclib-test-${TEST_NAME}) | ||
|
||
set(HEADERS | ||
canvas.h | ||
) | ||
|
||
set(SOURCES | ||
main.cpp | ||
) | ||
|
||
vclib_add_test( | ||
${TEST_NAME} | ||
VCLIB_MODULE render | ||
SOURCES ${HEADERS} ${SOURCES} | ||
${HEADER_ONLY_OPTION}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/***************************************************************************** | ||
* VCLib * | ||
* Visual Computing Library * | ||
* * | ||
* Copyright(C) 2021-2024 * | ||
* Visual Computing Lab * | ||
* ISTI - Italian National Research Council * | ||
* * | ||
* All rights reserved. * | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the Mozilla Public License Version 2.0 as published * | ||
* by the Mozilla Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
* This program is distributed in the hope that it will be useful, * | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | ||
* Mozilla Public License Version 2.0 * | ||
* (https://www.mozilla.org/en-US/MPL/2.0/) for more details. * | ||
****************************************************************************/ | ||
|
||
#ifndef CANVAS_H | ||
#define CANVAS_H | ||
|
||
#include <vclib/render/canvas.h> | ||
#include <vclib/render/renderer.h> | ||
|
||
#ifdef VCLIB_WITH_QT | ||
#include <vclib/qt/widget_manager.h> | ||
#elif VCLIB_WITH_GLFW | ||
#include <vclib/glfw/window_manager.h> | ||
#endif | ||
|
||
#ifdef VCLIB_WITH_QT | ||
template<typename DR> | ||
using WM = vcl::qt::WidgetManager<DR>; | ||
#elif VCLIB_WITH_GLFW | ||
template<typename DR> | ||
using WM = vcl::glfw::WindowManager<DR>; | ||
#endif | ||
|
||
void canvasStaticAsserts() | ||
{ | ||
using namespace vcl; | ||
|
||
using RendererType = Renderer<WM, Canvas>; | ||
|
||
static_assert( | ||
CanvasConcept<Canvas<RendererType>>, | ||
"Canvas does not satisfy the CanvasConcept"); | ||
static_assert( | ||
CanvasConcept<const Canvas<RendererType>>, | ||
"const Canvas does not satisfy the CanvasConcept"); | ||
static_assert( | ||
CanvasConcept<Canvas<RendererType>&>, | ||
"Canvas& does not satisfy the CanvasConcept"); | ||
static_assert( | ||
CanvasConcept<const Canvas<RendererType>&>, | ||
"const Canvas& does not satisfy the CanvasConcept"); | ||
static_assert( | ||
CanvasConcept<Canvas<RendererType>&&>, | ||
"Canvas&& does not satisfy the CanvasConcept"); | ||
} | ||
|
||
#endif // CANVAS_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/***************************************************************************** | ||
* VCLib * | ||
* Visual Computing Library * | ||
* * | ||
* Copyright(C) 2021-2024 * | ||
* Visual Computing Lab * | ||
* ISTI - Italian National Research Council * | ||
* * | ||
* All rights reserved. * | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the Mozilla Public License Version 2.0 as published * | ||
* by the Mozilla Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
* This program is distributed in the hope that it will be useful, * | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of * | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | ||
* Mozilla Public License Version 2.0 * | ||
* (https://www.mozilla.org/en-US/MPL/2.0/) for more details. * | ||
****************************************************************************/ | ||
|
||
#include "canvas.h" | ||
|
||
int main() | ||
{ | ||
canvasStaticAsserts(); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#***************************************************************************** | ||
#* VCLib * | ||
#* Visual Computing Library * | ||
#* * | ||
#* Copyright(C) 2021-2024 * | ||
#* Visual Computing Lab * | ||
#* ISTI - Italian National Research Council * | ||
#* * | ||
#* All rights reserved. * | ||
#* * | ||
#* This program is free software; you can redistribute it and/or modify * | ||
#* it under the terms of the Mozilla Public License Version 2.0 as published * | ||
#* by the Mozilla Foundation; either version 2 of the License, or * | ||
#* (at your option) any later version. * | ||
#* * | ||
#* This program is distributed in the hope that it will be useful, * | ||
#* but WITHOUT ANY WARRANTY; without even the implied warranty of * | ||
#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | ||
#* Mozilla Public License Version 2.0 * | ||
#* (https://www.mozilla.org/en-US/MPL/2.0/) for more details. * | ||
#****************************************************************************/ | ||
|
||
cmake_minimum_required(VERSION 3.24) | ||
project(vclib-render-tests) | ||
|
||
set(CMAKE_COMPILE_WARNING_AS_ERROR ${VCLIB_COMPILE_WARNINGS_AS_ERRORS}) | ||
|
||
if (TARGET vclib-3rd-qt OR TARGET vclib-3rd-glfw) | ||
add_subdirectory(000-static-asserts) | ||
endif() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters