You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/ApplicationIcons.md
+33-13Lines changed: 33 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,15 +5,17 @@
5
5
### macOS
6
6
7
7
To generate a `.icns` file on macOS, an `.iconset` folder needs to be converted via `iconutil`. The
8
-
folder `src/assets/icons/icon.iconset` contains all needed icon sizes. To generate the needed app icon under `src/assets/icons/icon.icns`, run from inside the `src/assets/icons` folder:
8
+
folder `src/assets/icons/icon.iconset` contains all needed icon sizes. To generate the needed app icon
9
+
under `src/assets/icons/icon.icns`, run from inside the `src/assets/icons` folder:
9
10
10
11
```shell
11
12
iconutil -c icns icon.iconset
12
13
```
13
14
14
15
### Windows
15
16
16
-
To create the `icon.ico` file [ImageMagick](https://www.imagemagick.org) is used. From inside the `src/assets/icons` folder run:
17
+
To create the `icon.ico` file [ImageMagick](https://www.imagemagick.org) is used. From inside the `src/assets/icons`
18
+
folder run:
17
19
18
20
```shell
19
21
convert \
@@ -31,29 +33,35 @@ identify icon.ico
31
33
32
34
### Linux
33
35
34
-
There is no need to generate an icon set for Linux. A high resolution PNG (1024x1024px) is enough for the app icon. This is located under `icons/BaseAppIcon.png`.
36
+
There is no need to generate an icon set for Linux. A high resolution PNG (1024x1024px) is enough for the app icon. This
37
+
is located under `icons/BaseAppIcon.png`.
35
38
36
39
## Icon design guidelines
37
40
38
-
The example project contains an example icon. To get guiding for creating an own unique app icon, here a couple of resources:
41
+
The example project contains an example icon. To get guiding for creating an own unique app icon, here a couple of
-[Apple human interface design, icons guide](https://developer.apple.com/design/human-interface-guidelines/foundations/app-icons/)
42
46
43
47
## Integrating icons
44
48
45
-
How are those application icons connected to become the icon of the generated executable? Through the packaging process and manifest files.
49
+
How are those application icons connected to become the icon of the generated executable? Through the packaging process
50
+
and manifest files.
46
51
47
52
### Package app icons
48
53
49
-
For macOS and Windows app icons are packed as static resources via CMake's [target_sources](https://cmake.org/cmake/help/latest/command/target_sources.html) function in `src/app/cmake/AppAssets.cmake`. For example, adding the Windows `.ico` file to the main executable:
54
+
For macOS and Windows app icons are packed as static resources via
55
+
CMake's [target_sources](https://cmake.org/cmake/help/latest/command/target_sources.html) function
56
+
in `src/app/cmake/AppAssets.cmake`. For example, adding the Windows `.ico` file to the main executable:
50
57
51
58
```cmake
52
59
# src/app/cmake/AppAssets.cmake
53
60
target_sources(App PUBLIC ${PROJECT_SOURCE_DIR}/src/assets/icons/icon.ico)
54
61
```
55
62
56
-
On Linux, it needs to be part of the installation process that is defined in `src/app/cmake/packaging/Linux.cmake`, where application icons are installed in a shared directory `share/pixmaps`. This does look like the following:
63
+
On Linux, it needs to be part of the installation process that is defined in `src/app/cmake/packaging/Linux.cmake`,
64
+
where application icons are installed in a shared directory `share/pixmaps`. This does look like the following:
57
65
58
66
```cmake
59
67
# src/app/cmake/packaging/Linux.cmake
@@ -67,7 +75,13 @@ The manifest files then link the app icon to the executable.
67
75
68
76
#### macOS
69
77
70
-
For macOS the manifest file is an [Info.plist](https://developer.apple.com/documentation/bundleresources/information_property_list) defining application properties. It is located at `src/app/Manifests/Info.plist` and added to the app bundle through `src/app/cmake/packaging/Darwin.cmake`. Here the CMake function [set_target_properties](https://cmake.org/cmake/help/latest/command/set_target_properties.html) defines `MACOSX_BUNDLE_INFO_PLIST` for the manifest location. The icon name is defined inside the `Info.plist` file under the property name `CFBundleIconFile`.
78
+
For macOS the manifest file is
79
+
an [Info.plist](https://developer.apple.com/documentation/bundleresources/information_property_list) defining
80
+
application properties. It is located at `src/app/Manifests/Info.plist` and added to the app bundle
81
+
through `src/app/cmake/packaging/Darwin.cmake`. Here the CMake
82
+
function [set_target_properties](https://cmake.org/cmake/help/latest/command/set_target_properties.html)
83
+
defines `MACOSX_BUNDLE_INFO_PLIST` for the manifest location. The icon name is defined inside the `Info.plist` file
The resource file `src/app/Manifests/app.rc` will bind the icon to the Windows executable. The resource file itself is then added as part of the application bundle via [target_sources](https://cmake.org/cmake/help/latest/command/target_sources.html) in `src/app/cmake/AppAssets.cmake`.
96
+
The resource file `src/app/Manifests/app.rc` will bind the icon to the Windows executable. The resource file itself is
97
+
then added as part of the application bundle
98
+
via [target_sources](https://cmake.org/cmake/help/latest/command/target_sources.html)
99
+
in `src/app/cmake/AppAssets.cmake`.
83
100
84
101
```cmake
85
102
target_sources(App PUBLIC
86
-
${PROJECT_SOURCE_DIR}/src/assets/icons/icon.ico
87
-
${PROJECT_SOURCE_DIR}/src/app/Manifests/app.rc)
103
+
${PROJECT_SOURCE_DIR}/src/assets/icons/icon.ico
104
+
${PROJECT_SOURCE_DIR}/src/app/Manifests/app.rc)
88
105
```
89
106
90
107
#### Linux
91
108
92
-
For Linux a `src/app/Manifests/App.desktop.in` defines the created shortcut with icon. The `.in` file will be processed by CMake via [configure_file](https://cmake.org/cmake/help/latest/command/configure_file.html) in `src/app/cmake/packaging/Linux.cmake`.
109
+
For Linux a `src/app/Manifests/App.desktop.in` defines the created shortcut with icon. The `.in` file will be processed
110
+
by CMake via [configure_file](https://cmake.org/cmake/help/latest/command/configure_file.html)
111
+
in `src/app/cmake/packaging/Linux.cmake`.
93
112
94
-
It will take the `.in` file and produce a final `.desktop` file for Linux with the given icon name under the property `Icon=`.
113
+
It will take the `.in` file and produce a final `.desktop` file for Linux with the given icon name under the
Will not only enable application internal debugging, but also profiling (`APP_PROFILE`). This option is mainly useful to get debugging and profiling output on release builds.
29
+
Will not only enable application internal debugging, but also profiling (`APP_PROFILE`). This option is mainly useful to
30
+
get debugging and profiling output on release builds.
30
31
31
32
**Example:**
32
33
@@ -64,31 +65,39 @@ After configuration the application can be built through CMake via `cmake --buil
64
65
cmake --build build/debug
65
66
```
66
67
67
-
This will build the application with the given configuration. Depending on the platform it was executed on a different build directory structure will be generated, reflecting how the application will latter be [installed on packaging](Packaging.md).
68
+
This will build the application with the given configuration. Depending on the platform it was executed on a different
69
+
build directory structure will be generated, reflecting how the application will latter
70
+
be [installed on packaging](Packaging.md).
68
71
69
72
## Execute
70
73
71
-
When not running through an [IDE like CLion](https://www.jetbrains.com/clion), the built application can be run by directly executing the generated binary. Depending on the operating system it can be found at a different place, as different build directory structures are generated.
74
+
When not running through an [IDE like CLion](https://www.jetbrains.com/clion), the built application can be run by
75
+
directly executing the generated binary. Depending on the operating system it can be found at a different place, as
76
+
different build directory structures are generated.
72
77
73
78
### macOS
74
79
75
-
On Apple devices an app package structure is created under `./build/<TARGET>/src/app/App.app`, where `<TARGET>` is the build target like **debug** or **release**. Inside that [application bundle](https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFBundles/AboutBundles/AboutBundles.html#//apple_ref/doc/uid/10000123i-CH100-SW1) is the app executable.
80
+
On Apple devices an app package structure is created under `./build/<TARGET>/src/app/App.app`, where `<TARGET>` is the
81
+
build target like **debug** or **release**. Inside
82
+
that [application bundle](https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFBundles/AboutBundles/AboutBundles.html#//apple_ref/doc/uid/10000123i-CH100-SW1)
83
+
is the app executable.
76
84
77
85
Run on a built target, in this example **debug**:
78
86
79
87
```shell
80
88
./build/debug/src/app/App.app/Contents/MacOS/App
81
89
```
82
90
83
-
Though, even better is to use **XCode as generator** to create app builds on macOS. Only difference in usage is running CMake with `-GXCode`. If `CMAKE_OSX_ARCHITECTURES` is not set, it will create universal binaries on M1/2 macs.
91
+
Though, even better is to use **Xcode as generator** to create app builds on macOS. Only difference in usage is running
92
+
CMake with `-GXcode`. If `CMAKE_OSX_ARCHITECTURES` is not set, it will create universal binaries on M1/2 macs.
Copy file name to clipboardExpand all lines: docs/Fonts.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,12 @@
1
1
# Fonts
2
2
3
-
Applications fonts are in `src/assets/fonts`, and the template comes with the amazing open source font [Manrope](https://manropefont.com).
3
+
Applications fonts are in `src/assets/fonts`, and the template comes with the amazing open source
4
+
font [Manrope](https://manropefont.com).
4
5
5
6
## Add new font
6
7
7
-
After adding a new font to the `src/assets/fonts` folder, the fonts needs to be added to ImGUI. This is done in `src/core/Core/Application.cpp`, the `run` method.
8
+
After adding a new font to the `src/assets/fonts` folder, the fonts needs to be added to ImGUI. This is done
9
+
in `src/core/Core/Application.cpp`, the `run` method.
The template app supports high DPI displays out-of-the-box. The header `src/core/Core/DPIHandler.hpp` defines the interface for DPI handling. The implementations are in `src/core/Platform` under `DPIHandler.cpp` per platform.
3
+
The template app supports high DPI displays out-of-the-box. The header `src/core/Core/DPIHandler.hpp` defines the
4
+
interface for DPI handling. The implementations are in `src/core/Platform` under `DPIHandler.cpp` per platform.
4
5
5
6
The following two functions are important for DPI handling.
6
7
7
8
## `get_scale()`
8
9
9
-
Returns a `float` scaling factor used to set render and font scale. Should be used whenever a relative scaling is needed. See usage in platform `DPIhandler.cpp` files and `src/core/Core/Application.cpp`, `run` method.
10
+
Returns a `float` scaling factor used to set render and font scale. Should be used whenever a relative scaling is
11
+
needed. See usage in platform `DPIhandler.cpp` files and `src/core/Core/Application.cpp`, `run` method.
10
12
11
13
## `get_dpi_aware_window_size()`
12
14
13
-
Returns a `WindowSize`, a struct with height and width as `int`. Will scale `Window::Settings` DPI aware per platform. See file `src/core/Core/Window.cpp`.
15
+
Returns a `WindowSize`, a struct with height and width as `int`. Will scale `Window::Settings` DPI aware per platform.
Copy file name to clipboardExpand all lines: docs/Logging.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,8 @@
1
1
# Logging
2
2
3
-
The library [spdlog](https://github.com/gabime/spdlog) is used for logging. The logger is set up in `src/core/Core/Log.{cpp,hpp}` that will define a default logger writing to stdout and into a `app.log` file. The macros used for logging are defined in `src/core/Core/Log.hpp`.
3
+
The library [spdlog](https://github.com/gabime/spdlog) is used for logging. The logger is set up
4
+
in `src/core/Core/Log.{cpp,hpp}` that will define a default logger writing to stdout and into a `app.log` file. The
5
+
macros used for logging are defined in `src/core/Core/Log.hpp`.
Copy file name to clipboardExpand all lines: docs/MakeItYourOwn.md
+11-5Lines changed: 11 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,9 @@ There are some variables and settings that should be adapted to specific project
4
4
5
5
## Project name and company
6
6
7
-
Inside the root `CMakeLists.txt`, the CMake [project](https://cmake.org/cmake/help/latest/command/project.html) call also defines the project name as `CMAKE_PROJECT_NAME` variable. This is currently called `BasicGuiProjectSetup`. Here an example how this could look like:
7
+
Inside the root `CMakeLists.txt`, the CMake [project](https://cmake.org/cmake/help/latest/command/project.html) call
8
+
also defines the project name as `CMAKE_PROJECT_NAME` variable. This is currently called `BasicGuiProjectSetup`. Here an
9
+
example how this could look like:
8
10
9
11
```cmake
10
12
# CMakeLists.txt
@@ -15,7 +17,8 @@ project(
15
17
LANGUAGES CXX)
16
18
```
17
19
18
-
In that same file, the **project company name and namespace** ([Reverse domain name notation](https://en.wikipedia.org/wiki/Reverse_domain_name_notation)) are defined.
20
+
In that same file, the **project company name and namespace
21
+
** ([Reverse domain name notation](https://en.wikipedia.org/wiki/Reverse_domain_name_notation)) are defined.
App icons are located under `src/assets/icons/`. There is dedicated documentation on how to update and integrate those into the project under [Application Icons](ApplicationIcons.md).
34
+
App icons are located under `src/assets/icons/`. There is dedicated documentation on how to update and integrate those
35
+
into the project under [Application Icons](ApplicationIcons.md).
32
36
33
37
## Installer graphics
34
38
35
-
The installer on macOS and Windows are graphical and use some images to properly represent the app. Images and documentation for macOS are in `packaging/dmg/`, same for Windows under `packaging/nsis/`.
39
+
The installer on macOS and Windows are graphical and use some images to properly represent the app. Images and
40
+
documentation for macOS are in `packaging/dmg/`, same for Windows under `packaging/nsis/`.
36
41
37
42
## Code of conduct
38
43
39
-
There is a basic Code of Conduct (CoC) provided by https://www.contributor-covenant.org in `CODE_OF_CONDUCT.md`. Search for `EMAIL` inside that document to provide a contact for the CoC.
44
+
There is a basic Code of Conduct (CoC) provided by https://www.contributor-covenant.org in `CODE_OF_CONDUCT.md`. Search
45
+
for `EMAIL` inside that document to provide a contact for the CoC.
0 commit comments