长沙 外贸网站建设公司排名,传统文化传播公司网站建设,微信支付网站开发,网站搬家去这个链接下载imgui源码#xff08;在此之前需要安装opengl glfw3等等#xff09;#xff1a;
sudo apt-get install libglfw3-dev
https://github.com/ocornut/imgui 我这里源码下载到/home/temp/imgui目录下#xff0c;咱们不需要编译源码成库#xff0c;而是直接将下… 去这个链接下载imgui源码在此之前需要安装opengl glfw3等等
sudo apt-get install libglfw3-dev
https://github.com/ocornut/imgui 我这里源码下载到/home/temp/imgui目录下咱们不需要编译源码成库而是直接将下图三个位置中一些源码文件copy到项目中去直接调用就行。如下图 这里上述标识的1、2、3进行简单解释
1、imGui底层渲染方法将以下文件拷出备用
1 imgui_impl_glfw.cpp
2 imgui_impl_opengl3.cpp
3 imgui_impl_glfw.h
4 imgui_impl_opengl3.h
2、将路径/imgui/examples/libs/gl3w拷贝出来
将/imgui/examples/example_glfw_opengl3/main.cpp例程拷贝出来
3、将上图3标识文件拷贝出来 最后将上面三个步骤拷贝好的文件、demo用clion创建工程、打开文件结构如下图 编写CMakeLists.txt如下
cmake_minimum_required(VERSION 3.10)
project(offical_demo1)set(CMAKE_CXX_STANDARD 17)include_directories(gl3w)
include_directories(imgui)add_executable(offical_demo1gl3w/GL/gl3w.cimgui/imgui.cppimgui/imgui_demo.cppimgui/imgui_draw.cppimgui/imgui_impl_glfw.cppimgui/imgui_impl_opengl3.cppimgui/imgui_tables.cppimgui/imgui_widgets.cppmain.cpp)target_link_libraries(${PROJECT_NAME} GL GLU glfw3 X11 Xxf86vm Xrandr pthread Xi dl Xinerama Xcursor) Note上述CMakeList.txt文件中有两行是红色的是新增的如果不增加cmake的时候会有一对诸如xxxx未定以引用。 效果图 reference
[1]、https://blog.csdn.net/weixin_43007275/article/details/81814705
[2]、https://blog.csdn.net/Azure10dai/article/details/80458802