Added imgui example to CMakeLists.txt [skip ci]

This commit is contained in:
saschawillems 2017-04-22 11:50:13 +02:00
parent 7f1849f9bc
commit dba54b09b3
2 changed files with 15 additions and 4 deletions

View file

@ -10,6 +10,7 @@ include_directories(external)
include_directories(external/glm) include_directories(external/glm)
include_directories(external/gli) include_directories(external/gli)
include_directories(external/assimp) include_directories(external/assimp)
include_directories(external/imgui)
include_directories(base) include_directories(base)
OPTION(USE_D2D_WSI "Build the project using Direct to Display swapchain" OFF) OPTION(USE_D2D_WSI "Build the project using Direct to Display swapchain" OFF)
@ -80,11 +81,20 @@ file(GLOB SOURCE *.cpp base/*.cpp)
# Function for building single example # Function for building single example
function(buildExample EXAMPLE_NAME) function(buildExample EXAMPLE_NAME)
file(GLOB SOURCE *.cpp base/*.cpp ${EXAMPLE_NAME}/*.cpp) file(GLOB SOURCE *.cpp base/*.cpp ${EXAMPLE_NAME}/*.cpp)
if(WIN32) SET(MAIN_CPP ${EXAMPLE_NAME}/${EXAMPLE_NAME}.cpp)
add_executable(${EXAMPLE_NAME} WIN32 ${EXAMPLE_NAME}/${EXAMPLE_NAME}.cpp ${SOURCE}) if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${EXAMPLE_NAME}/main.cpp)
SET(MAIN_CPP ${EXAMPLE_NAME}/main.cpp)
ENDIF()
# imgui example requires additional source files
IF(${EXAMPLE_NAME} STREQUAL "imgui")
file(GLOB ADD_SOURCE external/imgui/*.cpp)
SET(SOURCE ${SOURCE} ${ADD_SOURCE})
ENDIF()
if(WIN32)
add_executable(${EXAMPLE_NAME} WIN32 ${MAIN_CPP} ${SOURCE})
target_link_libraries(${EXAMPLE_NAME} ${Vulkan_LIBRARY} ${ASSIMP_LIBRARIES} ${WINLIBS}) target_link_libraries(${EXAMPLE_NAME} ${Vulkan_LIBRARY} ${ASSIMP_LIBRARIES} ${WINLIBS})
else(WIN32) else(WIN32)
add_executable(${EXAMPLE_NAME} ${EXAMPLE_NAME}/${EXAMPLE_NAME}.cpp ${SOURCE}) add_executable(${EXAMPLE_NAME} ${MAIN_CPP} ${SOURCE})
target_link_libraries(${EXAMPLE_NAME} ${Vulkan_LIBRARY} ${ASSIMP_LIBRARIES} ${WAYLAND_CLIENT_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) target_link_libraries(${EXAMPLE_NAME} ${Vulkan_LIBRARY} ${ASSIMP_LIBRARIES} ${WAYLAND_CLIENT_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
endif(WIN32) endif(WIN32)
endfunction(buildExample) endfunction(buildExample)
@ -125,6 +135,7 @@ set(EXAMPLES
gears gears
geometryshader geometryshader
hdr hdr
imgui
indirectdraw indirectdraw
instancing instancing
mesh mesh

View file

@ -37,7 +37,7 @@ struct UISettings {
bool displayBackground = true; bool displayBackground = true;
bool animateLight = false; bool animateLight = false;
float lightSpeed = 0.25f; float lightSpeed = 0.25f;
std::array<float, 50> frameTimes = { 0 }; std::array<float, 50> frameTimes{};
float frameTimeMin = 9999.0f, frameTimeMax = 0.0f; float frameTimeMin = 9999.0f, frameTimeMax = 0.0f;
float lightTimer = 0.0f; float lightTimer = 0.0f;
} uiSettings; } uiSettings;