Commit c318ffe372e16ef5aed5550dd0ccdf0c2f47f4f0
1 parent
67989048
Updated the instructions to create a new example
Change-Id: Iba04cb075409468a08639eabd5945901647470af
Showing
1 changed file
with
19 additions
and
30 deletions
README.md
| ... | ... | @@ -13,10 +13,10 @@ |
| 13 | 13 | * [DEBUG Builds](#debug-builds-1) |
| 14 | 14 | * [3. Building for Android](#3-android-builds) |
| 15 | 15 | * [4. Building for MS Windows](#4-windows-builds) |
| 16 | - * Build with the Visual Studio project. | |
| 17 | - * Build with CMake. | |
| 16 | + * [Build with the Visual Studio project](#build-with-the-visual-studio-project) | |
| 17 | + * [Build with CMake](#build-with-cmake) | |
| 18 | 18 | * [5. Building for MacOS](#5-building-for-macos) |
| 19 | - * [Creating an example](#creating-an-example) | |
| 19 | + * [Creating an Example](#creating-an-example) | |
| 20 | 20 | |
| 21 | 21 | # Build Instructions |
| 22 | 22 | |
| ... | ... | @@ -81,14 +81,6 @@ You can set the sample's name and can build that sample only. For example, If yo |
| 81 | 81 | |
| 82 | 82 | $ gbs build -A [TARGET_ARCH] --define "build_example_name hello-world" |
| 83 | 83 | |
| 84 | -# Creating an example | |
| 85 | - | |
| 86 | - - Make a directory in the "examples" directory. Only one example will be created per directory. | |
| 87 | - - The executable installed will have a ".example" appended to it, e.g. a "blocks" directory produces "blocks.example". | |
| 88 | - - Add all source files for the required example in this directory. | |
| 89 | - - Modify "com.samsung.dali-demo.xml" to include your example so that it can be launched on target. | |
| 90 | - - No changes are required to the make system as long as the above is followed, your example will be automatically built & installed. | |
| 91 | - | |
| 92 | 84 | ## 3. Building for Android |
| 93 | 85 | |
| 94 | 86 | ### Requirements |
| ... | ... | @@ -204,22 +196,19 @@ To build, run: |
| 204 | 196 | % make install -j8 |
| 205 | 197 | ``` |
| 206 | 198 | |
| 207 | -# Creating an example | |
| 208 | -In the dali-demo/examples folder, add another folder. This will become the name of your example executable, so for example the "hello-world" folder generates a "hello-world.example" binary. | |
| 209 | -In this folder, you can add as many source code files as you need. | |
| 210 | - | |
| 211 | -Usually, create a single class file containing a main function that instantiates an Application. Usually, the class is named after your example, followed by "Controller", e.g. hello-world.cpp contains a class called HelloWorldController. | |
| 212 | - | |
| 213 | -There is a DemoHelper::CreateView method, which enables you to easiliy set up a title bar and buttons. | |
| 214 | - | |
| 215 | -Add at least a key handler such that Escape or Back keys can be used to quit the application. Some apps that only present a single thing also add a touch handler that quits the application. | |
| 216 | - | |
| 217 | -Add a launcher line to one of demo/dali-demo.cpp, examples-reel/dali-examples-reel.cpp or tests-reel/dali-tests-reel.cpp, depending on the nature of what you are demonstrating. Generally, dali-demo is for graphical showcase demos, dali-examples-reel is for reasonable examples that look ok, and dali-tests is for examples that are only for testing. This needs a language string defining for the title. | |
| 218 | - | |
| 219 | -Add 2 lines to shared/dali-demo-strings.h for the title of your application, please keep in alphabetic ordering. Add english strings and translations to each of the language files in resources/po. | |
| 220 | - | |
| 221 | -To ensure your application can run on a Tizen device through the launcher, add an entry to com.samsung.dali-demo.xml, ensuring that only tabs are used for XML indent. | |
| 222 | - | |
| 223 | - | |
| 224 | - | |
| 225 | - | |
| 199 | +# Creating an Example | |
| 200 | + | |
| 201 | +- Make a directory in the `examples` directory. Only one example will be created per directory. | |
| 202 | +- The executable installed will have a `.example` appended to it, e.g. a `blocks` directory produces `blocks.example`. | |
| 203 | +- Add all source files for the required example in this directory. | |
| 204 | +- Modify `com.samsung.dali-demo.xml` to include your example so that it can be launched on target. | |
| 205 | +- No changes are required to the make system as long as the above is followed, your example will be automatically built & installed. | |
| 206 | +- Add a key handler so that the `ESC` or `Back` keys can be used to quit the application. | |
| 207 | +- Depending on the nature of what you are demonstrating, add a launcher line to either: | |
| 208 | + - `demo/dali-demo.cpp`: for graphical showcase demos. | |
| 209 | + - `examples-reel/dali-examples-reel.cpp`: generic examples of how to use various features. | |
| 210 | + - `tests-reel/dali-tests-reel.cpp`: for testing purposes. | |
| 211 | +- Add 2 lines to `shared/dali-demo-strings.h` for the title of your application, please keep in alphabetic order, | |
| 212 | +- Add as many translations of the title as possible to the files in `resources/po`. Currently, this only works on Ubuntu. | |
| 213 | +- In each example folder, create a README.md with images and a description of what the example is demonstrating. | |
| 214 | + Look at [this](examples/particle-system/README.md) for reference. | |
| 226 | 215 | \ No newline at end of file | ... | ... |