xo-imgui: + example ex4a. resize working on ubuntu (ex4 broken tho)
This commit is contained in:
parent
638707550b
commit
559ec7c8c9
19 changed files with 5076 additions and 0 deletions
|
|
@ -2,3 +2,4 @@ add_subdirectory(ex1)
|
|||
add_subdirectory(ex2)
|
||||
add_subdirectory(ex3)
|
||||
add_subdirectory(ex4)
|
||||
add_subdirectory(ex4a)
|
||||
|
|
|
|||
74
xo-imgui/example/ex4a/CMakeLists.txt
Normal file
74
xo-imgui/example/ex4a/CMakeLists.txt
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
if (XO_ENABLE_EXAMPLES)
|
||||
# imgui dependency
|
||||
|
||||
if (XO_ENABLE_VULKAN)
|
||||
|
||||
find_path(
|
||||
IMGUI_INCLUDE_DIR
|
||||
NAMES imgui/imgui.h
|
||||
DOC "path to imgui header"
|
||||
HINTS ${PROJECT_SOURCE_DIR}/include
|
||||
)
|
||||
if (IMGUI_INCLUDE_DIR)
|
||||
message(STATUS "found imgui/imgui.h in IMGUI_INCLUDE_DIR=[${IMGUI_INCLUDE_DIR}]")
|
||||
else()
|
||||
message(FATAL_ERROR "unable to find imgui.h")
|
||||
endif()
|
||||
|
||||
# target executable
|
||||
|
||||
set(SELF_EXE imgui_ex4a)
|
||||
add_executable(${SELF_EXE} imgui_ex4a.cpp
|
||||
${IMGUI_INCLUDE_DIR}/imgui/imgui.cpp
|
||||
${IMGUI_INCLUDE_DIR}/imgui/imgui_demo.cpp
|
||||
${IMGUI_INCLUDE_DIR}/imgui/imgui_draw.cpp
|
||||
${IMGUI_INCLUDE_DIR}/imgui/imgui_widgets.cpp
|
||||
${IMGUI_INCLUDE_DIR}/imgui/imgui_tables.cpp
|
||||
${IMGUI_INCLUDE_DIR}/imgui/backends/imgui_impl_sdl2.cpp
|
||||
#${IMGUI_INCLUDE_DIR}/imgui/backends/imgui_impl_opengl3.cpp
|
||||
#${IMGUI_INCLUDE_DIR}/imgui/backends/imgui_impl_glfw.cpp
|
||||
${IMGUI_INCLUDE_DIR}/imgui/backends/imgui_impl_vulkan.cpp
|
||||
)
|
||||
xo_include_options2(${SELF_EXE})
|
||||
|
||||
# OpenGL dependency
|
||||
|
||||
# have to choose between
|
||||
# libGL.so
|
||||
# or
|
||||
# libOpenGL.so + libGLX.so # GLVND = OpenGL Vendor Neutral Dispatch (e.g. mesa|nvda)
|
||||
#
|
||||
# expect in .build/CMakeCache.txt:
|
||||
# OPENGL_opengl_LIBRARY:FILEPATH=/path/to/libOpenGL.so
|
||||
# OpenGL_DIR:PATH=OpenGL_DIR-NOTFOUND # no cmake config file
|
||||
|
||||
# set(OpenGL_GL_PREFERENCE GLVND) # or LEGACY
|
||||
# find_package(OpenGL REQUIRED) # find_package(OpenGL CONFIG REQUIRE) won't work
|
||||
# target_link_libraries(${SELF_EXE} PUBLIC OpenGL::GL)
|
||||
|
||||
find_package(Vulkan REQUIRED)
|
||||
target_link_libraries(${SELF_EXE} PUBLIC Vulkan::Vulkan)
|
||||
|
||||
# GLEW dependency
|
||||
xo_external_pkgconfig_dependency(${SELF_EXE} GLEW glew)
|
||||
|
||||
# GLFW dependency
|
||||
#find_package(glfw3 CONFIG REQUIRED)
|
||||
#target_link_libraries(${SELF_EXE} PUBLIC glfw) # want -lglfw
|
||||
|
||||
# SDL2 dependency
|
||||
xo_external_pkgconfig_dependency(${SELF_EXE} SDL2 sdl2)
|
||||
|
||||
# would prefer to use just IMGUI_INCLUDE_DIR,
|
||||
# but imgui/backends/ .h files don't quote the imgui/ stem
|
||||
#
|
||||
target_include_directories(${SELF_EXE} PUBLIC ${IMGUI_INCLUDE_DIR}/imgui)
|
||||
|
||||
xo_dependency(${SELF_EXE} xo_object)
|
||||
xo_dependency(${SELF_EXE} randomgen)
|
||||
xo_dependency(${SELF_EXE} xo_flatstring)
|
||||
xo_dependency(${SELF_EXE} xo_alloc)
|
||||
|
||||
install(TARGETS ${SELF_EXE} DESTINATION ${XO_EXAMPLE_INSTALL_DIR})
|
||||
endif()
|
||||
endif()
|
||||
4985
xo-imgui/example/ex4a/imgui_ex4a.cpp
Normal file
4985
xo-imgui/example/ex4a/imgui_ex4a.cpp
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue