The fundation of any visual computational adventure. Ada is an easy cross platform OpenGL ES 2.0 library for creating apps in Windows, MacOS and Linux (with or without X11 support like in RaspberrPi)
brew install glfw3 pkg-config
For video support (using FFMpeg library LIBAV), also do:
brew install ffmpeg --build-from-source
sudo apt install git cmake xorg-dev libglu1-mesa-dev
For video support (using FFMpeg library LIBAV), also do:
sudo apt install ffmpeg libavcodec-dev libavcodec-extra libavfilter-dev libavfilter-extra libavdevice-dev libavformat-dev libavutil-dev libswscale-dev libv4l-dev libjpeg-dev libpng-dev libtiff-dev
sudo apt install git cmake xorg-dev libglu1-mesa-dev
sudo apt install git cmake libegl1-mesa-dev libgbm-dev libgles2-mesa-dev
Make sure on your /boot/config.txt
you have the following lines present and uncommented:
dtoverlay=vc4-fkms-v3d
max_framebuffers=2
hdmi_force_hotplug=1
sudo dnf install git gcc-c++ cmake mesa-libGLU-devel glfw-devel libXi-devel libXxf86vm-devel
sudo yum install libXdamage-devel
For video support (using FFMpeg library LIBAV), also do:
sudo dnf install ffmpeg ffmpeg-devel
sudo pacman -S glu glfw-x11
For video support (using FFMpeg library LIBAV), also do:
sudo pacman -S ffmpeg
For windows managers like MacOS, Windows or any Linux X11 enviroment like Gnome/KDE/etc (all through GLFW)
git clone https://github.com/patriciogonzalezvivo/ada.git
cd ada
mkdir build
cd build
cmake ..
make
sudo make install
example/./hello_world
git clone https://github.com/patriciogonzalezvivo/ada.git
cd ada
mkdir build
cd build
cmake -DNO_X11=TRUE ..
make
sudo make install
example/./hello_world
Note: Newer RaspberryPi distribution do have BROADCOM drivers but work only on GBM for that use -DFORCE_GBM=TRUE
instead
- Install emscripten which already includes glfw:
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
git pull
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh
cd ..
- Then build the project
git clone https://github.com/patriciogonzalezvivo/ada.git
cd ada
mkdir build
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake
make
- Serve the file either using node or python
python3 -m http.server
Then open http://localhost:8000/examples/hello_world.html
Add the ADA header files you need
#include "ada/window.h"
#include "ada/gl/gl.h"
...
int main(int argc, char **argv) {
// Initialize openGL context
ada::initGL(argc, argv);
// Render Loop
while ( ada::isGL() ) {
// Update
ada::updateGL();
// Do your thing
// ...
// Render the scene
ada::renderGL();
// Update the viewport
ada::updateViewport();
}
// Close the GL context
ada::closeGL();
return 1;
}
Then on the CMakeList.txt
you just need to do:
add_executable (myApp myApp.cpp)
set_target_properties(myApp PROPERTIES
CXX_STANDARD 11
CXX_STANDARD_REQUIRED ON
)
target_link_libraries (myApp PRIVATE ada)
This library is highly inspired on OpenFramewors, a dear framework and community very close to my heart. The Mesh, Node and Camera clases are VERY similar. The reason to branch ADA was to minimize the amount of code, dependencies and be hable to add it through CMake.