Book Image

OpenFrameworks Essentials

Book Image

OpenFrameworks Essentials

Overview of this book

Table of Contents (19 chapters)
openFrameworks Essentials
About the Authors
About the Reviewers

Discovering the project's code structure

Open the project's VideoSynth folder and find the src folder there. It contains the project's source code files, as shown in the following screenshot:

The project's folder contents (the center column) and its source code files placed in the src folder (the right column)

There are three source files:

  • main.cpp: This file contains the code to initiate a window and run the app. We will leave it unchanged.

  • ofApp.h: This file is a declaration of the ofApp application class, which consists of a declaration of the functions, such as setup(), update(), draw(), and some others. Currently, we do not need to add anything there.

  • ofApp.cpp: This file contains definitions of declared functions. This is the file we will edit right now.

The following functions, declared in the ofApp class, are called by the openFrameworks engine:

  • setup(): This function is called once at the beginning of the application execution. This is the place to implement a project's initialization...