Commit 5c29baed authored by Simon Boyé's avatar Simon Boyé

Vitelotte: Made common examples build as a library and fixed shader building.

parent 01635e58
......@@ -21,6 +21,36 @@ if( NOT cmake_build_type_tolower STREQUAL "debug"
message(FATAL_ERROR "Unknown build type \"${CMAKE_BUILD_TYPE}\". Allowed values are Debug, Release, RelWithDebInfo (case-insensitive).")
endif()
################################################################################
# Generate Vitelotte's shaders #
# TODO: find a more appropriate place for this. #
################################################################################
set(vitelotte_SHADERS
${Patate_SOURCE_DIR}/Patate/Vitelotte/Utils/vgMeshRendererShaders/vert_common.glsl
${Patate_SOURCE_DIR}/Patate/Vitelotte/Utils/vgMeshRendererShaders/geom_common.glsl
${Patate_SOURCE_DIR}/Patate/Vitelotte/Utils/vgMeshRendererShaders/frag_common.glsl
${Patate_SOURCE_DIR}/Patate/Vitelotte/Utils/vgMeshRendererShaders/frag_linear.glsl
${Patate_SOURCE_DIR}/Patate/Vitelotte/Utils/vgMeshRendererShaders/frag_quadratic.glsl
${Patate_SOURCE_DIR}/Patate/Vitelotte/Utils/vgMeshRendererShaders/frag_wireframe.glsl
)
add_custom_command(
OUTPUT ${Patate_SOURCE_DIR}/Patate/Vitelotte/Utils/vgMeshRendererShaders.hpp
COMMAND python3 ${Patate_SOURCE_DIR}/bin/shader2cpp
-l
-n Vitelotte::VGMeshRendererShaders
-g _VITELOTTE_UTILS_VG_MESH_RENDERER_SHADERS_
-o ${Patate_SOURCE_DIR}/Patate/Vitelotte/Utils/vgMeshRendererShaders.hpp
${vitelotte_SHADERS}
DEPENDS ${vitelotte_SHADERS}
WORKING_DIRECTORY ${Patate_SOURCE_DIR}
VERBATIM
)
add_custom_target(vitelottes_vg_mesh_renderer_shaders
DEPENDS ${PROJECT_SOURCE_DIR}/Patate/Vitelotte/Utils/vgMeshRendererShaders.hpp)
################################################################################
# add a target to generate API documentation with Doxygen #
################################################################################
......
......@@ -4,7 +4,7 @@
file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
// Generated by shader2cpp.
// 2015-05-04T13:44:58.201174
// 2015-05-04T15:46:34.276655
#ifndef _VITELOTTE_UTILS_VG_MESH_RENDERER_SHADERS_
......@@ -16,6 +16,86 @@ namespace Vitelotte
namespace VGMeshRendererShaders
{
static const char* vert_common_glsl =
"/*\n"
" This Source Code Form is subject to the terms of the Mozilla Public\n"
" License, v. 2.0. If a copy of the MPL was not distributed with this\n"
" file, You can obtain one at http://mozilla.org/MPL/2.0/.\n"
"*/\n"
"\n"
"#version 410 core\n"
"\n"
"uniform mat4 viewMatrix;\n"
"\n"
"in vec4 vx_position;\n"
"\n"
"out vec4 geom_position_obj;\n"
"\n"
"void main(void)\n"
"{\n"
" gl_Position = viewMatrix * vx_position;\n"
" geom_position_obj = vx_position;\n"
"}\n"
"";
static const char* geom_common_glsl =
"/*\n"
" This Source Code Form is subject to the terms of the Mozilla Public\n"
" License, v. 2.0. If a copy of the MPL was not distributed with this\n"
" file, You can obtain one at http://mozilla.org/MPL/2.0/.\n"
"*/\n"
"\n"
"#version 410 core\n"
"\n"
"layout(triangles) in;\n"
"layout(triangle_strip, max_vertices = 3) out;\n"
"\n"
"uniform vec2 viewportSize;\n"
"\n"
"in vec4 geom_position_obj[];\n"
"\n"
"flat out int frag_index;\n"
"out vec3 frag_linearBasis;\n"
"out vec3 frag_position_obj;\n"
"out vec3 frag_edgeDist_scr;\n"
"flat out vec3 frag_vertices_obj[3];\n"
"flat out vec3 frag_normEdges_obj[3];\n"
"\n"
"const vec3 basis[3] = vec3[3](\n"
" vec3(1, 0, 0),\n"
" vec3(0, 1, 0),\n"
" vec3(0, 0, 1)\n"
");\n"
"\n"
"void main()\n"
"{\n"
" vec2 position_scr[3];\n"
" for(int i=0; i<3; ++i)\n"
" {\n"
" position_scr[i] = (viewportSize * gl_in[i].gl_Position.xy)\n"
" / (2.0 * gl_in[i].gl_Position.z);\n"
" }\n"
" float area = abs(cross(vec3(position_scr[1] - position_scr[0], 0.0),\n"
" vec3(position_scr[2] - position_scr[0], 0.0)).z);\n"
" for(int i=0; i<3; ++i)\n"
" {\n"
" gl_Position = gl_in[i].gl_Position;\n"
" frag_index = gl_PrimitiveIDIn;\n"
" frag_linearBasis = basis[i];\n"
" frag_position_obj = geom_position_obj[i].xyz;\n"
" frag_edgeDist_scr = vec3(0.0);\n"
" frag_edgeDist_scr[i] = area / length(position_scr[(i+2)%3] - position_scr[(i+1)%3]);\n"
" for(int j=0; j<3; ++j)\n"
" {\n"
" frag_vertices_obj[j] = geom_position_obj[j].xyz;//gl_in[j].gl_Position.xy;\n"
" frag_normEdges_obj[j] = normalize(geom_position_obj[(j+2)%3].xyz\n"
" - geom_position_obj[(j+1)%3].xyz);\n"
" }\n"
" EmitVertex();\n"
" }\n"
"}\n"
"";
static const char* frag_common_glsl =
"/*\n"
" This Source Code Form is subject to the terms of the Mozilla Public\n"
......@@ -122,7 +202,7 @@ static const char* frag_quadratic_glsl =
"#version 410 core\n"
"\n"
"uniform samplerBuffer nodes;\n"
"uniform int baseNodeIndex;\n"
"uniform int baseNodeIndex;\n"
"uniform bool singularTriangles;\n"
"\n"
"flat in int frag_index;\n"
......@@ -198,86 +278,6 @@ static const char* frag_wireframe_glsl =
"}\n"
"";
static const char* geom_common_glsl =
"/*\n"
" This Source Code Form is subject to the terms of the Mozilla Public\n"
" License, v. 2.0. If a copy of the MPL was not distributed with this\n"
" file, You can obtain one at http://mozilla.org/MPL/2.0/.\n"
"*/\n"
"\n"
"#version 410 core\n"
"\n"
"layout(triangles) in;\n"
"layout(triangle_strip, max_vertices = 3) out;\n"
"\n"
"uniform vec2 viewportSize;\n"
"\n"
"in vec4 geom_position_obj[];\n"
"\n"
"flat out int frag_index;\n"
"out vec3 frag_linearBasis;\n"
"out vec3 frag_position_obj;\n"
"out vec3 frag_edgeDist_scr;\n"
"flat out vec3 frag_vertices_obj[3];\n"
"flat out vec3 frag_normEdges_obj[3];\n"
"\n"
"const vec3 basis[3] = vec3[3](\n"
" vec3(1, 0, 0),\n"
" vec3(0, 1, 0),\n"
" vec3(0, 0, 1)\n"
");\n"
"\n"
"void main()\n"
"{\n"
" vec2 position_scr[3];\n"
" for(int i=0; i<3; ++i)\n"
" {\n"
" position_scr[i] = (viewportSize * gl_in[i].gl_Position.xy)\n"
" / (2.0 * gl_in[i].gl_Position.z);\n"
" }\n"
" float area = abs(cross(vec3(position_scr[1] - position_scr[0], 0.0),\n"
" vec3(position_scr[2] - position_scr[0], 0.0)).z);\n"
" for(int i=0; i<3; ++i)\n"
" {\n"
" gl_Position = gl_in[i].gl_Position;\n"
" frag_index = gl_PrimitiveIDIn;\n"
" frag_linearBasis = basis[i];\n"
" frag_position_obj = geom_position_obj[i].xyz;\n"
" frag_edgeDist_scr = vec3(0.0);\n"
" frag_edgeDist_scr[i] = area / length(position_scr[(i+2)%3] - position_scr[(i+1)%3]);\n"
" for(int j=0; j<3; ++j)\n"
" {\n"
" frag_vertices_obj[j] = geom_position_obj[j].xyz;//gl_in[j].gl_Position.xy;\n"
" frag_normEdges_obj[j] = normalize(geom_position_obj[(j+2)%3].xyz\n"
" - geom_position_obj[(j+1)%3].xyz);\n"
" }\n"
" EmitVertex();\n"
" }\n"
"}\n"
"";
static const char* vert_common_glsl =
"/*\n"
" This Source Code Form is subject to the terms of the Mozilla Public\n"
" License, v. 2.0. If a copy of the MPL was not distributed with this\n"
" file, You can obtain one at http://mozilla.org/MPL/2.0/.\n"
"*/\n"
"\n"
"#version 410 core\n"
"\n"
"uniform mat4 viewMatrix;\n"
"\n"
"in vec4 vx_position;\n"
"\n"
"out vec4 geom_position_obj;\n"
"\n"
"void main(void)\n"
"{\n"
" gl_Position = viewMatrix * vx_position;\n"
" geom_position_obj = vx_position;\n"
"}\n"
"";
}
}
......
......@@ -7,15 +7,9 @@
-o Patate/Vitelotte/Utils/vgMeshRendererShaders.hpp \
Patate/Vitelotte/Utils/vgMeshRendererShaders/*
./bin/shader2cpp \
-l \
-n Vitelotte::VGMeshGL2RendererShaders \
-g _VITELOTTE_UTILS_VG_MESH_GL2_RENDERER_SHADERS_ \
-o Patate/Vitelotte/Utils/vgMeshGL2RendererShaders.hpp \
Patate/Vitelotte/Utils/vgMeshGL2RendererShaders/*
./bin/shader2cpp \
-e \
-l \
-o examples/Vitelotte/common/shaders.cpp \
examples/Vitelotte/common/shaders/*
#./bin/shader2cpp \
# -l \
# -n Vitelotte::VGMeshGL2RendererShaders \
# -g _VITELOTTE_UTILS_VG_MESH_GL2_RENDERER_SHADERS_ \
# -o Patate/Vitelotte/Utils/vgMeshGL2RendererShaders.hpp \
# Patate/Vitelotte/Utils/vgMeshGL2RendererShaders/*
......@@ -2,6 +2,7 @@ project(VitelotteExamples)
cmake_minimum_required(VERSION 2.8)
add_subdirectory(common)
add_subdirectory(mvgtk)
add_subdirectory(mvg_viewer)
add_subdirectory(mvg_editor)
########################################################################
# Vitelotte Examples common #
########################################################################
project(VitelotteExamplesCommon)
set(vitelotte_examples_SHADERS
shaders/vert_points.glsl
shaders/geom_points.glsl
shaders/frag_points.glsl
shaders/vert_lines.glsl
shaders/geom_lines.glsl
shaders/frag_lines.glsl
)
add_custom_command(
OUTPUT ${PROJECT_SOURCE_DIR}/shaders.cpp
COMMAND python3 ${PROJECT_SOURCE_DIR}/../../../bin/shader2cpp -o ${PROJECT_SOURCE_DIR}/shaders.cpp -e -l ${vitelotte_examples_SHADERS}
DEPENDS ${vitelotte_examples_SHADERS}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
VERBATIM
)
set(vitelotte_examples_common_SRCS
bezierCurve.cpp
glLineRenderer.cpp
glPointRenderer.cpp
orthographicCamera.cpp
shaders.cpp
textFormatter.cpp
trackball.cpp
vgMeshWithCurves.cpp
vgMeshWithCurvesReader.cpp
vgMeshWithCurvesWriter.cpp
vgNodeRenderer.cpp
)
add_library(vitelotte_examples_common
${vitelotte_examples_common_SRCS}
)
add_dependencies(examples vitelotte_examples_common)
add_dependencies(vitelotte_examples_common vitelottes_vg_mesh_renderer_shaders)
......@@ -4,12 +4,12 @@
file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
// Generated by shader2cpp.
// 2015-05-04T13:44:58.265314
// 2015-05-04T14:37:26.299168
extern const char* frag_lines_glsl;
const char* frag_lines_glsl =
extern const char* vert_points_glsl;
const char* vert_points_glsl =
"/*\n"
" This Source Code Form is subject to the terms of the Mozilla Public\n"
" License, v. 2.0. If a copy of the MPL was not distributed with this\n"
......@@ -18,33 +18,78 @@ const char* frag_lines_glsl =
"\n"
"#version 410 core\n"
"\n"
"flat in vec4 color[2];\n"
"in vec2 texCoord;\n"
"flat in vec3 line;\n"
"uniform mat4 viewMatrix;\n"
"\n"
"out vec4 out_color;\n"
"in vec4 vx_position;\n"
"in vec4 vx_color;\n"
"\n"
"out vec4 point_color;\n"
"out float point_radius;\n"
"\n"
"void main(void)\n"
"{\n"
" float r0 = line[0];\n"
" float r1 = line[1];\n"
" float len = line[2];\n"
" float alpha;\n"
" if(texCoord.x < 0.)\n"
" alpha = r0 - length(texCoord);\n"
" else if(texCoord.x > len)\n"
" alpha = r1 - length(texCoord - vec2(len, 0.));\n"
" else\n"
" alpha = mix(r0, r1, texCoord.x / len) - abs(texCoord.y);\n"
" gl_Position = viewMatrix * vec4(vx_position.xyz, 1.);\n"
"\n"
" if(alpha <= 0.)\n"
" discard;\n"
" alpha = clamp(alpha, 0., 1.);\n"
" vec4 c = mix(color[0], color[1], texCoord.x / len);\n"
" out_color = mix(vec4(c.rgb, 0.), c, alpha);\n"
" //out_color = c;\n"
" //out_color = vec4(vec3(fract((texCoord.x)/r0)), 1.);\n"
" //out_color = vec4(texCoord, 0., 1.);\n"
" point_color = vx_color;\n"
" point_radius = vx_position.w;\n"
"}\n"
"";
extern const char* geom_points_glsl;
const char* geom_points_glsl =
"/*\n"
" This Source Code Form is subject to the terms of the Mozilla Public\n"
" License, v. 2.0. If a copy of the MPL was not distributed with this\n"
" file, You can obtain one at http://mozilla.org/MPL/2.0/.\n"
"*/\n"
"\n"
"#version 410 core\n"
"\n"
"layout(points) in;\n"
"layout(triangle_strip, max_vertices = 4) out;\n"
"\n"
"uniform vec2 viewportSize;\n"
"\n"
"in vec4 point_color[];\n"
"in float point_radius[];\n"
"\n"
"flat out vec4 color;\n"
"out vec2 texCoord;\n"
"flat out float radius;\n"
"\n"
"void main()\n"
"{\n"
" vec2 sp = gl_in[0].gl_Position.xy / gl_in[0].gl_Position.w;\n"
"\n"
" float pixelRadius = point_radius[0] + .5001;\n"
" vec2 r = pixelRadius * 2. / viewportSize;\n"
"\n"
" color = point_color[0];\n"
" radius = pixelRadius;\n"
"\n"
" gl_Position = vec4(\n"
" gl_in[0].gl_Position.xy + vec2(-r.x, r.y) * gl_in[0].gl_Position.w,\n"
" gl_in[0].gl_Position.zw);\n"
" texCoord = vec2(-pixelRadius, pixelRadius);\n"
" EmitVertex();\n"
"\n"
" gl_Position = vec4(\n"
" gl_in[0].gl_Position.xy + vec2(-r.x, -r.y) * gl_in[0].gl_Position.w,\n"
" gl_in[0].gl_Position.zw);\n"
" texCoord = vec2(-pixelRadius, -pixelRadius);\n"
" EmitVertex();\n"
"\n"
" gl_Position = vec4(\n"
" gl_in[0].gl_Position.xy + vec2( r.x, r.y) * gl_in[0].gl_Position.w,\n"
" gl_in[0].gl_Position.zw);\n"
" texCoord = vec2( pixelRadius, pixelRadius);\n"
" EmitVertex();\n"
"\n"
" gl_Position = vec4(\n"
" gl_in[0].gl_Position.xy + vec2( r.x, -r.y) * gl_in[0].gl_Position.w,\n"
" gl_in[0].gl_Position.zw);\n"
" texCoord = vec2( pixelRadius, -pixelRadius);\n"
" EmitVertex();\n"
"}\n"
"";
......@@ -75,6 +120,33 @@ const char* frag_points_glsl =
"}\n"
"";
extern const char* vert_lines_glsl;
const char* vert_lines_glsl =
"/*\n"
" This Source Code Form is subject to the terms of the Mozilla Public\n"
" License, v. 2.0. If a copy of the MPL was not distributed with this\n"
" file, You can obtain one at http://mozilla.org/MPL/2.0/.\n"
"*/\n"
"\n"
"#version 410 core\n"
"\n"
"uniform mat4 viewMatrix;\n"
"\n"
"in vec4 vx_position;\n"
"in vec4 vx_color;\n"
"\n"
"out vec4 line_position;\n"
"out vec4 line_color;\n"
"\n"
"void main(void)\n"
"{\n"
" gl_Position = viewMatrix * vec4(vx_position.xyz, 1.);\n"
"\n"
" line_position = vx_position;\n"
" line_color = vx_color;\n"
"}\n"
"";
extern const char* geom_lines_glsl;
const char* geom_lines_glsl =
"/*\n"
......@@ -139,93 +211,8 @@ const char* geom_lines_glsl =
"}\n"
"";
extern const char* geom_points_glsl;
const char* geom_points_glsl =
"/*\n"
" This Source Code Form is subject to the terms of the Mozilla Public\n"
" License, v. 2.0. If a copy of the MPL was not distributed with this\n"
" file, You can obtain one at http://mozilla.org/MPL/2.0/.\n"
"*/\n"
"\n"
"#version 410 core\n"
"\n"
"layout(points) in;\n"
"layout(triangle_strip, max_vertices = 4) out;\n"
"\n"
"uniform vec2 viewportSize;\n"
"\n"
"in vec4 point_color[];\n"
"in float point_radius[];\n"
"\n"
"flat out vec4 color;\n"
"out vec2 texCoord;\n"
"flat out float radius;\n"
"\n"
"void main()\n"
"{\n"
" vec2 sp = gl_in[0].gl_Position.xy / gl_in[0].gl_Position.w;\n"
"\n"
" float pixelRadius = point_radius[0] + .5001;\n"
" vec2 r = pixelRadius * 2. / viewportSize;\n"
"\n"
" color = point_color[0];\n"
" radius = pixelRadius;\n"
"\n"
" gl_Position = vec4(\n"
" gl_in[0].gl_Position.xy + vec2(-r.x, r.y) * gl_in[0].gl_Position.w,\n"
" gl_in[0].gl_Position.zw);\n"
" texCoord = vec2(-pixelRadius, pixelRadius);\n"
" EmitVertex();\n"
"\n"
" gl_Position = vec4(\n"
" gl_in[0].gl_Position.xy + vec2(-r.x, -r.y) * gl_in[0].gl_Position.w,\n"
" gl_in[0].gl_Position.zw);\n"
" texCoord = vec2(-pixelRadius, -pixelRadius);\n"
" EmitVertex();\n"
"\n"
" gl_Position = vec4(\n"
" gl_in[0].gl_Position.xy + vec2( r.x, r.y) * gl_in[0].gl_Position.w,\n"
" gl_in[0].gl_Position.zw);\n"
" texCoord = vec2( pixelRadius, pixelRadius);\n"
" EmitVertex();\n"
"\n"
" gl_Position = vec4(\n"
" gl_in[0].gl_Position.xy + vec2( r.x, -r.y) * gl_in[0].gl_Position.w,\n"
" gl_in[0].gl_Position.zw);\n"
" texCoord = vec2( pixelRadius, -pixelRadius);\n"
" EmitVertex();\n"
"}\n"
"";
extern const char* vert_lines_glsl;
const char* vert_lines_glsl =
"/*\n"
" This Source Code Form is subject to the terms of the Mozilla Public\n"
" License, v. 2.0. If a copy of the MPL was not distributed with this\n"
" file, You can obtain one at http://mozilla.org/MPL/2.0/.\n"
"*/\n"
"\n"
"#version 410 core\n"
"\n"
"uniform mat4 viewMatrix;\n"
"\n"
"in vec4 vx_position;\n"
"in vec4 vx_color;\n"
"\n"
"out vec4 line_position;\n"
"out vec4 line_color;\n"
"\n"
"void main(void)\n"
"{\n"
" gl_Position = viewMatrix * vec4(vx_position.xyz, 1.);\n"
"\n"
" line_position = vx_position;\n"
" line_color = vx_color;\n"
"}\n"
"";
extern const char* vert_points_glsl;
const char* vert_points_glsl =
extern const char* frag_lines_glsl;
const char* frag_lines_glsl =
"/*\n"
" This Source Code Form is subject to the terms of the Mozilla Public\n"
" License, v. 2.0. If a copy of the MPL was not distributed with this\n"
......@@ -234,20 +221,33 @@ const char* vert_points_glsl =
"\n"
"#version 410 core\n"
"\n"
"uniform mat4 viewMatrix;\n"
"\n"
"in vec4 vx_position;\n"
"in vec4 vx_color;\n"
"flat in vec4 color[2];\n"
"in vec2 texCoord;\n"
"flat in vec3 line;\n"
"\n"
"out vec4 point_color;\n"
"out float point_radius;\n"
"out vec4 out_color;\n"
"\n"
"void main(void)\n"
"{\n"
" gl_Position = viewMatrix * vec4(vx_position.xyz, 1.);\n"
" float r0 = line[0];\n"
" float r1 = line[1];\n"
" float len = line[2];\n"
" float alpha;\n"
" if(texCoord.x < 0.)\n"
" alpha = r0 - length(texCoord);\n"
" else if(texCoord.x > len)\n"
" alpha = r1 - length(texCoord - vec2(len, 0.));\n"
" else\n"
" alpha = mix(r0, r1, texCoord.x / len) - abs(texCoord.y);\n"
"\n"
" point_color = vx_color;\n"
" point_radius = vx_position.w;\n"
" if(alpha <= 0.)\n"
" discard;\n"
" alpha = clamp(alpha, 0., 1.);\n"
" vec4 c = mix(color[0], color[1], texCoord.x / len);\n"
" out_color = mix(vec4(c.rgb, 0.), c, alpha);\n"
" //out_color = c;\n"
" //out_color = vec4(vec3(fract((texCoord.x)/r0)), 1.);\n"
" //out_color = vec4(texCoord, 0., 1.);\n"
"}\n"
"";
......
......@@ -25,27 +25,11 @@ include_directories(
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(mvg_editor_SHADERS
shaders/vert_points.glsl
shaders/geom_points.glsl
shaders/frag_points.glsl
shaders/vert_lines.glsl
shaders/geom_lines.glsl
shaders/frag_lines.glsl
)
qt5_add_resources(mvg_editor_RES
editor.qrc
)
set(mvg_editor_SRCS
../common/orthographicCamera.cpp
../common/glPointRenderer.cpp
../common/glLineRenderer.cpp
../common/vgMeshWithCurves.cpp
../common/vgMeshWithCurvesReader.cpp
../common/vgNodeRenderer.cpp
../common/shaders.cpp
document.cpp
valueEditor.cpp
editor.cpp
......@@ -54,22 +38,14 @@ set(mvg_editor_SRCS
main.cpp
)
add_custom_command(
OUTPUT ${PROJECT_SOURCE_DIR}/shaders.cpp
COMMAND python3 ${PROJECT_SOURCE_DIR}/../../../bin/shader2cpp -o shaders.cpp -e ${mvg_editor_SHADERS}
DEPENDS ${mvg_editor_SHADERS}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
VERBATIM
)
#set_source_files_properties(glLineRenderer.cpp
# OBJECT_DEPENDS ${PROJECT_SOURCE_DIR}/shaders.hpp)
add_executable(mvg_editor
${mvg_editor_SRCS}
)
add_dependencies(examples mvg_editor)
add_dependencies(mvg_editor vitelottes_vg_mesh_renderer_shaders)
target_link_libraries(mvg_editor
vitelotte_examples_common
Qt5::Widgets
Qt5::OpenGL
${OPENGL_LIBRARIES}
......
......@@ -23,17 +23,14 @@ include_directories(
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(mvg_viewer_SRCS
../common/trackball.cpp
../common/shaders.cpp
../common/glPointRenderer.cpp
../common/glLineRenderer.cpp
../common/vgNodeRenderer.cpp
mvgViewer.cpp
)
add_executable(mvg_viewer ${mvg_viewer_SRCS})
add_dependencies(examples mvg_viewer)
add_dependencies(mvg_viewer vitelottes_vg_mesh_renderer_shaders)
target_link_libraries(mvg_viewer
vitelotte_examples_common
${GLFW3_LIBRARIES}
${GLEW_LIBRARIES}
)
......@@ -19,10 +19,6 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(vitelotte_mvgtk_SRCS
solveCommand.cpp
../common/textFormatter.cpp
../common/vgMeshWithCurves.cpp
../common/vgMeshWithCurvesReader.cpp
../common/vgMeshWithCurvesWriter.cpp
mvgtk.cpp
checkCommand.cpp
compactCommand.cpp
......@@ -35,3 +31,7 @@ set(vitelotte_mvgtk_SRCS
)
add_executable(mvgtk ${vitelotte_mvgtk_SRCS})
add_dependencies(examples mvgtk)
target_link_libraries(mvgtk
vitelotte_examples_common
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment