openFrameworks (oF)
wraps different C++ libraries together
harmonises access to them, following a creative coding paradigm inspired by Processing
1. some libraries are built in oF
2. some are available as bundled addons
3. others can be added as additional addons

———

To load media in openFrameworks
1. Create a media object (in .h), depending on the class (for example ofTrueTypeFont)
2. Load the media file into the media object (usually in .mm, setup) - load() method
2. Display the media object (usually in .mm, draw)

—

Object-Oriented Programming (OOP)

- Classes (entities that can be materialised in distinct objects with certain properties and methods)
- Properties are characteristics, ex. visual traits
- methods is what the objects can do
- Ex. in a game you can have a Class: Monster
	For this monster you can have an object called FlyingMonster, which has property colour=pink and method setRunning=true
- The class sets what the entity can be like and do; the object defines what it is like and what state it is in

—

Naming conventions
- object names start with lower case, and do not have spaces
- do not start with numbers
- if name is composed of more than one word, merge words together, and after 1st word capitilise initial letter, for example myPrettyFont (this is called camel case)
- capital initials are reserved for classes for example Monster class

—

Punctuation
- dots follow object names to indicate a new property or method (value)
- commas separate values (inside a method for example)
- each line of code must end with a semicolon

—

Color
In oF, colour is defined with “char” type of interval, between 0 and 255
In hexadecimal, corresponds to 0 and FF
in RGB colors, red, for example is 255, 0, 0
Usually, we have 3 types of colour in oF
- Grayscale (1 value, 1 colour channel)
- RGB (3 channels)
- RGBA (4 channels - channel 4 is alpha or transparency)

—

Operators
X++ is the same as X+=1 is the same as X=X+1
X+=5 is the same as X=X+5

—

Variable types - most used
String, text “”
Numbers - integers - int (ex 3) or floating points - float (ex 3.4)
Booleans - false, true (0, 1)

Variable scope
A variable can be accessible inside a certain scope where it is defined
If a variable is defined in h for example, it is accessible in all methods of mm
If a variable is defined in one method of mm, it is only accessible to that method

— 

If clause - logic comparison
equality ==
inequality !=
greater than > lesser than <
greater r equal than >= lesser or equal than <=
And &&
Or ||

—

For loops (for arrays)
for(1. index definition and minimum value ; 2. index maximum value ; 3. index increment)
for(int i=0; i<length of array;i++){
…..
}

length of array is the size, or number of items, in array

—

Constants in C++
#define NUM_SQUARES 20
All CAPS, in h, before class definition