- Prerequisites
- Simple setup
- To Compile and run an existing sample application
- To create a new demo project named 'CoolNewDemo'
- Visual Studio Code support
- Appendix
- Visual Studio 2022 (community or better)
- CMake 3.16 or newer
- Python 3.6+ To be able run python scripts.
- Download the source from git.
For OpenGL ES, OpenCL, OpenCV, OpenVX and Vulkan support additional packages are required, see below.
It's also a good idea to read the introduction to the FslBuild toolchain
-
Decide what API's you want to compile and run apps for, then install them using one of the guides below.
-
Start a windows console (cmd.exe) in the DemoFramework folder
-
Run the visual studio
vcvarsall.bat x64
to prepare your command line compiler environment for x64 compilation.- For VS2022 its often located here:
"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
- For VS2022 its often located here:
-
Run the
prepare.bat
file located in the root of the framework folder to configure the necessary environment variables and paths. Please beware that theprepare.bat
file requires the current working directory to be the root of your demo-framework folder to function (which is also the folder it resides in).prepare.bat
-
One of these (they are mutually exclusive):
-
Arm Mali OpenGL ES Emulator v3.0.4-2c-g8d905 (64 bit)
Please use the exact version (64bit) and use the installer to install it to the default location!
-
Vivante OpenGL ES Emulator
To get started its recommended to utilize the Arm Mali OpenGL ES 3.0.4 emulator (64 bit) which this guide will assume you are using.
-
-
Configure the OpenGL ES emulator for arm
ConfigureOpenGLESEmu.bat arm
-
Continue the normal setup.
To utilize a different emulator the ConfigureOpenGLESEmu.bat
file can be launched with the following arguments
argument | emulator |
---|---|
arm | the arm mali emulator |
powervr | the powervr emulator |
qualcomm | the qualcomm andreno adreno emulator (expects its installed in "c:\AdrenoSDK") |
vivante | the vivante emulator |
Install the Vulkan SDK, See the official SDK guide
-
Follow the documentation
-
Continue the normal setup.
- Download and install a OpenCL implementation. Beware we depend on cmake's find_package support to locate the installed OpenCL implementation.
- Continue the normal setup.
-
Install the 4.6.0 sdk files.
-
Configure the environment variable OPENCV_DIR to point to the sdk location like this
set OPENCV_DIR=c:\_sdk\opencv-4.6.0\build
-
Continue the normal setup.
- Follow the guide for setting up OpenCL and OpenCV support. (need OpenCV4)
- Continue the normal setup.
The build chain will download and compile a OpenVX implementation.
The general approach will be:
-
Make sure that you performed the simple setup, including the API's the sample need.
-
Change directory to the sample directory:
cd DemoApps\<MAIN-API-NAME>\<SAMPLE-NAME>
Example MAIN-API-NAME's: GLES2, GLES3, OpenCL, Vulkan.
Type
dir
to see the dir choice.Example SAMPLE-NAME's: Bloom, S06_Texturing.
Type
dir
after entering a API folder to see the list of samples -
Launch the visual studio project
FslBuild.py -c open
-
Verify that the executable is set as the startup project in the solution explorer, if its not then right click the executable and select "Set as Startup Project". If this is not done you are likely to get a "access denied" error when you try to run the project as it might try to run the "ALL_BUILD" target instead.
-
Compile and run the project (The default is to press F5)
The following commands are also pretty useful to know.
Command | Description |
---|---|
FslBuild.py |
To build the example. |
FslBuildRun.py |
To build and run the example. |
FslBuild.py --ListVariants |
List all the build variants that can be specified. |
FslBuildInfo.py --ListRequirements |
To list the samples requirements. |
FslBuild.py -c open2 |
Experimental Open the project in Visual Studio Code |
It is also recommended to check out the README.md
and Example.jpg
that is included with all samples.
Note:
If you add source files to a project or change the Fsl.gen file then run the
FslBuildGen.py
script in the project root folder to regenerate the various
build files or just make sure you always use the FslBuild.py
script as it
automatically adds files and regenerate build files as needed.
In this example we will utilize the GLES2.S06_Texturing app.
-
Make sure that you performed the simple setup, including installing and configuring a OpenGLES emulator.
-
Change directory to the sample directory:
cd DemoApps\GLES2\S06_Texturing
-
Launch the visual studio project
FslBuild.py -c open
-
Compile and run the project (The default is to press F5)
-
Make sure that you performed the simple setup including the additional OpenGL ES setup.
-
Change directory to the appropriate sample directory:
cd DemoApps\<MAIN-API-NAME>
Example MAIN-API-NAME's: GLES2, GLES3, OpenCL, Vulkan.
Type
dir
to see the dir choice. -
Create the project template using the FslBuildNew.py script
FslBuildNew.py <TEMPLATE-NAME> CoolNewDemo
Example TEMPLATE-NAME's: GLES2, GLES3, OpenCL1_2, OpenCV4, Vulkan.
To get a full list run
FslBuildNew.py . . --List
-
Change directory to the newly created project folder 'CoolNewDemo'
cd CoolNewDemo
-
Launch the visual studio project
FslBuild.py -c open
Note:
If you add source files to a project or change the Fsl.gen file then run the
FslBuildGen.py
script in the project root folder to regenerate the various
build files or just make sure you always use the FslBuild.py
script as it
automatically adds files and regenerate build files as needed.
In this example we will create a GLES2 app called CoolNewDemo.
-
Make sure that you performed the simple setup including the additional OpenGL ES setup.
-
Change directory to the GLES2 sample directory:
cd DemoApps/GLES2
-
Create the project template using the FslBuildNew.py script
FslBuildNew.py GLES2 CoolNewDemo
-
Change directory to the newly created project folder 'CoolNewDemo'
cd CoolNewDemo
-
Launch the visual studio project
FslBuild.py -c open
There is now experimental visual studio code support.
To support visual studio code we generate/patch the configuration files stored under .vscode
.
launch.json
contains the configuration used to launch the executable if one existsettings.json
contains the cmake configuration required to build the project.
- Visual Studio Code
- Visual Studio Code Extensions:
- Recommended visual studio code extensions:
In this example we will utilize the GLES2.S06_Texturing app.
-
Make sure that you performed the simple setup.
-
Change directory to the sample directory:
cd DemoApps/GLES2/S06_Texturing
-
Open the project in visual studio code
FslBuild.py -c open2
This should launch visual studio code configured for the app.
BEWARE: Visual Studio Code has its own setting for debug/release build which is configured in the bottom blue line. BEWARE: Make sure you use the correct launch script. "FslBuild-Windows" for windows and "FslBuild-Ubuntu" for ubuntu.
- Introduced FSL_GLES_EMULATOR_PATH as the main path to the emulation installation
- Renamed FSL_GLES_NAME to FSL_GLES_EMULATOR_NAME
- Renamed FSL_GLES_LIB_PATH to FSL_GLES_EMULATOR_LIB_PATH
- Removed FSL_GLES_INCLUDE_PATH
- Removed FSL_GLES_LIB_EGL
- Removed FSL_GLES_LIB_GLES
When you add the generated build.sh to git on windows then please remember to set the executable bit using:
git update-index --chmod=+x build.sh
WARNING: only do this if you have issues with the pre-compiled version we include