Dear ImGUI 使用指南

Stella981
• 阅读 668

文档

  1. Dear IMGui

  2. 知乎

组件

 1) Com 如何设置动态字符串?

//char*pTest = "aaaa\0bbbb\0cccc\0dddd\0eeee\0\0";  用0 隔开所有的字符串。

const int iLength = 1024;
        char szTemp[iLength] = {0};
        //SafeMBSprintf(szTemp,iLength,"%s",pMainUserContainer->GetUser()->GetName().c_str());
        int iIndex = 0;
        int iLefeTempBuffSize = iLength;
        char *pTemPointer = szTemp;
        auto iSize = vecOppentName.size();
        for (int i = 0 ; i < iSize; i++)
        {
            pTemPointer = szTemp + iIndex;
            auto iSize = vecOppentName[i].size();
            SafeMemcpy(pTemPointer,iLefeTempBuffSize,vecOppentName[i].c_str(),iSize);
            iIndex += iSize;
            szTemp[iIndex] = 0;
            //This space is set to 0 for spilt
            iIndex ++;
            iLefeTempBuffSize = iLength - iIndex;

        }
        pTemPointer[iIndex++] = 0;
        pTemPointer[iIndex] = 0

ImGui::Combo(szPosition, &iShowGuardSelectIndex[j], szTemp);

字体

  1. 设置默认字体

                 ImGui::CreateContext();
    
                     ImGuiIO& io = ImGui::GetIO();
                     io.Fonts->AddFontDefault();
                     ImFont* font = io.Fonts->AddFontFromFileTTF("font\\FounderCN.ttf", 18.0f, NULL, io.Fonts->GetGlyphRangesChineseFull());
                     IM_ASSERT(font != NULL);
                     ImGui::GetIO().FontDefault = font;
                     ImGui_ImplDX11_Init(device,context);
                     ImGui_ImplWin32_Init(window->WndHandle());
                     ImGui_ImplDX11_CreateDeviceObjects()
    

2)输入中文必须采用utf8

点赞
收藏
评论区
推荐文章
Easter79 Easter79
3年前
sumk
更新的文档参见github(https://www.oschina.net/action/GoToLink?urlhttps%3A%2F%2Fgithub.com%2Fyoutongluan%2Fsumkserverdemo)中的《sumkdata介绍.docx(https://www.oschina.net/action/GoToLink
Easter79 Easter79
3年前
Vue 轻量级后台管理系统基础模板
项目地址(https://www.oschina.net/action/GoToLink?urlhttps%3A%2F%2Fgithub.com%2Fwoai3c%2Fvueadmintemplate)在线预览(https://www.oschina.net/action/GoToLink?urlhttps%3A%2F%2
Stella981 Stella981
3年前
PHP 使用 Redis
PHPRedis项目地址(https://www.oschina.net/action/GoToLink?urlhttps%3A%2F%2Fgithub.com%2Fphpredis%2Fphpredis)安装步骤参考链接(https://www.oschina.net/action/GoToLink?urlhttps%3A%2F%2Fg
Stella981 Stella981
3年前
Jenkins+Ansible+Gitlab自动化部署三剑客
JenkinsAnsibleGitlab自动化部署三剑客小中大showerlee2016031113:00Ansible(https://www.oschina.net/action/GoToLink?urlhttp%3A%2F%2Fwww.
Stella981 Stella981
3年前
Golang注册Eureka的工具包goeureka发布
1.简介提供Go微服务客户端注册到Eureka中心。点击:github地址(https://www.oschina.net/action/GoToLink?urlhttps%3A%2F%2Fgithub.com%2FSimonWang00%2Fgoeureka),欢迎各位多多star!(已通过测试验证,用于正式生产部署)2.原理
Stella981 Stella981
3年前
JVM源码分析之Attach机制实现完全解读
本文来自:PerfMa技术社区(https://www.oschina.net/action/GoToLink?urlhttps%3A%2F%2Fclub.perfma.com)PerfMa(笨马网络)官网(https://www.oschina.net/action/GoToLink?urlhttps%3A%2F%2Fwww.
Stella981 Stella981
3年前
JVM 源码分析之一个 Java 进程究竟能创建多少线程
本文来自:PerfMa技术社区(https://www.oschina.net/action/GoToLink?urlhttps%3A%2F%2Fclub.perfma.com)PerfMa(笨马网络)官网(https://www.oschina.net/action/GoToLink?urlhttps%3A%2F%2Fwww.
Wesley13 Wesley13
3年前
JDK8在泛型类型推导上的变化
本文来自:PerfMa技术社区(https://www.oschina.net/action/GoToLink?urlhttps%3A%2F%2Fclub.perfma.com)PerfMa(笨马网络)官网(https://www.oschina.net/action/GoToLink?urlhttps%3A%2F%2Fwww.
Wesley13 Wesley13
3年前
2016 年崛起的 JS 项目
本文首发知乎专栏(https://www.oschina.net/action/GoToLink?urlhttps%3A%2F%2Fzhuanlan.zhihu.com%2Fp%2F25709238),是我对中文版risingstars2016(https://www.oschina.net/action/GoToLink?urlhttp%
Stella981 Stella981
3年前
Hotspot GC研发工程师也许漏掉了一块逻辑
本文来自:PerfMa技术社区(https://www.oschina.net/action/GoToLink?urlhttps%3A%2F%2Fclub.perfma.com)PerfMa(笨马网络)官网(https://www.oschina.net/action/GoToLink?urlhttps%3A%2F%2Fwww.