git.haldean.org qb / 5e77bf3
that's not my readme haldean 1 year, 1 month ago
2 changed file(s) with 129 addition(s) and 129 deletion(s). Raw diff Collapse all Expand all
+0
-129
README.md less more
0 # cimgui-sokol-starterkit
1
2 A minimal cross-platform starter-kit to write simple
3 Dear ImGui tools for Windows, Linux and macOS in C.
4
5 [WASM version](https://floooh.github.io/cimgui-sokol-starterkit/) (see below for build instructions)
6
7 ## Clone:
8
9 ```bash
10 > git clone https://github.com/floooh/cimgui-sokol-starterkit
11 > cd cimgui-sokol-starterkit
12 ```
13
14 ## Build:
15
16 ```bash
17 > mkdir build
18 > cd build
19
20 > cmake ..
21 > cmake --build .
22 ```
23
24 To build a Release version on Linux and Mac:
25
26 ```bash
27 > cmake -DCMAKE_BUILD_TYPE=MinSizeRel ..
28 > cmake --build .
29 ```
30
31 To build a Release version on Windows with the VisualStudio toolchain:
32
33 ```bash
34 > cmake ..
35 > cmake --build . --config MinSizeRel
36 ```
37
38 NOTE: on Linux you'll also need to install the 'usual' dev-packages needed for X11+GL development.
39
40 ## Run:
41
42 On Linux and macOS:
43 ```bash
44 > ./demo
45 ```
46
47 On Windows with the Visual Studio toolchain the exe is in a subdirectory:
48 ```bash
49 > Debug\demo.exe
50 > MinSizeRel\demo.exe
51 ```
52
53 ## Build and Run WASM/HTML version via Emscripten (Linux, macOS)
54
55 Setup the emscripten SDK as described here:
56
57 https://emscripten.org/docs/getting_started/downloads.html#installation-instructions
58
59 Don't forget to run ```source ./emsdk_env.sh``` after activating the SDK.
60
61 And then in the ```cimgui-sokol-starterkit``` directory:
62
63 ```
64 mkdir build
65 cd build
66 emcmake cmake -DCMAKE_BUILD_TYPE=MinSizeRel ..
67 cmake --build .
68 ```
69
70 To run the compilation result in the system web browser:
71
72 ```
73 > emrun demo.html
74 ```
75
76 ...which should look like [this](https://floooh.github.io/cimgui-sokol-starterkit/).
77
78 (this procedure should also work on Windows with ```make``` in the path, but
79 is currently untested)
80
81 ## IDE Support
82
83 ### Visual Studio (Windows)
84
85 On Windows, cmake will automatically create a Visual Studio solution file in
86 the build directory, which can be opened with:
87
88 ```bash
89 > start cimgui-sokol-starterkit.sln
90 ```
91
92 ### Xcode (macOS)
93
94 Replace ```cmake ..``` with ```cmake -GXcode ..``` and open the generated
95 Xcode project:
96
97 ```bash
98 > cmake -GXcode ..
99 > open cimgui-sokol-starterkit.xcodeproj
100 ```
101
102 ### Visual Studio Code (Windows, Linux, macOS)
103
104 Use the [MS C/C++ extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools)
105 together with the [MS CMake Tools extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools)
106 and start Visual Studio code from the project's root directory. The CMake
107 extension will detect the CMakeLists.txt file and take over from there.
108
109 ## Notes:
110
111 The repository contains snapshots of the following libraries:
112
113 - [Dear ImGui](https://github.com/ocornut/imgui)
114 - [cimgui](https://github.com/cimgui/cimgui) (C bindings for Dear ImGui)
115 - [Sokol Headers](https://github.com/floooh/sokol) (only what's needed)
116
117 I'm not planning to do frequent updates to newer versions of those
118 files, so the versions contained in here may be behind. Updating
119 your own copies is trivial though, just copy the new files from
120 the original repositories over the files contained here.
121
122 I tried to keep the CMake file as simple as possible (unfortunately
123 it's not quite as simple as I had liked, because of some cross-platform
124 differences).
125
126 All the important code is in ```demo.c```.
127
128 Enjoy!
0 # cimgui-sokol-starterkit
1
2 A minimal cross-platform starter-kit to write simple
3 Dear ImGui tools for Windows, Linux and macOS in C.
4
5 [WASM version](https://floooh.github.io/cimgui-sokol-starterkit/) (see below for build instructions)
6
7 ## Clone:
8
9 ```bash
10 > git clone https://github.com/floooh/cimgui-sokol-starterkit
11 > cd cimgui-sokol-starterkit
12 ```
13
14 ## Build:
15
16 ```bash
17 > mkdir build
18 > cd build
19
20 > cmake ..
21 > cmake --build .
22 ```
23
24 To build a Release version on Linux and Mac:
25
26 ```bash
27 > cmake -DCMAKE_BUILD_TYPE=MinSizeRel ..
28 > cmake --build .
29 ```
30
31 To build a Release version on Windows with the VisualStudio toolchain:
32
33 ```bash
34 > cmake ..
35 > cmake --build . --config MinSizeRel
36 ```
37
38 NOTE: on Linux you'll also need to install the 'usual' dev-packages needed for X11+GL development.
39
40 ## Run:
41
42 On Linux and macOS:
43 ```bash
44 > ./demo
45 ```
46
47 On Windows with the Visual Studio toolchain the exe is in a subdirectory:
48 ```bash
49 > Debug\demo.exe
50 > MinSizeRel\demo.exe
51 ```
52
53 ## Build and Run WASM/HTML version via Emscripten (Linux, macOS)
54
55 Setup the emscripten SDK as described here:
56
57 https://emscripten.org/docs/getting_started/downloads.html#installation-instructions
58
59 Don't forget to run ```source ./emsdk_env.sh``` after activating the SDK.
60
61 And then in the ```cimgui-sokol-starterkit``` directory:
62
63 ```
64 mkdir build
65 cd build
66 emcmake cmake -DCMAKE_BUILD_TYPE=MinSizeRel ..
67 cmake --build .
68 ```
69
70 To run the compilation result in the system web browser:
71
72 ```
73 > emrun demo.html
74 ```
75
76 ...which should look like [this](https://floooh.github.io/cimgui-sokol-starterkit/).
77
78 (this procedure should also work on Windows with ```make``` in the path, but
79 is currently untested)
80
81 ## IDE Support
82
83 ### Visual Studio (Windows)
84
85 On Windows, cmake will automatically create a Visual Studio solution file in
86 the build directory, which can be opened with:
87
88 ```bash
89 > start cimgui-sokol-starterkit.sln
90 ```
91
92 ### Xcode (macOS)
93
94 Replace ```cmake ..``` with ```cmake -GXcode ..``` and open the generated
95 Xcode project:
96
97 ```bash
98 > cmake -GXcode ..
99 > open cimgui-sokol-starterkit.xcodeproj
100 ```
101
102 ### Visual Studio Code (Windows, Linux, macOS)
103
104 Use the [MS C/C++ extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools)
105 together with the [MS CMake Tools extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools)
106 and start Visual Studio code from the project's root directory. The CMake
107 extension will detect the CMakeLists.txt file and take over from there.
108
109 ## Notes:
110
111 The repository contains snapshots of the following libraries:
112
113 - [Dear ImGui](https://github.com/ocornut/imgui)
114 - [cimgui](https://github.com/cimgui/cimgui) (C bindings for Dear ImGui)
115 - [Sokol Headers](https://github.com/floooh/sokol) (only what's needed)
116
117 I'm not planning to do frequent updates to newer versions of those
118 files, so the versions contained in here may be behind. Updating
119 your own copies is trivial though, just copy the new files from
120 the original repositories over the files contained here.
121
122 I tried to keep the CMake file as simple as possible (unfortunately
123 it's not quite as simple as I had liked, because of some cross-platform
124 differences).
125
126 All the important code is in ```demo.c```.
127
128 Enjoy!