Skip to content

Commit

Permalink
[render] some render examples use generic getDrawableMesh function im…
Browse files Browse the repository at this point in the history
…plemented in common
  • Loading branch information
alemuntoni committed Jan 8, 2025
1 parent 676f8e8 commit 2ceb50e
Show file tree
Hide file tree
Showing 16 changed files with 14 additions and 263 deletions.
5 changes: 1 addition & 4 deletions examples/render/01-viewer/bgfx/glfw/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,10 @@ project(vclib-render-example-${EXAMPLE_NAME})
### Build settings
set(CMAKE_CXX_STANDARD 20)

set(HEADERS
common.h)

set(SOURCES
main.cpp)

# will create a target called 'vclib-render-example-${EXAMPLE_NAME}'
vclib_add_example(${EXAMPLE_NAME}
VCLIB_MODULE render
SOURCES ${HEADERS} ${SOURCES})
SOURCES ${SOURCES})
2 changes: 1 addition & 1 deletion examples/render/01-viewer/bgfx/glfw/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* (https://www.mozilla.org/en-US/MPL/2.0/) for more details. *
****************************************************************************/

#include "common.h"
#include "get_drawable_mesh.h"

#include <vclib/glfw/viewer_window.h>

Expand Down
5 changes: 1 addition & 4 deletions examples/render/01-viewer/bgfx/qt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,10 @@ project(vclib-render-example-${EXAMPLE_NAME})
### Build settings
set(CMAKE_CXX_STANDARD 20)

set(HEADERS
common.h)

set(SOURCES
main.cpp)

# will create a target called 'vclib-render-example-${EXAMPLE_NAME}'
vclib_add_example(${EXAMPLE_NAME}
VCLIB_MODULE render
SOURCES ${HEADERS} ${SOURCES})
SOURCES ${SOURCES})
59 changes: 0 additions & 59 deletions examples/render/01-viewer/bgfx/qt/common.h

This file was deleted.

2 changes: 1 addition & 1 deletion examples/render/01-viewer/bgfx/qt/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* (https://www.mozilla.org/en-US/MPL/2.0/) for more details. *
****************************************************************************/

#include "common.h"
#include "get_drawable_mesh.h"

#include <QApplication>
#include <vclib/qt/viewer_widget.h>
Expand Down
5 changes: 1 addition & 4 deletions examples/render/01-viewer/opengl2/glfw/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,10 @@ project(vclib-render-example-${EXAMPLE_NAME})
### Build settings
set(CMAKE_CXX_STANDARD 20)

set(HEADERS
common.h)

set(SOURCES
main.cpp)

# will create a target called 'vclib-render-example-${EXAMPLE_NAME}'
vclib_add_example(${EXAMPLE_NAME}
VCLIB_MODULE render
SOURCES ${HEADERS} ${SOURCES})
SOURCES ${SOURCES})
61 changes: 0 additions & 61 deletions examples/render/01-viewer/opengl2/glfw/common.h

This file was deleted.

5 changes: 4 additions & 1 deletion examples/render/01-viewer/opengl2/glfw/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* (https://www.mozilla.org/en-US/MPL/2.0/) for more details. *
****************************************************************************/

#include "common.h"
#include "get_drawable_mesh.h"

#include <vclib/glfw/viewer_window.h>

Expand All @@ -31,6 +31,9 @@ int main(int argc, char** argv)
// load and set up a drawable mesh
vcl::DrawableMesh<vcl::TriMesh> drawable = getDrawableMesh();

drawable.color() = vcl::Color::Yellow;
drawable.updateBuffers();

auto mrs = drawable.renderSettings();
mrs.setSurfaceColorPerMesh();
mrs.setSurfaceShadingFlat();
Expand Down
5 changes: 1 addition & 4 deletions examples/render/01-viewer/opengl2/qt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,10 @@ project(vclib-render-example-${EXAMPLE_NAME})
### Build settings
set(CMAKE_CXX_STANDARD 20)

set(HEADERS
common.h)

set(SOURCES
main.cpp)

# will create a target called 'vclib-render-example-${EXAMPLE_NAME}'
vclib_add_example(${EXAMPLE_NAME}
VCLIB_MODULE render
SOURCES ${HEADERS} ${SOURCES})
SOURCES ${SOURCES})
59 changes: 0 additions & 59 deletions examples/render/01-viewer/opengl2/qt/common.h

This file was deleted.

2 changes: 1 addition & 1 deletion examples/render/01-viewer/opengl2/qt/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* (https://www.mozilla.org/en-US/MPL/2.0/) for more details. *
****************************************************************************/

#include "common.h"
#include "get_drawable_mesh.h"

#include <QApplication>
#include <vclib/qt/viewer_widget.h>
Expand Down
5 changes: 1 addition & 4 deletions examples/render/910-viewer-imgui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,10 @@ project(vclib-render-example-${EXAMPLE_NAME})
### Build settings
set(CMAKE_CXX_STANDARD 20)

set(HEADERS
common.h)

set(SOURCES
main.cpp)

# will create a target called 'vclib-render-example-${EXAMPLE_NAME}'
vclib_add_example(${EXAMPLE_NAME}
VCLIB_MODULE render
SOURCES ${HEADERS} ${SOURCES})
SOURCES ${SOURCES})
59 changes: 0 additions & 59 deletions examples/render/910-viewer-imgui/common.h

This file was deleted.

2 changes: 1 addition & 1 deletion examples/render/910-viewer-imgui/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* for more details. *
****************************************************************************/

#include "common.h"
#include "get_drawable_mesh.h"

#include <vclib/glfw_imgui/viewer_window_imgui.h>
#include <imgui.h>
Expand Down
1 change: 1 addition & 0 deletions examples/render/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ cmake_minimum_required(VERSION 3.24)
project(common)

set(HEADERS
get_drawable_mesh.h
default_viewer.h)

add_library(vclib-render-examples-common INTERFACE)
Expand Down
File renamed without changes.

0 comments on commit 2ceb50e

Please sign in to comment.