abcg

ABCg

build workflow GitHub release (latest by date)

Development framework accompanying the course MCTA008-17 Computer Graphics at UFABC.

Documentation Release notes

ABCg is a lightweight C++ framework that simplifies the development of 3D graphics applications based on OpenGL, OpenGL ES, WebGL, and Vulkan. It is designed for the tutorials and assignments of the course “MCTA008-17 Computer Graphics” taught at Federal University of ABC (UFABC).


Main features


Requirements

The following minimum requirements are shared among all platforms:

For WebAssembly:

For building desktop applications:

Desktop dependencies can be resolved automatically with Conan, but it is disabled by default. To use Conan, install Conan 1.47 or a later 1.* version (ABCg is not compatible with Conan 2.0!) and then configure CMake with -DENABLE_CONAN=ON.

The default renderer backend is OpenGL (CMake option GRAPHICS_API=OpenGL). To use the Vulkan backend, configure CMake with -DGRAPHICS_API=Vulkan.


Installation and usage

Start by cloning the repository:

# Get abcg repo
git clone https://github.com/hbatagelo/abcg.git

# Enter the directory
cd abcg

Follow the instructions below to build the “Hello, World!” sample located in abcg/examples/helloworld.

Windows

build-vs.bat and build.bat accept two optional arguments: (1) the build type, which is Release by default, and (2) an extra CMake option. For example, for a Debug build with -DENABLE_CONAN=ON using VS 2022, run

build-vs.bat Debug -DENABLE_CONAN=ON

Linux and macOS

Run ./build.sh.

The script accepts two optional arguments: (1) the build type, which is Release by default, and (2) an extra CMake option. For example, for a Debug build with -DENABLE_CONAN=ON, run

./build.sh Debug -DENABLE_CONAN=ON

WebAssembly

  1. Run build-wasm.bat (Windows) or ./build-wasm.sh (Linux/macOS).
  2. Run runweb.bat (Windows) or ./runweb.sh (Linux/macOS) for setting up a local web server.
  3. Open http://localhost:8080/helloworld.html.

Docker setup

ABCg can be built in a Docker container. The Dockerfile provided is based on Ubuntu 22.04 and includes Emscripten.

  1. Create the Docker image (abcg):

    sudo docker build -t abcg .
    
  2. Create the container (abcg_container):

    sudo docker create -it \
      -p 8080:8080 \
      -v /tmp/.X11-unix:/tmp/.X11-unix:rw \
      -e DISPLAY \
      --name abcg_container abcg
    
  3. Start the container:

    sudo docker start -ai abcg_container
    

    On NVIDIA GPUs, install the NVIDIA Container Toolkit to allow the container to use the host’s NVIDIA driver and X server. Expose the X server with sudo xhost +local:root before starting the container.


License

ABCg is licensed under the MIT License. See LICENSE for more information.