imgui
下载地址:https://github.com/ocornut/imgui
- 新建CMakeLists.txt,编辑如下,可以生成imgui.lib
cmake_minimum_required(VERSION 3.0)
project(imgui)
aux_source_directory(. code)
list(REMOVE_ITEM code ./imgui_demo.cpp) #排除imgui_demo文件,生成examples中的示例时需要添加该文件
add_library(imgui STATIC ${code})
- 直接添加imgui的源码到项目中编译
结构
imgui绘制使用
- vertexbuffer,点缓冲区,查看ImDrawList结构
- indexbuffer,索引缓冲区,构成图像和3d模型点索引,和索引值对应vertexbuffer中得顺序
- texture,字体在imgui中也是texture贴图,参考imgui_draw中得RenderText函数
imgui数据结构
- ImGuiContext,绘图上下文dc</