# poomer-raylib-bella_onimage

c++ prototype GUI interface for [Bella Path Tracer](https://bellarender.com) using raylib/raygui 

<img src="resources/raylibmac.png" alt="Alt text" width="225" height="225">
<img src="resources/raylibubuntu.png" alt="Alt text" width="225" height="225">
<img src="resources/raylibwin.png" alt="Alt text" width="225" height="225">


# Build instructions

```
workdir/
├── bella_engine_sdk/
├── raylib/
├── raygui/
├── poomer-raylib-bella_onimage/
└── cmake/ (macos)
```

# Ubuntu Linux x64
```
sudo apt install -y build-essential git cmake mesa-vulkan-drivers libgl1 libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libgl1-mesa-dev mesa-vulkan-drivers
mkdir workdir && cd workdir
mkdir raylib raygui poomer-raylib-bella_onimage

# Install Bella SDK
wget https://downloads.bellarender.com/bella_engine_sdk-25.3.0-linux.tar.gz
tar -xvf bella_engine_sdk-25.3.0-linux.tar.gz

# Build raylib
cd raylib
git clone https://github.com/raysan5/raylib.git .
cmake -B ./build -DBUILD_SHARED_LIBS=ON -DUSE_EXTERNAL_GLFW=OFF 
cmake --build ./build -j$(nproc)

# Install raygui
cd ..
git clone https://github.com/raysan5/raygui.git

# Build poomer-raylib-bella_onimage
git clone https://git.indoodle.com/oomer/oom.git
cd poomer-raylib-bella_onimage
git clone https://git.indoodle.com/oomer/poomer-raylib-bella_onimage.git .
make -j$(nproc)
bin/Linux/release/poomer-raylib-bella_onimage 
```

## MacOS x64 and arm64
```
# Install xcode
xcode-select --install

mkdir workdir && cd workdir
mkdir cmake raylib raygui poomer-raylib-bella_onimage

# Install Bella SDK
curl -O https://downloads.bellarender.com/bella_engine_sdk-25.3.0-macos.zip
unzip bella_engine_sdk-25.3.0-macos.zip

# Build cmake
cd cmake
git clone https://github.com/Kitware/CMake.git .
./configure
make -j$(sysctl -n hw.ncpu)

# Build raylib
cd ../raylib
git clone https://github.com/raysan5/raylib.git .
../cmake/bin/cmake -B ./build -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release
../cmake/bin/cmake --build ./build -j$(sysctl -n hw.ncpu)

# Install raygui
cd ..
git clone https://github.com/raysan5/raygui.git

# Build poomer-raylib-bella_onimage 
git clone https://git.indoodle.com/oomer/oom.git
cd ../poomer-raylib-bella_onimage
git clone https://git.indoodle.com/oomer/poomer-raylib-bella_onimage.git .
make -j$(sysctl -n hw.ncpu)
bin/Darwin/release/poomer-raylib-bella_onimage 
```

## Windows x64
- Download Visual Studio Community Edition
- Run VisualStudioSetup.exe
- Workload = [x] Desktop development with C++
- Individual components = [x] Git For Windows

#### x64 Native Tools for VS
```
mkdir workdir && cd workdir
mkdir raylib raygui poomer-raylib-bella_onimage

# Install Bella SDK
curl -O https://downloads.bellarender.com/bella_engine_sdk-25.3.0-win32.zip
tar -xf bella_engine_sdk-25.3.0-win32.zip

# Build raylib
cd raylib
git clone https://github.com/raysan5/raylib.git .
cmake -B ./build
cmake --build ./build --config Release -j%NUMBER_OF_PROCESSORS%

#Install raygui
cd ..
git clone https://github.com/raysan5/raygui.git

# Build poomer-raylib-bella_onimage
git clone https://git.indoodle.com/oomer/oom.git
cd poomer-raylib-bella_onimage
git clone https://git.indoodle.com/oomer/poomer-raylib-bella_onimage.git .
msbuild poomer-raylib-bella_onimage.vcxproj /p:Configuration=release
x64\release\poomer-raylib-bella_onimage.exe
```


If Windows only has a Microsoft Basic Display Adapter, raylib will initialization crash when creating a window. Install a Mesa OpenGL driver https://github.com/pal1000/mesa-dist-win/releases

