This document will explain how to create the necessary files to start working on your own sample.
To create a new sample, run the
generate_sample script that exists within
bldsys/scripts. There is a batch script for Windows, and a shell script for Unix based systems.
generate_sample <sample_id> <category> [<create_path>]
<sample_id>is the id tag that your sample will have (e.g. ‘
<category>is the category this sample will be placed into (e.g. ‘
<create_path>is optional, for deciding where your sample gets created. This should generally be left blank as the script will automatically place your sample its category folder.
generate_sample my_sample category
Running the above line will generate the following files:
samples/category/my_sample/CMakeLists.txt samples/category/my_sample/my_sample.cpp samples/category/my_sample/my_sample.h
To configure how your sample will appear, you can modify the
CMakeLists.txt within the generated directory:
NAMEthe string that will appear as the title of the sample in the sample list, and the header in the GUI for the sample
DESCRIPTIONthe string that will appear under the samples title in the sample list
To change the order of the samples (or place your sample in a specific place), modify the
ORDER_LIST list inside
samples/CMakeLists.txt. Just place a string of your
<sample_id> where you would like it to be placed relative to the other samples.
If you would like to show different configurations of your sample during batch mode, you will need to insert these configurations in the constructor of your sample (inside
get_configuration().insert<vkb::IntSetting>(0, my_sample_value, 3);