Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dinau/dear_bindings_build

ImGui: Simple dear_bindings build project
https://github.com/dinau/dear_bindings_build

c-language cimgui clang gcc glfw gui imgui makefile mingw msys2 opengl sdl sdl2 sdl3 windows windowsos zig

Last synced: 24 days ago
JSON representation

ImGui: Simple dear_bindings build project

Awesome Lists containing this project

README

        

- [Dear_Bindings_Build](#dear_bindings_build)
- [Prerequisites](#prerequisites)
- [Build and run](#build-and-run)
- [Examples screen shots](#examples-screen-shots)
- [Hiding console window](#hiding-console-window)
- [Regenarate ImGui bindings](#regenarate-imgui-bindings)
- [Build with Clang, Zig cc](#build-with-clang-zig-cc)
- [SDL](#sdl)
- [My tools version](#my-tools-version)
- [Similar project](#similar-project)

# Dear_Bindings_Build

This project aims to simply and easily build ImGui examples with **C language** and **Zig language** using [Dear_Bindings](https://github.com/dearimgui/dear_bindings) as first step.

ImGui version **1.90.8** (2024/06)

## Prerequisites

---

- Windows10 OS
- GCC (or Clang or **'Zig cc'** compiler)
- Use **Zig: 0.12.0** (zig cc: clang version 17.0.6)
- **Zig 0.13.0 ?** (Compiling is ok so far)
- Pyhton3
- MSys/MinGW basic commands (make, rm, cp ...)

## Build and run

---

1. Download this project.

```sh
git clone --recurse-submodules https://github.com/dinau/dear_bindings_build
```
1. Go to one of the examples folder,

```sh
cd dear_bindings_build/examples/glfw_opengl3
```

1. Build and Run

```sh
make run
```

## Examples screen shots

---

| Language | GLFW | SDL2 | SDL3 |
|:---------:|----------------------------------------------:|----------------------------------------------:|----------------------------------------------:|
| C lang. | [glfw_opengl3](examples/glfw_opengl3) | [sdl2_opengl3](examples/sdl2_opengl3) | [sdl3_opengl3](examples/sdl3_opengl3) |
| Zig lang. | [zig_glfw_opengl3](examples/zig_glfw_opengl3) | [zig_sdl2_opengl3](examples/zig_sdl2_opengl3) | [zig_sdl3_opengl3](examples/zig_sdl3_opengl3) |

![alt](img/glfw_opengl3.png)

---

| Language | GLFW |
|:--------:|--------------------------------------------:|
| C lang. | [glfw_opengl3_jp](examples/glfw_opengl3_jp) |

![alt](img/glfw_opengl3_jp.png)

---

| Language | GLFW |
|:---------:|--------------------------------------------------------------------:|
| C lang. | [glfw_opengl3_image_load](examples/glfw_opengl3_image_load) |
| Zig lang. | [zig_glfw_opengl3_image_load](examples/zig_glfw_opengl3_image_load) |

![alt](img/glfw_opengl3_image_load.png)

---

| Language | GLFW |
|:---------:|--------------------------------------------------------------------:|
| C lang. | [glfw_opengl3_image_save](examples/glfw_opengl3_image_save) |
| Zig lang. | [zig_glfw_opengl3_image_load](examples/zig_glfw_opengl3_image_load) |

![alt](img/glfw_opengl3_image_save.png)
Image file captured would be saved in current folder.
Image can be saved as `JPEG / PNG / BMP / TGA` file.

## Hiding console window

---

- Zig lang. examples
Open `build.zig` in each example folder and **enable** option line as follows,

```zig
... snip ...
exe.subsystem = .Windows; // Hide console window
... snip ...
```

and execute `make`.

- C lang. examples
Open `Makefile` in each example folder and **change** option as follows,

```Makefile
... snip ...
HIDE_CONSOLE_WINDOW = true
... snip ...
```

and execute `make`.

## Regenarate ImGui bindings

---

For instance,

```sh
pwd
glfw_opengl3
make cleanall
make gen
make run
```

Note: Except Zig lang. examples.

Artifacts are generated into `../libs/cimgui` folder.

## Build with Clang, Zig cc

---

For instance,

```sh
pwd
glfw_opengl3
make cleanobjs
make TC=clang # or TC=zigcc
```

Compiling with `TC=zigcc` may link dynamic library at this time.

Note: Except Zig lang. examples.

## SDL

---

- SDL3 Build-SDL3
https://github.com/mmozeiko/build-sdl3/releases
https://github.com/mmozeiko/build-sdl3
- SDL3 Build-SDL3-Win32
https://github.com/JBetz/build-sdl3-win32/releases
https://github.com/JBetz/build-sdl3-win32

## My tools version

---

- clang version 18.1.6
- gcc.exe (Rev2, Built by MSYS2 project) 13.2.0
- git version 2.41.0.windows.3
- make: GNU Make 4.3
- Python 3.12.3
- zig: 0.12.0 (zig cc: clang version 17.0.6)
- SDL2 ver.2.30.3
- SDL3 2024-06-02

## Similar project

---

| Language | Project |
| -------------------: | :----------------------------------------------------------------: |
| **Nim** | [Imguin](https://github.com/dinau/imguin), [Nimgl_test](https://github.com/dinau/nimgl_test), [Nim_implot](https://github.com/dinau/nim_implot) |
| **Lua** | [LuaJITImGui](https://github.com/dinau/luajitimgui) |
| **Python** | [DearPyGui for 32bit WindowsOS Binary](https://github.com/dinau/DearPyGui32/tree/win32) |