-
Notifications
You must be signed in to change notification settings - Fork 2
First steps
Currently Toto2DEngine is in alpha version. The main drawback of that version is a naughty dependency to GLM, which is included in the sources to make things easier. The next version will fix that.
Toto2DEngine is not dedicated to context initialization. But because it can be a very tedious task, a SetContext class is included, which has been written from the examples shipped with the Raspberry PI. It will initialize easily for you a fullscreen openGL context. For convenience, the examples will use it.
Toto2DEngine is not either dedicated to image loading. But because you will need to load atlas images, a copy of STBI_IMAGE is included. It can load images files easily and efficiently. For convenience, the examples will use it.
We assume you have Raspbian installed on your Raspberry PI. It important to notice because Raspbian is shipped with a bundle of pre-installed libraries being essential to the Raspberry programmation.
Knowing that, you just need to copy the Toto2DEngine source folder at the following destination on your Raspberry PI:
/opt/vc/src/hello_pi/Toto2DEngine
Create a new hello_toto directory at the following destination on your Raspberry PI:
/opt/vc/src/hello_pi/hello_toto
Copy the Makefile file in that folder.
Copy the main.cpp file in that folder.
Copy the atlas.png file in that folder.
Open a terminal in the hello_toto directory.
Type make command in the terminal in order to compile the application. After few seconds you should see the following result in your terminal:
g++ -c -I/opt/vc/include -I./ -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -I../libs/ilclient -I../Toto2DEngine -o main.o main.cpp
g++ -L/opt/vc/lib -lGLESv2 -lEGL -lopenmaxil -lbcm_host -lvcos -lvchiq_arm -lpthread -lrt -L../libs/ilclient -o main main.o
A new executable main is then available in your directory.
Finally, execute it by typing ./main