https://github.com/dinau/nimgl_test
Nimgl: Dear ImGui (CImGui) demo program test for Japanese fonts
https://github.com/dinau/nimgl_test
cimgui font glfw gui imgui implot nim nimgl opengl ui
Last synced: about 1 month ago
JSON representation
Nimgl: Dear ImGui (CImGui) demo program test for Japanese fonts
- Host: GitHub
- URL: https://github.com/dinau/nimgl_test
- Owner: dinau
- License: mit
- Created: 2023-02-25T08:13:56.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-09-06T00:58:05.000Z (9 months ago)
- Last Synced: 2025-09-06T01:19:15.925Z (9 months ago)
- Topics: cimgui, font, glfw, gui, imgui, implot, nim, nimgl, opengl, ui
- Language: Nim
- Homepage:
- Size: 854 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
- [Nimgl / ImGui demo program](#nimgl--imgui-demo-program)
- [Prerequisite](#prerequisite)
- [Install dependencies](#install-dependencies)
- [Examples](#examples)
- [rlimgui_basic (Naylib(Raylib) + rlImGui)](#rlimgui_basic-naylibraylib--rlimgui)
- [glfw_opengl3](#glfw_opengl3)
- [glfw_opengl3_image_load](#glfw_opengl3_image_load)
- [glfw_opengl3_implot](#glfw_opengl3_implot)
- [imDrawListParty](#imdrawlistparty)
- [implot_jp](#implot_jp)
- [jpFont](#jpfont)
- [IME for Japanese / 日本語入力(IME)について](#ime-for-japanese--%E6%97%A5%E6%9C%AC%E8%AA%9E%E5%85%A5%E5%8A%9Bime%E3%81%AB%E3%81%A4%E3%81%84%E3%81%A6)
- [Referrence](#referrence)
- [My tools version](#my-tools-version)
- [Other ImGui / CImGui project](#other-imgui--cimgui-project)
- [SDL game tutorial Platfromer](#sdl-game-tutorial-platfromer)
### Nimgl / ImGui demo program
**Note**: Using [Dear ImGui](https://github.com/ocornut/imgui) v1.91.9bdock (2025/10) with [nimgl/imgui](https://github.com/nimgl/imgui)
#### Prerequisite
---
- nim-2.2.4 or later
- OS: Windows11 or later
- Download
```sh
$ git clone https://github.com/dinau/nimgl_test
$ cd nimgl_test
```
- For Linux Debian13 or later
```sh
$ sudo apt install libopengl-dev libgl1-mesa-dev libglfw3-dev
$ sudo apt install libxcursor-dev libx11-dev libxext-dev libxinerama-dev libxi-dev
```
#### Install dependencies
---
```sh
$ pwd
nimgl_test
$ nimble build
```
#### Examples
---
##### rlimgui_basic (Naylib(Raylib) + rlImGui)
---
[rlimgui_basic.nim](examples/rlimgui_basic/rlimgui_basic.nim)
```sh
$ pwd
nimgl_test
$ cd examples/rlimgui_basic
$ make run
```

##### glfw_opengl3
---
[glfw_opengl3.nim](examples/glfw_opengl3/glfw_opengl3.nim)
```sh
$ pwd
nimgl_test
$ cd examples/glfw_opengl3
$ make run
```

##### glfw_opengl3_image_load
---
[glfw_opengl3_image_load.nim](examples/glfw_opengl3_image_load/glfw_opengl3_image_load.nim)
```sh
$ pwd
nimgl_test
$ cd examples/glfw_opengl3_image_load
$ make run
```

##### glfw_opengl3_implot
---
[glfw_opengl3_implot.nim](examples/glfw_opengl3_implot/glfw_opengl3_implot.nim)
```sh
$ pwd
nimgl_test
$ cd examples/glfw_opengl3_implot
$ make run
```

##### imDrawListParty
---
[imDrawListParty.nim](examples/imDrawListParty/imDrawListParty.nim)
```sh
$ pwd
nimgl_test
cd examples/imDrawListParty
$ make run
```
[ImDrawList coding party - deadline Nov 30, 2020! #3606](https://github.com/ocornut/imgui/issues/3606)
This demo has been converted to Nim lang from two programs,
[Curve](https://github.com/ocornut/imgui/issues/3606#issuecomment-730648517)

and [Real-time visualization of the interweb blogosphere](https://github.com/ocornut/imgui/issues/3606#issuecomment-730704909).


##### implot_jp
---
[implot_jp.nim](examples/implot_jp/implot_jp.nim)
ImPlot demo with Japanese fonts
```sh
$ pwd
nimgl_test
$ cd examples/implot_jp
$ make run
```

##### jpFont
---
[jpFont.nim](examples/jpFont/jpFont.nim)
```sh
$ pwd
nimgl_test
$ cd examples/jpfont
$ make run
```

- Download: Windows10 sample exe file
[nimgl-test-jp-font-imgui-v1.84.2-ime-ok-2023-07.exe.7z](https://bitbucket.org/dinau/storage/downloads/nimgl-test-jp-font-imgui-v1.84.2-ime-ok-2023-07.exe.7z)
#### IME for Japanese / 日本語入力(IME)について
---
以下のNim言語コンパイル / リンク時オプションを加えることで日本語入力を可能としている
オプションはバックエンドのC/C++コンパイラにのみ渡される
```sh
--passc:"-DIMGUI_ENABLE_WIN32_DEFAULT_IME_FUNCTIONS"
--passL:"-limm32"
```
同じことをconfig.nims内に記述する場合は以下となる
```nim
switch "passC","-DIMGUI_ENABLE_WIN32_DEFAULT_IME_FUNCTIONS"
switch "passL","-limm32"
```
#### Referrence
---
[Dear ImGuiで日本語入力時のIMEの位置をいい感じにする](https://qiita.com/babiron_i/items/759d80965b497384bc0e)
[Viewport, Platform: Fixed IME positioning for multi-viewport. Moved API from...](http://dalab.se.sjtu.edu.cn/gitlab/xiaoyuwei/imgui/-/commit/cb78e62df93732b64afcc9d4cd02e378730b32af)
[ImGui で日本語と記号♥と絵文字😺の表示](https://zenn.dev/tenka/articles/display_japanese_symbols_and_emoji_with_imgui)
#### My tools version
---
- Windows
- Nim Compiler Version 2.2.4
- gcc.exe 15.2.0
- git version 2.46.0.windows.1
- make: GNU Make 4.4.1
#### Other ImGui / CImGui project
---
| Language | | Project |
| -------------------: | :---: | :----------------------------------------------------------------: |
| **Lua** | Script | [LuaJITImGui](https://github.com/dinau/luajitImGui) |
| **NeLua** | Compiler | [NeLuaImGui](https://github.com/dinau/neluaImGui), [NeLuaImGui2](https://github.com/dinau/neluaImGui2) |
| **Nim** | Compiler | [ImGuin](https://github.com/dinau/imguin), [Nimgl_test](https://github.com/dinau/nimgl_test), [Nim_implot](https://github.com/dinau/nim_implot) |
| **Python** | Script | [DearPyGui for 32bit WindowsOS Binary](https://github.com/dinau/DearPyGui32/tree/win32) |
| **Ruby** | Script | [igRuby_Examples](https://github.com/dinau/igruby_examples) |
| **Zig**, C lang. | Compiler | [Dear_Bindings_Build](https://github.com/dinau/dear_bindings_build) |
| **Zig** | Compiler | [ImGuinZ](https://github.com/dinau/imguinz) |
#### SDL game tutorial Platfromer
---

| Language | | SDL | Project |
| -------------------: | :---: | :---: | :----------------------------------------------------------------: |
| **LuaJIT** | Script | SDL2 | [LuaJIT-Platformer](https://github.com/dinau/luajit-platformer)
| **Nelua** | Compiler | SDL2 | [NeLua-Platformer](https://github.com/dinau/nelua-platformer)
| **Nim** | Compiler | SDL3 / SDL2 | [Nim-Platformer-sdl2](https://github.com/def-/nim-platformer)/ [Nim-Platformer-sdl3](https://github.com/dinau/sdl3_nim/tree/main/examples/platformer) |
| **Ruby** | Script | SDL3 | [Ruby-Platformer](https://github.com/dinau/ruby-platformer) |
| **Zig** | Compiler | SDL3 / SDL2 | [Zig-Platformer](https://github.com/dinau/zig-platformer) |