2022-05-11 23:48:56 +00:00
|
|
|
|
|
|
|
set( GAL_SRCS
|
|
|
|
# Common part
|
2022-05-13 02:50:33 +00:00
|
|
|
../callback_gal.cpp
|
2022-05-11 23:48:56 +00:00
|
|
|
../draw_panel_gal.cpp
|
|
|
|
../gl_context_mgr.cpp
|
|
|
|
../newstroke_font.cpp
|
|
|
|
../painter.cpp
|
|
|
|
color4d.cpp
|
|
|
|
cursors.cpp
|
|
|
|
dpi_scaling.cpp
|
|
|
|
gal_display_options.cpp
|
|
|
|
graphics_abstraction_layer.cpp
|
|
|
|
hidpi_gl_canvas.cpp
|
|
|
|
|
|
|
|
../view/view_controls.cpp
|
|
|
|
../view/view_overlay.cpp
|
|
|
|
../view/wx_view_controls.cpp
|
|
|
|
../view/zoom_controller.cpp
|
|
|
|
|
|
|
|
# OpenGL GAL
|
|
|
|
opengl/opengl_gal.cpp
|
|
|
|
opengl/gl_resources.cpp
|
2022-05-13 03:37:29 +00:00
|
|
|
|
2022-05-11 23:48:56 +00:00
|
|
|
opengl/shader.cpp
|
|
|
|
opengl/vertex_item.cpp
|
|
|
|
opengl/vertex_container.cpp
|
|
|
|
opengl/cached_container.cpp
|
|
|
|
opengl/cached_container_gpu.cpp
|
|
|
|
opengl/cached_container_ram.cpp
|
|
|
|
opengl/noncached_container.cpp
|
|
|
|
opengl/vertex_manager.cpp
|
|
|
|
opengl/gpu_manager.cpp
|
|
|
|
opengl/antialiasing.cpp
|
|
|
|
opengl/opengl_compositor.cpp
|
|
|
|
opengl/utils.cpp
|
|
|
|
|
|
|
|
# Cairo GAL
|
|
|
|
cairo/cairo_gal.cpp
|
|
|
|
cairo/cairo_compositor.cpp
|
|
|
|
cairo/cairo_print.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
add_library( gal STATIC ${GAL_SRCS} )
|
|
|
|
|
|
|
|
target_link_libraries( gal
|
|
|
|
common # This is needed until the circular dependency is removed
|
|
|
|
kimath
|
|
|
|
nlohmann_json
|
|
|
|
${GLEW_LIBRARIES}
|
|
|
|
${CAIRO_LIBRARIES}
|
|
|
|
${PIXMAN_LIBRARIES}
|
|
|
|
${OPENGL_LIBRARIES}
|
|
|
|
${GDI_PLUS_LIBRARIES}
|
2022-05-13 02:50:33 +00:00
|
|
|
# outline font support
|
|
|
|
${FREETYPE_LIBRARIES}
|
|
|
|
${HarfBuzz_LIBRARIES}
|
|
|
|
${Fontconfig_LIBRARIES}
|
2022-05-11 23:48:56 +00:00
|
|
|
)
|
2022-05-13 02:50:33 +00:00
|
|
|
function( add_shader outTarget inFile shaderName )
|
|
|
|
set(outCppName "${shaderName}.cpp")
|
|
|
|
set(outHeaderName "${shaderName}.h")
|
2022-05-11 23:48:56 +00:00
|
|
|
|
2022-05-13 02:50:33 +00:00
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${outCppName}
|
|
|
|
${CMAKE_BINARY_DIR}/include/gal/shaders/${outHeaderName}
|
|
|
|
COMMAND ${CMAKE_COMMAND}
|
2022-05-14 15:39:14 +00:00
|
|
|
-DSOURCE_FILE="${CMAKE_CURRENT_SOURCE_DIR}/shaders/${inFile}"
|
|
|
|
-DOUT_CPP_DIR="${CMAKE_CURRENT_BINARY_DIR}/"
|
|
|
|
-DOUT_HEADER_DIR="${CMAKE_BINARY_DIR}/include/gal/shaders/"
|
|
|
|
-DOUT_CPP_FILENAME="${outCppName}"
|
|
|
|
-DOUT_HEADER_FILENAME="${outHeaderName}"
|
|
|
|
-DOUT_VAR_NAME="${shaderName}"
|
2022-05-13 02:50:33 +00:00
|
|
|
-P ${CMAKE_MODULE_PATH}/BuildSteps/CreateShaderCpp.cmake
|
|
|
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/shaders/${inFile}
|
|
|
|
${CMAKE_MODULE_PATH}/BuildSteps/CreateShaderCpp.cmake
|
|
|
|
)
|
|
|
|
|
|
|
|
target_sources( ${outTarget} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/${outCppName} )
|
|
|
|
target_include_directories( ${outTarget} PUBLIC ${CMAKE_BINARY_DIR}/include/gal/shaders/ )
|
|
|
|
endfunction()
|
|
|
|
|
|
|
|
add_shader( gal kicad_frag.glsl glsl_kicad_frag )
|
2022-05-13 03:37:29 +00:00
|
|
|
add_shader( gal kicad_vert.glsl glsl_kicad_vert )
|
|
|
|
add_shader( gal smaa_base.glsl glsl_smaa_base )
|
|
|
|
add_shader( gal smaa_pass_1_frag_color.glsl glsl_smaa_pass_1_frag_color )
|
|
|
|
add_shader( gal smaa_pass_1_frag_luma.glsl glsl_smaa_pass_1_frag_luma )
|
|
|
|
add_shader( gal smaa_pass_1_vert.glsl glsl_smaa_pass_1_vert )
|
|
|
|
add_shader( gal smaa_pass_2_frag.glsl glsl_smaa_pass_2_frag )
|
|
|
|
add_shader( gal smaa_pass_2_vert.glsl glsl_smaa_pass_2_vert )
|
|
|
|
add_shader( gal smaa_pass_3_frag.glsl glsl_smaa_pass_3_frag )
|
|
|
|
add_shader( gal smaa_pass_3_vert.glsl glsl_smaa_pass_3_vert )
|